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.
41 #include <sys/types.h>
44 #include <fontconfig/fontconfig.h>
45 #include <fontconfig/fcprivate.h>
46 #include "fcdeprecate.h"
48 #ifndef FC_CONFIG_PATH
49 #define FC_CONFIG_PATH "fonts.conf"
54 # define _WIN32_WINNT 0x0500
56 # define WIN32_LEAN_AND_MEAN
59 typedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT);
60 typedef HRESULT (WINAPI *pfnSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
61 extern pfnGetSystemWindowsDirectory pGetSystemWindowsDirectory;
62 extern pfnSHGetFolderPathA pSHGetFolderPathA;
63 # define FC_SEARCH_PATH_SEPARATOR ';'
64 # define FC_DIR_SEPARATOR '\\'
65 # define FC_DIR_SEPARATOR_S "\\"
67 # define FC_SEARCH_PATH_SEPARATOR ':'
68 # define FC_DIR_SEPARATOR '/'
69 # define FC_DIR_SEPARATOR_S "/"
72 #define FC_DBG_MATCH 1
73 #define FC_DBG_MATCHV 2
75 #define FC_DBG_FONTSET 8
76 #define FC_DBG_CACHE 16
77 #define FC_DBG_CACHEV 32
78 #define FC_DBG_PARSE 64
79 #define FC_DBG_SCAN 128
80 #define FC_DBG_SCANV 256
81 #define FC_DBG_MEMORY 512
82 #define FC_DBG_CONFIG 1024
83 #define FC_DBG_LANGSET 2048
84 #define FC_DBG_OBJTYPES 4096
86 #define FC_MEM_CHARSET 0
87 #define FC_MEM_CHARLEAF 1
88 #define FC_MEM_FONTSET 2
89 #define FC_MEM_FONTPTR 3
90 #define FC_MEM_OBJECTSET 4
91 #define FC_MEM_OBJECTPTR 5
92 #define FC_MEM_MATRIX 6
93 #define FC_MEM_PATTERN 7
94 #define FC_MEM_PATELT 8
95 #define FC_MEM_VALLIST 9
96 #define FC_MEM_SUBSTATE 10
97 #define FC_MEM_STRING 11
98 #define FC_MEM_LISTBUCK 12
99 #define FC_MEM_STRSET 13
100 #define FC_MEM_STRLIST 14
101 #define FC_MEM_CONFIG 15
102 #define FC_MEM_LANGSET 16
103 #define FC_MEM_ATOMIC 17
104 #define FC_MEM_BLANKS 18
105 #define FC_MEM_CACHE 19
106 #define FC_MEM_STRBUF 20
107 #define FC_MEM_SUBST 21
108 #define FC_MEM_OBJECTTYPE 22
109 #define FC_MEM_CONSTANT 23
110 #define FC_MEM_TEST 24
111 #define FC_MEM_EXPR 25
112 #define FC_MEM_VSTACK 26
113 #define FC_MEM_ATTR 27
114 #define FC_MEM_PSTACK 28
115 #define FC_MEM_SHAREDSTR 29
117 #define FC_MEM_NUM 30
119 #define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
120 #define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond))
121 #define FC_ASSERT_STATIC(_cond) _FC_ASSERT_STATIC0 (__LINE__, (_cond))
123 #define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
124 #define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
125 #define FC_ABS(a) ((a) < 0 ? -(a) : (a))
127 /* slim_internal.h */
128 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
129 #define FcPrivate __attribute__((__visibility__("hidden")))
130 #define HAVE_GNUC_ATTRIBUTE 1
132 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
133 #define FcPrivate __hidden
134 #else /* not gcc >= 3.3 and not Sun Studio >= 8 */
138 typedef enum _FcValueBinding {
139 FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
143 * Serialized data structures use only offsets instead of pointers
144 * A low bit of 1 indicates an offset.
147 /* Is the provided pointer actually an offset? */
148 #define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0)
150 /* Encode offset in a pointer of type t */
151 #define FcOffsetEncode(o,t) ((t *) ((o) | 1))
153 /* Decode a pointer into an offset */
154 #define FcOffsetDecode(p) (((intptr_t) (p)) & ~1)
156 /* Compute pointer offset */
157 #define FcPtrToOffset(b,p) ((intptr_t) (p) - (intptr_t) (b))
159 /* Given base address, offset and type, return a pointer */
160 #define FcOffsetToPtr(b,o,t) ((t *) ((intptr_t) (b) + (o)))
162 /* Given base address, encoded offset and type, return a pointer */
163 #define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t)
165 /* Given base address, pointer and type, return an encoded offset */
166 #define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t)
168 /* Given a structure, offset member and type, return pointer */
169 #define FcOffsetMember(s,m,t) FcOffsetToPtr(s,(s)->m,t)
171 /* Given a structure, encoded offset member and type, return pointer to member */
172 #define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t)
174 /* Given a structure, member and type, convert the member to a pointer */
175 #define FcPointerMember(s,m,t) (FcIsEncodedOffset((s)->m) ? \
176 FcEncodedOffsetMember (s,m,t) : \
180 * Serialized values may hold strings, charsets and langsets as pointers,
181 * unfortunately FcValue is an exposed type so we can't just always use
184 #define FcValueString(v) FcPointerMember(v,u.s,FcChar8)
185 #define FcValueCharSet(v) FcPointerMember(v,u.c,const FcCharSet)
186 #define FcValueLangSet(v) FcPointerMember(v,u.l,const FcLangSet)
188 typedef struct _FcValueList *FcValueListPtr;
190 typedef struct _FcValueList {
191 struct _FcValueList *next;
193 FcValueBinding binding;
196 #define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList)
198 typedef int FcObject;
200 typedef struct _FcPatternElt *FcPatternEltPtr;
203 * Pattern elts are stuck in a structure connected to the pattern,
204 * so they get moved around when the pattern is resized. Hence, the
205 * values field must be a pointer/offset instead of just an offset
207 typedef struct _FcPatternElt {
212 #define FcPatternEltValues(pe) FcPointerMember(pe,values,FcValueList)
217 intptr_t elts_offset;
221 #define FcPatternElts(p) FcOffsetMember(p,elts_offset,FcPatternElt)
223 #define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *)
225 #define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \
226 FcEncodedOffsetToPtr(fs, \
227 FcFontSetFonts(fs)[i], \
232 FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpRange, FcOpBool, FcOpCharSet, FcOpLangSet,
234 FcOpField, FcOpConst,
235 FcOpAssign, FcOpAssignReplace,
236 FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
238 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
239 FcOpContains, FcOpListing, FcOpNotContains,
240 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
241 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
242 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
246 typedef enum _FcOpFlags {
247 FcOpFlagIgnoreBlanks = 1 << 0
250 #define FC_OP_GET_OP(_x_) ((_x_) & 0xffff)
251 #define FC_OP_GET_FLAGS(_x_) (((_x_) & 0xffff0000) >> 16)
252 #define FC_OP(_x_,_f_) (FC_OP_GET_OP (_x_) | ((_f_) << 16))
254 typedef struct _FcExpr {
265 const FcChar8 *constant;
267 struct _FcExpr *left, *right;
272 typedef struct _FcExprPage FcExprPage;
275 FcExprPage *next_page;
277 FcExpr exprs[(1024 - 2/* two pointers */ - 2/* malloc overhead */) * sizeof (void *) / sizeof (FcExpr)];
278 FcExpr end[FLEXIBLE_ARRAY_MEMBER];
281 typedef enum _FcQual {
282 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
285 #define FcMatchDefault ((FcMatchKind) -1)
287 typedef struct _FcTest {
288 struct _FcTest *next;
296 typedef struct _FcEdit {
297 struct _FcEdit *next;
301 FcValueBinding binding;
304 typedef struct _FcSubst {
305 struct _FcSubst *next;
310 typedef struct _FcCharLeaf {
311 FcChar32 map[256/32];
314 #define FC_REF_CONSTANT -1
317 int ref; /* reference count */
318 int num; /* size of leaves and numbers arrays */
319 intptr_t leaves_offset;
320 intptr_t numbers_offset;
323 #define FcCharSetLeaves(c) FcOffsetMember(c,leaves_offset,intptr_t)
324 #define FcCharSetLeaf(c,i) (FcOffsetToPtr(FcCharSetLeaves(c), \
325 FcCharSetLeaves(c)[i], \
327 #define FcCharSetNumbers(c) FcOffsetMember(c,numbers_offset,FcChar16)
330 int ref; /* reference count */
341 typedef struct _FcStrBuf {
347 FcChar8 buf_static[16 * sizeof (void *)];
351 int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
352 int version; /* FC_CACHE_CONTENT_VERSION */
353 intptr_t size; /* size of file */
354 intptr_t dir; /* offset to dir name */
355 intptr_t dirs; /* offset to subdirs */
356 int dirs_count; /* number of subdir strings */
357 intptr_t set; /* offset to font set */
358 int checksum; /* checksum of directory state */
363 #define FcCacheDir(c) FcOffsetMember(c,dir,FcChar8)
364 #define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t)
365 #define FcCacheSet(c) FcOffsetMember(c,set,FcFontSet)
366 #define FcCacheSubdir(c,i) FcOffsetToPtr (FcCacheDirs(c),\
371 * Used while constructing a directory cache object
374 #define FC_SERIALIZE_HASH_SIZE 8191
376 typedef union _FcAlign {
384 typedef struct _FcSerializeBucket {
385 struct _FcSerializeBucket *next;
390 typedef struct _FcCharSetFreezer FcCharSetFreezer;
392 typedef struct _FcSerialize {
394 FcCharSetFreezer *cs_freezer;
396 FcSerializeBucket *buckets[FC_SERIALIZE_HASH_SIZE];
400 * To map adobe glyph names to unicode values, a precomputed hash
404 typedef struct _FcGlyphName {
405 FcChar32 ucs; /* unicode value */
406 FcChar8 name[1]; /* name extends beyond struct */
410 * To perform case-insensitive string comparisons, a table
411 * is used which holds three different kinds of folding data.
413 * The first is a range of upper case values mapping to a range
414 * of their lower case equivalents. Within each range, the offset
415 * between upper and lower case is constant.
417 * The second is a range of upper case values which are interleaved
418 * with their lower case equivalents.
420 * The third is a set of raw unicode values mapping to a list
421 * of unicode values for comparison purposes. This allows conversion
422 * of ß to "ss" so that SS, ss and ß all match. A separate array
423 * holds the list of unicode values for each entry.
425 * These are packed into a single table. Using a binary search,
426 * the appropriate entry can be located.
429 #define FC_CASE_FOLD_RANGE 0
430 #define FC_CASE_FOLD_EVEN_ODD 1
431 #define FC_CASE_FOLD_FULL 2
433 typedef struct _FcCaseFold {
437 short offset; /* lower - upper for RANGE, table id for FULL */
440 #define FC_MAX_FILE_LEN 4096
442 #define FC_CACHE_MAGIC_MMAP 0xFC02FC04
443 #define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
444 #define FC_CACHE_CONTENT_VERSION 3 /* also check FC_CACHE_VERSION */
447 FcChar8 *file; /* original file name */
448 FcChar8 *new; /* temp file name -- write data here */
449 FcChar8 *lck; /* lockfile name (used for locking) */
450 FcChar8 *tmp; /* tmpfile name (used for locking) */
461 * File names loaded from the configuration -- saved here as the
462 * cache file must be consulted before the directories are scanned,
463 * and those directives may occur in any order
465 FcStrSet *configDirs; /* directories to scan for fonts */
467 * Set of allowed blank chars -- used to
468 * trim fonts of bogus glyphs
472 * List of directories containing fonts,
473 * built by recursively scanning the set
474 * of configured directories
478 * List of directories containing cache files.
482 * Names of all of the configuration files used
483 * to create this configuration
485 FcStrSet *configFiles; /* config files loaded */
487 * Substitution instructions for patterns and fonts;
488 * maxObjects is used to allocate appropriate intermediate storage
489 * while performing a whole set of substitutions
491 FcSubst *substPattern; /* substitutions for patterns */
492 FcSubst *substFont; /* substitutions for fonts */
493 FcSubst *substScan; /* substitutions for scanned fonts */
494 int maxObjects; /* maximum number of tests in all substs */
496 * List of patterns used to control font file selection
498 FcStrSet *acceptGlobs;
499 FcStrSet *rejectGlobs;
500 FcFontSet *acceptPatterns;
501 FcFontSet *rejectPatterns;
503 * The set of fonts loaded from the listed directories; the
504 * order within the set does not determine the font selection,
505 * except in the case of identical matches in which case earlier fonts
506 * match preferrentially
508 FcFontSet *fonts[FcSetApplication + 1];
510 * Fontconfig can periodically rescan the system configuration
511 * and font directories. This rescanning occurs when font
512 * listing requests are made, but no more often than rescanInterval
515 time_t rescanTime; /* last time information was scanned */
516 int rescanInterval; /* interval between scans */
518 int ref; /* reference count */
520 FcExprPage *expr_pool; /* pool of FcExpr's */
523 extern FcPrivate FcConfig *_fcConfig;
525 typedef struct _FcFileTime {
530 typedef struct _FcCharMap FcCharMap;
532 typedef struct _FcRange FcRange;
539 typedef struct _FcStatFS FcStatFS;
543 FcBool is_mtime_broken;
551 FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
554 FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
557 FcDirCacheWrite (FcCache *cache, FcConfig *config);
560 FcDirCacheCreateTagFile (const FcChar8 *cache_dir);
563 FcCacheObjectReference (void *object);
566 FcCacheObjectDereference (void *object);
572 FcDirCacheReference (FcCache *cache, int nref);
577 FcConfigXdgCacheHome (void);
580 FcConfigXdgConfigHome (void);
583 FcConfigXdgDataHome (void);
586 FcConfigAllocExpr (FcConfig *config);
589 FcConfigAddConfigDir (FcConfig *config,
593 FcConfigAddFontDir (FcConfig *config,
597 FcConfigAddDir (FcConfig *config,
601 FcConfigAddCacheDir (FcConfig *config,
605 FcConfigAddConfigFile (FcConfig *config,
609 FcConfigAddBlank (FcConfig *config,
613 FcConfigAddEdit (FcConfig *config,
619 FcConfigSetFonts (FcConfig *config,
624 FcConfigCompareValue (const FcValue *m,
629 FcConfigGlobAdd (FcConfig *config,
634 FcConfigAcceptFilename (FcConfig *config,
635 const FcChar8 *filename);
638 FcConfigPatternsAdd (FcConfig *config,
643 FcConfigAcceptFont (FcConfig *config,
644 const FcPattern *font);
647 FcConfigModifiedTime (FcConfig *config);
650 FcConfigAddCache (FcConfig *config, FcCache *cache,
651 FcSetName set, FcStrSet *dirSet);
655 FcAlignSize (intptr_t size);
657 FcPrivate FcSerialize *
658 FcSerializeCreate (void);
661 FcSerializeDestroy (FcSerialize *serialize);
664 FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
667 FcSerializeReserve (FcSerialize *serialize, int size);
670 FcSerializeOffset (FcSerialize *serialize, const void *object);
673 FcSerializePtr (FcSerialize *serialize, const void *object);
676 FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
678 FcPrivate FcLangSet *
679 FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
683 FcLangCharSetPopulate (void);
685 FcPrivate FcCharSetFreezer *
686 FcCharSetFreezerCreate (void);
688 FcPrivate const FcCharSet *
689 FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
692 FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
695 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
697 FcPrivate FcCharSet *
698 FcNameParseCharSet (FcChar8 *string);
701 FcNameUnparseValue (FcStrBuf *buf,
706 FcNameUnparseValueList (FcStrBuf *buf,
710 FcPrivate FcCharLeaf *
711 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
714 FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
716 FcPrivate FcCharSet *
717 FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
720 FcCharSetGetNumbers(const FcCharSet *c);
724 FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark);
727 FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos);
730 FcValueListPrint (FcValueListPtr l);
733 FcLangSetPrint (const FcLangSet *ls);
739 FcTestPrint (const FcTest *test);
742 FcExprPrint (const FcExpr *expr);
745 FcEditPrint (const FcEdit *edit);
748 FcSubstPrint (const FcSubst *subst);
751 FcCharSetPrint (const FcCharSet *c);
753 extern FcPrivate int FcDebugVal;
755 #define FcDebug() (FcDebugVal)
762 FcGetDefaultLang (void);
767 FcFileIsLink (const FcChar8 *file);
770 FcFileScanConfig (FcFontSet *set,
777 FcDirScanConfig (FcFontSet *set,
791 FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
793 FcPrivate FcFontSet *
794 FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
798 FcTestDestroy (FcTest *test);
801 FcEditDestroy (FcEdit *e);
809 FcMemAlloc (int kind, int size);
812 FcMemFree (int kind, int size);
815 FcPrivate FcLangSet *
816 FcFreeTypeLangSet (const FcCharSet *charset,
817 const FcChar8 *exclusiveLang);
820 FcLangNormalize (const FcChar8 *lang);
822 FcPrivate FcLangResult
823 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
825 FcPrivate FcLangSet *
826 FcLangSetPromote (const FcChar8 *lang);
828 FcPrivate FcLangSet *
829 FcNameParseLangSet (const FcChar8 *string);
832 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
835 FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
840 FcListPatternMatchAny (const FcPattern *p,
841 const FcPattern *font);
848 * NOTE -- this ordering is part of the cache file format.
849 * It must also match the ordering in fcname.c
852 #define FC_FAMILY_OBJECT 1
853 #define FC_FAMILYLANG_OBJECT 2
854 #define FC_STYLE_OBJECT 3
855 #define FC_STYLELANG_OBJECT 4
856 #define FC_FULLNAME_OBJECT 5
857 #define FC_FULLNAMELANG_OBJECT 6
858 #define FC_SLANT_OBJECT 7
859 #define FC_WEIGHT_OBJECT 8
860 #define FC_WIDTH_OBJECT 9
861 #define FC_SIZE_OBJECT 10
862 #define FC_ASPECT_OBJECT 11
863 #define FC_PIXEL_SIZE_OBJECT 12
864 #define FC_SPACING_OBJECT 13
865 #define FC_FOUNDRY_OBJECT 14
866 #define FC_ANTIALIAS_OBJECT 15
867 #define FC_HINT_STYLE_OBJECT 16
868 #define FC_HINTING_OBJECT 17
869 #define FC_VERTICAL_LAYOUT_OBJECT 18
870 #define FC_AUTOHINT_OBJECT 19
871 #define FC_GLOBAL_ADVANCE_OBJECT 20 /* deprecated */
872 #define FC_FILE_OBJECT 21
873 #define FC_INDEX_OBJECT 22
874 #define FC_RASTERIZER_OBJECT 23
875 #define FC_OUTLINE_OBJECT 24
876 #define FC_SCALABLE_OBJECT 25
877 #define FC_DPI_OBJECT 26
878 #define FC_RGBA_OBJECT 27
879 #define FC_SCALE_OBJECT 28
880 #define FC_MINSPACE_OBJECT 29
881 #define FC_CHAR_WIDTH_OBJECT 30
882 #define FC_CHAR_HEIGHT_OBJECT 31
883 #define FC_MATRIX_OBJECT 32
884 #define FC_CHARSET_OBJECT 33
885 #define FC_LANG_OBJECT 34
886 #define FC_FONTVERSION_OBJECT 35
887 #define FC_CAPABILITY_OBJECT 36
888 #define FC_FONTFORMAT_OBJECT 37
889 #define FC_EMBOLDEN_OBJECT 38
890 #define FC_EMBEDDED_BITMAP_OBJECT 39
891 #define FC_DECORATIVE_OBJECT 40
892 #define FC_LCD_FILTER_OBJECT 41
893 #define FC_NAMELANG_OBJECT 42
894 #define FC_MAX_BASE_OBJECT FC_NAMELANG_OBJECT
897 FcNameBool (const FcChar8 *v, FcBool *result);
900 FcObjectValidType (FcObject object, FcType type);
903 FcObjectFromName (const char * name);
905 FcPrivate const char *
906 FcObjectName (FcObject object);
908 FcPrivate FcObjectSet *
909 FcObjectGetSet (void);
917 #define FcObjectCompare(a, b) ((int) a - (int) b)
922 FcValueCanonicalize (const FcValue *v);
924 FcPrivate FcValueListPtr
925 FcValueListCreate (void);
928 FcValueListDestroy (FcValueListPtr l);
930 FcPrivate FcValueListPtr
931 FcValueListPrepend (FcValueListPtr vallist,
933 FcValueBinding binding);
935 FcPrivate FcValueListPtr
936 FcValueListAppend (FcValueListPtr vallist,
938 FcValueBinding binding);
940 FcPrivate FcValueListPtr
941 FcValueListDuplicate(FcValueListPtr orig);
943 FcPrivate FcPatternElt *
944 FcPatternObjectFindElt (const FcPattern *p, FcObject object);
946 FcPrivate FcPatternElt *
947 FcPatternObjectInsertElt (FcPattern *p, FcObject object);
950 FcPatternObjectListAdd (FcPattern *p,
956 FcPatternObjectAddWithBinding (FcPattern *p,
959 FcValueBinding binding,
963 FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
966 FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
969 FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
972 FcPatternObjectDel (FcPattern *p, FcObject object);
975 FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
978 FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
981 FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
984 FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
987 FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
990 FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
993 FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
996 FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
999 FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
1002 FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
1005 FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
1008 FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
1011 FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
1014 FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
1017 FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
1020 FcPatternAppend (FcPattern *p, FcPattern *s);
1022 FcPrivate const FcChar8 *
1023 FcSharedStr (const FcChar8 *name);
1026 FcSharedStrFree (const FcChar8 *name);
1029 FcStringHash (const FcChar8 *s);
1032 FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
1034 FcPrivate FcPattern *
1035 FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
1038 FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
1040 FcPrivate FcValueList *
1041 FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
1047 extern FcPrivate const FcMatrix FcIdentityMatrix;
1050 FcMatrixFree (FcMatrix *mat);
1055 FcStat (const FcChar8 *file, struct stat *statb);
1058 FcStatChecksum (const FcChar8 *file, struct stat *statb);
1061 FcIsFsMmapSafe (int fd);
1064 FcIsFsMtimeBroken (const FcChar8 *dir);
1068 FcStrSetAddLangs (FcStrSet *strs, const char *languages);
1071 FcStrSetSort (FcStrSet * set);
1074 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
1077 FcStrBufDestroy (FcStrBuf *buf);
1080 FcStrBufDone (FcStrBuf *buf);
1083 FcStrBufDoneStatic (FcStrBuf *buf);
1086 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
1089 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
1092 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
1095 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1098 FcStrRegexCmp (const FcChar8 *s, const FcChar8 *regex);
1101 FcStrRegexCmpIgnoreCase (const FcChar8 *s, const FcChar8 *regex);
1103 FcPrivate const FcChar8 *
1104 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1106 FcPrivate const FcChar8 *
1107 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1109 FcPrivate const FcChar8 *
1110 FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2);
1113 FcStrUsesHome (const FcChar8 *s);
1116 FcStrLastSlash (const FcChar8 *path);
1119 FcStrHashIgnoreCase (const FcChar8 *s);
1122 FcStrCanonFilename (const FcChar8 *s);
1125 FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
1128 FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
1130 #endif /* _FC_INT_H_ */