Replace FcObjectStaticName by FcStrStaticName. Implement serialization of
[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 FcGlobalCache *
445 FcGlobalCacheCreate (void);
446
447 void
448 FcGlobalCacheDestroy (FcGlobalCache *cache);
449
450 FcBool
451 FcGlobalCacheCheckTime (const FcChar8*file, FcGlobalCacheInfo *info);
452
453 void
454 FcGlobalCacheReferenced (FcGlobalCache      *cache,
455                          FcGlobalCacheInfo  *info);
456
457 void
458 FcGlobalCacheReferenceSubdir (FcGlobalCache *cache,
459                               const FcChar8 *dir);
460
461 FcGlobalCacheDir *
462 FcGlobalCacheDirGet (FcGlobalCache  *cache,
463                      const FcChar8  *dir,
464                      int            len,
465                      FcBool         create_missing);
466
467 FcBool
468 FcGlobalCacheScanDir (FcFontSet         *set,
469                       FcStrSet          *dirs,
470                       FcGlobalCache     *cache,
471                       const FcChar8     *dir,
472                       FcConfig          *config);
473
474 FcGlobalCacheFile *
475 FcGlobalCacheFileGet (FcGlobalCache *cache,
476                       const FcChar8 *file,
477                       int           id,
478                       int           *count);
479
480
481 void
482 FcGlobalCacheLoad (FcGlobalCache    *cache,
483                    const FcChar8    *cache_file);
484
485 FcBool
486 FcGlobalCacheUpdate (FcGlobalCache  *cache,
487                      const FcChar8  *file,
488                      int            id,
489                      const FcChar8  *name);
490
491 FcBool
492 FcGlobalCacheSave (FcGlobalCache    *cache,
493                    const FcChar8    *cache_file);
494
495 void
496 FcCacheForce(FcBool force);
497
498 FcBool
499 FcCacheSerialize (int bank, FcConfig * config);
500
501 FcFontSet *
502 FcCacheRead (FcConfig *config, FcGlobalCache * cache);
503
504 FcBool
505 FcDirCacheRead (FcFontSet * set, const FcChar8 *dir);
506
507 FcBool
508 FcDirCacheWrite (int bank, FcFontSet *set, const FcChar8 *dir);
509
510 int
511 FcCacheBankCount (void);
512
513 FcBool
514 FcCacheHaveBank (int bank);
515
516 int
517 FcCacheBankToIndex (int bank);
518  
519 /* fccfg.c */
520
521 FcBool
522 FcConfigAddConfigDir (FcConfig      *config,
523                       const FcChar8 *d);
524
525 FcBool
526 FcConfigAddFontDir (FcConfig        *config,
527                     const FcChar8   *d);
528
529 FcBool
530 FcConfigAddDir (FcConfig        *config,
531                 const FcChar8   *d);
532
533 FcBool
534 FcConfigAddConfigFile (FcConfig         *config,
535                        const FcChar8    *f);
536
537 FcBool
538 FcConfigSetCache (FcConfig      *config,
539                   const FcChar8 *c);
540
541 FcBool
542 FcConfigAddBlank (FcConfig      *config,
543                   FcChar32      blank);
544
545 FcBool
546 FcConfigAddEdit (FcConfig       *config,
547                  FcTest         *test,
548                  FcEdit         *edit,
549                  FcMatchKind    kind);
550
551 void
552 FcConfigSetFonts (FcConfig      *config,
553                   FcFontSet     *fonts,
554                   FcSetName     set);
555
556 FcBool
557 FcConfigCompareValue (const FcValue *m,
558                       FcOp          op,
559                       const FcValue *v);
560
561 FcBool
562 FcConfigGlobAdd (FcConfig       *config,
563                  const FcChar8  *glob,
564                  FcBool         accept);
565
566 FcBool
567 FcConfigAcceptFilename (FcConfig        *config,
568                         const FcChar8   *filename);
569
570 FcBool
571 FcConfigPatternsAdd (FcConfig   *config,
572                      FcPattern  *pattern,
573                      FcBool     accept);
574
575 FcBool
576 FcConfigAcceptFont (FcConfig        *config,
577                     const FcPattern *font);
578
579 /* fccharset.c */
580 FcCharSet *
581 FcCharSetFreeze (FcCharSet *cs);
582
583 void
584 FcCharSetThawAll (void);
585
586 FcBool
587 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
588
589 FcCharSet *
590 FcNameParseCharSet (FcChar8 *string);
591
592 FcCharLeaf *
593 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
594
595 void
596 FcCharSetNewBank (void);
597
598 int
599 FcCharSetNeededBytes (const FcCharSet *c);
600
601 void *
602 FcCharSetDistributeBytes (FcCache * metadata,
603                           void * block_ptr);
604
605 FcCharSet *
606 FcCharSetSerialize(int bank, FcCharSet *c);
607
608 void *
609 FcCharSetUnserialize (FcCache metadata, void *block_ptr);
610
611 FcCharLeaf *
612 FcCharSetGetLeaf(const FcCharSet *c, int i);
613
614 FcChar16 *
615 FcCharSetGetNumbers(const FcCharSet *c);
616
617 /* fcdbg.c */
618 void
619 FcValueListPrint (const FcValueListPtr l);
620
621 void
622 FcLangSetPrint (const FcLangSet *ls);
623
624 void
625 FcOpPrint (FcOp op);
626
627 void
628 FcTestPrint (const FcTest *test);
629
630 void
631 FcExprPrint (const FcExpr *expr);
632
633 void
634 FcEditPrint (const FcEdit *edit);
635
636 void
637 FcSubstPrint (const FcSubst *subst);
638
639 int
640 FcDebug (void);
641
642 /* fcdir.c */
643
644 FcBool
645 FcFileIsDir (const FcChar8 *file);
646
647 FcBool
648 FcFileScanConfig (FcFontSet     *set,
649                   FcStrSet      *dirs,
650                   FcFileCache   *cache,
651                   FcBlanks      *blanks,
652                   const FcChar8 *file,
653                   FcBool        force,
654                   FcConfig      *config);
655
656 FcBool
657 FcDirScanConfig (FcFontSet      *set,
658                  FcStrSet       *dirs,
659                  FcFileCache    *cache,
660                  FcBlanks       *blanks,
661                  const FcChar8  *dir,
662                  FcBool         force,
663                  FcConfig       *config);
664
665 /* fcfont.c */
666 int
667 FcFontDebug (void);
668     
669 /* fcfreetype.c */
670 FcBool
671 FcFreeTypeIsExclusiveLang (const FcChar8  *lang);
672
673 FcBool
674 FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
675
676 FcChar32
677 FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
678
679 FcChar32
680 FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
681
682 const FcCharMap *
683 FcFreeTypeGetPrivateMap (FT_Encoding encoding);
684     
685 /* fcfs.c */
686
687 void
688 FcFontSetNewBank (void);
689
690 int
691 FcFontSetNeededBytes (FcFontSet *s);
692
693 void *
694 FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
695
696 FcBool
697 FcFontSetSerialize (int bank, FcFontSet * s);
698
699 FcBool
700 FcFontSetUnserialize(FcCache metadata, FcFontSet * s, void * block_ptr);
701
702 /* fcgram.y */
703 int
704 FcConfigparse (void);
705
706 int
707 FcConfigwrap (void);
708     
709 void
710 FcConfigerror (char *fmt, ...);
711     
712 char *
713 FcConfigSaveField (const char *field);
714
715 void
716 FcTestDestroy (FcTest *test);
717
718 FcExpr *
719 FcExprCreateInteger (int i);
720
721 FcExpr *
722 FcExprCreateDouble (double d);
723
724 FcExpr *
725 FcExprCreateString (const FcChar8 *s);
726
727 FcExpr *
728 FcExprCreateMatrix (const FcMatrix *m);
729
730 FcExpr *
731 FcExprCreateBool (FcBool b);
732
733 FcExpr *
734 FcExprCreateNil (void);
735
736 FcExpr *
737 FcExprCreateField (const char *field);
738
739 FcExpr *
740 FcExprCreateConst (const FcChar8 *constant);
741
742 FcExpr *
743 FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
744
745 void
746 FcExprDestroy (FcExpr *e);
747
748 void
749 FcEditDestroy (FcEdit *e);
750
751 /* fcinit.c */
752
753 void
754 FcMemReport (void);
755
756 void
757 FcMemAlloc (int kind, int size);
758
759 void
760 FcMemFree (int kind, int size);
761
762 /* fclang.c */
763 FcLangSet *
764 FcFreeTypeLangSet (const FcCharSet  *charset, 
765                    const FcChar8    *exclusiveLang);
766
767 FcLangResult
768 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
769     
770 const FcCharSet *
771 FcCharSetForLang (const FcChar8 *lang);
772
773 FcLangSet *
774 FcLangSetPromote (const FcChar8 *lang);
775
776 FcLangSet *
777 FcNameParseLangSet (const FcChar8 *string);
778
779 FcBool
780 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
781
782 void
783 FcLangSetNewBank (void);
784
785 int
786 FcLangSetNeededBytes (const FcLangSet *l);
787
788 void *
789 FcLangSetDistributeBytes (FcCache * metadata,
790                           void * block_ptr);
791
792 FcLangSet *
793 FcLangSetSerialize (int bank, FcLangSet *l);
794
795 void *
796 FcLangSetUnserialize (FcCache metadata, void *block_ptr);
797
798 /* fclist.c */
799
800 FcBool
801 FcListPatternMatchAny (const FcPattern *p,
802                        const FcPattern *font);
803
804 /* fcmatch.c */
805
806 /* fcname.c */
807
808 FcBool
809 FcNameBool (const FcChar8 *v, FcBool *result);
810
811 void *
812 FcObjectDistributeBytes (FcCache * metadata,
813                          void * block_ptr);
814
815 FcObjectPtr
816 FcObjectToPtr (const char * si);
817
818 int
819 FcObjectNeededBytes (void);
820
821 void *
822 FcObjectUnserialize (FcCache metadata, void *block_ptr);
823
824 void
825 FcObjectSerialize (void);
826
827 const char *
828 FcObjectPtrU (FcObjectPtr p);
829
830 int
831 FcObjectPtrCompare (FcObjectPtr a, FcObjectPtr b);
832
833 void
834 FcObjectStaticNameFini (void);
835
836 /* fcpat.c */
837
838 FcValue
839 FcValueCanonicalize (const FcValue *v);
840
841 void
842 FcValueListDestroy (FcValueListPtr l);
843
844 FcPatternElt *
845 FcPatternFindElt (const FcPattern *p, const char *object);
846
847 FcPatternElt *
848 FcPatternInsertElt (FcPattern *p, const char *object);
849
850 FcBool
851 FcPatternAddWithBinding  (FcPattern         *p,
852                           const char        *object,
853                           FcValue           value,
854                           FcValueBinding    binding,
855                           FcBool            append);
856
857 FcPattern *
858 FcPatternFreeze (FcPattern *p);
859
860 void
861 FcPatternFini (void);
862
863 FcBool
864 FcPatternAppend (FcPattern *p, FcPattern *s);
865
866 const char *
867 FcStrStaticName (const char *name);
868
869 FcChar32
870 FcStringHash (const FcChar8 *s);
871
872 void
873 FcPatternNewBank (void);
874
875 int
876 FcPatternNeededBytes (FcPattern *p);
877
878 void *
879 FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
880
881 FcValueList * 
882 FcValueListPtrU(FcValueListPtr p);
883
884 FcPatternElt *
885 FcPatternEltU (FcPatternEltPtr pei);
886
887 FcValueListPtr
888 FcValueListPtrCreateDynamic(FcValueList * p);
889
890 FcPattern *
891 FcPatternSerialize (int bank, FcPattern * p);
892
893 void *
894 FcPatternUnserialize (FcCache metadata, void *block_ptr);
895
896 /* fcrender.c */
897
898 /* fcmatrix.c */
899
900 extern const FcMatrix    FcIdentityMatrix;
901
902 void
903 FcMatrixFree (FcMatrix *mat);
904
905 /* fcstr.c */
906 void
907 FcStrSetSort (FcStrSet * set);
908
909 FcChar8 *
910 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
911     
912 void
913 FcStrFree (FcChar8 *s);
914
915 void
916 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
917
918 void
919 FcStrBufDestroy (FcStrBuf *buf);
920
921 FcChar8 *
922 FcStrBufDone (FcStrBuf *buf);
923
924 FcBool
925 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
926
927 FcBool
928 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
929
930 FcBool
931 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
932
933 int
934 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
935
936 const FcChar8 *
937 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
938
939 const FcChar8 *
940 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
941
942 FcBool
943 FcStrUsesHome (const FcChar8 *s);
944
945 FcChar8 *
946 FcStrLastSlash (const FcChar8  *path);
947
948 FcChar32
949 FcStrHashIgnoreCase (const FcChar8 *s);
950
951 #endif /* _FC_INT_H_ */