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 = 1 << 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 */
569 FcHashTable *alias_table; /* alias table for cachedirs */
572 typedef struct _FcFileTime {
577 typedef struct _FcCharMap FcCharMap;
579 typedef struct _FcStatFS FcStatFS;
583 FcBool is_mtime_broken;
586 typedef struct _FcValuePromotionBuffer FcValuePromotionBuffer;
588 struct _FcValuePromotionBuffer {
593 char c[256]; /* Enlarge as needed */
600 FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
603 FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
606 FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
609 FcDirCacheWrite (FcCache *cache, FcConfig *config);
612 FcDirCacheCreateTagFile (const FcChar8 *cache_dir);
615 FcCacheObjectReference (void *object);
618 FcCacheObjectDereference (void *object);
624 FcDirCacheReference (FcCache *cache, int nref);
627 FcDirCacheLock (const FcChar8 *dir,
631 FcDirCacheUnlock (int fd);
642 FcConfigXdgCacheHome (void);
645 FcConfigXdgConfigHome (void);
648 FcConfigXdgDataHome (void);
651 FcConfigAllocExpr (FcConfig *config);
654 FcConfigAddConfigDir (FcConfig *config,
658 FcConfigAddFontDir (FcConfig *config,
662 FcConfigAddCacheDir (FcConfig *config,
666 FcConfigAddConfigFile (FcConfig *config,
670 FcConfigAddBlank (FcConfig *config,
674 FcConfigAddRule (FcConfig *config,
679 FcConfigSetFonts (FcConfig *config,
684 FcConfigCompareValue (const FcValue *m,
689 FcConfigGlobAdd (FcConfig *config,
694 FcConfigAcceptFilename (FcConfig *config,
695 const FcChar8 *filename);
698 FcConfigPatternsAdd (FcConfig *config,
703 FcConfigAcceptFont (FcConfig *config,
704 const FcPattern *font);
707 FcConfigModifiedTime (FcConfig *config);
710 FcConfigAddCache (FcConfig *config, FcCache *cache,
711 FcSetName set, FcStrSet *dirSet);
713 FcPrivate FcRuleSet *
714 FcRuleSetCreate (const FcChar8 *name);
717 FcRuleSetDestroy (FcRuleSet *rs);
720 FcRuleSetReference (FcRuleSet *rs);
723 FcRuleSetEnable (FcRuleSet *rs,
727 FcRuleSetAddDescription (FcRuleSet *rs,
728 const FcChar8 *domain,
729 const FcChar8 *description);
732 FcRuleSetAdd (FcRuleSet *rs,
738 FcAlignSize (intptr_t size);
740 FcPrivate FcSerialize *
741 FcSerializeCreate (void);
744 FcSerializeDestroy (FcSerialize *serialize);
747 FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
750 FcSerializeReserve (FcSerialize *serialize, int size);
753 FcSerializeOffset (FcSerialize *serialize, const void *object);
756 FcSerializePtr (FcSerialize *serialize, const void *object);
759 FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
761 FcPrivate FcLangSet *
762 FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
765 FcPrivate FcCharSet *
766 FcCharSetPromote (FcValuePromotionBuffer *vbuf);
769 FcLangCharSetPopulate (void);
771 FcPrivate FcCharSetFreezer *
772 FcCharSetFreezerCreate (void);
774 FcPrivate const FcCharSet *
775 FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
778 FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
781 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
783 FcPrivate FcCharSet *
784 FcNameParseCharSet (FcChar8 *string);
787 FcNameUnparseValue (FcStrBuf *buf,
792 FcNameUnparseValueList (FcStrBuf *buf,
796 FcPrivate FcCharLeaf *
797 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
800 FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
802 FcPrivate FcCharSet *
803 FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
806 FcCharSetGetNumbers(const FcCharSet *c);
810 FcOpen(const char *pathname, int flags, ...);
813 FcMakeTempfile (char *template);
819 FcMakeDirectory (const FcChar8 *dir);
822 FcReadLink (const FcChar8 *pathname,
829 FcValuePrintFile (FILE *f, const FcValue v);
832 FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark);
835 FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos);
838 FcValueListPrint (FcValueListPtr l);
841 FcLangSetPrint (const FcLangSet *ls);
847 FcTestPrint (const FcTest *test);
850 FcExprPrint (const FcExpr *expr);
853 FcEditPrint (const FcEdit *edit);
856 FcRulePrint (const FcRule *rule);
859 FcCharSetPrint (const FcCharSet *c);
862 FcPatternPrint2 (FcPattern *p1, FcPattern *p2, const FcObjectSet *os);
864 extern FcPrivate int FcDebugVal;
866 #define FcDebug() (FcDebugVal)
873 FcGetDefaultLang (void);
879 FcDefaultFini (void);
884 FcFileIsLink (const FcChar8 *file);
887 FcFileIsFile (const FcChar8 *file);
890 FcFileScanConfig (FcFontSet *set,
896 FcDirScanConfig (FcFontSet *set,
909 FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
911 FcPrivate FcFontSet *
912 FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
914 FcPrivate FcFontSet *
915 FcFontSetDeserialize (const FcFontSet *set);
918 FcPrivate FcPtrList *
919 FcPtrListCreate (FcDestroyFunc func);
922 FcPtrListDestroy (FcPtrList *list);
925 FcPtrListIterInit (const FcPtrList *list,
926 FcPtrListIter *iter);
929 FcPtrListIterInitAtLast (FcPtrList *list,
930 FcPtrListIter *iter);
933 FcPtrListIterNext (const FcPtrList *list,
934 FcPtrListIter *iter);
937 FcPtrListIterIsValid (const FcPtrList *list,
938 const FcPtrListIter *iter);
941 FcPtrListIterGetValue (const FcPtrList *list,
942 const FcPtrListIter *iter);
945 FcPtrListIterAdd (FcPtrList *list,
950 FcPtrListIterRemove (FcPtrList *list,
951 FcPtrListIter *iter);
955 FcInitLoadOwnConfig (FcConfig *config);
958 FcInitLoadOwnConfigAndFonts (FcConfig *config);
962 FcConfigPathFini (void);
965 FcTestDestroy (FcTest *test);
968 FcEditDestroy (FcEdit *e);
971 FcRuleDestroy (FcRule *rule);
974 FcPrivate FcLangSet *
975 FcFreeTypeLangSet (const FcCharSet *charset,
976 const FcChar8 *exclusiveLang);
978 FcPrivate FcLangResult
979 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
981 FcPrivate FcLangSet *
982 FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *buf);
984 FcPrivate FcLangSet *
985 FcNameParseLangSet (const FcChar8 *string);
988 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
991 FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
994 FcConfigParseOnly (FcConfig *config,
999 FcConfigRealFilename (FcConfig *config,
1000 const FcChar8 *url);
1005 FcListPatternMatchAny (const FcPattern *p,
1006 const FcPattern *font);
1013 FC_INVALID_OBJECT = 0,
1014 #define FC_OBJECT(NAME, Type, Cmp) FC_##NAME##_OBJECT,
1017 FC_ONE_AFTER_MAX_BASE_OBJECT
1018 #define FC_MAX_BASE_OBJECT (FC_ONE_AFTER_MAX_BASE_OBJECT - 1)
1022 FcNameBool (const FcChar8 *v, FcBool *result);
1025 FcObjectValidType (FcObject object, FcType type);
1028 FcObjectFromName (const char * name);
1030 FcPrivate const char *
1031 FcObjectName (FcObject object);
1033 FcPrivate FcObjectSet *
1034 FcObjectGetSet (void);
1036 #define FcObjectCompare(a, b) ((int) a - (int) b)
1041 FcValueCanonicalize (const FcValue *v);
1043 FcPrivate FcValueListPtr
1044 FcValueListCreate (void);
1047 FcValueListDestroy (FcValueListPtr l);
1049 FcPrivate FcValueListPtr
1050 FcValueListPrepend (FcValueListPtr vallist,
1052 FcValueBinding binding);
1054 FcPrivate FcValueListPtr
1055 FcValueListAppend (FcValueListPtr vallist,
1057 FcValueBinding binding);
1059 FcPrivate FcValueListPtr
1060 FcValueListDuplicate(FcValueListPtr orig);
1062 FcPrivate FcPatternElt *
1063 FcPatternObjectFindElt (const FcPattern *p, FcObject object);
1065 FcPrivate FcPatternElt *
1066 FcPatternObjectInsertElt (FcPattern *p, FcObject object);
1069 FcPatternObjectListAdd (FcPattern *p,
1071 FcValueListPtr list,
1075 FcPatternObjectAddWithBinding (FcPattern *p,
1078 FcValueBinding binding,
1082 FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
1085 FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
1088 FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b);
1091 FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
1094 FcPatternObjectDel (FcPattern *p, FcObject object);
1097 FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
1100 FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
1103 FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
1106 FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
1109 FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
1112 FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
1115 FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
1118 FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
1121 FcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r);
1124 FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
1127 FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
1130 FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
1133 FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
1136 FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
1139 FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
1142 FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
1145 FcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r);
1148 FcPatternAppend (FcPattern *p, FcPattern *s);
1151 FcPatternPosition (const FcPattern *p, const char *object);
1154 FcStringHash (const FcChar8 *s);
1157 FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
1159 FcPrivate FcPattern *
1160 FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
1163 FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
1165 FcPrivate FcValueList *
1166 FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
1172 extern FcPrivate const FcMatrix FcIdentityMatrix;
1175 FcMatrixFree (FcMatrix *mat);
1180 FcRangePromote (double v, FcValuePromotionBuffer *vbuf);
1183 FcRangeIsInRange (const FcRange *a, const FcRange *b);
1186 FcRangeCompare (FcOp op, const FcRange *a, const FcRange *b);
1189 FcRangeHash (const FcRange *r);
1192 FcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r);
1195 FcRangeSerialize (FcSerialize *serialize, const FcRange *r);
1200 FcStat (const FcChar8 *file, struct stat *statb);
1203 FcStatChecksum (const FcChar8 *file, struct stat *statb);
1206 FcIsFsMmapSafe (int fd);
1209 FcIsFsMtimeBroken (const FcChar8 *dir);
1212 FcPrivate FcStrSet *
1213 FcStrSetCreateEx (unsigned int control);
1216 FcStrSetAddLangs (FcStrSet *strs, const char *languages);
1219 FcStrSetSort (FcStrSet * set);
1222 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
1225 FcStrBufDestroy (FcStrBuf *buf);
1228 FcStrBufDone (FcStrBuf *buf);
1231 FcStrBufDoneStatic (FcStrBuf *buf);
1234 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
1237 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
1240 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
1243 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1246 FcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
1248 FcPrivate const FcChar8 *
1249 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1251 FcPrivate const FcChar8 *
1252 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1254 FcPrivate const FcChar8 *
1255 FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2);
1258 FcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
1261 FcStrGlobMatch (const FcChar8 *glob,
1262 const FcChar8 *string);
1265 FcStrUsesHome (const FcChar8 *s);
1268 FcStrBuildFilename (const FcChar8 *path,
1272 FcStrLastSlash (const FcChar8 *path);
1275 FcStrHashIgnoreCase (const FcChar8 *s);
1278 FcStrCanonFilename (const FcChar8 *s);
1281 FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
1284 FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
1289 FcObjectFini (void);
1292 FcObjectLookupIdByName (const char *str);
1295 FcObjectLookupBuiltinIdByName (const char *str);
1297 FcPrivate const char *
1298 FcObjectLookupOtherNameById (FcObject id);
1300 FcPrivate const FcObjectType *
1301 FcObjectLookupOtherTypeById (FcObject id);
1303 FcPrivate const FcObjectType *
1304 FcObjectLookupOtherTypeByName (const char *str);
1308 FcHashStrCopy (const void *src,
1312 FcHashUuidCopy (const void *src,
1316 FcHashUuidFree (void *data);
1318 FcPrivate FcHashTable *
1319 FcHashTableCreate (FcHashFunc hash_func,
1320 FcCompareFunc compare_func,
1321 FcCopyFunc key_copy_func,
1322 FcCopyFunc value_copy_func,
1323 FcDestroyFunc key_destroy_func,
1324 FcDestroyFunc value_destroy_func);
1327 FcHashTableDestroy (FcHashTable *table);
1330 FcHashTableFind (FcHashTable *table,
1335 FcHashTableAdd (FcHashTable *table,
1340 FcHashTableReplace (FcHashTable *table,
1344 #endif /* _FC_INT_H_ */