2 * fontconfig/src/fcint.h
4 * Copyright © 2000 Keith Packard
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 the author(s) not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. The authors make no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
16 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL THE AUTHOR(S) 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.
45 #include <sys/types.h>
48 #include <fontconfig/fontconfig.h>
49 #include <fontconfig/fcprivate.h>
50 #include "fcdeprecate.h"
54 #ifndef FC_CONFIG_PATH
55 #define FC_CONFIG_PATH "fonts.conf"
59 # include "fcwindows.h"
60 typedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT);
61 typedef HRESULT (WINAPI *pfnSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
62 extern pfnGetSystemWindowsDirectory pGetSystemWindowsDirectory;
63 extern pfnSHGetFolderPathA pSHGetFolderPathA;
64 # define FC_SEARCH_PATH_SEPARATOR ';'
65 # define FC_DIR_SEPARATOR '\\'
66 # define FC_DIR_SEPARATOR_S "\\"
68 # define FC_SEARCH_PATH_SEPARATOR ':'
69 # define FC_DIR_SEPARATOR '/'
70 # define FC_DIR_SEPARATOR_S "/"
74 #define FC_PATH_MAX PATH_MAX
76 #define FC_PATH_MAX 128
80 #define FC_UNUSED __attribute__((unused))
85 #define FC_DBG_MATCH 1
86 #define FC_DBG_MATCHV 2
88 #define FC_DBG_FONTSET 8
89 #define FC_DBG_CACHE 16
90 #define FC_DBG_CACHEV 32
91 #define FC_DBG_PARSE 64
92 #define FC_DBG_SCAN 128
93 #define FC_DBG_SCANV 256
94 #define FC_DBG_CONFIG 1024
95 #define FC_DBG_LANGSET 2048
96 #define FC_DBG_MATCH2 4096
98 #define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1] FC_UNUSED
99 #define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond))
100 #define FC_ASSERT_STATIC(_cond) _FC_ASSERT_STATIC0 (__LINE__, (_cond))
102 #define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
103 #define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
105 /* slim_internal.h */
106 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
107 #define FcPrivate __attribute__((__visibility__("hidden")))
108 #define HAVE_GNUC_ATTRIBUTE 1
110 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
111 #define FcPrivate __hidden
112 #else /* not gcc >= 3.3 and not Sun Studio >= 8 */
119 #define _(x) (dgettext(GETTEXT_PACKAGE, x))
121 #define dgettext(d, s) (s)
127 FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
129 #define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
130 #define FcFree(s) (free ((FcChar8 *) (s)))
133 * Serialized data structures use only offsets instead of pointers
134 * A low bit of 1 indicates an offset.
137 /* Is the provided pointer actually an offset? */
138 #define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0)
140 /* Encode offset in a pointer of type t */
141 #define FcOffsetEncode(o,t) ((t *) ((o) | 1))
143 /* Decode a pointer into an offset */
144 #define FcOffsetDecode(p) (((intptr_t) (p)) & ~1)
146 /* Compute pointer offset */
147 #define FcPtrToOffset(b,p) ((intptr_t) (p) - (intptr_t) (b))
149 /* Given base address, offset and type, return a pointer */
150 #define FcOffsetToPtr(b,o,t) ((t *) ((intptr_t) (b) + (o)))
152 /* Given base address, encoded offset and type, return a pointer */
153 #define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t)
155 /* Given base address, pointer and type, return an encoded offset */
156 #define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t)
158 /* Given a structure, offset member and type, return pointer */
159 #define FcOffsetMember(s,m,t) FcOffsetToPtr(s,(s)->m,t)
161 /* Given a structure, encoded offset member and type, return pointer to member */
162 #define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t)
164 /* Given a structure, member and type, convert the member to a pointer */
165 #define FcPointerMember(s,m,t) (FcIsEncodedOffset((s)->m) ? \
166 FcEncodedOffsetMember (s,m,t) : \
170 * Serialized values may hold strings, charsets and langsets as pointers,
171 * unfortunately FcValue is an exposed type so we can't just always use
174 #define FcValueString(v) FcPointerMember(v,u.s,FcChar8)
175 #define FcValueCharSet(v) FcPointerMember(v,u.c,const FcCharSet)
176 #define FcValueLangSet(v) FcPointerMember(v,u.l,const FcLangSet)
177 #define FcValueRange(v) FcPointerMember(v,u.r,const FcRange)
179 typedef struct _FcValueList *FcValueListPtr;
181 typedef struct _FcValueList {
182 struct _FcValueList *next;
184 FcValueBinding binding;
187 #define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList)
189 typedef int FcObject;
191 /* The 1024 is to leave some room for future added internal objects, such
192 * that caches from newer fontconfig can still be used with older fontconfig
193 * without getting confused. */
194 #define FC_EXT_OBJ_INDEX 1024
195 #define FC_OBJ_ID(_n_) ((_n_) & (~FC_EXT_OBJ_INDEX))
197 typedef struct _FcPatternElt *FcPatternEltPtr;
200 * Pattern elts are stuck in a structure connected to the pattern,
201 * so they get moved around when the pattern is resized. Hence, the
202 * values field must be a pointer/offset instead of just an offset
204 typedef struct _FcPatternElt {
209 #define FcPatternEltValues(pe) FcPointerMember(pe,values,FcValueList)
214 intptr_t elts_offset;
218 #define FcPatternElts(p) FcOffsetMember(p,elts_offset,FcPatternElt)
220 #define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *)
222 #define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \
223 FcEncodedOffsetToPtr(fs, \
224 FcFontSetFonts(fs)[i], \
229 FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpRange, FcOpBool, FcOpCharSet, FcOpLangSet,
231 FcOpField, FcOpConst,
232 FcOpAssign, FcOpAssignReplace,
233 FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
234 FcOpDelete, FcOpDeleteAll,
236 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
237 FcOpContains, FcOpListing, FcOpNotContains,
238 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
239 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
240 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
244 typedef enum _FcOpFlags {
245 FcOpFlagIgnoreBlanks = 1U << 0
248 #define FC_OP_GET_OP(_x_) ((_x_) & 0xffff)
249 #define FC_OP_GET_FLAGS(_x_) (((_x_) & 0xffff0000) >> 16)
250 #define FC_OP(_x_,_f_) (FC_OP_GET_OP (_x_) | ((_f_) << 16))
252 typedef struct _FcExprMatrix {
253 struct _FcExpr *xx, *xy, *yx, *yy;
256 typedef struct _FcExprName {
267 typedef struct _FcExpr {
280 const FcChar8 *constant;
282 struct _FcExpr *left, *right;
287 typedef struct _FcExprPage FcExprPage;
290 FcExprPage *next_page;
292 FcExpr exprs[(1024 - 2/* two pointers */ - 2/* malloc overhead */) * sizeof (void *) / sizeof (FcExpr)];
293 FcExpr end[FLEXIBLE_ARRAY_MEMBER];
296 typedef enum _FcQual {
297 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
300 #define FcMatchDefault ((FcMatchKind) -1)
302 typedef struct _FcTest {
310 typedef struct _FcEdit {
314 FcValueBinding binding;
317 typedef void (* FcDestroyFunc) (void *data);
319 typedef struct _FcPtrList FcPtrList;
320 /* need to sync with FcConfigFileInfoIter at fontconfig.h */
321 typedef struct _FcPtrListIter {
327 typedef enum _FcRuleType {
328 FcRuleUnknown, FcRuleTest, FcRuleEdit
331 typedef struct _FcRule {
332 struct _FcRule *next;
340 typedef struct _FcRuleSet {
343 FcChar8 *description;
346 FcPtrList *subst[FcMatchKindEnd];
349 typedef struct _FcCharLeaf {
350 FcChar32 map[256/32];
354 FcRef ref; /* reference count */
355 int num; /* size of leaves and numbers arrays */
356 intptr_t leaves_offset;
357 intptr_t numbers_offset;
360 #define FcCharSetLeaves(c) FcOffsetMember(c,leaves_offset,intptr_t)
361 #define FcCharSetLeaf(c,i) (FcOffsetToPtr(FcCharSetLeaves(c), \
362 FcCharSetLeaves(c)[i], \
364 #define FcCharSetNumbers(c) FcOffsetMember(c,numbers_offset,FcChar16)
366 #define FCSS_DEFAULT 0 /* default behavior */
367 #define FCSS_ALLOW_DUPLICATES 1 /* allows for duplicate strings in the set */
368 #define FCSS_GROW_BY_64 2 /* grows buffer by 64 elements instead of 1 */
370 #define FcStrSetHasControlBit(s,c) (s->control & c)
371 #define FcStrSetHasControlBits(s,c) ( (c) == (s->control & (c)) )
374 FcRef ref; /* reference count */
378 unsigned int control; /* control bits for set behavior */
386 typedef struct _FcStrBuf {
392 FcChar8 buf_static[16 * sizeof (void *)];
395 typedef struct _FcHashTable FcHashTable;
397 typedef FcChar32 (* FcHashFunc) (const void *data);
398 typedef int (* FcCompareFunc) (const void *v1, const void *v2);
399 typedef FcBool (* FcCopyFunc) (const void *src, void **dest);
403 unsigned int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
404 int version; /* FC_CACHE_VERSION_NUMBER */
405 intptr_t size; /* size of file */
406 intptr_t dir; /* offset to dir name */
407 intptr_t dirs; /* offset to subdirs */
408 int dirs_count; /* number of subdir strings */
409 intptr_t set; /* offset to font set */
410 int checksum; /* checksum of directory state */
411 int64_t checksum_nano; /* checksum of directory state */
416 #define FcCacheDir(c) FcOffsetMember(c,dir,FcChar8)
417 #define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t)
418 #define FcCacheSet(c) FcOffsetMember(c,set,FcFontSet)
419 #define FcCacheSubdir(c,i) FcOffsetToPtr (FcCacheDirs(c),\
424 * Used while constructing a directory cache object
427 #define FC_SERIALIZE_HASH_SIZE 8191
429 typedef union _FcAlign {
437 typedef struct _FcSerializeBucket {
438 struct _FcSerializeBucket *next;
443 typedef struct _FcCharSetFreezer FcCharSetFreezer;
445 typedef struct _FcSerialize {
447 FcCharSetFreezer *cs_freezer;
449 FcSerializeBucket *buckets[FC_SERIALIZE_HASH_SIZE];
453 * To map adobe glyph names to unicode values, a precomputed hash
457 typedef struct _FcGlyphName {
458 FcChar32 ucs; /* unicode value */
459 FcChar8 name[1]; /* name extends beyond struct */
463 * To perform case-insensitive string comparisons, a table
464 * is used which holds three different kinds of folding data.
466 * The first is a range of upper case values mapping to a range
467 * of their lower case equivalents. Within each range, the offset
468 * between upper and lower case is constant.
470 * The second is a range of upper case values which are interleaved
471 * with their lower case equivalents.
473 * The third is a set of raw unicode values mapping to a list
474 * of unicode values for comparison purposes. This allows conversion
475 * of ß to "ss" so that SS, ss and ß all match. A separate array
476 * holds the list of unicode values for each entry.
478 * These are packed into a single table. Using a binary search,
479 * the appropriate entry can be located.
482 #define FC_CASE_FOLD_RANGE 0
483 #define FC_CASE_FOLD_EVEN_ODD 1
484 #define FC_CASE_FOLD_FULL 2
486 typedef struct _FcCaseFold {
490 short offset; /* lower - upper for RANGE, table id for FULL */
493 #define FC_MAX_FILE_LEN 4096
495 #define FC_CACHE_MAGIC_MMAP 0xFC02FC04
496 #define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
499 FcChar8 *file; /* original file name */
500 FcChar8 *new; /* temp file name -- write data here */
501 FcChar8 *lck; /* lockfile name (used for locking) */
502 FcChar8 *tmp; /* tmpfile name (used for locking) */
507 * File names loaded from the configuration -- saved here as the
508 * cache file must be consulted before the directories are scanned,
509 * and those directives may occur in any order
511 FcStrSet *configDirs; /* directories to scan for fonts */
513 * List of directories containing fonts,
514 * built by recursively scanning the set
515 * of configured directories
519 * List of directories containing cache files.
523 * Names of all of the configuration files used
524 * to create this configuration
526 FcStrSet *configFiles; /* config files loaded */
528 * Substitution instructions for patterns and fonts;
529 * maxObjects is used to allocate appropriate intermediate storage
530 * while performing a whole set of substitutions
532 * 0.. substitutions for patterns
533 * 1.. substitutions for fonts
534 * 2.. substitutions for scanned fonts
536 FcPtrList *subst[FcMatchKindEnd];
537 int maxObjects; /* maximum number of tests in all substs */
539 * List of patterns used to control font file selection
541 FcStrSet *acceptGlobs;
542 FcStrSet *rejectGlobs;
543 FcFontSet *acceptPatterns;
544 FcFontSet *rejectPatterns;
546 * The set of fonts loaded from the listed directories; the
547 * order within the set does not determine the font selection,
548 * except in the case of identical matches in which case earlier fonts
549 * match preferrentially
551 FcFontSet *fonts[FcSetApplication + 1];
553 * Fontconfig can periodically rescan the system configuration
554 * and font directories. This rescanning occurs when font
555 * listing requests are made, but no more often than rescanInterval
558 time_t rescanTime; /* last time information was scanned */
559 int rescanInterval; /* interval between scans */
561 FcRef ref; /* reference count */
563 FcExprPage *expr_pool; /* pool of FcExpr's */
565 FcChar8 *sysRoot; /* override the system root directory */
566 FcStrSet *availConfigFiles; /* config files available */
567 FcPtrList *rulesetList; /* List of rulesets being installed */
568 FcHashTable *uuid_table; /* UUID table for cachedirs */
571 typedef struct _FcFileTime {
576 typedef struct _FcCharMap FcCharMap;
578 typedef struct _FcStatFS FcStatFS;
582 FcBool is_mtime_broken;
585 typedef struct _FcValuePromotionBuffer FcValuePromotionBuffer;
587 struct _FcValuePromotionBuffer {
592 char c[256]; /* Enlarge as needed */
599 FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
602 FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
605 FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
608 FcDirCacheWrite (FcCache *cache, FcConfig *config);
611 FcDirCacheCreateTagFile (const FcChar8 *cache_dir);
614 FcCacheObjectReference (void *object);
617 FcCacheObjectDereference (void *object);
620 FcCacheAllocate (FcCache *cache, size_t len);
627 FcDirCacheReference (FcCache *cache, int nref);
630 FcDirCacheLock (const FcChar8 *dir,
634 FcDirCacheUnlock (int fd);
645 FcConfigXdgCacheHome (void);
648 FcConfigXdgConfigHome (void);
651 FcConfigXdgDataHome (void);
654 FcConfigAllocExpr (FcConfig *config);
657 FcConfigAddConfigDir (FcConfig *config,
661 FcConfigAddFontDir (FcConfig *config,
665 FcConfigAddCacheDir (FcConfig *config,
669 FcConfigAddConfigFile (FcConfig *config,
673 FcConfigAddBlank (FcConfig *config,
677 FcConfigAddRule (FcConfig *config,
682 FcConfigSetFonts (FcConfig *config,
687 FcConfigCompareValue (const FcValue *m,
692 FcConfigGlobAdd (FcConfig *config,
697 FcConfigAcceptFilename (FcConfig *config,
698 const FcChar8 *filename);
701 FcConfigPatternsAdd (FcConfig *config,
706 FcConfigAcceptFont (FcConfig *config,
707 const FcPattern *font);
710 FcConfigModifiedTime (FcConfig *config);
713 FcConfigAddCache (FcConfig *config, FcCache *cache,
714 FcSetName set, FcStrSet *dirSet, FcChar8 *forDir);
716 FcPrivate FcRuleSet *
717 FcRuleSetCreate (const FcChar8 *name);
720 FcRuleSetDestroy (FcRuleSet *rs);
723 FcRuleSetReference (FcRuleSet *rs);
726 FcRuleSetEnable (FcRuleSet *rs,
730 FcRuleSetAddDescription (FcRuleSet *rs,
731 const FcChar8 *domain,
732 const FcChar8 *description);
735 FcRuleSetAdd (FcRuleSet *rs,
741 FcAlignSize (intptr_t size);
743 FcPrivate FcSerialize *
744 FcSerializeCreate (void);
747 FcSerializeDestroy (FcSerialize *serialize);
750 FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
753 FcSerializeReserve (FcSerialize *serialize, int size);
756 FcSerializeOffset (FcSerialize *serialize, const void *object);
759 FcSerializePtr (FcSerialize *serialize, const void *object);
762 FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
764 FcPrivate FcLangSet *
765 FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
768 FcPrivate FcCharSet *
769 FcCharSetPromote (FcValuePromotionBuffer *vbuf);
772 FcLangCharSetPopulate (void);
774 FcPrivate FcCharSetFreezer *
775 FcCharSetFreezerCreate (void);
777 FcPrivate const FcCharSet *
778 FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
781 FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
784 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
786 FcPrivate FcCharSet *
787 FcNameParseCharSet (FcChar8 *string);
790 FcNameUnparseValue (FcStrBuf *buf,
795 FcNameUnparseValueList (FcStrBuf *buf,
799 FcPrivate FcCharLeaf *
800 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
803 FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
805 FcPrivate FcCharSet *
806 FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
809 FcCharSetGetNumbers(const FcCharSet *c);
813 FcOpen(const char *pathname, int flags, ...);
816 FcMakeTempfile (char *template);
822 FcMakeDirectory (const FcChar8 *dir);
825 FcReadLink (const FcChar8 *pathname,
832 FcValuePrintFile (FILE *f, const FcValue v);
835 FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark);
838 FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos);
841 FcValueListPrint (FcValueListPtr l);
844 FcLangSetPrint (const FcLangSet *ls);
850 FcTestPrint (const FcTest *test);
853 FcExprPrint (const FcExpr *expr);
856 FcEditPrint (const FcEdit *edit);
859 FcRulePrint (const FcRule *rule);
862 FcCharSetPrint (const FcCharSet *c);
865 FcPatternPrint2 (FcPattern *p1, FcPattern *p2, const FcObjectSet *os);
867 extern FcPrivate int FcDebugVal;
869 #define FcDebug() (FcDebugVal)
876 FcGetDefaultLang (void);
882 FcDefaultFini (void);
887 FcFileIsLink (const FcChar8 *file);
890 FcFileIsFile (const FcChar8 *file);
893 FcFileScanConfig (FcFontSet *set,
899 FcDirScanConfig (FcFontSet *set,
912 FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
914 FcPrivate FcFontSet *
915 FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
917 FcPrivate FcFontSet *
918 FcFontSetDeserialize (const FcFontSet *set);
921 FcPrivate FcPtrList *
922 FcPtrListCreate (FcDestroyFunc func);
925 FcPtrListDestroy (FcPtrList *list);
928 FcPtrListIterInit (const FcPtrList *list,
929 FcPtrListIter *iter);
932 FcPtrListIterInitAtLast (FcPtrList *list,
933 FcPtrListIter *iter);
936 FcPtrListIterNext (const FcPtrList *list,
937 FcPtrListIter *iter);
940 FcPtrListIterIsValid (const FcPtrList *list,
941 const FcPtrListIter *iter);
944 FcPtrListIterGetValue (const FcPtrList *list,
945 const FcPtrListIter *iter);
948 FcPtrListIterAdd (FcPtrList *list,
953 FcPtrListIterRemove (FcPtrList *list,
954 FcPtrListIter *iter);
958 FcInitLoadOwnConfig (FcConfig *config);
961 FcInitLoadOwnConfigAndFonts (FcConfig *config);
965 FcConfigPathFini (void);
968 FcTestDestroy (FcTest *test);
971 FcEditDestroy (FcEdit *e);
974 FcRuleDestroy (FcRule *rule);
977 FcPrivate FcLangSet *
978 FcFreeTypeLangSet (const FcCharSet *charset,
979 const FcChar8 *exclusiveLang);
981 FcPrivate FcLangResult
982 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
984 FcPrivate FcLangSet *
985 FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *buf);
987 FcPrivate FcLangSet *
988 FcNameParseLangSet (const FcChar8 *string);
991 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
994 FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
997 FcConfigParseOnly (FcConfig *config,
1002 FcConfigRealFilename (FcConfig *config,
1003 const FcChar8 *url);
1008 FcListPatternMatchAny (const FcPattern *p,
1009 const FcPattern *font);
1016 FC_INVALID_OBJECT = 0,
1017 #define FC_OBJECT(NAME, Type, Cmp) FC_##NAME##_OBJECT,
1020 FC_ONE_AFTER_MAX_BASE_OBJECT
1021 #define FC_MAX_BASE_OBJECT (FC_ONE_AFTER_MAX_BASE_OBJECT - 1)
1025 FcNameBool (const FcChar8 *v, FcBool *result);
1028 FcObjectValidType (FcObject object, FcType type);
1031 FcObjectFromName (const char * name);
1033 FcPrivate const char *
1034 FcObjectName (FcObject object);
1036 FcPrivate FcObjectSet *
1037 FcObjectGetSet (void);
1039 #define FcObjectCompare(a, b) ((int) a - (int) b)
1044 FcValueCanonicalize (const FcValue *v);
1046 FcPrivate FcValueListPtr
1047 FcValueListCreate (void);
1050 FcValueListDestroy (FcValueListPtr l);
1052 FcPrivate FcValueListPtr
1053 FcValueListPrepend (FcValueListPtr vallist,
1055 FcValueBinding binding);
1057 FcPrivate FcValueListPtr
1058 FcValueListAppend (FcValueListPtr vallist,
1060 FcValueBinding binding);
1062 FcPrivate FcValueListPtr
1063 FcValueListDuplicate(FcValueListPtr orig);
1065 FcPrivate FcPatternElt *
1066 FcPatternObjectFindElt (const FcPattern *p, FcObject object);
1068 FcPrivate FcPatternElt *
1069 FcPatternObjectInsertElt (FcPattern *p, FcObject object);
1072 FcPatternObjectListAdd (FcPattern *p,
1074 FcValueListPtr list,
1078 FcPatternObjectAddWithBinding (FcPattern *p,
1081 FcValueBinding binding,
1085 FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
1088 FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
1091 FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b);
1094 FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
1097 FcPatternObjectDel (FcPattern *p, FcObject object);
1100 FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
1103 FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
1106 FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
1109 FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
1112 FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
1115 FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
1118 FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
1121 FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
1124 FcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r);
1127 FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
1130 FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
1133 FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
1136 FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
1139 FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
1142 FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
1145 FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
1148 FcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r);
1151 FcPatternAppend (FcPattern *p, FcPattern *s);
1154 FcPatternPosition (const FcPattern *p, const char *object);
1157 FcPatternFindObjectIter (const FcPattern *pat, FcPatternIter *iter, FcObject object);
1160 FcPatternIterGetObjectId (const FcPattern *pat, FcPatternIter *iter);
1162 FcPrivate FcValueListPtr
1163 FcPatternIterGetValues (const FcPattern *pat, FcPatternIter *iter);
1165 FcPrivate FcPattern *
1166 FcPatternCacheRewriteFile (const FcPattern *pat, FcCache *cache, const FcChar8 *relocated_font_file);
1169 FcStringHash (const FcChar8 *s);
1172 FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
1174 FcPrivate FcPattern *
1175 FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
1178 FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
1180 FcPrivate FcValueList *
1181 FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
1187 extern FcPrivate const FcMatrix FcIdentityMatrix;
1190 FcMatrixFree (FcMatrix *mat);
1195 FcRangePromote (double v, FcValuePromotionBuffer *vbuf);
1198 FcRangeIsInRange (const FcRange *a, const FcRange *b);
1201 FcRangeCompare (FcOp op, const FcRange *a, const FcRange *b);
1204 FcRangeHash (const FcRange *r);
1207 FcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r);
1210 FcRangeSerialize (FcSerialize *serialize, const FcRange *r);
1215 FcStat (const FcChar8 *file, struct stat *statb);
1218 FcStatChecksum (const FcChar8 *file, struct stat *statb);
1221 FcIsFsMmapSafe (int fd);
1224 FcIsFsMtimeBroken (const FcChar8 *dir);
1227 FcPrivate FcStrSet *
1228 FcStrSetCreateEx (unsigned int control);
1231 FcStrSetAddLangs (FcStrSet *strs, const char *languages);
1234 FcStrSetSort (FcStrSet * set);
1237 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
1240 FcStrBufDestroy (FcStrBuf *buf);
1243 FcStrBufDone (FcStrBuf *buf);
1246 FcStrBufDoneStatic (FcStrBuf *buf);
1249 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
1252 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
1255 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
1258 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1261 FcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
1263 FcPrivate const FcChar8 *
1264 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1266 FcPrivate const FcChar8 *
1267 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1269 FcPrivate const FcChar8 *
1270 FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2);
1273 FcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
1276 FcStrGlobMatch (const FcChar8 *glob,
1277 const FcChar8 *string);
1280 FcStrUsesHome (const FcChar8 *s);
1283 FcStrIsAbsoluteFilename (const FcChar8 *s);
1286 FcStrBuildFilename (const FcChar8 *path,
1290 FcStrLastSlash (const FcChar8 *path);
1293 FcStrHashIgnoreCase (const FcChar8 *s);
1296 FcStrCanonFilename (const FcChar8 *s);
1299 FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
1302 FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
1307 FcObjectFini (void);
1310 FcObjectLookupIdByName (const char *str);
1313 FcObjectLookupBuiltinIdByName (const char *str);
1315 FcPrivate const char *
1316 FcObjectLookupOtherNameById (FcObject id);
1318 FcPrivate const FcObjectType *
1319 FcObjectLookupOtherTypeById (FcObject id);
1321 FcPrivate const FcObjectType *
1322 FcObjectLookupOtherTypeByName (const char *str);
1326 FcHashStrCopy (const void *src,
1330 FcHashUuidCopy (const void *src,
1334 FcHashUuidFree (void *data);
1336 FcPrivate FcHashTable *
1337 FcHashTableCreate (FcHashFunc hash_func,
1338 FcCompareFunc compare_func,
1339 FcCopyFunc key_copy_func,
1340 FcCopyFunc value_copy_func,
1341 FcDestroyFunc key_destroy_func,
1342 FcDestroyFunc value_destroy_func);
1345 FcHashTableDestroy (FcHashTable *table);
1348 FcHashTableFind (FcHashTable *table,
1353 FcHashTableAdd (FcHashTable *table,
1358 FcHashTableReplace (FcHashTable *table,
1363 FcHashTableRemove (FcHashTable *table,
1366 #endif /* _FC_INT_H_ */