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.
47 #include <sys/types.h>
50 #include <fontconfig/fontconfig.h>
51 #include <fontconfig/fcprivate.h>
52 #include "fcdeprecate.h"
56 #ifndef FC_CONFIG_PATH
57 #define FC_CONFIG_PATH "fonts.conf"
61 #define FC_LIKELY(expr) (expr)
62 #define FC_UNLIKELY(expr) (expr)
64 #define FC_LIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 1))
65 #define FC_UNLIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 0))
69 # include "fcwindows.h"
70 typedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT);
71 typedef HRESULT (WINAPI *pfnSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
72 extern pfnGetSystemWindowsDirectory pGetSystemWindowsDirectory;
73 extern pfnSHGetFolderPathA pSHGetFolderPathA;
74 # define FC_SEARCH_PATH_SEPARATOR ';'
75 # define FC_DIR_SEPARATOR '\\'
76 # define FC_DIR_SEPARATOR_S "\\"
78 # define FC_SEARCH_PATH_SEPARATOR ':'
79 # define FC_DIR_SEPARATOR '/'
80 # define FC_DIR_SEPARATOR_S "/"
84 #define FC_PATH_MAX PATH_MAX
86 #define FC_PATH_MAX 128
90 #define FC_UNUSED __attribute__((unused))
95 #ifndef FC_UINT64_FORMAT
96 #define FC_UINT64_FORMAT "llu"
99 #define FC_DBG_MATCH 1
100 #define FC_DBG_MATCHV 2
101 #define FC_DBG_EDIT 4
102 #define FC_DBG_FONTSET 8
103 #define FC_DBG_CACHE 16
104 #define FC_DBG_CACHEV 32
105 #define FC_DBG_PARSE 64
106 #define FC_DBG_SCAN 128
107 #define FC_DBG_SCANV 256
108 #define FC_DBG_CONFIG 1024
109 #define FC_DBG_LANGSET 2048
110 #define FC_DBG_MATCH2 4096
112 #define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1] FC_UNUSED
113 #define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond))
114 #define FC_ASSERT_STATIC(_cond) _FC_ASSERT_STATIC0 (__LINE__, (_cond))
116 #define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
117 #define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
119 /* slim_internal.h */
120 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
121 #define FcPrivate __attribute__((__visibility__("hidden")))
122 #define HAVE_GNUC_ATTRIBUTE 1
124 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
125 #define FcPrivate __hidden
126 #else /* not gcc >= 3.3 and not Sun Studio >= 8 */
133 #define _(x) (dgettext(GETTEXT_PACKAGE, x))
135 #define dgettext(d, s) (s)
141 FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
143 #define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
144 #define FcFree(s) (free ((FcChar8 *) (s)))
147 * Serialized data structures use only offsets instead of pointers
148 * A low bit of 1 indicates an offset.
151 /* Is the provided pointer actually an offset? */
152 #define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0)
154 /* Encode offset in a pointer of type t */
155 #define FcOffsetEncode(o,t) ((t *) (intptr_t) ((o) | 1))
157 /* Decode a pointer into an offset */
158 #define FcOffsetDecode(p) (((intptr_t) (p)) & ~1)
160 /* Compute pointer offset */
161 #define FcPtrToOffset(b,p) ((ptrdiff_t) ((intptr_t) (p) - (intptr_t) (b)))
163 /* Given base address, offset and type, return a pointer */
164 #define FcOffsetToPtr(b,o,t) ((t *) ((intptr_t) (b) + (ptrdiff_t) (o)))
166 /* Given base address, encoded offset and type, return a pointer */
167 #define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t)
169 /* Given base address, pointer and type, return an encoded offset */
170 #define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t)
172 /* Given a structure, offset member and type, return pointer */
173 #define FcOffsetMember(s,m,t) FcOffsetToPtr(s,(s)->m,t)
175 /* Given a structure, encoded offset member and type, return pointer to member */
176 #define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t)
178 /* Given a structure, member and type, convert the member to a pointer */
179 #define FcPointerMember(s,m,t) (FcIsEncodedOffset((s)->m) ? \
180 FcEncodedOffsetMember (s,m,t) : \
184 * Serialized values may hold strings, charsets and langsets as pointers,
185 * unfortunately FcValue is an exposed type so we can't just always use
188 #define FcValueString(v) FcPointerMember(v,u.s,FcChar8)
189 #define FcValueCharSet(v) FcPointerMember(v,u.c,const FcCharSet)
190 #define FcValueLangSet(v) FcPointerMember(v,u.l,const FcLangSet)
191 #define FcValueRange(v) FcPointerMember(v,u.r,const FcRange)
193 typedef struct _FcValueList *FcValueListPtr;
195 typedef struct _FcValueList {
196 struct _FcValueList *next;
198 FcValueBinding binding;
201 #define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList)
203 typedef int FcObject;
205 /* The 1024 is to leave some room for future added internal objects, such
206 * that caches from newer fontconfig can still be used with older fontconfig
207 * without getting confused. */
208 #define FC_EXT_OBJ_INDEX 1024
209 #define FC_OBJ_ID(_n_) ((_n_) & (~FC_EXT_OBJ_INDEX))
211 typedef struct _FcPatternElt *FcPatternEltPtr;
214 * Pattern elts are stuck in a structure connected to the pattern,
215 * so they get moved around when the pattern is resized. Hence, the
216 * values field must be a pointer/offset instead of just an offset
218 typedef struct _FcPatternElt {
223 #define FcPatternEltValues(pe) FcPointerMember(pe,values,FcValueList)
228 intptr_t elts_offset;
232 #define FcPatternElts(p) FcOffsetMember(p,elts_offset,FcPatternElt)
234 #define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *)
236 #define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \
237 FcEncodedOffsetToPtr(fs, \
238 FcFontSetFonts(fs)[i], \
243 FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpRange, FcOpBool, FcOpCharSet, FcOpLangSet,
245 FcOpField, FcOpConst,
246 FcOpAssign, FcOpAssignReplace,
247 FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
248 FcOpDelete, FcOpDeleteAll,
250 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
251 FcOpContains, FcOpListing, FcOpNotContains,
252 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
253 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
254 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
258 typedef enum _FcOpFlags {
259 FcOpFlagIgnoreBlanks = 1U << 0
262 #define FC_OP_GET_OP(_x_) ((_x_) & 0xffff)
263 #define FC_OP_GET_FLAGS(_x_) (((_x_) & 0xffff0000) >> 16)
264 #define FC_OP(_x_,_f_) (FC_OP_GET_OP (_x_) | ((_f_) << 16))
266 typedef struct _FcExprMatrix {
267 struct _FcExpr *xx, *xy, *yx, *yy;
270 typedef struct _FcExprName {
281 typedef struct _FcExpr {
294 const FcChar8 *constant;
296 struct _FcExpr *left, *right;
301 typedef struct _FcExprPage FcExprPage;
304 FcExprPage *next_page;
306 FcExpr exprs[(1024 - 2/* two pointers */ - 2/* malloc overhead */) * sizeof (void *) / sizeof (FcExpr)];
307 FcExpr end[FLEXIBLE_ARRAY_MEMBER];
310 typedef enum _FcQual {
311 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
314 #define FcMatchDefault ((FcMatchKind) -1)
316 typedef struct _FcTest {
324 typedef struct _FcEdit {
328 FcValueBinding binding;
331 typedef void (* FcDestroyFunc) (void *data);
333 typedef struct _FcPtrList FcPtrList;
334 /* need to sync with FcConfigFileInfoIter at fontconfig.h */
335 typedef struct _FcPtrListIter {
341 typedef enum _FcRuleType {
342 FcRuleUnknown, FcRuleTest, FcRuleEdit
345 typedef struct _FcRule {
346 struct _FcRule *next;
354 typedef struct _FcRuleSet {
357 FcChar8 *description;
360 FcPtrList *subst[FcMatchKindEnd];
363 typedef struct _FcCharLeaf {
364 FcChar32 map[256/32];
368 FcRef ref; /* reference count */
369 int num; /* size of leaves and numbers arrays */
370 intptr_t leaves_offset;
371 intptr_t numbers_offset;
374 #define FcCharSetLeaves(c) FcOffsetMember(c,leaves_offset,intptr_t)
375 #define FcCharSetLeaf(c,i) (FcOffsetToPtr(FcCharSetLeaves(c), \
376 FcCharSetLeaves(c)[i], \
378 #define FcCharSetNumbers(c) FcOffsetMember(c,numbers_offset,FcChar16)
380 #define FCSS_DEFAULT 0 /* default behavior */
381 #define FCSS_ALLOW_DUPLICATES 1 /* allows for duplicate strings in the set */
382 #define FCSS_GROW_BY_64 2 /* grows buffer by 64 elements instead of 1 */
384 #define FcStrSetHasControlBit(s,c) (s->control & c)
385 #define FcStrSetHasControlBits(s,c) ( (c) == (s->control & (c)) )
388 FcRef ref; /* reference count */
392 unsigned int control; /* control bits for set behavior */
400 typedef struct _FcStrBuf {
406 FcChar8 buf_static[16 * sizeof (void *)];
409 typedef struct _FcHashTable FcHashTable;
411 typedef FcChar32 (* FcHashFunc) (const void *data);
412 typedef int (* FcCompareFunc) (const void *v1, const void *v2);
413 typedef FcBool (* FcCopyFunc) (const void *src, void **dest);
417 unsigned int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
418 int version; /* FC_CACHE_VERSION_NUMBER */
419 intptr_t size; /* size of file */
420 intptr_t dir; /* offset to dir name */
421 intptr_t dirs; /* offset to subdirs */
422 int dirs_count; /* number of subdir strings */
423 intptr_t set; /* offset to font set */
424 int checksum; /* checksum of directory state */
425 int64_t checksum_nano; /* checksum of directory state */
430 #define FcCacheDir(c) FcOffsetMember(c,dir,FcChar8)
431 #define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t)
432 #define FcCacheSet(c) FcOffsetMember(c,set,FcFontSet)
433 #define FcCacheSubdir(c,i) FcOffsetToPtr (FcCacheDirs(c),\
438 * Used while constructing a directory cache object
441 typedef union _FcAlign {
449 typedef struct _FcSerializeBucket {
450 const void *object; /* key */
451 uintptr_t hash; /* hash of key */
452 intptr_t offset; /* value */
455 typedef struct _FcCharSetFreezer FcCharSetFreezer;
457 typedef struct _FcSerialize {
459 FcCharSetFreezer *cs_freezer;
461 FcSerializeBucket *buckets;
462 size_t buckets_count;
464 size_t buckets_used_max;
468 * To map adobe glyph names to unicode values, a precomputed hash
472 typedef struct _FcGlyphName {
473 FcChar32 ucs; /* unicode value */
474 FcChar8 name[1]; /* name extends beyond struct */
478 * To perform case-insensitive string comparisons, a table
479 * is used which holds three different kinds of folding data.
481 * The first is a range of upper case values mapping to a range
482 * of their lower case equivalents. Within each range, the offset
483 * between upper and lower case is constant.
485 * The second is a range of upper case values which are interleaved
486 * with their lower case equivalents.
488 * The third is a set of raw unicode values mapping to a list
489 * of unicode values for comparison purposes. This allows conversion
490 * of ß to "ss" so that SS, ss and ß all match. A separate array
491 * holds the list of unicode values for each entry.
493 * These are packed into a single table. Using a binary search,
494 * the appropriate entry can be located.
497 #define FC_CASE_FOLD_RANGE 0
498 #define FC_CASE_FOLD_EVEN_ODD 1
499 #define FC_CASE_FOLD_FULL 2
501 typedef struct _FcCaseFold {
505 short offset; /* lower - upper for RANGE, table id for FULL */
508 #define FC_MAX_FILE_LEN 4096
510 #define FC_CACHE_MAGIC_MMAP 0xFC02FC04
511 #define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
514 FcChar8 *file; /* original file name */
515 FcChar8 *new; /* temp file name -- write data here */
516 FcChar8 *lck; /* lockfile name (used for locking) */
517 FcChar8 *tmp; /* tmpfile name (used for locking) */
522 * File names loaded from the configuration -- saved here as the
523 * cache file must be consulted before the directories are scanned,
524 * and those directives may occur in any order
526 FcStrSet *configDirs; /* directories to scan for fonts */
527 FcStrSet *configMapDirs; /* mapped names to generate cache entries */
529 * List of directories containing fonts,
530 * built by recursively scanning the set
531 * of configured directories
535 * List of directories containing cache files.
539 * Names of all of the configuration files used
540 * to create this configuration
542 FcStrSet *configFiles; /* config files loaded */
544 * Substitution instructions for patterns and fonts;
545 * maxObjects is used to allocate appropriate intermediate storage
546 * while performing a whole set of substitutions
548 * 0.. substitutions for patterns
549 * 1.. substitutions for fonts
550 * 2.. substitutions for scanned fonts
552 FcPtrList *subst[FcMatchKindEnd];
553 int maxObjects; /* maximum number of tests in all substs */
555 * List of patterns used to control font file selection
557 FcStrSet *acceptGlobs;
558 FcStrSet *rejectGlobs;
559 FcFontSet *acceptPatterns;
560 FcFontSet *rejectPatterns;
562 * The set of fonts loaded from the listed directories; the
563 * order within the set does not determine the font selection,
564 * except in the case of identical matches in which case earlier fonts
565 * match preferrentially
567 FcFontSet *fonts[FcSetApplication + 1];
569 * Fontconfig can periodically rescan the system configuration
570 * and font directories. This rescanning occurs when font
571 * listing requests are made, but no more often than rescanInterval
574 time_t rescanTime; /* last time information was scanned */
575 int rescanInterval; /* interval between scans */
577 FcRef ref; /* reference count */
579 FcExprPage *expr_pool; /* pool of FcExpr's */
581 FcChar8 *sysRoot; /* override the system root directory */
582 FcStrSet *availConfigFiles; /* config files available */
583 FcPtrList *rulesetList; /* List of rulesets being installed */
586 typedef struct _FcFileTime {
591 typedef struct _FcCharMap FcCharMap;
593 typedef struct _FcStatFS FcStatFS;
597 FcBool is_mtime_broken;
600 typedef struct _FcValuePromotionBuffer FcValuePromotionBuffer;
602 struct _FcValuePromotionBuffer {
607 char c[256]; /* Enlarge as needed */
614 FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
617 FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
620 FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
623 FcDirCacheWrite (FcCache *cache, FcConfig *config);
626 FcDirCacheCreateTagFile (const FcChar8 *cache_dir);
629 FcCacheObjectReference (void *object);
632 FcCacheObjectDereference (void *object);
635 FcCacheAllocate (FcCache *cache, size_t len);
642 FcDirCacheReference (FcCache *cache, int nref);
645 FcDirCacheLock (const FcChar8 *dir,
649 FcDirCacheUnlock (int fd);
660 FcConfigXdgCacheHome (void);
663 FcConfigXdgConfigHome (void);
666 FcConfigXdgDataHome (void);
669 FcConfigXdgDataDirs (void);
672 FcConfigAllocExpr (FcConfig *config);
675 FcConfigAddConfigDir (FcConfig *config,
679 FcConfigAddFontDir (FcConfig *config,
682 const FcChar8 *salt);
685 FcConfigResetFontDirs (FcConfig *config);
688 FcConfigMapFontPath(FcConfig *config,
689 const FcChar8 *path);
691 FcPrivate const FcChar8 *
692 FcConfigMapSalt (FcConfig *config,
693 const FcChar8 *path);
696 FcConfigAddCacheDir (FcConfig *config,
700 FcConfigAddConfigFile (FcConfig *config,
704 FcConfigAddBlank (FcConfig *config,
708 FcConfigAddRule (FcConfig *config,
713 FcConfigSetFonts (FcConfig *config,
718 FcConfigCompareValue (const FcValue *m,
723 FcConfigGlobAdd (FcConfig *config,
728 FcConfigAcceptFilename (FcConfig *config,
729 const FcChar8 *filename);
732 FcConfigPatternsAdd (FcConfig *config,
737 FcConfigAcceptFont (FcConfig *config,
738 const FcPattern *font);
741 FcConfigModifiedTime (FcConfig *config);
744 FcConfigAddCache (FcConfig *config, FcCache *cache,
745 FcSetName set, FcStrSet *dirSet, FcChar8 *forDir);
747 FcPrivate FcRuleSet *
748 FcRuleSetCreate (const FcChar8 *name);
751 FcRuleSetDestroy (FcRuleSet *rs);
754 FcRuleSetReference (FcRuleSet *rs);
757 FcRuleSetEnable (FcRuleSet *rs,
761 FcRuleSetAddDescription (FcRuleSet *rs,
762 const FcChar8 *domain,
763 const FcChar8 *description);
766 FcRuleSetAdd (FcRuleSet *rs,
772 FcAlignSize (intptr_t size);
774 FcPrivate FcSerialize *
775 FcSerializeCreate (void);
778 FcSerializeDestroy (FcSerialize *serialize);
781 FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
784 FcSerializeReserve (FcSerialize *serialize, int size);
787 FcSerializeOffset (FcSerialize *serialize, const void *object);
790 FcSerializePtr (FcSerialize *serialize, const void *object);
793 FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
795 FcPrivate FcLangSet *
796 FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
799 FcPrivate FcCharSet *
800 FcCharSetPromote (FcValuePromotionBuffer *vbuf);
803 FcLangCharSetPopulate (void);
805 FcPrivate FcCharSetFreezer *
806 FcCharSetFreezerCreate (void);
808 FcPrivate const FcCharSet *
809 FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
812 FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
815 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
817 FcPrivate FcCharSet *
818 FcNameParseCharSet (FcChar8 *string);
821 FcNameUnparseValue (FcStrBuf *buf,
826 FcNameUnparseValueList (FcStrBuf *buf,
830 FcPrivate FcCharLeaf *
831 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
834 FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
836 FcPrivate FcCharSet *
837 FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
840 FcCharSetGetNumbers(const FcCharSet *c);
844 FcOpen(const char *pathname, int flags, ...);
847 FcMakeTempfile (char *template);
853 FcMakeDirectory (const FcChar8 *dir);
856 FcReadLink (const FcChar8 *pathname,
863 FcValuePrintFile (FILE *f, const FcValue v);
866 FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark);
869 FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos);
872 FcValueListPrint (FcValueListPtr l);
875 FcLangSetPrint (const FcLangSet *ls);
881 FcTestPrint (const FcTest *test);
884 FcExprPrint (const FcExpr *expr);
887 FcEditPrint (const FcEdit *edit);
890 FcRulePrint (const FcRule *rule);
893 FcCharSetPrint (const FcCharSet *c);
896 FcPatternPrint2 (FcPattern *p1, FcPattern *p2, const FcObjectSet *os);
898 extern FcPrivate int FcDebugVal;
900 #define FcDebug() (FcDebugVal)
907 FcGetDefaultLang (void);
913 FcGetDesktopName (void);
916 FcDefaultFini (void);
921 FcFileIsLink (const FcChar8 *file);
924 FcFileIsFile (const FcChar8 *file);
927 FcFileScanConfig (FcFontSet *set,
933 FcDirScanConfig (FcFontSet *set,
946 FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
948 FcPrivate FcFontSet *
949 FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
951 FcPrivate FcFontSet *
952 FcFontSetDeserialize (const FcFontSet *set);
955 FcPrivate FcPtrList *
956 FcPtrListCreate (FcDestroyFunc func);
959 FcPtrListDestroy (FcPtrList *list);
962 FcPtrListIterInit (const FcPtrList *list,
963 FcPtrListIter *iter);
966 FcPtrListIterInitAtLast (FcPtrList *list,
967 FcPtrListIter *iter);
970 FcPtrListIterNext (const FcPtrList *list,
971 FcPtrListIter *iter);
974 FcPtrListIterIsValid (const FcPtrList *list,
975 const FcPtrListIter *iter);
978 FcPtrListIterGetValue (const FcPtrList *list,
979 const FcPtrListIter *iter);
982 FcPtrListIterAdd (FcPtrList *list,
987 FcPtrListIterRemove (FcPtrList *list,
988 FcPtrListIter *iter);
992 FcInitLoadOwnConfig (FcConfig *config);
995 FcInitLoadOwnConfigAndFonts (FcConfig *config);
999 FcConfigPathFini (void);
1002 FcTestDestroy (FcTest *test);
1005 FcEditDestroy (FcEdit *e);
1008 FcRuleDestroy (FcRule *rule);
1011 FcPrivate FcLangSet *
1012 FcFreeTypeLangSet (const FcCharSet *charset,
1013 const FcChar8 *exclusiveLang);
1015 FcPrivate FcLangResult
1016 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
1018 FcPrivate FcLangSet *
1019 FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *buf);
1021 FcPrivate FcLangSet *
1022 FcNameParseLangSet (const FcChar8 *string);
1025 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
1028 FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
1031 FcConfigParseOnly (FcConfig *config,
1032 const FcChar8 *name,
1036 FcConfigRealFilename (FcConfig *config,
1037 const FcChar8 *url);
1042 FcListPatternMatchAny (const FcPattern *p,
1043 const FcPattern *font);
1050 FC_INVALID_OBJECT = 0,
1051 #define FC_OBJECT(NAME, Type, Cmp) FC_##NAME##_OBJECT,
1054 FC_ONE_AFTER_MAX_BASE_OBJECT
1055 #define FC_MAX_BASE_OBJECT (FC_ONE_AFTER_MAX_BASE_OBJECT - 1)
1059 FcNameConstantWithObjectCheck (const FcChar8 *string, const char *object, int *result);
1062 FcNameBool (const FcChar8 *v, FcBool *result);
1065 FcObjectValidType (FcObject object, FcType type);
1068 FcObjectFromName (const char * name);
1070 FcPrivate const char *
1071 FcObjectName (FcObject object);
1073 FcPrivate FcObjectSet *
1074 FcObjectGetSet (void);
1076 #define FcObjectCompare(a, b) ((int) a - (int) b)
1081 FcValueCanonicalize (const FcValue *v);
1083 FcPrivate FcValueListPtr
1084 FcValueListCreate (void);
1087 FcValueListDestroy (FcValueListPtr l);
1089 FcPrivate FcValueListPtr
1090 FcValueListPrepend (FcValueListPtr vallist,
1092 FcValueBinding binding);
1094 FcPrivate FcValueListPtr
1095 FcValueListAppend (FcValueListPtr vallist,
1097 FcValueBinding binding);
1099 FcPrivate FcValueListPtr
1100 FcValueListDuplicate(FcValueListPtr orig);
1102 FcPrivate FcPatternElt *
1103 FcPatternObjectFindElt (const FcPattern *p, FcObject object);
1105 FcPrivate FcPatternElt *
1106 FcPatternObjectInsertElt (FcPattern *p, FcObject object);
1109 FcPatternObjectListAdd (FcPattern *p,
1111 FcValueListPtr list,
1115 FcPatternObjectAddWithBinding (FcPattern *p,
1118 FcValueBinding binding,
1122 FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
1125 FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
1128 FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b);
1131 FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
1134 FcPatternObjectDel (FcPattern *p, FcObject object);
1137 FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
1140 FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
1143 FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
1146 FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
1149 FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
1152 FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
1155 FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
1158 FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
1161 FcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r);
1164 FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
1167 FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
1170 FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
1173 FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
1176 FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
1179 FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
1182 FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
1185 FcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r);
1188 FcPatternAppend (FcPattern *p, FcPattern *s);
1191 FcPatternPosition (const FcPattern *p, const char *object);
1194 FcPatternFindObjectIter (const FcPattern *pat, FcPatternIter *iter, FcObject object);
1197 FcPatternIterGetObjectId (const FcPattern *pat, FcPatternIter *iter);
1199 FcPrivate FcValueListPtr
1200 FcPatternIterGetValues (const FcPattern *pat, FcPatternIter *iter);
1202 FcPrivate FcPattern *
1203 FcPatternCacheRewriteFile (const FcPattern *pat, FcCache *cache, const FcChar8 *relocated_font_file);
1206 FcStringHash (const FcChar8 *s);
1209 FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
1211 FcPrivate FcPattern *
1212 FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
1215 FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
1217 FcPrivate FcValueList *
1218 FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
1224 extern FcPrivate const FcMatrix FcIdentityMatrix;
1227 FcMatrixFree (FcMatrix *mat);
1232 FcRangePromote (double v, FcValuePromotionBuffer *vbuf);
1235 FcRangeIsInRange (const FcRange *a, const FcRange *b);
1238 FcRangeCompare (FcOp op, const FcRange *a, const FcRange *b);
1241 FcRangeHash (const FcRange *r);
1244 FcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r);
1247 FcRangeSerialize (FcSerialize *serialize, const FcRange *r);
1252 FcStat (const FcChar8 *file, struct stat *statb);
1255 FcStatChecksum (const FcChar8 *file, struct stat *statb);
1258 FcIsFsMmapSafe (int fd);
1261 FcIsFsMtimeBroken (const FcChar8 *dir);
1264 FcPrivate FcStrSet *
1265 FcStrSetCreateEx (unsigned int control);
1268 FcStrSetInsert (FcStrSet *set, const FcChar8 *s, int pos);
1271 FcStrSetAddLangs (FcStrSet *strs, const char *languages);
1274 FcStrSetSort (FcStrSet * set);
1277 FcStrSetMemberAB (FcStrSet *set, const FcChar8 *a, FcChar8 *b, FcChar8 **ret);
1280 FcStrSetAddTriple (FcStrSet *set, const FcChar8 *a, const FcChar8 *b, const FcChar8 *c);
1282 FcPrivate const FcChar8 *
1283 FcStrTripleSecond (FcChar8 *s);
1285 FcPrivate const FcChar8 *
1286 FcStrTripleThird (FcChar8 *str);
1289 FcStrSetAddFilenamePairWithSalt (FcStrSet *strs, const FcChar8 *d, const FcChar8 *m, const FcChar8 *salt);
1292 FcStrSetDeleteAll (FcStrSet *set);
1295 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
1298 FcStrBufDestroy (FcStrBuf *buf);
1301 FcStrBufDone (FcStrBuf *buf);
1304 FcStrBufDoneStatic (FcStrBuf *buf);
1307 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
1310 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
1313 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
1316 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1319 FcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
1321 FcPrivate const FcChar8 *
1322 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1324 FcPrivate const FcChar8 *
1325 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1327 FcPrivate const FcChar8 *
1328 FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2);
1331 FcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
1334 FcStrGlobMatch (const FcChar8 *glob,
1335 const FcChar8 *string);
1338 FcStrUsesHome (const FcChar8 *s);
1341 FcStrIsAbsoluteFilename (const FcChar8 *s);
1344 FcStrLastSlash (const FcChar8 *path);
1347 FcStrHashIgnoreCase (const FcChar8 *s);
1350 FcStrHashIgnoreBlanksAndCase (const FcChar8 *s);
1353 FcStrRealPath (const FcChar8 *path);
1356 FcStrCanonFilename (const FcChar8 *s);
1359 FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
1362 FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
1367 FcObjectFini (void);
1370 FcObjectLookupIdByName (const char *str);
1373 FcObjectLookupBuiltinIdByName (const char *str);
1375 FcPrivate const char *
1376 FcObjectLookupOtherNameById (FcObject id);
1378 FcPrivate const FcObjectType *
1379 FcObjectLookupOtherTypeById (FcObject id);
1381 FcPrivate const FcObjectType *
1382 FcObjectLookupOtherTypeByName (const char *str);
1386 FcHashStrCopy (const void *src,
1390 FcHashUuidCopy (const void *src,
1394 FcHashUuidFree (void *data);
1396 FcPrivate FcHashTable *
1397 FcHashTableCreate (FcHashFunc hash_func,
1398 FcCompareFunc compare_func,
1399 FcCopyFunc key_copy_func,
1400 FcCopyFunc value_copy_func,
1401 FcDestroyFunc key_destroy_func,
1402 FcDestroyFunc value_destroy_func);
1405 FcHashTableDestroy (FcHashTable *table);
1408 FcHashTableFind (FcHashTable *table,
1413 FcHashTableAdd (FcHashTable *table,
1418 FcHashTableReplace (FcHashTable *table,
1423 FcHashTableRemove (FcHashTable *table,
1426 #endif /* _FC_INT_H_ */