w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

fcpat.c
Go to the documentation of this file.
1 /*
2  * Copyright © 2000 Keith Packard
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name of the author(s) not be used in
9  * advertising or publicity pertaining to distribution of the software without
10  * specific, written prior permission. The authors make no
11  * representations about the suitability of this software for any purpose. It
12  * is provided "as is" without express or implied warranty.
13  *
14  * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20  * PERFORMANCE OF THIS SOFTWARE.
21  */
22 
23 #include "fcint.h"
24 #include "fcftint.h"
25 
26 /* Objects MT-safe for readonly access. */
27 
28 FcPattern *
30 {
31  FcPattern *p;
32 
33  p = (FcPattern *) malloc (sizeof (FcPattern));
34  if (!p)
35  return 0;
36  memset (p, 0, sizeof (FcPattern));
37  p->num = 0;
38  p->size = 0;
39  p->elts_offset = FcPtrToOffset (p, NULL);
40  FcRefInit (&p->ref, 1);
41  return p;
42 }
43 
44 void
46 {
47  switch ((int) v.type) {
48  case FcTypeString:
49  FcFree (v.u.s);
50  break;
51  case FcTypeMatrix:
52  FcMatrixFree ((FcMatrix *) v.u.m);
53  break;
54  case FcTypeCharSet:
55  FcCharSetDestroy ((FcCharSet *) v.u.c);
56  break;
57  case FcTypeLangSet:
58  FcLangSetDestroy ((FcLangSet *) v.u.l);
59  break;
60  case FcTypeRange:
61  FcRangeDestroy ((FcRange *) v.u.r);
62  break;
63  default:
64  break;
65  }
66 }
67 
68 FcValue
70 {
71  FcValue new;
72 
73  switch ((int) v->type)
74  {
75  case FcTypeString:
76  new.u.s = FcValueString(v);
77  new.type = FcTypeString;
78  break;
79  case FcTypeCharSet:
80  new.u.c = FcValueCharSet(v);
81  new.type = FcTypeCharSet;
82  break;
83  case FcTypeLangSet:
84  new.u.l = FcValueLangSet(v);
85  new.type = FcTypeLangSet;
86  break;
87  case FcTypeRange:
88  new.u.r = FcValueRange(v);
89  new.type = FcTypeRange;
90  break;
91  default:
92  new = *v;
93  break;
94  }
95  return new;
96 }
97 
98 FcValue
100 {
101  switch ((int) v.type) {
102  case FcTypeString:
103  v.u.s = FcStrdup (v.u.s);
104  if (!v.u.s)
105  v.type = FcTypeVoid;
106  break;
107  case FcTypeMatrix:
108  v.u.m = FcMatrixCopy (v.u.m);
109  if (!v.u.m)
110  v.type = FcTypeVoid;
111  break;
112  case FcTypeCharSet:
113  v.u.c = FcCharSetCopy ((FcCharSet *) v.u.c);
114  if (!v.u.c)
115  v.type = FcTypeVoid;
116  break;
117  case FcTypeLangSet:
118  v.u.l = FcLangSetCopy (v.u.l);
119  if (!v.u.l)
120  v.type = FcTypeVoid;
121  break;
122  case FcTypeRange:
123  v.u.r = FcRangeCopy (v.u.r);
124  if (!v.u.r)
125  v.type = FcTypeVoid;
126  break;
127  default:
128  break;
129  }
130  return v;
131 }
132 
135 {
136  return calloc (1, sizeof (FcValueList));
137 }
138 
139 void
141 {
143  for (; l; l = next)
144  {
145  switch ((int) l->value.type) {
146  case FcTypeString:
147  FcFree (l->value.u.s);
148  break;
149  case FcTypeMatrix:
150  FcMatrixFree ((FcMatrix *)l->value.u.m);
151  break;
152  case FcTypeCharSet:
154  ((FcCharSet *) (l->value.u.c));
155  break;
156  case FcTypeLangSet:
158  ((FcLangSet *) (l->value.u.l));
159  break;
160  case FcTypeRange:
161  FcRangeDestroy ((FcRange *) (l->value.u.r));
162  break;
163  default:
164  break;
165  }
167  free(l);
168  }
169 }
170 
173  FcValue value,
175 {
176  FcValueListPtr new;
177 
178  if (value.type == FcTypeVoid)
179  return vallist;
180  new = FcValueListCreate ();
181  if (!new)
182  return vallist;
183 
184  new->value = FcValueSave (value);
185  new->binding = binding;
186  new->next = vallist;
187 
188  return new;
189 }
190 
193  FcValue value,
195 {
196  FcValueListPtr new, last;
197 
198  if (value.type == FcTypeVoid)
199  return vallist;
200  new = FcValueListCreate ();
201  if (!new)
202  return vallist;
203 
204  new->value = FcValueSave (value);
205  new->binding = binding;
206  new->next = NULL;
207 
208  if (vallist)
209  {
210  for (last = vallist; FcValueListNext (last); last = FcValueListNext (last));
211 
212  last->next = new;
213  }
214  else
215  vallist = new;
216 
217  return vallist;
218 }
219 
222 {
223  FcValueListPtr new = NULL, l, t = NULL;
224  FcValue v;
225 
226  for (l = orig; l != NULL; l = FcValueListNext (l))
227  {
228  if (!new)
229  {
230  t = new = FcValueListCreate();
231  }
232  else
233  {
234  t->next = FcValueListCreate();
235  t = FcValueListNext (t);
236  }
237  v = FcValueCanonicalize (&l->value);
238  t->value = FcValueSave (v);
239  t->binding = l->binding;
240  t->next = NULL;
241  }
242 
243  return new;
244 }
245 
246 FcBool
248 {
249  if (va.type != vb.type)
250  {
251  if (va.type == FcTypeInteger)
252  {
253  va.type = FcTypeDouble;
254  va.u.d = va.u.i;
255  }
256  if (vb.type == FcTypeInteger)
257  {
258  vb.type = FcTypeDouble;
259  vb.u.d = vb.u.i;
260  }
261  if (va.type != vb.type)
262  return FcFalse;
263  }
264  switch (va.type) {
265  case FcTypeUnknown:
266  return FcFalse; /* don't know how to compare this object */
267  case FcTypeVoid:
268  return FcTrue;
269  case FcTypeInteger:
270  return va.u.i == vb.u.i;
271  case FcTypeDouble:
272  return va.u.d == vb.u.d;
273  case FcTypeString:
274  return FcStrCmpIgnoreCase (va.u.s, vb.u.s) == 0;
275  case FcTypeBool:
276  return va.u.b == vb.u.b;
277  case FcTypeMatrix:
278  return FcMatrixEqual (va.u.m, vb.u.m);
279  case FcTypeCharSet:
280  return FcCharSetEqual (va.u.c, vb.u.c);
281  case FcTypeFTFace:
282  return va.u.f == vb.u.f;
283  case FcTypeLangSet:
284  return FcLangSetEqual (va.u.l, vb.u.l);
285  case FcTypeRange:
286  return FcRangeIsInRange (va.u.r, vb.u.r);
287  }
288  return FcFalse;
289 }
290 
291 static FcChar32
292 FcDoubleHash (double d)
293 {
294  if (d < 0)
295  d = -d;
296  if (d > 0xffffffff)
297  d = 0xffffffff;
298  return (FcChar32) d;
299 }
300 
301 FcChar32
303 {
304  FcChar8 c;
305  FcChar32 h = 0;
306 
307  if (s)
308  while ((c = *s++))
309  h = ((h << 1) | (h >> 31)) ^ c;
310  return h;
311 }
312 
313 static FcChar32
315 {
316  switch (v->type) {
317  case FcTypeUnknown:
318  case FcTypeVoid:
319  return 0;
320  case FcTypeInteger:
321  return (FcChar32) v->u.i;
322  case FcTypeDouble:
323  return FcDoubleHash (v->u.d);
324  case FcTypeString:
325  return FcStringHash (FcValueString(v));
326  case FcTypeBool:
327  return (FcChar32) v->u.b;
328  case FcTypeMatrix:
329  return (FcDoubleHash (v->u.m->xx) ^
330  FcDoubleHash (v->u.m->xy) ^
331  FcDoubleHash (v->u.m->yx) ^
332  FcDoubleHash (v->u.m->yy));
333  case FcTypeCharSet:
334  return (FcChar32) FcValueCharSet(v)->num;
335  case FcTypeFTFace:
336  return FcStringHash ((const FcChar8 *) ((FT_Face) v->u.f)->family_name) ^
337  FcStringHash ((const FcChar8 *) ((FT_Face) v->u.f)->style_name);
338  case FcTypeLangSet:
339  return FcLangSetHash (FcValueLangSet(v));
340  case FcTypeRange:
341  return FcRangeHash (FcValueRange (v));
342  }
343  return 0;
344 }
345 
346 static FcBool
348 {
349  if (la == lb)
350  return FcTrue;
351 
352  while (la && lb)
353  {
354  if (!FcValueEqual (la->value, lb->value))
355  return FcFalse;
356  la = FcValueListNext(la);
357  lb = FcValueListNext(lb);
358  }
359  if (la || lb)
360  return FcFalse;
361  return FcTrue;
362 }
363 
364 static FcChar32
366 {
367  FcChar32 hash = 0;
368 
369  for (; l; l = FcValueListNext(l))
370  {
371  hash = ((hash << 1) | (hash >> 31)) ^ FcValueHash (&l->value);
372  }
373  return hash;
374 }
375 
376 static void *
378 {
379  /* We use a value to find the cache, instead of the FcPattern object
380  * because the pattern itself may be a cache allocation if we rewrote the path,
381  * so the p may not be in the cached region. */
382  return FcPatternEltValues(&FcPatternElts (p)[0]);
383 }
384 
385 FcPattern *
387  FcCache *cache,
388  const FcChar8 *relocated_font_file)
389 {
390  FcPatternElt *elts = FcPatternElts (p);
391  size_t i,j;
392  FcChar8 *data;
393  FcPattern *new_p;
394  FcPatternElt *new_elts;
395  FcValueList *new_value_list;
396  size_t new_path_len = strlen ((char *)relocated_font_file);
397  FcChar8 *new_path;
398 
399  /* Allocate space for the patter, the PatternElt headers and
400  * the FC_FILE FcValueList and path that will be freed with the
401  * cache */
403  sizeof (FcPattern) +
404  p->num * sizeof (FcPatternElt) +
405  sizeof (FcValueList) +
406  new_path_len + 1);
407 
408  new_p = (FcPattern *)data;
409  data += sizeof (FcPattern);
410  new_elts = (FcPatternElt *)(data);
411  data += p->num * sizeof (FcPatternElt);
412  new_value_list = (FcValueList *)data;
413  data += sizeof (FcValueList);
414  new_path = data;
415 
416  *new_p = *p;
417  new_p->elts_offset = FcPtrToOffset (new_p, new_elts);
418 
419  /* Copy all but the FILE values from the cache */
420  for (i = 0, j = 0; i < p->num; i++)
421  {
422  FcPatternElt *elt = &elts[i];
423  new_elts[j].object = elt->object;
424  if (elt->object != FC_FILE_OBJECT)
425  new_elts[j++].values = FcPatternEltValues(elt);
426  else
427  new_elts[j++].values = new_value_list;
428  }
429 
430  new_value_list->next = NULL;
431  new_value_list->value.type = FcTypeString;
432  new_value_list->value.u.s = new_path;
433  new_value_list->binding = FcValueBindingWeak;
434 
435  /* Add rewritten path at the end */
436  strcpy ((char *)new_path, (char *)relocated_font_file);
437 
438  return new_p;
439 }
440 
441 void
443 {
444  int i;
445  FcPatternElt *elts;
446 
447  if (!p)
448  return;
449 
450  if (FcRefIsConst (&p->ref))
451  {
453  return;
454  }
455 
456  if (FcRefDec (&p->ref) != 1)
457  return;
458 
459  elts = FcPatternElts (p);
460  for (i = 0; i < FcPatternObjectCount (p); i++)
462 
463  free (elts);
464  free (p);
465 }
466 
467 int
469 {
470  if (pat)
471  return pat->num;
472 
473  return 0;
474 }
475 
476 
477 static int
479 {
480  int low, high, mid, c;
481  FcPatternElt *elts = FcPatternElts(p);
482 
483  low = 0;
484  high = FcPatternObjectCount (p) - 1;
485  c = 1;
486  mid = 0;
487  while (low <= high)
488  {
489  mid = (low + high) >> 1;
490  c = elts[mid].object - object;
491  if (c == 0)
492  return mid;
493  if (c < 0)
494  low = mid + 1;
495  else
496  high = mid - 1;
497  }
498  if (c < 0)
499  mid++;
500  return -(mid + 1);
501 }
502 
503 int
504 FcPatternPosition (const FcPattern *p, const char *object)
505 {
506  return FcPatternObjectPosition (p, FcObjectFromName (object));
507 }
508 
509 FcPatternElt *
511 {
512  int i = FcPatternObjectPosition (p, object);
513  if (i < 0)
514  return 0;
515  return &FcPatternElts(p)[i];
516 }
517 
518 FcPatternElt *
520 {
521  int i;
522  FcPatternElt *e;
523 
524  i = FcPatternObjectPosition (p, object);
525  if (i < 0)
526  {
527  i = -i - 1;
528 
529  /* reallocate array */
530  if (FcPatternObjectCount (p) + 1 >= p->size)
531  {
532  int s = p->size + 16;
533  if (p->size)
534  {
536  e = (FcPatternElt *) realloc (e0, s * sizeof (FcPatternElt));
537  if (!e) /* maybe it was mmapped */
538  {
539  e = malloc(s * sizeof (FcPatternElt));
540  if (e)
541  memcpy(e, e0, FcPatternObjectCount (p) * sizeof (FcPatternElt));
542  }
543  }
544  else
545  e = (FcPatternElt *) malloc (s * sizeof (FcPatternElt));
546  if (!e)
547  return FcFalse;
548  p->elts_offset = FcPtrToOffset (p, e);
549  while (p->size < s)
550  {
551  e[p->size].object = 0;
552  e[p->size].values = NULL;
553  p->size++;
554  }
555  }
556 
557  e = FcPatternElts(p);
558  /* move elts up */
559  memmove (e + i + 1,
560  e + i,
561  sizeof (FcPatternElt) *
562  (FcPatternObjectCount (p) - i));
563 
564  /* bump count */
565  p->num++;
566 
567  e[i].object = object;
568  e[i].values = NULL;
569  }
570 
571  return FcPatternElts(p) + i;
572 }
573 
574 FcBool
575 FcPatternEqual (const FcPattern *pa, const FcPattern *pb)
576 {
577  FcPatternIter ia, ib;
578 
579  if (pa == pb)
580  return FcTrue;
581 
583  return FcFalse;
584  FcPatternIterStart (pa, &ia);
585  FcPatternIterStart (pb, &ib);
586  do {
587  FcBool ra, rb;
588 
589  if (!FcPatternIterEqual (pa, &ia, pb, &ib))
590  return FcFalse;
591  ra = FcPatternIterNext (pa, &ia);
592  rb = FcPatternIterNext (pb, &ib);
593  if (!ra && !rb)
594  break;
595  } while (1);
596 
597  return FcTrue;
598 }
599 
600 FcChar32
602 {
603  int i;
604  FcChar32 h = 0;
606 
607  for (i = 0; i < FcPatternObjectCount (p); i++)
608  {
609  h = (((h << 1) | (h >> 31)) ^
610  pe[i].object ^
612  }
613  return h;
614 }
615 
616 FcBool
617 FcPatternEqualSubset (const FcPattern *pai, const FcPattern *pbi, const FcObjectSet *os)
618 {
619  FcPatternElt *ea, *eb;
620  int i;
621 
622  for (i = 0; i < os->nobject; i++)
623  {
624  FcObject object = FcObjectFromName (os->objects[i]);
625  ea = FcPatternObjectFindElt (pai, object);
626  eb = FcPatternObjectFindElt (pbi, object);
627  if (ea)
628  {
629  if (!eb)
630  return FcFalse;
632  return FcFalse;
633  }
634  else
635  {
636  if (eb)
637  return FcFalse;
638  }
639  }
640  return FcTrue;
641 }
642 
643 FcBool
645  FcObject object,
647  FcBool append)
648 {
649  FcPatternElt *e;
651 
652  if (FcRefIsConst (&p->ref))
653  goto bail0;
654 
655  /*
656  * Make sure the stored type is valid for built-in objects
657  */
658  for (l = list; l != NULL; l = FcValueListNext (l))
659  {
660  if (!FcObjectValidType (object, l->value.type))
661  {
662  fprintf (stderr,
663  "Fontconfig warning: FcPattern object %s does not accept value", FcObjectName (object));
664  FcValuePrintFile (stderr, l->value);
665  fprintf (stderr, "\n");
666  goto bail0;
667  }
668  }
669 
670  e = FcPatternObjectInsertElt (p, object);
671  if (!e)
672  goto bail0;
673 
674  if (append)
675  {
676  for (prev = &e->values; *prev; prev = &(*prev)->next)
677  ;
678  *prev = list;
679  }
680  else
681  {
682  for (prev = &list; *prev; prev = &(*prev)->next)
683  ;
684  *prev = e->values;
685  e->values = list;
686  }
687 
688  return FcTrue;
689 
690 bail0:
691  return FcFalse;
692 }
693 
694 FcBool
696  FcObject object,
697  FcValue value,
699  FcBool append)
700 {
701  FcPatternElt *e;
702  FcValueListPtr new, *prev;
703 
704  if (FcRefIsConst (&p->ref))
705  goto bail0;
706 
707  new = FcValueListCreate ();
708  if (!new)
709  goto bail0;
710 
711  value = FcValueSave (value);
712  if (value.type == FcTypeVoid)
713  goto bail1;
714 
715  /*
716  * Make sure the stored type is valid for built-in objects
717  */
718  if (!FcObjectValidType (object, value.type))
719  {
720  fprintf (stderr,
721  "Fontconfig warning: FcPattern object %s does not accept value",
722  FcObjectName (object));
723  FcValuePrintFile (stderr, value);
724  fprintf (stderr, "\n");
725  goto bail1;
726  }
727 
728  new->value = value;
729  new->binding = binding;
730  new->next = NULL;
731 
732  e = FcPatternObjectInsertElt (p, object);
733  if (!e)
734  goto bail2;
735 
736  if (append)
737  {
738  for (prev = &e->values; *prev; prev = &(*prev)->next)
739  ;
740  *prev = new;
741  }
742  else
743  {
744  new->next = e->values;
745  e->values = new;
746  }
747 
748  return FcTrue;
749 
750 bail2:
752 bail1:
753  free (new);
754 bail0:
755  return FcFalse;
756 }
757 
758 FcBool
760 {
761  return FcPatternObjectAddWithBinding (p, object,
763 }
764 
765 FcBool
767 {
770 }
771 
772 FcBool
774 {
777 }
778 
779 FcBool
781 {
782  FcPatternElt *e;
783 
784  e = FcPatternObjectFindElt (p, object);
785  if (!e)
786  return FcFalse;
787 
788  /* destroy value */
789  FcValueListDestroy (e->values);
790 
791  /* shuffle existing ones down */
792  memmove (e, e+1,
793  (FcPatternElts(p) + FcPatternObjectCount (p) - (e + 1)) *
794  sizeof (FcPatternElt));
795  p->num--;
797  e->object = 0;
798  e->values = NULL;
799  return FcTrue;
800 }
801 
802 FcBool
803 FcPatternDel (FcPattern *p, const char *object)
804 {
805  return FcPatternObjectDel (p, FcObjectFromName (object));
806 }
807 
808 FcBool
809 FcPatternRemove (FcPattern *p, const char *object, int id)
810 {
811  FcPatternElt *e;
813 
815  if (!e)
816  return FcFalse;
817  for (prev = &e->values; (l = *prev); prev = &l->next)
818  {
819  if (!id)
820  {
821  *prev = l->next;
822  l->next = NULL;
824  if (!e->values)
825  FcPatternDel (p, object);
826  return FcTrue;
827  }
828  id--;
829  }
830  return FcFalse;
831 }
832 
833 FcBool
835 {
836  FcValue v;
837 
838  v.type = FcTypeInteger;
839  v.u.i = i;
840  return FcPatternObjectAdd (p, object, v, FcTrue);
841 }
842 
843 FcBool
844 FcPatternAddInteger (FcPattern *p, const char *object, int i)
845 {
846  return FcPatternObjectAddInteger (p, FcObjectFromName (object), i);
847 }
848 
849 FcBool
851 {
852  FcValue v;
853 
854  v.type = FcTypeDouble;
855  v.u.d = d;
856  return FcPatternObjectAdd (p, object, v, FcTrue);
857 }
858 
859 
860 FcBool
861 FcPatternAddDouble (FcPattern *p, const char *object, double d)
862 {
863  return FcPatternObjectAddDouble (p, FcObjectFromName (object), d);
864 }
865 
866 FcBool
868 {
869  FcValue v;
870 
871  if (!s)
872  {
873  v.type = FcTypeVoid;
874  v.u.s = 0;
875  return FcPatternObjectAdd (p, object, v, FcTrue);
876  }
877 
878  v.type = FcTypeString;
879  v.u.s = s;
880  return FcPatternObjectAdd (p, object, v, FcTrue);
881 }
882 
883 FcBool
884 FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s)
885 {
886  return FcPatternObjectAddString (p, FcObjectFromName (object), s);
887 }
888 
889 FcBool
890 FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s)
891 {
892  FcValue v;
893 
894  v.type = FcTypeMatrix;
895  v.u.m = s;
896  return FcPatternAdd (p, object, v, FcTrue);
897 }
898 
899 
900 FcBool
902 {
903  FcValue v;
904 
905  v.type = FcTypeBool;
906  v.u.b = b;
907  return FcPatternObjectAdd (p, object, v, FcTrue);
908 }
909 
910 FcBool
911 FcPatternAddBool (FcPattern *p, const char *object, FcBool b)
912 {
913  return FcPatternObjectAddBool (p, FcObjectFromName (object), b);
914 }
915 
916 FcBool
918 {
919  FcValue v;
920 
921  v.type = FcTypeCharSet;
922  v.u.c = (FcCharSet *)c;
923  return FcPatternObjectAdd (p, object, v, FcTrue);
924 }
925 
926 FcBool
927 FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c)
928 {
929  return FcPatternObjectAddCharSet (p, FcObjectFromName (object), c);
930 }
931 
932 FcBool
933 FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f)
934 {
935  FcValue v;
936 
937  v.type = FcTypeFTFace;
938  v.u.f = (void *) f;
939  return FcPatternAdd (p, object, v, FcTrue);
940 }
941 
942 FcBool
944 {
945  FcValue v;
946 
947  v.type = FcTypeLangSet;
948  v.u.l = (FcLangSet *)ls;
949  return FcPatternObjectAdd (p, object, v, FcTrue);
950 }
951 
952 FcBool
953 FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls)
954 {
955  return FcPatternObjectAddLangSet (p, FcObjectFromName (object), ls);
956 }
957 
958 FcBool
960 {
961  FcValue v;
962 
963  v.type = FcTypeRange;
964  v.u.r = (FcRange *)r;
965  return FcPatternObjectAdd (p, object, v, FcTrue);
966 }
967 
968 FcBool
969 FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r)
970 {
971  return FcPatternObjectAddRange (p, FcObjectFromName (object), r);
972 }
973 
974 FcResult
976 {
977  FcPatternElt *e;
979 
980  if (!p)
981  return FcResultNoMatch;
982  e = FcPatternObjectFindElt (p, object);
983  if (!e)
984  return FcResultNoMatch;
985  for (l = FcPatternEltValues(e); l; l = FcValueListNext(l))
986  {
987  if (!id)
988  {
989  *v = FcValueCanonicalize(&l->value);
990  if (b)
991  *b = l->binding;
992  return FcResultMatch;
993  }
994  id--;
995  }
996  return FcResultNoId;
997 }
998 
999 FcResult
1000 FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v)
1001 {
1002  return FcPatternObjectGetWithBinding (p, object, id, v, NULL);
1003 }
1004 
1005 FcResult
1006 FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b)
1007 {
1008  return FcPatternObjectGetWithBinding (p, FcObjectFromName (object), id, v, b);
1009 }
1010 
1011 FcResult
1012 FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v)
1013 {
1014  return FcPatternObjectGetWithBinding (p, FcObjectFromName (object), id, v, NULL);
1015 }
1016 
1017 FcResult
1018 FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int id, int *i)
1019 {
1020  FcValue v;
1021  FcResult r;
1022 
1023  r = FcPatternObjectGet (p, object, id, &v);
1024  if (r != FcResultMatch)
1025  return r;
1026  switch ((int) v.type) {
1027  case FcTypeDouble:
1028  *i = (int) v.u.d;
1029  break;
1030  case FcTypeInteger:
1031  *i = v.u.i;
1032  break;
1033  default:
1034  return FcResultTypeMismatch;
1035  }
1036  return FcResultMatch;
1037 }
1038 
1039 FcResult
1040 FcPatternGetInteger (const FcPattern *p, const char *object, int id, int *i)
1041 {
1042  return FcPatternObjectGetInteger (p, FcObjectFromName (object), id, i);
1043 }
1044 
1045 
1046 FcResult
1047 FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int id, double *d)
1048 {
1049  FcValue v;
1050  FcResult r;
1051 
1052  r = FcPatternObjectGet (p, object, id, &v);
1053  if (r != FcResultMatch)
1054  return r;
1055  switch ((int) v.type) {
1056  case FcTypeDouble:
1057  *d = v.u.d;
1058  break;
1059  case FcTypeInteger:
1060  *d = (double) v.u.i;
1061  break;
1062  default:
1063  return FcResultTypeMismatch;
1064  }
1065  return FcResultMatch;
1066 }
1067 
1068 FcResult
1069 FcPatternGetDouble (const FcPattern *p, const char *object, int id, double *d)
1070 {
1071  return FcPatternObjectGetDouble (p, FcObjectFromName (object), id, d);
1072 }
1073 
1074 FcResult
1076 {
1077  FcValue v;
1078  FcResult r;
1079 
1080  r = FcPatternObjectGet (p, object, id, &v);
1081  if (r != FcResultMatch)
1082  return r;
1083  if (v.type != FcTypeString)
1084  return FcResultTypeMismatch;
1085 
1086  *s = (FcChar8 *) v.u.s;
1087  return FcResultMatch;
1088 }
1089 
1090 FcResult
1091 FcPatternGetString (const FcPattern *p, const char *object, int id, FcChar8 ** s)
1092 {
1093  return FcPatternObjectGetString (p, FcObjectFromName (object), id, s);
1094 }
1095 
1096 FcResult
1097 FcPatternGetMatrix(const FcPattern *p, const char *object, int id, FcMatrix **m)
1098 {
1099  FcValue v;
1100  FcResult r;
1101 
1102  r = FcPatternGet (p, object, id, &v);
1103  if (r != FcResultMatch)
1104  return r;
1105  if (v.type != FcTypeMatrix)
1106  return FcResultTypeMismatch;
1107  *m = (FcMatrix *)v.u.m;
1108  return FcResultMatch;
1109 }
1110 
1111 
1112 FcResult
1114 {
1115  FcValue v;
1116  FcResult r;
1117 
1118  r = FcPatternObjectGet (p, object, id, &v);
1119  if (r != FcResultMatch)
1120  return r;
1121  if (v.type != FcTypeBool)
1122  return FcResultTypeMismatch;
1123  *b = v.u.b;
1124  return FcResultMatch;
1125 }
1126 
1127 FcResult
1128 FcPatternGetBool(const FcPattern *p, const char *object, int id, FcBool *b)
1129 {
1130  return FcPatternObjectGetBool (p, FcObjectFromName (object), id, b);
1131 }
1132 
1133 FcResult
1134 FcPatternGetCharSet(const FcPattern *p, const char *object, int id, FcCharSet **c)
1135 {
1136  FcValue v;
1137  FcResult r;
1138 
1139  r = FcPatternGet (p, object, id, &v);
1140  if (r != FcResultMatch)
1141  return r;
1142  if (v.type != FcTypeCharSet)
1143  return FcResultTypeMismatch;
1144  *c = (FcCharSet *)v.u.c;
1145  return FcResultMatch;
1146 }
1147 
1148 FcResult
1149 FcPatternGetFTFace(const FcPattern *p, const char *object, int id, FT_Face *f)
1150 {
1151  FcValue v;
1152  FcResult r;
1153 
1154  r = FcPatternGet (p, object, id, &v);
1155  if (r != FcResultMatch)
1156  return r;
1157  if (v.type != FcTypeFTFace)
1158  return FcResultTypeMismatch;
1159  *f = (FT_Face) v.u.f;
1160  return FcResultMatch;
1161 }
1162 
1163 FcResult
1164 FcPatternGetLangSet(const FcPattern *p, const char *object, int id, FcLangSet **ls)
1165 {
1166  FcValue v;
1167  FcResult r;
1168 
1169  r = FcPatternGet (p, object, id, &v);
1170  if (r != FcResultMatch)
1171  return r;
1172  if (v.type != FcTypeLangSet)
1173  return FcResultTypeMismatch;
1174  *ls = (FcLangSet *)v.u.l;
1175  return FcResultMatch;
1176 }
1177 
1178 FcResult
1180 {
1181  FcValue v;
1182  FcResult res;
1183 
1184  res = FcPatternObjectGet (p, object, id, &v);
1185  if (res != FcResultMatch)
1186  return res;
1187  switch ((int)v.type) {
1188  case FcTypeRange:
1189  *r = (FcRange *)v.u.r;
1190  break;
1191  default:
1192  return FcResultTypeMismatch;
1193  }
1194  return FcResultMatch;
1195 }
1196 
1197 FcResult
1198 FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r)
1199 {
1200  return FcPatternObjectGetRange (p, FcObjectFromName (object), id, r);
1201 }
1202 
1203 FcPattern *
1205 {
1206  FcPattern *new;
1207  FcPatternIter iter;
1208  FcValueListPtr l;
1209 
1210  if (!orig)
1211  return NULL;
1212 
1213  new = FcPatternCreate ();
1214  if (!new)
1215  goto bail0;
1216 
1217  FcPatternIterStart (orig, &iter);
1218  do
1219  {
1220  for (l = FcPatternIterGetValues (orig, &iter); l; l = FcValueListNext (l))
1221  {
1223  FcValueCanonicalize(&l->value),
1224  l->binding,
1225  FcTrue))
1226  goto bail1;
1227  }
1228  } while (FcPatternIterNext (orig, &iter));
1229 
1230  return new;
1231 
1232 bail1:
1233  FcPatternDestroy (new);
1234 bail0:
1235  return 0;
1236 }
1237 
1238 void
1240 {
1241  if (!FcRefIsConst (&p->ref))
1242  FcRefInc (&p->ref);
1243  else
1245 }
1246 
1247 FcPattern *
1249 {
1250  FcPattern *ret;
1251 
1252  FcPatternVapBuild (ret, p, va);
1253  return ret;
1254 }
1255 
1256 FcPattern *
1258 {
1259  va_list va;
1260 
1261  va_start (va, p);
1262  FcPatternVapBuild (p, p, va);
1263  va_end (va);
1264  return p;
1265 }
1266 
1267 /*
1268  * Add all of the elements in 's' to 'p'
1269  */
1270 FcBool
1272 {
1273  FcPatternIter iter;
1274  FcValueListPtr v;
1275 
1276  FcPatternIterStart (s, &iter);
1277  do
1278  {
1279  for (v = FcPatternIterGetValues (s, &iter); v; v = FcValueListNext (v))
1280  {
1282  FcValueCanonicalize(&v->value),
1283  v->binding, FcTrue))
1284  return FcFalse;
1285  }
1286  } while (FcPatternIterNext (s, &iter));
1287 
1288  return FcTrue;
1289 }
1290 
1291 FcPattern *
1293 {
1294  int i;
1295  FcPattern *ret;
1296  FcPatternElt *e;
1297  FcValueListPtr v;
1298 
1299  if (!os)
1300  return FcPatternDuplicate (p);
1301 
1302  ret = FcPatternCreate ();
1303  if (!ret)
1304  return NULL;
1305 
1306  for (i = 0; i < os->nobject; i++)
1307  {
1308  FcObject object = FcObjectFromName (os->objects[i]);
1309  e = FcPatternObjectFindElt (p, object);
1310  if (e)
1311  {
1312  for (v = FcPatternEltValues(e); v; v = FcValueListNext(v))
1313  {
1314  if (!FcPatternObjectAddWithBinding (ret, e->object,
1315  FcValueCanonicalize(&v->value),
1316  v->binding, FcTrue))
1317  goto bail0;
1318  }
1319  }
1320  }
1321  return ret;
1322 
1323 bail0:
1325  return NULL;
1326 }
1327 
1328 typedef struct _FcPatternPrivateIter {
1330  int pos;
1332 
1333 static void
1335 {
1336  iter->elt = FcPatternObjectCount (pat) > 0 && iter->pos < FcPatternObjectCount (pat) ? &FcPatternElts (pat)[iter->pos] : NULL;
1337 }
1338 
1339 void
1341 {
1342  FcPatternPrivateIter *priv = (FcPatternPrivateIter *) iter;
1343 
1344  priv->pos = 0;
1345  FcPatternIterSet (pat, priv);
1346 }
1347 
1348 FcBool
1350 {
1351  FcPatternPrivateIter *priv = (FcPatternPrivateIter *) iter;
1352 
1353  priv->pos++;
1354  if (priv->pos >= FcPatternObjectCount (pat))
1355  return FcFalse;
1356  FcPatternIterSet (pat, priv);
1357 
1358  return FcTrue;
1359 }
1360 
1361 FcBool
1363  const FcPattern *p2, FcPatternIter *i2)
1364 {
1365  FcBool b1 = FcPatternIterIsValid (p1, i1);
1366  FcBool b2 = FcPatternIterIsValid (p2, i2);
1367 
1368  if (!i1 && !i2)
1369  return FcTrue;
1370  if (!b1 || !b2)
1371  return FcFalse;
1373  return FcFalse;
1374 
1376  FcPatternIterGetValues (p2, i2));
1377 }
1378 
1379 FcBool
1381 {
1382  FcPatternPrivateIter *priv = (FcPatternPrivateIter *) iter;
1383  int i = FcPatternObjectPosition (pat, object);
1384 
1385  priv->elt = NULL;
1386  if (i < 0)
1387  return FcFalse;
1388 
1389  priv->pos = i;
1390  FcPatternIterSet (pat, priv);
1391 
1392  return FcTrue;
1393 }
1394 
1395 FcBool
1396 FcPatternFindIter (const FcPattern *pat, FcPatternIter *iter, const char *object)
1397 {
1398  return FcPatternFindObjectIter (pat, iter, FcObjectFromName (object));
1399 }
1400 
1401 FcBool
1403 {
1405 
1406  if (priv && priv->elt)
1407  return FcTrue;
1408 
1409  return FcFalse;
1410 }
1411 
1412 FcObject
1414 {
1415  FcPatternPrivateIter *priv = (FcPatternPrivateIter *) iter;
1416 
1417  if (priv && priv->elt)
1418  return priv->elt->object;
1419 
1420  return 0;
1421 }
1422 
1423 const char *
1425 {
1426  return FcObjectName (FcPatternIterGetObjectId (pat, iter));
1427 }
1428 
1431 {
1432  FcPatternPrivateIter *priv = (FcPatternPrivateIter *) iter;
1433 
1434  if (priv && priv->elt)
1435  return FcPatternEltValues (priv->elt);
1436 
1437  return NULL;
1438 }
1439 
1440 int
1442 {
1443  int count = 0;
1444  FcValueListPtr l;
1445 
1446  for (l = FcPatternIterGetValues (pat, iter); l; l = FcValueListNext (l))
1447  count++;
1448 
1449  return count;
1450 }
1451 
1452 FcResult
1454 {
1455  FcValueListPtr l;
1456 
1457  for (l = FcPatternIterGetValues (pat, iter); l; l = FcValueListNext (l))
1458  {
1459  if (id == 0)
1460  {
1461  *v = FcValueCanonicalize (&l->value);
1462  if (b)
1463  *b = l->binding;
1464  return FcResultMatch;
1465  }
1466  id--;
1467  }
1468  return FcResultNoId;
1469 }
1470 
1471 FcBool
1473 {
1474  int i;
1475  FcPatternElt *elts = FcPatternElts(pat);
1476 
1477  if (!FcSerializeAlloc (serialize, pat, sizeof (FcPattern)))
1478  return FcFalse;
1479  if (!FcSerializeAlloc (serialize, elts, FcPatternObjectCount (pat) * sizeof (FcPatternElt)))
1480  return FcFalse;
1481  for (i = 0; i < FcPatternObjectCount (pat); i++)
1483  return FcFalse;
1484  return FcTrue;
1485 }
1486 
1487 FcPattern *
1489 {
1490  FcPattern *pat_serialized;
1491  FcPatternElt *elts = FcPatternElts (pat);
1492  FcPatternElt *elts_serialized;
1493  FcValueList *values_serialized;
1494  int i;
1495 
1496  pat_serialized = FcSerializePtr (serialize, pat);
1497  if (!pat_serialized)
1498  return NULL;
1499  *pat_serialized = *pat;
1500  pat_serialized->size = FcPatternObjectCount (pat);
1501  FcRefSetConst (&pat_serialized->ref);
1502 
1503  elts_serialized = FcSerializePtr (serialize, elts);
1504  if (!elts_serialized)
1505  return NULL;
1506 
1507  pat_serialized->elts_offset = FcPtrToOffset (pat_serialized,
1508  elts_serialized);
1509 
1510  for (i = 0; i < FcPatternObjectCount (pat); i++)
1511  {
1512  values_serialized = FcValueListSerialize (serialize, FcPatternEltValues (elts+i));
1513  if (!values_serialized)
1514  return NULL;
1515  elts_serialized[i].object = elts[i].object;
1516  elts_serialized[i].values = FcPtrToEncodedOffset (&elts_serialized[i],
1517  values_serialized,
1518  FcValueList);
1519  }
1520  if (FcDebug() & FC_DBG_CACHEV) {
1521  printf ("Raw pattern:\n");
1522  FcPatternPrint (pat);
1523  printf ("Serialized pattern:\n");
1524  FcPatternPrint (pat_serialized);
1525  printf ("\n");
1526  }
1527  return pat_serialized;
1528 }
1529 
1530 FcBool
1532 {
1533  while (vl)
1534  {
1535  if (!FcSerializeAlloc (serialize, vl, sizeof (FcValueList)))
1536  return FcFalse;
1537  switch ((int) vl->value.type) {
1538  case FcTypeString:
1539  if (!FcStrSerializeAlloc (serialize, vl->value.u.s))
1540  return FcFalse;
1541  break;
1542  case FcTypeCharSet:
1544  return FcFalse;
1545  break;
1546  case FcTypeLangSet:
1548  return FcFalse;
1549  break;
1550  case FcTypeRange:
1551  if (!FcRangeSerializeAlloc (serialize, vl->value.u.r))
1552  return FcFalse;
1553  break;
1554  default:
1555  break;
1556  }
1557  vl = vl->next;
1558  }
1559  return FcTrue;
1560 }
1561 
1562 FcValueList *
1564 {
1565  FcValueList *vl_serialized;
1566  FcChar8 *s_serialized;
1567  FcCharSet *c_serialized;
1568  FcLangSet *l_serialized;
1569  FcRange *r_serialized;
1570  FcValueList *head_serialized = NULL;
1571  FcValueList *prev_serialized = NULL;
1572 
1573  while (vl)
1574  {
1575  vl_serialized = FcSerializePtr (serialize, vl);
1576  if (!vl_serialized)
1577  return NULL;
1578 
1579  if (prev_serialized)
1580  prev_serialized->next = FcPtrToEncodedOffset (prev_serialized,
1581  vl_serialized,
1582  FcValueList);
1583  else
1584  head_serialized = vl_serialized;
1585 
1586  vl_serialized->next = NULL;
1587  vl_serialized->value.type = vl->value.type;
1588  switch ((int) vl->value.type) {
1589  case FcTypeInteger:
1590  vl_serialized->value.u.i = vl->value.u.i;
1591  break;
1592  case FcTypeDouble:
1593  vl_serialized->value.u.d = vl->value.u.d;
1594  break;
1595  case FcTypeString:
1596  s_serialized = FcStrSerialize (serialize, vl->value.u.s);
1597  if (!s_serialized)
1598  return NULL;
1599  vl_serialized->value.u.s = FcPtrToEncodedOffset (&vl_serialized->value,
1600  s_serialized,
1601  FcChar8);
1602  break;
1603  case FcTypeBool:
1604  vl_serialized->value.u.b = vl->value.u.b;
1605  break;
1606  case FcTypeMatrix:
1607  /* can't happen */
1608  break;
1609  case FcTypeCharSet:
1610  c_serialized = FcCharSetSerialize (serialize, vl->value.u.c);
1611  if (!c_serialized)
1612  return NULL;
1613  vl_serialized->value.u.c = FcPtrToEncodedOffset (&vl_serialized->value,
1614  c_serialized,
1615  FcCharSet);
1616  break;
1617  case FcTypeFTFace:
1618  /* can't happen */
1619  break;
1620  case FcTypeLangSet:
1621  l_serialized = FcLangSetSerialize (serialize, vl->value.u.l);
1622  if (!l_serialized)
1623  return NULL;
1624  vl_serialized->value.u.l = FcPtrToEncodedOffset (&vl_serialized->value,
1625  l_serialized,
1626  FcLangSet);
1627  break;
1628  case FcTypeRange:
1629  r_serialized = FcRangeSerialize (serialize, vl->value.u.r);
1630  if (!r_serialized)
1631  return NULL;
1632  vl_serialized->value.u.r = FcPtrToEncodedOffset (&vl_serialized->value,
1633  r_serialized,
1634  FcRange);
1635  break;
1636  default:
1637  break;
1638  }
1639  prev_serialized = vl_serialized;
1640  vl = vl->next;
1641  }
1642  return head_serialized;
1643 }
1644 
1645 #define __fcpat__
1646 #include "fcaliastail.h"
1647 #include "fcftaliastail.h"
1648 #undef __fcpat__
#define count(a)
Definition: aptex-macros.h:781
#define next(a)
Definition: aptex-macros.h:924
#define hash
Definition: aptex.h:388
char * p2
Definition: bmpfont.h:62
char * p1
Definition: bmpfont.h:62
#define b
Definition: jpegint.h:372
#define free(a)
Definition: decNumber.cpp:310
int v
Definition: dviconv.c:10
int h
Definition: dviconv.c:9
int printf()
char * strcpy()
struct rect data
Definition: dvipdfm.c:64
void FcCacheObjectDereference(void *object)
Definition: fc-lang.c:51
void FcCacheObjectReference(void *object)
Definition: fc-lang.c:46
#define FcLangSetHash
Definition: fcalias.h:202
#define FcCharSetEqual
Definition: fcalias.h:100
#define FcMatrixEqual
Definition: fcalias.h:254
#define FcLangSetEqual
Definition: fcalias.h:200
#define FcLangSetCopy
Definition: fcalias.h:188
#define FcLangSetDestroy
Definition: fcalias.h:186
#define FcRangeDestroy
Definition: fcalias.h:360
#define FcPatternPrint
Definition: fcalias.h:128
#define FcMatrixCopy
Definition: fcalias.h:252
#define FcRangeCopy
Definition: fcalias.h:362
#define FcCharSetCopy
Definition: fcalias.h:98
#define FcStrCmpIgnoreCase
Definition: fcalias.h:400
#define FcCharSetDestroy
Definition: fcalias.h:92
static int FcRefInc(FcRef *r)
Definition: fcatomic.h:141
static FcBool FcRefIsConst(const FcRef *r)
Definition: fcatomic.h:145
static void FcRefSetConst(FcRef *r)
Definition: fcatomic.h:144
static int FcRefDec(FcRef *r)
Definition: fcatomic.h:142
static void FcRefInit(FcRef *r, int v)
Definition: fcatomic.h:140
void * FcCacheAllocate(FcCache *cache, size_t len)
Definition: fccache.c:768
FcCharSet * FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs)
Definition: fccharset.c:1338
FcBool FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs)
Definition: fccharset.c:1301
void FcValuePrintFile(FILE *f, const FcValue v)
Definition: fcdbg.c:74
FcLangSet * FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l)
Definition: fclang.c:1030
FcBool FcObjectValidType(FcObject object, FcType type)
Definition: fcname.c:73
FcBool FcRangeSerializeAlloc(FcSerialize *serialize, const FcRange *r)
Definition: fcrange.c:139
FcRange * FcRangeSerialize(FcSerialize *serialize, const FcRange *r)
Definition: fcrange.c:147
void FcMatrixFree(FcMatrix *mat)
Definition: fcmatrix.c:46
FcObject FcObjectFromName(const char *name)
Definition: fcname.c:107
#define FcPatternElts(p)
Definition: fcint.h:235
struct _FcValueList FcValueList
#define FcValueCharSet(v)
Definition: fcint.h:192
#define FcPtrToEncodedOffset(b, p, t)
Definition: fcint.h:173
FcBool FcSerializeAlloc(FcSerialize *serialize, const void *object, int size)
Definition: fcserialize.c:79
FcBool FcRangeIsInRange(const FcRange *a, const FcRange *b)
Definition: fcrange.c:97
void * FcSerializePtr(FcSerialize *serialize, const void *object)
Definition: fcserialize.c:130
#define FcFree(s)
Definition: fcint.h:147
FcChar8 * FcStrSerialize(FcSerialize *serialize, const FcChar8 *str)
Definition: fcserialize.c:146
#define FcValueLangSet(v)
Definition: fcint.h:193
int FcObject
Definition: fcint.h:206
struct _FcPatternElt FcPatternElt
#define FcValueListNext(vl)
Definition: fcint.h:204
#define FcValueString(v)
Definition: fcint.h:191
FcBool FcLangSetSerializeAlloc(FcSerialize *serialize, const FcLangSet *l)
Definition: fclang.c:1022
const char * FcObjectName(FcObject object)
Definition: fcname.c:127
#define FcPtrToOffset(b, p)
Definition: fcint.h:164
#define FcStrdup(s)
Definition: fcint.h:146
#define FcValueRange(v)
Definition: fcint.h:194
#define FC_DBG_CACHEV
Definition: fcint.h:107
#define FcDebug()
Definition: fcint.h:899
#define FcPatternEltValues(pe)
Definition: fcint.h:226
FcChar32 FcRangeHash(const FcRange *r)
Definition: fcrange.c:130
FcBool FcStrSerializeAlloc(FcSerialize *serialize, const FcChar8 *str)
Definition: fcserialize.c:140
FcResult FcPatternObjectGetDouble(const FcPattern *p, FcObject object, int id, double *d)
Definition: fcpat.c:1047
void FcPatternDestroy(FcPattern *p)
Definition: fcpat.c:442
FcResult FcPatternGetMatrix(const FcPattern *p, const char *object, int id, FcMatrix **m)
Definition: fcpat.c:1097
FcResult FcPatternGet(const FcPattern *p, const char *object, int id, FcValue *v)
Definition: fcpat.c:1012
FcBool FcPatternDel(FcPattern *p, const char *object)
Definition: fcpat.c:803
static FcChar32 FcValueListHash(FcValueListPtr l)
Definition: fcpat.c:365
FcResult FcPatternGetWithBinding(const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b)
Definition: fcpat.c:1006
FcValueList * FcValueListSerialize(FcSerialize *serialize, const FcValueList *vl)
Definition: fcpat.c:1563
static FcChar32 FcDoubleHash(double d)
Definition: fcpat.c:292
FcValue FcValueCanonicalize(const FcValue *v)
Definition: fcpat.c:69
FcPatternElt * FcPatternObjectFindElt(const FcPattern *p, FcObject object)
Definition: fcpat.c:510
FcBool FcPatternAddWeak(FcPattern *p, const char *object, FcValue value, FcBool append)
Definition: fcpat.c:773
FcPattern * FcPatternFilter(FcPattern *p, const FcObjectSet *os)
Definition: fcpat.c:1292
FcResult FcPatternObjectGetString(const FcPattern *p, FcObject object, int id, FcChar8 **s)
Definition: fcpat.c:1075
FcResult FcPatternGetInteger(const FcPattern *p, const char *object, int id, int *i)
Definition: fcpat.c:1040
FcValueListPtr FcValueListAppend(FcValueListPtr vallist, FcValue value, FcValueBinding binding)
Definition: fcpat.c:192
FcBool FcPatternAdd(FcPattern *p, const char *object, FcValue value, FcBool append)
Definition: fcpat.c:766
FcBool FcValueEqual(FcValue va, FcValue vb)
Definition: fcpat.c:247
FcResult FcPatternGetCharSet(const FcPattern *p, const char *object, int id, FcCharSet **c)
Definition: fcpat.c:1134
void FcPatternReference(FcPattern *p)
Definition: fcpat.c:1239
FcPattern * FcPatternSerialize(FcSerialize *serialize, const FcPattern *pat)
Definition: fcpat.c:1488
struct _FcPatternPrivateIter FcPatternPrivateIter
void FcPatternIterStart(const FcPattern *pat, FcPatternIter *iter)
Definition: fcpat.c:1340
FcBool FcPatternObjectAddInteger(FcPattern *p, FcObject object, int i)
Definition: fcpat.c:834
FcBool FcPatternIterIsValid(const FcPattern *pat, FcPatternIter *iter)
Definition: fcpat.c:1402
FcPattern * FcPatternBuild(FcPattern *p,...)
Definition: fcpat.c:1257
FcBool FcPatternAddCharSet(FcPattern *p, const char *object, const FcCharSet *c)
Definition: fcpat.c:927
FcBool FcPatternRemove(FcPattern *p, const char *object, int id)
Definition: fcpat.c:809
FcValueListPtr FcValueListDuplicate(FcValueListPtr orig)
Definition: fcpat.c:221
FcBool FcPatternObjectAddString(FcPattern *p, FcObject object, const FcChar8 *s)
Definition: fcpat.c:867
FcBool FcPatternObjectListAdd(FcPattern *p, FcObject object, FcValueListPtr list, FcBool append)
Definition: fcpat.c:644
FcValueListPtr FcValueListCreate(void)
Definition: fcpat.c:134
FcPattern * FcPatternDuplicate(const FcPattern *orig)
Definition: fcpat.c:1204
int FcPatternObjectCount(const FcPattern *pat)
Definition: fcpat.c:468
FcBool FcPatternObjectAddWithBinding(FcPattern *p, FcObject object, FcValue value, FcValueBinding binding, FcBool append)
Definition: fcpat.c:695
FcBool FcPatternAddInteger(FcPattern *p, const char *object, int i)
Definition: fcpat.c:844
FcBool FcPatternObjectAddCharSet(FcPattern *p, FcObject object, const FcCharSet *c)
Definition: fcpat.c:917
FcChar32 FcStringHash(const FcChar8 *s)
Definition: fcpat.c:302
FcBool FcPatternObjectAddLangSet(FcPattern *p, FcObject object, const FcLangSet *ls)
Definition: fcpat.c:943
FcBool FcPatternAddMatrix(FcPattern *p, const char *object, const FcMatrix *s)
Definition: fcpat.c:890
int FcPatternPosition(const FcPattern *p, const char *object)
Definition: fcpat.c:504
FcResult FcPatternObjectGetInteger(const FcPattern *p, FcObject object, int id, int *i)
Definition: fcpat.c:1018
FcPatternElt * FcPatternObjectInsertElt(FcPattern *p, FcObject object)
Definition: fcpat.c:519
FcBool FcPatternAddBool(FcPattern *p, const char *object, FcBool b)
Definition: fcpat.c:911
FcResult FcPatternGetString(const FcPattern *p, const char *object, int id, FcChar8 **s)
Definition: fcpat.c:1091
FcBool FcPatternAddRange(FcPattern *p, const char *object, const FcRange *r)
Definition: fcpat.c:969
FcValueListPtr FcValueListPrepend(FcValueListPtr vallist, FcValue value, FcValueBinding binding)
Definition: fcpat.c:172
FcObject FcPatternIterGetObjectId(const FcPattern *pat, FcPatternIter *iter)
Definition: fcpat.c:1413
int FcPatternIterValueCount(const FcPattern *pat, FcPatternIter *iter)
Definition: fcpat.c:1441
FcBool FcPatternEqualSubset(const FcPattern *pai, const FcPattern *pbi, const FcObjectSet *os)
Definition: fcpat.c:617
FcResult FcPatternGetBool(const FcPattern *p, const char *object, int id, FcBool *b)
Definition: fcpat.c:1128
FcBool FcPatternFindIter(const FcPattern *pat, FcPatternIter *iter, const char *object)
Definition: fcpat.c:1396
const char * FcPatternIterGetObject(const FcPattern *pat, FcPatternIter *iter)
Definition: fcpat.c:1424
FcBool FcPatternAddFTFace(FcPattern *p, const char *object, const FT_Face f)
Definition: fcpat.c:933
static void FcPatternIterSet(const FcPattern *pat, FcPatternPrivateIter *iter)
Definition: fcpat.c:1334
static FcChar32 FcValueHash(const FcValue *v)
Definition: fcpat.c:314
FcBool FcPatternAppend(FcPattern *p, FcPattern *s)
Definition: fcpat.c:1271
FcPattern * FcPatternCacheRewriteFile(const FcPattern *p, FcCache *cache, const FcChar8 *relocated_font_file)
Definition: fcpat.c:386
FcResult FcPatternGetDouble(const FcPattern *p, const char *object, int id, double *d)
Definition: fcpat.c:1069
FcChar32 FcPatternHash(const FcPattern *p)
Definition: fcpat.c:601
void FcValueListDestroy(FcValueListPtr l)
Definition: fcpat.c:140
FcValueListPtr FcPatternIterGetValues(const FcPattern *pat, FcPatternIter *iter)
Definition: fcpat.c:1430
static FcBool FcValueListEqual(FcValueListPtr la, FcValueListPtr lb)
Definition: fcpat.c:347
FcBool FcPatternObjectAddDouble(FcPattern *p, FcObject object, double d)
Definition: fcpat.c:850
FcBool FcPatternIterEqual(const FcPattern *p1, FcPatternIter *i1, const FcPattern *p2, FcPatternIter *i2)
Definition: fcpat.c:1362
FcBool FcPatternAddLangSet(FcPattern *p, const char *object, const FcLangSet *ls)
Definition: fcpat.c:953
FcBool FcPatternObjectAdd(FcPattern *p, FcObject object, FcValue value, FcBool append)
Definition: fcpat.c:759
FcResult FcPatternGetRange(const FcPattern *p, const char *object, int id, FcRange **r)
Definition: fcpat.c:1198
FcBool FcPatternFindObjectIter(const FcPattern *pat, FcPatternIter *iter, FcObject object)
Definition: fcpat.c:1380
FcBool FcPatternAddDouble(FcPattern *p, const char *object, double d)
Definition: fcpat.c:861
FcBool FcPatternSerializeAlloc(FcSerialize *serialize, const FcPattern *pat)
Definition: fcpat.c:1472
FcPattern * FcPatternCreate(void)
Definition: fcpat.c:29
static int FcPatternObjectPosition(const FcPattern *p, FcObject object)
Definition: fcpat.c:478
FcBool FcValueListSerializeAlloc(FcSerialize *serialize, const FcValueList *vl)
Definition: fcpat.c:1531
FcBool FcPatternObjectAddBool(FcPattern *p, FcObject object, FcBool b)
Definition: fcpat.c:901
void FcValueDestroy(FcValue v)
Definition: fcpat.c:45
FcBool FcPatternEqual(const FcPattern *pa, const FcPattern *pb)
Definition: fcpat.c:575
FcPattern * FcPatternVaBuild(FcPattern *p, va_list va)
Definition: fcpat.c:1248
static void * FcPatternGetCacheObject(FcPattern *p)
Definition: fcpat.c:377
FcResult FcPatternGetLangSet(const FcPattern *p, const char *object, int id, FcLangSet **ls)
Definition: fcpat.c:1164
FcResult FcPatternGetFTFace(const FcPattern *p, const char *object, int id, FT_Face *f)
Definition: fcpat.c:1149
FcBool FcPatternIterNext(const FcPattern *pat, FcPatternIter *iter)
Definition: fcpat.c:1349
FcResult FcPatternObjectGetWithBinding(const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b)
Definition: fcpat.c:975
FcBool FcPatternAddString(FcPattern *p, const char *object, const FcChar8 *s)
Definition: fcpat.c:884
FcBool FcPatternObjectAddRange(FcPattern *p, FcObject object, const FcRange *r)
Definition: fcpat.c:959
FcBool FcPatternObjectDel(FcPattern *p, FcObject object)
Definition: fcpat.c:780
FcResult FcPatternIterGetValue(const FcPattern *pat, FcPatternIter *iter, int id, FcValue *v, FcValueBinding *b)
Definition: fcpat.c:1453
FcResult FcPatternObjectGetRange(const FcPattern *p, FcObject object, int id, FcRange **r)
Definition: fcpat.c:1179
FcValue FcValueSave(FcValue v)
Definition: fcpat.c:99
FcResult FcPatternObjectGet(const FcPattern *p, FcObject object, int id, FcValue *v)
Definition: fcpat.c:1000
FcResult FcPatternObjectGetBool(const FcPattern *p, FcObject object, int id, FcBool *b)
Definition: fcpat.c:1113
#define FcPatternVapBuild(result, orig, va)
Definition: fcprivate.h:34
unsigned char FcChar8
Definition: fontconfig.h:43
enum _FcValueBinding FcValueBinding
#define FcFalse
Definition: fontconfig.h:75
@ FcTypeMatrix
Definition: fontconfig.h:208
@ FcTypeDouble
Definition: fontconfig.h:205
@ FcTypeFTFace
Definition: fontconfig.h:210
@ FcTypeCharSet
Definition: fontconfig.h:209
@ FcTypeBool
Definition: fontconfig.h:207
@ FcTypeVoid
Definition: fontconfig.h:203
@ FcTypeLangSet
Definition: fontconfig.h:211
@ FcTypeInteger
Definition: fontconfig.h:204
@ FcTypeRange
Definition: fontconfig.h:212
@ FcTypeUnknown
Definition: fontconfig.h:202
@ FcTypeString
Definition: fontconfig.h:206
enum _FcResult FcResult
#define FcTrue
Definition: fontconfig.h:76
struct _FcPattern FcPattern
Definition: fontconfig.h:251
@ FcResultNoId
Definition: fontconfig.h:241
@ FcResultMatch
Definition: fontconfig.h:241
@ FcResultNoMatch
Definition: fontconfig.h:241
@ FcResultTypeMismatch
Definition: fontconfig.h:241
@ FcValueBindingWeak
Definition: fontconfig.h:246
@ FcValueBindingStrong
Definition: fontconfig.h:246
int FcBool
Definition: fontconfig.h:46
unsigned int FcChar32
Definition: fontconfig.h:45
mpz_t * f
Definition: gen-fib.c:34
#define s
Definition: afcover.h:80
static FIELD_PTR prev
Definition: genind.c:36
#define c(n)
Definition: gpos-common.c:150
#define d(n)
Definition: gpos-common.c:151
#define memmove(d, s, n)
Definition: gsftopk.c:65
#define memcpy(d, s, n)
Definition: gsftopk.c:64
void * object
Definition: jmemsys.h:48
struct FT_FaceRec_ * FT_Face
Definition: freetype.h:483
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
sizeof(AF_ModuleRec)
voidp calloc()
static unsigned char pat[8]
Definition: pkfont.c:194
static int ret
Definition: convert.c:72
#define fprintf
Definition: mendex.h:64
#define b1
Definition: texmfmem.h:169
#define b2
Definition: texmfmem.h:170
#define malloc
Definition: alloca.c:91
cell * list
Definition: list_routines.h:30
static UHashtable * cache
int low
Definition: combiners.h:904
int high
Definition: combiners.h:904
#define realloc
Definition: glob.c:206
void serialize(MeasureUnitImpl &impl, UErrorCode &status)
union value value
Definition: obx.h:44
#define res(length)
Definition: picttoppm.c:287
#define ra
static int32_t last
Definition: ppagelist.c:29
int r
Definition: ppmqvga.c:68
bstring c int memset(void *s, int c, int length)
ShellFileEnvironment e
Definition: sh6.c:388
const char ** objects
Definition: fontconfig.h:286
FcValueList * values
Definition: fcint.h:223
FcObject object
Definition: fcint.h:222
FcPatternElt * elt
Definition: fcpat.c:1329
FcRef ref
Definition: fcint.h:232
intptr_t elts_offset
Definition: fcint.h:231
int size
Definition: fcint.h:230
struct _FcValueList * next
Definition: fcint.h:199
FcValueBinding binding
Definition: fcint.h:201
FcValue value
Definition: fcint.h:200
const FcLangSet * l
Definition: fontconfig.h:272
union _FcValue::@935 u
FcType type
Definition: fontconfig.h:263
const FcRange * r
Definition: fontconfig.h:273
void * f
Definition: fontconfig.h:271
const FcChar8 * s
Definition: fontconfig.h:265
FcBool b
Definition: fontconfig.h:267
const FcCharSet * c
Definition: fontconfig.h:270
const FcMatrix * m
Definition: fontconfig.h:269
double d
Definition: fontconfig.h:268
Definition: sh2.c:920
Definition: dvips.h:235
struct t * next
Definition: dvips.h:237
int j
Definition: t4ht.c:1589
*job_name strlen((char *) job_name) - 4)
m
Definition: tex4ht.c:3990
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
Definition: obx.h:51
#define va_start(pvar)
Definition: varargs.h:30
#define va_end(pvar)
Definition: varargs.h:38
char * va_list
Definition: varargs.h:22
#define append(a, b)
Definition: y.tab.c:257