#define FC_FONT_FILE_INVALID ((FcChar8 *) ".")
#define FC_FONT_FILE_DIR ((FcChar8 *) ".dir")
-#define FC_GLOBAL_MAGIC_COOKIE "GLOBAL"
#ifdef _WIN32
#define FC_SEARCH_PATH_SEPARATOR ';'
#define FC_DBG_MEMORY 512
#define FC_DBG_CONFIG 1024
#define FC_DBG_LANGSET 2048
+#define FC_DBG_OBJTYPES 4096
#define FC_MEM_CHARSET 0
#define FC_MEM_CHARLEAF 1
#define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *)
#define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \
- FcEncodedOffsetToPtr(FcFontSetFonts(fs), \
+ FcEncodedOffsetToPtr(fs, \
FcFontSetFonts(fs)[i], \
FcPattern) : \
fs->fonts[i])
} FcStrBuf;
typedef struct _FcCache {
- int magic; /* FC_CACHE_MAGIC */
- off_t size; /* size of file */
+ int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
+ int version; /* FC_CACHE_CONTENT_VERSION */
+ intptr_t size; /* size of file */
intptr_t dir; /* offset to dir name */
intptr_t dirs; /* offset to subdirs */
int dirs_count; /* number of subdir strings */
#define FcCacheDir(c) FcOffsetMember(c,dir,FcChar8)
#define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t)
#define FcCacheSet(c) FcOffsetMember(c,set,FcFontSet)
+#define FcCacheSubdir(c,i) FcOffsetToPtr (FcCacheDirs(cache),\
+ FcCacheDirs(cache)[i], \
+ FcChar8)
/*
* Used while constructing a directory cache object
intptr_t offset;
} FcSerializeBucket;
+typedef struct _FcCharSetFreezer FcCharSetFreezer;
+
typedef struct _FcSerialize {
intptr_t size;
+ FcCharSetFreezer *cs_freezer;
void *linear;
FcSerializeBucket *buckets[FC_SERIALIZE_HASH_SIZE];
} FcSerialize;
#define fc_alignof(type) offsetof (struct { char c; type member; }, member)
-#define FC_CACHE_MAGIC 0xFC02FC04
-#define FC_CACHE_MAGIC_COPY 0xFC02FC05
+#define FC_CACHE_MAGIC_MMAP 0xFC02FC04
+#define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
+#define FC_CACHE_CONTENT_VERSION 1
struct _FcAtomic {
FcChar8 *file; /* original file name */
*/
FcSubst *substPattern; /* substitutions for patterns */
FcSubst *substFont; /* substitutions for fonts */
+ FcSubst *substScan; /* substitutions for scanned fonts */
int maxObjects; /* maximum number of tests in all substs */
/*
* List of patterns used to control font file selection
/* fccache.c */
-FcFontSet *
-FcCacheRead (FcConfig *config);
-
FcBool
-FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
+FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
-FcBool
-FcDirCacheConsume (FILE *file, FcFontSet *set, FcStrSet *dirs,
- const FcChar8 *dir, char *dirname);
+void
+FcDirCacheUnload (FcCache *cache);
+
+FcCache *
+FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
+
+FcCache *
+FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
FcCache *
-FcDirCacheMap (int fd, off_t size);
+FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
-void
-FcDirCacheUnmap (FcCache *cache);
+FcBool
+FcDirCacheValid (const FcChar8 *dir);
+
+FcCache *
+FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, FcStrSet *dirs);
FcBool
-FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
-
+FcDirCacheWrite (FcCache *cache, FcConfig *config);
+
/* fccfg.c */
FcBool
void
FcLangCharSetPopulate (void);
-FcCharSet *
-FcCharSetFreeze (FcCharSet *cs);
+FcCharSetFreezer *
+FcCharSetFreezerCreate (void);
+
+const FcCharSet *
+FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
void
-FcCharSetThawAll (void);
+FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
FcBool
FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
FcStrSet *dirs,
FcBlanks *blanks,
const FcChar8 *file,
- FcBool force,
FcConfig *config);
FcBool
FcDirScanConfig (FcFontSet *set,
FcStrSet *dirs,
FcBlanks *blanks,
- const FcChar8 *dir,
+ const FcChar8 *dir,
FcBool force,
FcConfig *config);
+FcCache *
+FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
+
/* fcfont.c */
int
FcFontDebug (void);
FcBool
FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
+FcChar8 *
+FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
+
/* fclist.c */
FcBool
#define FC_FONTFORMAT_OBJECT 37
#define FC_EMBOLDEN_OBJECT 38
#define FC_EMBEDDED_BITMAP_OBJECT 39
+#define FC_DECORATIVE_OBJECT 40
FcBool
FcNameBool (const FcChar8 *v, FcBool *result);