Overhaul the serialization system to create one mmapable file per directory
[platform/upstream/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 _FcValueListPtr {
113     int                 bank;
114     union {
115         int                 stat;
116         struct _FcValueList *dyn;
117     } u;
118 } FcValueListPtr;
119
120 typedef struct _FcValueList {
121     FcValueListPtr          next;
122
123     FcValue                 value;
124     FcValueBinding          binding;
125 } FcValueList;
126
127 typedef int FcObjectPtr;
128
129 typedef struct _FcPatternEltPtr {
130     int                 bank;
131     union {
132         int                 stat;
133         struct _FcPatternElt *dyn;
134     } u;
135 } FcPatternEltPtr;
136
137 typedef struct _FcPatternElt {
138     FcObjectPtr             object;
139     FcValueListPtr          values;
140 } FcPatternElt;
141
142 struct _FcPattern {
143     int             num;
144     int             size;
145     FcPatternEltPtr elts;
146     int             ref;
147     int             bank;
148 };
149
150 typedef enum _FcOp {
151     FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet, 
152     FcOpNil,
153     FcOpField, FcOpConst,
154     FcOpAssign, FcOpAssignReplace, 
155     FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
156     FcOpQuest,
157     FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, 
158     FcOpContains, FcOpListing, FcOpNotContains,
159     FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
160     FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
161     FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
162     FcOpInvalid
163 } FcOp;
164
165 typedef struct _FcExpr {
166     FcOp   op;
167     union {
168         int         ival;
169         double      dval;
170         FcChar8     *sval;
171         FcMatrix    *mval;
172         FcBool      bval;
173         FcCharSet   *cval;
174         char        *field;
175         FcChar8     *constant;
176         struct {
177             struct _FcExpr *left, *right;
178         } tree;
179     } u;
180 } FcExpr;
181
182 typedef enum _FcQual {
183     FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
184 } FcQual;
185
186 #define FcMatchDefault  ((FcMatchKind) -1)
187
188 typedef struct _FcTest {
189     struct _FcTest      *next;
190     FcMatchKind         kind;
191     FcQual              qual;
192     const char          *field;
193     FcOp                op;
194     FcExpr              *expr;
195 } FcTest;
196
197 typedef struct _FcEdit {
198     struct _FcEdit *next;
199     const char      *field;
200     FcOp            op;
201     FcExpr          *expr;
202     FcValueBinding  binding;
203 } FcEdit;
204
205 typedef struct _FcSubst {
206     struct _FcSubst     *next;
207     FcTest              *test;
208     FcEdit              *edit;
209 } FcSubst;
210
211 typedef struct _FcCharLeaf {
212     FcChar32    map[256/32];
213 } FcCharLeaf;
214
215 #define FC_REF_CONSTANT     -1
216
217 struct _FcCharSet {
218     int             ref;        /* reference count */
219     int             num;        /* size of leaves and numbers arrays */
220     int             bank;
221     union {
222         struct {
223             FcCharLeaf  **leaves;
224             FcChar16    *numbers;
225         } dyn;
226         struct {
227             int         leafidx_offset;
228             int         numbers_offset;
229         } stat;
230     } u;
231 };
232
233 struct _FcStrSet {
234     int             ref;        /* reference count */
235     int             num;
236     int             size;
237     FcChar8         **strs;
238 };
239
240 struct _FcStrList {
241     FcStrSet        *set;
242     int             n;
243 };
244
245 typedef struct _FcStrBuf {
246     FcChar8 *buf;
247     FcBool  allocated;
248     FcBool  failed;
249     int     len;
250     int     size;
251 } FcStrBuf;
252
253 typedef struct _FcCache {
254     int     magic;
255     int     count;
256     int     bank;
257     int     pattern_count;
258     int     patternelt_count;
259     int     valuelist_count;
260     int     str_count;
261     int     langset_count;
262     int     charset_count;
263     int     charset_numbers_count;
264     int     charset_leaf_count;
265     int     charset_leaf_idx_count;
266 } FcCache;
267
268 /*
269  * To map adobe glyph names to unicode values, a precomputed hash
270  * table is used
271  */
272
273 typedef struct _FcGlyphName {
274     FcChar32    ucs;            /* unicode value */
275     FcChar8     name[1];        /* name extends beyond struct */
276 } FcGlyphName;
277
278 /*
279  * To perform case-insensitive string comparisons, a table
280  * is used which holds three different kinds of folding data.
281  * 
282  * The first is a range of upper case values mapping to a range
283  * of their lower case equivalents.  Within each range, the offset
284  * between upper and lower case is constant.
285  *
286  * The second is a range of upper case values which are interleaved
287  * with their lower case equivalents.
288  * 
289  * The third is a set of raw unicode values mapping to a list
290  * of unicode values for comparison purposes.  This allows conversion
291  * of ß to "ss" so that SS, ss and ß all match.  A separate array
292  * holds the list of unicode values for each entry.
293  *
294  * These are packed into a single table.  Using a binary search,
295  * the appropriate entry can be located.
296  */
297
298 #define FC_CASE_FOLD_RANGE          0
299 #define FC_CASE_FOLD_EVEN_ODD       1
300 #define FC_CASE_FOLD_FULL           2
301
302 typedef struct _FcCaseFold {
303     FcChar32    upper;
304     FcChar16    method : 2;
305     FcChar16    count : 14;
306     short       offset;     /* lower - upper for RANGE, table id for FULL */
307 } FcCaseFold;
308
309 #define FC_MAX_FILE_LEN     4096
310
311 #define FC_STORAGE_STATIC 0x80
312 #define fc_value_string(v)  (((v)->type & FC_STORAGE_STATIC) ? ((FcChar8 *) v) + (v)->u.s_off : (v) -> u.s)
313 #define fc_value_charset(v)  (((v)->type & FC_STORAGE_STATIC) ? (const FcCharSet *)(((char *) v) + (v)->u.c_off) : (v) -> u.c)
314 #define fc_value_langset(v)  (((v)->type & FC_STORAGE_STATIC) ? (const FcLangSet *)(((char *) v) + (v)->u.l_off) : (v) -> u.l)
315
316 /*
317  * The per-user ~/.fonts.cache-<version> file is loaded into
318  * this data structure.  Each directory gets a substructure
319  * which is validated by comparing the directory timestamp with
320  * that saved in the cache.  When valid, the entire directory cache
321  * can be immediately loaded without reading the directory.  Otherwise,
322  * the files are checked individually; updated files are loaded into the
323  * cache which is then rewritten to the users home directory
324  */
325
326 #define FC_CACHE_MAGIC 0x12345678
327 #define FC_GLOBAL_CACHE_DIR_HASH_SIZE       37
328 #define FC_GLOBAL_CACHE_FILE_HASH_SIZE      67
329
330 typedef struct _FcGlobalCacheInfo {
331     unsigned int                hash;
332     FcChar8                     *file;
333     time_t                      time;
334     FcBool                      referenced;
335 } FcGlobalCacheInfo;
336
337 typedef struct _FcGlobalCacheFile {
338     struct _FcGlobalCacheFile   *next;
339     FcGlobalCacheInfo           info;
340     int                         id;
341     FcChar8                     *name;
342 } FcGlobalCacheFile;
343
344 typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
345
346 typedef struct _FcGlobalCacheSubdir {
347     struct _FcGlobalCacheSubdir *next;
348     FcGlobalCacheDir            *ent;
349 } FcGlobalCacheSubdir;
350
351 struct _FcGlobalCacheDir {
352     struct _FcGlobalCacheDir    *next;
353     FcGlobalCacheInfo           info;
354     int                         len;
355     FcGlobalCacheFile           *ents[FC_GLOBAL_CACHE_FILE_HASH_SIZE];
356     FcGlobalCacheSubdir         *subdirs;
357 };
358
359 typedef struct _FcGlobalCache {
360     FcGlobalCacheDir            *ents[FC_GLOBAL_CACHE_DIR_HASH_SIZE];
361     FcBool                      updated;
362     FcBool                      broken;
363     int                         entries;
364     int                         referenced;
365 } FcGlobalCache;
366
367 struct _FcAtomic {
368     FcChar8     *file;          /* original file name */
369     FcChar8     *new;           /* temp file name -- write data here */
370     FcChar8     *lck;           /* lockfile name (used for locking) */
371     FcChar8     *tmp;           /* tmpfile name (used for locking) */
372 };
373
374 struct _FcBlanks {
375     int         nblank;
376     int         sblank;
377     FcChar32    *blanks;
378 };
379
380 struct _FcConfig {
381     /*
382      * File names loaded from the configuration -- saved here as the
383      * cache file must be consulted before the directories are scanned,
384      * and those directives may occur in any order
385      */
386     FcStrSet    *configDirs;        /* directories to scan for fonts */
387     FcChar8     *cache;             /* name of per-user cache file */
388     /*
389      * Set of allowed blank chars -- used to
390      * trim fonts of bogus glyphs
391      */
392     FcBlanks    *blanks;
393     /*
394      * List of directories containing fonts,
395      * built by recursively scanning the set 
396      * of configured directories
397      */
398     FcStrSet    *fontDirs;
399     /*
400      * Names of all of the configuration files used
401      * to create this configuration
402      */
403     FcStrSet    *configFiles;       /* config files loaded */
404     /*
405      * Substitution instructions for patterns and fonts;
406      * maxObjects is used to allocate appropriate intermediate storage
407      * while performing a whole set of substitutions
408      */
409     FcSubst     *substPattern;      /* substitutions for patterns */
410     FcSubst     *substFont;         /* substitutions for fonts */
411     int         maxObjects;         /* maximum number of tests in all substs */
412     /*
413      * List of patterns used to control font file selection
414      */
415     FcStrSet    *acceptGlobs;
416     FcStrSet    *rejectGlobs;
417     FcFontSet   *acceptPatterns;
418     FcFontSet   *rejectPatterns;
419     /*
420      * The set of fonts loaded from the listed directories; the
421      * order within the set does not determine the font selection,
422      * except in the case of identical matches in which case earlier fonts
423      * match preferrentially
424      */
425     FcFontSet   *fonts[FcSetApplication + 1];
426     /*
427      * Fontconfig can periodically rescan the system configuration
428      * and font directories.  This rescanning occurs when font
429      * listing requests are made, but no more often than rescanInterval
430      * seconds apart.
431      */
432     time_t      rescanTime;         /* last time information was scanned */
433     int         rescanInterval;     /* interval between scans */
434 };
435  
436 extern FcConfig *_fcConfig;
437
438 typedef struct _FcCharMap FcCharMap;
439
440 /* fcblanks.c */
441
442 /* fccache.c */
443
444 void
445 FcCacheForce(FcBool force);
446
447 FcBool
448 FcCacheSerialize (int bank, FcConfig * config);
449
450 FcFontSet *
451 FcCacheRead (FcConfig *config);
452
453 FcBool
454 FcDirCacheRead (FcFontSet * set, const FcChar8 *dir);
455
456 FcBool
457 FcDirCacheWrite (int bank, FcFontSet *set, const FcChar8 *dir);
458
459 int
460 FcCacheBankCount (void);
461
462 FcBool
463 FcCacheHaveBank (int bank);
464
465 int
466 FcCacheBankToIndex (int bank);
467  
468 /* fccfg.c */
469
470 FcBool
471 FcConfigAddConfigDir (FcConfig      *config,
472                       const FcChar8 *d);
473
474 FcBool
475 FcConfigAddFontDir (FcConfig        *config,
476                     const FcChar8   *d);
477
478 FcBool
479 FcConfigAddDir (FcConfig        *config,
480                 const FcChar8   *d);
481
482 FcBool
483 FcConfigAddConfigFile (FcConfig         *config,
484                        const FcChar8    *f);
485
486 FcBool
487 FcConfigSetCache (FcConfig      *config,
488                   const FcChar8 *c);
489
490 FcBool
491 FcConfigAddBlank (FcConfig      *config,
492                   FcChar32      blank);
493
494 FcBool
495 FcConfigAddEdit (FcConfig       *config,
496                  FcTest         *test,
497                  FcEdit         *edit,
498                  FcMatchKind    kind);
499
500 void
501 FcConfigSetFonts (FcConfig      *config,
502                   FcFontSet     *fonts,
503                   FcSetName     set);
504
505 FcBool
506 FcConfigCompareValue (const FcValue *m,
507                       FcOp          op,
508                       const FcValue *v);
509
510 FcBool
511 FcConfigGlobAdd (FcConfig       *config,
512                  const FcChar8  *glob,
513                  FcBool         accept);
514
515 FcBool
516 FcConfigAcceptFilename (FcConfig        *config,
517                         const FcChar8   *filename);
518
519 FcBool
520 FcConfigPatternsAdd (FcConfig   *config,
521                      FcPattern  *pattern,
522                      FcBool     accept);
523
524 FcBool
525 FcConfigAcceptFont (FcConfig        *config,
526                     const FcPattern *font);
527
528 /* fccharset.c */
529 FcCharSet *
530 FcCharSetFreeze (FcCharSet *cs);
531
532 void
533 FcCharSetThawAll (void);
534
535 FcBool
536 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
537
538 FcCharSet *
539 FcNameParseCharSet (FcChar8 *string);
540
541 FcCharLeaf *
542 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
543
544 void
545 FcCharSetNewBank (void);
546
547 int
548 FcCharSetNeededBytes (const FcCharSet *c);
549
550 void *
551 FcCharSetDistributeBytes (FcCache * metadata,
552                           void * block_ptr);
553
554 FcCharSet *
555 FcCharSetSerialize(int bank, FcCharSet *c);
556
557 void *
558 FcCharSetUnserialize (FcCache metadata, void *block_ptr);
559
560 FcCharLeaf *
561 FcCharSetGetLeaf(const FcCharSet *c, int i);
562
563 FcChar16 *
564 FcCharSetGetNumbers(const FcCharSet *c);
565
566 /* fcdbg.c */
567 void
568 FcValueListPrint (const FcValueListPtr l);
569
570 void
571 FcLangSetPrint (const FcLangSet *ls);
572
573 void
574 FcOpPrint (FcOp op);
575
576 void
577 FcTestPrint (const FcTest *test);
578
579 void
580 FcExprPrint (const FcExpr *expr);
581
582 void
583 FcEditPrint (const FcEdit *edit);
584
585 void
586 FcSubstPrint (const FcSubst *subst);
587
588 int
589 FcDebug (void);
590
591 /* fcdir.c */
592
593 FcBool
594 FcFileIsDir (const FcChar8 *file);
595
596 FcBool
597 FcFileScanConfig (FcFontSet     *set,
598                   FcStrSet      *dirs,
599                   FcFileCache   *cache,
600                   FcBlanks      *blanks,
601                   const FcChar8 *file,
602                   FcBool        force,
603                   FcConfig      *config);
604
605 FcBool
606 FcDirScanConfig (FcFontSet      *set,
607                  FcStrSet       *dirs,
608                  FcFileCache    *cache,
609                  FcBlanks       *blanks,
610                  const FcChar8  *dir,
611                  FcBool         force,
612                  FcConfig       *config);
613
614 /* fcfont.c */
615 int
616 FcFontDebug (void);
617     
618 /* fcfreetype.c */
619 FcBool
620 FcFreeTypeIsExclusiveLang (const FcChar8  *lang);
621
622 FcBool
623 FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
624
625 FcChar32
626 FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
627
628 FcChar32
629 FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
630
631 const FcCharMap *
632 FcFreeTypeGetPrivateMap (FT_Encoding encoding);
633     
634 /* fcfs.c */
635
636 void
637 FcFontSetNewBank (void);
638
639 int
640 FcFontSetNeededBytes (FcFontSet *s);
641
642 void *
643 FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
644
645 FcBool
646 FcFontSetSerialize (int bank, FcFontSet * s);
647
648 FcBool
649 FcFontSetUnserialize(FcCache metadata, FcFontSet * s, void * block_ptr);
650
651 /* fcgram.y */
652 int
653 FcConfigparse (void);
654
655 int
656 FcConfigwrap (void);
657     
658 void
659 FcConfigerror (char *fmt, ...);
660     
661 char *
662 FcConfigSaveField (const char *field);
663
664 void
665 FcTestDestroy (FcTest *test);
666
667 FcExpr *
668 FcExprCreateInteger (int i);
669
670 FcExpr *
671 FcExprCreateDouble (double d);
672
673 FcExpr *
674 FcExprCreateString (const FcChar8 *s);
675
676 FcExpr *
677 FcExprCreateMatrix (const FcMatrix *m);
678
679 FcExpr *
680 FcExprCreateBool (FcBool b);
681
682 FcExpr *
683 FcExprCreateNil (void);
684
685 FcExpr *
686 FcExprCreateField (const char *field);
687
688 FcExpr *
689 FcExprCreateConst (const FcChar8 *constant);
690
691 FcExpr *
692 FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
693
694 void
695 FcExprDestroy (FcExpr *e);
696
697 void
698 FcEditDestroy (FcEdit *e);
699
700 /* fcinit.c */
701
702 void
703 FcMemReport (void);
704
705 void
706 FcMemAlloc (int kind, int size);
707
708 void
709 FcMemFree (int kind, int size);
710
711 /* fclang.c */
712 FcLangSet *
713 FcFreeTypeLangSet (const FcCharSet  *charset, 
714                    const FcChar8    *exclusiveLang);
715
716 FcLangResult
717 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
718     
719 const FcCharSet *
720 FcCharSetForLang (const FcChar8 *lang);
721
722 FcLangSet *
723 FcLangSetPromote (const FcChar8 *lang);
724
725 FcLangSet *
726 FcNameParseLangSet (const FcChar8 *string);
727
728 FcBool
729 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
730
731 void
732 FcLangSetNewBank (void);
733
734 int
735 FcLangSetNeededBytes (const FcLangSet *l);
736
737 void *
738 FcLangSetDistributeBytes (FcCache * metadata,
739                           void * block_ptr);
740
741 FcLangSet *
742 FcLangSetSerialize (int bank, FcLangSet *l);
743
744 void *
745 FcLangSetUnserialize (FcCache metadata, void *block_ptr);
746
747 /* fclist.c */
748
749 FcBool
750 FcListPatternMatchAny (const FcPattern *p,
751                        const FcPattern *font);
752
753 /* fcmatch.c */
754
755 /* fcname.c */
756
757 FcBool
758 FcNameBool (const FcChar8 *v, FcBool *result);
759
760 void
761 FcObjectNewBank(void);
762
763 void *
764 FcObjectDistributeBytes (FcCache * metadata,
765                          void * block_ptr);
766
767 FcObjectPtr
768 FcObjectToPtr (const char * si);
769
770 int
771 FcObjectNeededBytes (FcObjectPtr p);
772
773 void
774 FcObjectUnserialize (FcCache metadata, FcConfig * config, void *block_ptr);
775
776 FcObjectPtr
777 FcObjectSerialize (FcObjectPtr s);
778
779 /* fcpat.c */
780
781 FcValue
782 FcValueCanonicalize (const FcValue *v);
783
784 void
785 FcValueListDestroy (FcValueListPtr l);
786
787 FcPatternElt *
788 FcPatternFindElt (const FcPattern *p, const char *object);
789
790 FcPatternElt *
791 FcPatternInsertElt (FcPattern *p, const char *object);
792
793 FcBool
794 FcPatternAddWithBinding  (FcPattern         *p,
795                           const char        *object,
796                           FcValue           value,
797                           FcValueBinding    binding,
798                           FcBool            append);
799
800 FcPattern *
801 FcPatternFreeze (FcPattern *p);
802
803 void
804 FcPatternFini (void);
805
806 FcBool
807 FcPatternAppend (FcPattern *p, FcPattern *s);
808
809 const char *
810 FcObjectStaticName (const char *name);
811
812 const char *
813 FcObjectPtrU (FcObjectPtr p);
814
815 int
816 FcObjectPtrCompare (FcObjectPtr a, FcObjectPtr b);
817
818 void
819 FcPatternNewBank (void);
820
821 int
822 FcPatternNeededBytes (FcPattern *p);
823
824 void *
825 FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
826
827 FcValueList * 
828 FcValueListPtrU(FcValueListPtr p);
829
830 FcPatternElt *
831 FcPatternEltU (FcPatternEltPtr pei);
832
833 FcValueListPtr
834 FcValueListPtrCreateDynamic(FcValueList * p);
835
836 FcPattern *
837 FcPatternSerialize (int bank, FcPattern * p);
838
839 FcPattern *
840 FcPatternUnserialize (FcCache metadata, void *block_ptr);
841
842 /* fcrender.c */
843
844 /* fcmatrix.c */
845
846 extern const FcMatrix    FcIdentityMatrix;
847
848 void
849 FcMatrixFree (FcMatrix *mat);
850
851 /* fcstr.c */
852 void
853 FcStrSetSort (FcStrSet * set);
854
855 FcChar8 *
856 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
857     
858 void
859 FcStrFree (FcChar8 *s);
860
861 void
862 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
863
864 void
865 FcStrBufDestroy (FcStrBuf *buf);
866
867 FcChar8 *
868 FcStrBufDone (FcStrBuf *buf);
869
870 FcBool
871 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
872
873 FcBool
874 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
875
876 FcBool
877 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
878
879 int
880 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
881
882 const FcChar8 *
883 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
884
885 const FcChar8 *
886 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
887
888 FcBool
889 FcStrUsesHome (const FcChar8 *s);
890
891 FcChar8 *
892 FcStrLastSlash (const FcChar8  *path);
893
894 FcChar32
895 FcStrHashIgnoreCase (const FcChar8 *s);
896
897 #endif /* _FC_INT_H_ */