]> git.wh0rd.org - fontconfig.git/blob - src/fcint.h
#ifdef out old cache stuff, replace with first version of new mmapping
[fontconfig.git] / src / fcint.h
1 /*
2 * $RCSId: xc/lib/fontconfig/src/fcint.h,v 1.27 2002/08/31 22:17:32 keithp Exp $
3 *
4 * Copyright © 2000 Keith Packard
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. Keith Packard makes no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
15 *
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
23 */
24
25 #ifndef _FCINT_H_
26 #define _FCINT_H_
27
28 #include <stdlib.h>
29 #include <stdio.h>
30 #include <string.h>
31 #include <ctype.h>
32 #include <errno.h>
33 #include <unistd.h>
34 #include <sys/types.h>
35 #include <sys/stat.h>
36 #include <time.h>
37 #include <fontconfig/fontconfig.h>
38 #include <fontconfig/fcprivate.h>
39 #include <fontconfig/fcfreetype.h>
40 #ifdef HAVE_CONFIG_H
41 #include <config.h>
42 #endif
43
44 /* unused */
45 typedef struct _FcSymbolic {
46 const char *name;
47 int value;
48 } FcSymbolic;
49
50 #ifndef FC_CONFIG_PATH
51 #define FC_CONFIG_PATH "fonts.conf"
52 #endif
53
54 #define FC_FONT_FILE_INVALID ((FcChar8 *) ".")
55 #define FC_FONT_FILE_DIR ((FcChar8 *) ".dir")
56
57 #ifdef _WIN32
58 #define FC_SEARCH_PATH_SEPARATOR ';'
59 #else
60 #define FC_SEARCH_PATH_SEPARATOR ':'
61 #endif
62
63 #define FC_DBG_MATCH 1
64 #define FC_DBG_MATCHV 2
65 #define FC_DBG_EDIT 4
66 #define FC_DBG_FONTSET 8
67 #define FC_DBG_CACHE 16
68 #define FC_DBG_CACHEV 32
69 #define FC_DBG_PARSE 64
70 #define FC_DBG_SCAN 128
71 #define FC_DBG_SCANV 256
72 #define FC_DBG_MEMORY 512
73 #define FC_DBG_CONFIG 1024
74
75 #define FC_MEM_CHARSET 0
76 #define FC_MEM_CHARLEAF 1
77 #define FC_MEM_FONTSET 2
78 #define FC_MEM_FONTPTR 3
79 #define FC_MEM_OBJECTSET 4
80 #define FC_MEM_OBJECTPTR 5
81 #define FC_MEM_MATRIX 6
82 #define FC_MEM_PATTERN 7
83 #define FC_MEM_PATELT 8
84 #define FC_MEM_VALLIST 9
85 #define FC_MEM_SUBSTATE 10
86 #define FC_MEM_STRING 11
87 #define FC_MEM_LISTBUCK 12
88 #define FC_MEM_STRSET 13
89 #define FC_MEM_STRLIST 14
90 #define FC_MEM_CONFIG 15
91 #define FC_MEM_LANGSET 16
92 #define FC_MEM_ATOMIC 17
93 #define FC_MEM_BLANKS 18
94 #define FC_MEM_CACHE 19
95 #define FC_MEM_STRBUF 20
96 #define FC_MEM_SUBST 21
97 #define FC_MEM_OBJECTTYPE 22
98 #define FC_MEM_CONSTANT 23
99 #define FC_MEM_TEST 24
100 #define FC_MEM_EXPR 25
101 #define FC_MEM_VSTACK 26
102 #define FC_MEM_ATTR 27
103 #define FC_MEM_PSTACK 28
104 #define FC_MEM_STATICSTR 29
105
106 #define FC_MEM_NUM 30
107
108 typedef enum _FcValueBinding {
109 FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
110 } FcValueBinding;
111
112 typedef struct _FcStrSetPtr {
113 FcStorage storage;
114 union {
115 int stat;
116 struct _FcStrSet *dyn;
117 } u;
118 } FcStrSetPtr;
119
120 typedef struct _FcValueListPtr {
121 FcStorage storage;
122 union {
123 int stat;
124 struct _FcValueList *dyn;
125 } u;
126 } FcValueListPtr;
127
128 typedef struct _FcValueList {
129 FcValueListPtr next;
130
131 FcValue value;
132 FcValueBinding binding;
133 } FcValueList;
134
135 typedef struct _FcPatternEltPtr {
136 FcStorage storage;
137 union {
138 int stat;
139 struct _FcPatternElt *dyn;
140 } u;
141 } FcPatternEltPtr;
142
143 typedef struct _FcPatternElt {
144 FcObjectPtr object;
145 FcValueListPtr values;
146 } FcPatternElt;
147
148 struct _FcPattern {
149 int num;
150 int size;
151 FcPatternEltPtr elts;
152 int ref;
153 };
154
155 typedef enum _FcOp {
156 FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet,
157 FcOpNil,
158 FcOpField, FcOpConst,
159 FcOpAssign, FcOpAssignReplace,
160 FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
161 FcOpQuest,
162 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
163 FcOpContains, FcOpListing, FcOpNotContains,
164 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
165 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
166 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
167 FcOpInvalid
168 } FcOp;
169
170 typedef struct _FcExpr {
171 FcOp op;
172 union {
173 int ival;
174 double dval;
175 FcChar8 *sval;
176 FcMatrix *mval;
177 FcBool bval;
178 FcCharSet *cval;
179 char *field;
180 FcChar8 *constant;
181 struct {
182 struct _FcExpr *left, *right;
183 } tree;
184 } u;
185 } FcExpr;
186
187 typedef enum _FcQual {
188 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
189 } FcQual;
190
191 #define FcMatchDefault ((FcMatchKind) -1)
192
193 typedef struct _FcTest {
194 struct _FcTest *next;
195 FcMatchKind kind;
196 FcQual qual;
197 const char *field;
198 FcOp op;
199 FcExpr *expr;
200 } FcTest;
201
202 typedef struct _FcEdit {
203 struct _FcEdit *next;
204 const char *field;
205 FcOp op;
206 FcExpr *expr;
207 FcValueBinding binding;
208 } FcEdit;
209
210 typedef struct _FcSubst {
211 struct _FcSubst *next;
212 FcTest *test;
213 FcEdit *edit;
214 } FcSubst;
215
216 typedef struct _FcCharLeaf {
217 FcChar32 map[256/32];
218 } FcCharLeaf;
219
220 #define FC_REF_CONSTANT -1
221
222 struct _FcCharSet {
223 int ref; /* reference count */
224 int num; /* size of leaves and numbers arrays */
225 FcStorage storage;
226 union {
227 struct {
228 FcCharLeaf **leaves;
229 FcChar16 *numbers;
230 } dyn;
231 struct {
232 int leafidx_offset;
233 int numbers_offset;
234 } stat;
235 } u;
236 };
237
238 struct _FcStrSet {
239 int ref; /* reference count */
240 int num;
241 int size;
242 FcStorage storage;
243 union {
244 FcChar8 **strs;
245 int stridx_offset;
246 } u;
247 };
248
249 struct _FcStrList {
250 FcStrSet *set;
251 int n;
252 };
253
254 typedef struct _FcStrBuf {
255 FcChar8 *buf;
256 FcBool allocated;
257 FcBool failed;
258 int len;
259 int size;
260 } FcStrBuf;
261
262 typedef struct _FcCache {
263 int magic;
264 off_t fontsets_offset;
265 off_t pattern_offset; int pattern_length;
266 off_t patternelt_offset; int patternelt_length;
267 off_t valuelist_offset; int valuelist_length;
268 off_t object_offset; int object_length;
269 off_t objectcontent_offset; int objectcontent_length;
270 off_t langsets_offset; int langsets_length;
271 off_t charsets_offset; int charsets_length;
272 off_t charset_leaf_offset; int charset_num_sum;
273 off_t charset_leafidx_offset;
274 off_t charset_numbers_offset;
275 off_t matrices_offset; int matrices_length;
276 off_t strsets_offset; int strsets_length;
277 off_t strsets_idx_offset; int strsets_idx_length;
278 off_t strset_buf_offset; int strset_buf_length;
279 } FcCache;
280
281 /*
282 * To map adobe glyph names to unicode values, a precomputed hash
283 * table is used
284 */
285
286 typedef struct _FcGlyphName {
287 FcChar32 ucs; /* unicode value */
288 FcChar8 name[1]; /* name extends beyond struct */
289 } FcGlyphName;
290
291 /*
292 * To perform case-insensitive string comparisons, a table
293 * is used which holds three different kinds of folding data.
294 *
295 * The first is a range of upper case values mapping to a range
296 * of their lower case equivalents. Within each range, the offset
297 * between upper and lower case is constant.
298 *
299 * The second is a range of upper case values which are interleaved
300 * with their lower case equivalents.
301 *
302 * The third is a set of raw unicode values mapping to a list
303 * of unicode values for comparison purposes. This allows conversion
304 * of ß to "ss" so that SS, ss and ß all match. A separate array
305 * holds the list of unicode values for each entry.
306 *
307 * These are packed into a single table. Using a binary search,
308 * the appropriate entry can be located.
309 */
310
311 #define FC_CASE_FOLD_RANGE 0
312 #define FC_CASE_FOLD_EVEN_ODD 1
313 #define FC_CASE_FOLD_FULL 2
314
315 typedef struct _FcCaseFold {
316 FcChar32 upper;
317 FcChar16 method : 2;
318 FcChar16 count : 14;
319 short offset; /* lower - upper for RANGE, table id for FULL */
320 } FcCaseFold;
321
322 #define FC_MAX_FILE_LEN 4096
323
324 /*
325 * The per-user ~/.fonts.cache-<version> file is loaded into
326 * this data structure. Each directory gets a substructure
327 * which is validated by comparing the directory timestamp with
328 * that saved in the cache. When valid, the entire directory cache
329 * can be immediately loaded without reading the directory. Otherwise,
330 * the files are checked individually; updated files are loaded into the
331 * cache which is then rewritten to the users home directory
332 */
333
334 #define FC_CACHE_MAGIC 0x12345678
335 #define FC_GLOBAL_CACHE_DIR_HASH_SIZE 37
336 #define FC_GLOBAL_CACHE_FILE_HASH_SIZE 67
337
338 typedef struct _FcGlobalCacheInfo {
339 unsigned int hash;
340 FcChar8 *file;
341 time_t time;
342 FcBool referenced;
343 } FcGlobalCacheInfo;
344
345 typedef struct _FcGlobalCacheFile {
346 struct _FcGlobalCacheFile *next;
347 FcGlobalCacheInfo info;
348 int id;
349 FcChar8 *name;
350 } FcGlobalCacheFile;
351
352 typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
353
354 typedef struct _FcGlobalCacheSubdir {
355 struct _FcGlobalCacheSubdir *next;
356 FcGlobalCacheDir *ent;
357 } FcGlobalCacheSubdir;
358
359 struct _FcGlobalCacheDir {
360 struct _FcGlobalCacheDir *next;
361 FcGlobalCacheInfo info;
362 int len;
363 FcGlobalCacheFile *ents[FC_GLOBAL_CACHE_FILE_HASH_SIZE];
364 FcGlobalCacheSubdir *subdirs;
365 };
366
367 typedef struct _FcGlobalCache {
368 FcGlobalCacheDir *ents[FC_GLOBAL_CACHE_DIR_HASH_SIZE];
369 FcBool updated;
370 FcBool broken;
371 int entries;
372 int referenced;
373 } FcGlobalCache;
374
375 struct _FcAtomic {
376 FcChar8 *file; /* original file name */
377 FcChar8 *new; /* temp file name -- write data here */
378 FcChar8 *lck; /* lockfile name (used for locking) */
379 FcChar8 *tmp; /* tmpfile name (used for locking) */
380 };
381
382 struct _FcBlanks {
383 int nblank;
384 int sblank;
385 FcChar32 *blanks;
386 };
387
388 struct _FcConfig {
389 /*
390 * File names loaded from the configuration -- saved here as the
391 * cache file must be consulted before the directories are scanned,
392 * and those directives may occur in any order
393 */
394 FcStrSet *configDirs; /* directories to scan for fonts */
395 FcChar8 *cache; /* name of per-user cache file */
396 /*
397 * Set of allowed blank chars -- used to
398 * trim fonts of bogus glyphs
399 */
400 FcBlanks *blanks;
401 /*
402 * List of directories containing fonts,
403 * built by recursively scanning the set
404 * of configured directories
405 */
406 FcStrSet *fontDirs;
407 /*
408 * Names of all of the configuration files used
409 * to create this configuration
410 */
411 FcStrSet *configFiles; /* config files loaded */
412 /*
413 * Substitution instructions for patterns and fonts;
414 * maxObjects is used to allocate appropriate intermediate storage
415 * while performing a whole set of substitutions
416 */
417 FcSubst *substPattern; /* substitutions for patterns */
418 FcSubst *substFont; /* substitutions for fonts */
419 int maxObjects; /* maximum number of tests in all substs */
420 /*
421 * List of patterns used to control font file selection
422 */
423 FcStrSet *acceptGlobs;
424 FcStrSet *rejectGlobs;
425 FcFontSet *acceptPatterns;
426 FcFontSet *rejectPatterns;
427 /*
428 * The set of fonts loaded from the listed directories; the
429 * order within the set does not determine the font selection,
430 * except in the case of identical matches in which case earlier fonts
431 * match preferrentially
432 */
433 FcFontSet *fonts[FcSetApplication + 1];
434 /*
435 * Fontconfig can periodically rescan the system configuration
436 * and font directories. This rescanning occurs when font
437 * listing requests are made, but no more often than rescanInterval
438 * seconds apart.
439 */
440 time_t rescanTime; /* last time information was scanned */
441 int rescanInterval; /* interval between scans */
442 };
443
444 extern FcConfig *_fcConfig;
445
446 typedef struct _FcCharMap FcCharMap;
447
448 /* fcblanks.c */
449
450 /* fccache.c */
451
452 int
453 FcCacheNextOffset(int fd);
454
455 void
456 FcCacheForce(FcBool force);
457
458 void
459 FcCacheClearStatic(void);
460
461 FcBool
462 FcCachePrepareSerialize(FcConfig * config);
463
464 FcBool
465 FcCacheSerialize (FcConfig * config);
466
467 FcBool
468 FcCacheRead (FcConfig *config);
469
470 FcBool
471 FcCacheWrite (FcConfig * config);
472
473 /* fccfg.c */
474
475 FcBool
476 FcConfigAddConfigDir (FcConfig *config,
477 const FcChar8 *d);
478
479 FcBool
480 FcConfigAddFontDir (FcConfig *config,
481 const FcChar8 *d);
482
483 FcBool
484 FcConfigAddDir (FcConfig *config,
485 const FcChar8 *d);
486
487 FcBool
488 FcConfigAddConfigFile (FcConfig *config,
489 const FcChar8 *f);
490
491 FcBool
492 FcConfigSetCache (FcConfig *config,
493 const FcChar8 *c);
494
495 FcBool
496 FcConfigAddBlank (FcConfig *config,
497 FcChar32 blank);
498
499 FcBool
500 FcConfigAddEdit (FcConfig *config,
501 FcTest *test,
502 FcEdit *edit,
503 FcMatchKind kind);
504
505 void
506 FcConfigSetFonts (FcConfig *config,
507 FcFontSet *fonts,
508 FcSetName set);
509
510 FcBool
511 FcConfigCompareValue (const FcValue m,
512 FcOp op,
513 const FcValue v);
514
515 FcBool
516 FcConfigGlobAdd (FcConfig *config,
517 const FcChar8 *glob,
518 FcBool accept);
519
520 FcBool
521 FcConfigAcceptFilename (FcConfig *config,
522 const FcChar8 *filename);
523
524 FcBool
525 FcConfigPatternsAdd (FcConfig *config,
526 FcPattern *pattern,
527 FcBool accept);
528
529 FcBool
530 FcConfigAcceptFont (FcConfig *config,
531 const FcPattern *font);
532
533 /* fccharset.c */
534 FcCharSet *
535 FcCharSetFreeze (FcCharSet *cs);
536
537 FcCharSetPtr
538 FcCharSetCopyPtr (FcCharSetPtr src);
539
540 void
541 FcCharSetThawAll (void);
542
543 FcBool
544 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
545
546 FcCharSet *
547 FcNameParseCharSet (FcChar8 *string);
548
549 FcCharLeaf *
550 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
551
552 void
553 FcCharSetPtrDestroy (FcCharSetPtr fcs);
554
555 void
556 FcCharSetClearStatic(void);
557
558 FcBool
559 FcCharSetPrepareSerialize(FcCharSet *c);
560
561 FcCharSetPtr
562 FcCharSetSerialize(FcCharSet *c);
563
564 FcCharSetPtr
565 FcCharSetPtrCreateDynamic(FcCharSet *c);
566
567 FcCharLeaf *
568 FcCharSetGetLeaf(const FcCharSet *c, int i);
569
570 FcChar16 *
571 FcCharSetGetNumbers(const FcCharSet *c);
572
573 FcBool
574 FcCharSetRead (int fd, FcCache metadata);
575
576 FcBool
577 FcCharSetWrite (int fd, FcCache *metadata);
578
579 /* fcdbg.c */
580 void
581 FcValueListPrint (const FcValueListPtr l);
582
583 void
584 FcLangSetPrint (const FcLangSet *ls);
585
586 void
587 FcOpPrint (FcOp op);
588
589 void
590 FcTestPrint (const FcTest *test);
591
592 void
593 FcExprPrint (const FcExpr *expr);
594
595 void
596 FcEditPrint (const FcEdit *edit);
597
598 void
599 FcSubstPrint (const FcSubst *subst);
600
601 int
602 FcDebug (void);
603
604 FcCharSet *
605 FcCharSetPtrU (FcCharSetPtr mi);
606
607 /* fcdir.c */
608
609 FcBool
610 FcFileIsDir (const FcChar8 *file);
611
612 FcBool
613 FcFileScanConfig (FcFontSet *set,
614 FcStrSet *dirs,
615 FcFileCache *cache,
616 FcBlanks *blanks,
617 const FcChar8 *file,
618 FcBool force,
619 FcConfig *config);
620
621 FcBool
622 FcDirScanConfig (FcFontSet *set,
623 FcStrSet *dirs,
624 FcFileCache *cache,
625 FcBlanks *blanks,
626 const FcChar8 *dir,
627 FcBool force,
628 FcConfig *config);
629
630 /* fcfont.c */
631 int
632 FcFontDebug (void);
633
634 /* fcfreetype.c */
635 FcBool
636 FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
637
638 FcBool
639 FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
640
641 FcChar32
642 FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
643
644 FcChar32
645 FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
646
647 const FcCharMap *
648 FcFreeTypeGetPrivateMap (FT_Encoding encoding);
649
650 /* fcfs.c */
651
652 void
653 FcFontSetClearStatic (void);
654
655 FcBool
656 FcFontSetPrepareSerialize (FcFontSet * s);
657
658 FcBool
659 FcFontSetSerialize (FcFontSet * s);
660
661 FcBool
662 FcFontSetRead(int fd, FcConfig * config, FcCache metadata);
663
664 FcBool
665 FcFontSetWrite(int fd, FcConfig * config, FcCache * metadata);
666
667 /* fcgram.y */
668 int
669 FcConfigparse (void);
670
671 int
672 FcConfigwrap (void);
673
674 void
675 FcConfigerror (char *fmt, ...);
676
677 char *
678 FcConfigSaveField (const char *field);
679
680 void
681 FcTestDestroy (FcTest *test);
682
683 FcExpr *
684 FcExprCreateInteger (int i);
685
686 FcExpr *
687 FcExprCreateDouble (double d);
688
689 FcExpr *
690 FcExprCreateString (const FcChar8 *s);
691
692 FcExpr *
693 FcExprCreateMatrix (const FcMatrix *m);
694
695 FcExpr *
696 FcExprCreateBool (FcBool b);
697
698 FcExpr *
699 FcExprCreateNil (void);
700
701 FcExpr *
702 FcExprCreateField (const char *field);
703
704 FcExpr *
705 FcExprCreateConst (const FcChar8 *constant);
706
707 FcExpr *
708 FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
709
710 void
711 FcExprDestroy (FcExpr *e);
712
713 void
714 FcEditDestroy (FcEdit *e);
715
716 /* fcinit.c */
717
718 void
719 FcMemReport (void);
720
721 void
722 FcMemAlloc (int kind, int size);
723
724 void
725 FcMemFree (int kind, int size);
726
727 /* fclang.c */
728 FcLangSet *
729 FcFreeTypeLangSet (const FcCharSet *charset,
730 const FcChar8 *exclusiveLang);
731
732 FcLangResult
733 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
734
735 const FcCharSet *
736 FcCharSetForLang (const FcChar8 *lang);
737
738 FcLangSet *
739 FcLangSetPromote (const FcChar8 *lang);
740
741 FcLangSet *
742 FcNameParseLangSet (const FcChar8 *string);
743
744 FcBool
745 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
746
747 void
748 FcLangSetClearStatic (void);
749
750 FcBool
751 FcLangSetPrepareSerialize (FcLangSet *l);
752
753 FcLangSetPtr
754 FcLangSetSerialize (FcLangSet *l);
755
756 FcLangSet *
757 FcLangSetPtrU (FcLangSetPtr li);
758
759 FcLangSetPtr
760 FcLangSetPtrCreateDynamic (FcLangSet *l);
761
762 void
763 FcLangSetPtrDestroy (FcLangSetPtr li);
764
765 FcBool
766 FcLangSetRead (int fd, FcCache metadata);
767
768 FcBool
769 FcLangSetWrite (int fd, FcCache *metadata);
770
771 /* fclist.c */
772
773 FcBool
774 FcListPatternMatchAny (const FcPattern *p,
775 const FcPattern *font);
776
777 /* fcmatch.c */
778
779 /* fcname.c */
780
781 FcBool
782 FcNameBool (const FcChar8 *v, FcBool *result);
783
784 /* fcpat.c */
785 void
786 FcValueListDestroy (FcValueListPtr l);
787
788 FcPatternElt *
789 FcPatternFindElt (const FcPattern *p, const char *object);
790
791 FcPatternElt *
792 FcPatternInsertElt (FcPattern *p, const char *object);
793
794 FcBool
795 FcPatternAddWithBinding (FcPattern *p,
796 const char *object,
797 FcValue value,
798 FcValueBinding binding,
799 FcBool append);
800
801 FcPattern *
802 FcPatternFreeze (FcPattern *p);
803
804 void
805 FcPatternFini (void);
806
807 FcBool
808 FcPatternAppend (FcPattern *p, FcPattern *s);
809
810 void
811 FcObjectClearStatic(void);
812
813 FcObjectPtr
814 FcObjectStaticName (const char *name);
815
816 FcBool
817 FcObjectRead (int fd, FcCache metadata);
818
819 FcBool
820 FcObjectWrite (int fd, FcCache * metadata);
821
822 const char *
823 FcObjectPtrU (FcObjectPtr p);
824
825 int
826 FcObjectPtrCompare (FcObjectPtr a, FcObjectPtr b);
827
828 void
829 FcObjectPtrDestroy (FcObjectPtr p);
830
831 FcBool
832 FcPatternPrepareSerialize (FcPattern *p);
833
834 void
835 FcValueListClearStatic (void);
836
837 void
838 FcPatternClearStatic (void);
839
840 FcValueList *
841 FcValueListPtrU(FcValueListPtr p);
842
843 FcPatternElt *
844 FcPatternEltU (FcPatternEltPtr pei);
845
846 FcValueListPtr
847 FcValueListPtrCreateDynamic(FcValueList * p);
848
849 FcBool
850 FcValueListPrepareSerialize (FcValueList *p);
851
852 FcValueListPtr
853 FcValueListSerialize(FcValueList *pi);
854
855 FcPattern *
856 FcPatternSerialize (FcPattern * p);
857
858 FcBool
859 FcPatternRead (int fd, FcCache metadata);
860
861 FcBool
862 FcPatternWrite (int fd, FcCache *metadata);
863
864 FcBool
865 FcPatternEltRead (int fd, FcCache metadata);
866
867 FcBool
868 FcPatternEltWrite (int fd, FcCache *metadata);
869
870 FcBool
871 FcValueListRead (int fd, FcCache metadata);
872
873 FcBool
874 FcValueListWrite (int fd, FcCache *metadata);
875
876 /* fcrender.c */
877
878 /* fcmatrix.c */
879
880 extern const FcMatrixPtr FcIdentityMatrix;
881
882 void
883 FcMatrixFree (FcMatrix *mat);
884
885 void
886 FcMatrixPtrDestroy (FcMatrixPtr mi);
887
888 FcBool
889 FcMatrixPrepareSerialize(FcMatrix *m);
890
891 FcMatrixPtr
892 FcMatrixSerialize(FcMatrix *m);
893
894 FcMatrix *
895 FcMatrixPtrU (FcMatrixPtr mi);
896
897 FcMatrixPtr
898 FcMatrixPtrCreateDynamic (FcMatrix *m);
899
900 void
901 FcMatrixClearStatic (void);
902
903 FcBool
904 FcMatrixWrite (int fd, FcCache *metadata);
905
906 FcBool
907 FcMatrixRead (int fd, FcCache metadata);
908
909 /* fcstr.c */
910 FcStrSet *
911 FcStrSetPtrU (const FcStrSetPtr set);
912
913 FcStrSetPtr
914 FcStrSetPtrCreateDynamic (const FcStrSet * set);
915
916 void
917 FcStrSetClearStatic (void);
918
919 FcBool
920 FcStrSetPrepareSerialize (const FcStrSet *set);
921
922 void
923 FcStrSetSort (FcStrSet * set);
924
925 FcChar8 *
926 FcStrSetGet (const FcStrSet *set, int i);
927
928 FcChar8 *
929 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
930
931 void
932 FcStrFree (FcChar8 *s);
933
934 void
935 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
936
937 void
938 FcStrBufDestroy (FcStrBuf *buf);
939
940 FcChar8 *
941 FcStrBufDone (FcStrBuf *buf);
942
943 FcBool
944 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
945
946 FcBool
947 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
948
949 FcBool
950 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
951
952 FcStrSetPtr
953 FcStrSetSerialize (FcStrSet *set);
954
955 FcBool
956 FcStrSetRead (int fd, FcCache metadata);
957
958 FcBool
959 FcStrSetWrite (int fd, FcCache *metadata);
960
961 int
962 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
963
964 const FcChar8 *
965 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
966
967 const FcChar8 *
968 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
969
970 FcBool
971 FcStrUsesHome (const FcChar8 *s);
972
973 FcChar8 *
974 FcStrLastSlash (const FcChar8 *path);
975
976 FcChar32
977 FcStrHashIgnoreCase (const FcChar8 *s);
978
979 #endif /* _FC_INT_H_ */