typedef struct _FcCache {
int magic; /* FC_CACHE_MAGIC */
- off_t size; /* size of file */
+ 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 */
FcChar32 *blanks;
};
+typedef struct _FcCacheList {
+ struct _FcCacheList *next;
+ FcCache *cache;
+} FcCacheList;
+
struct _FcConfig {
/*
* File names loaded from the configuration -- saved here as the
* and those directives may occur in any order
*/
FcStrSet *configDirs; /* directories to scan for fonts */
- FcChar8 *cache; /* name of per-user cache file */
/*
* Set of allowed blank chars -- used to
* trim fonts of bogus glyphs
* match preferrentially
*/
FcFontSet *fonts[FcSetApplication + 1];
+ /*
+ * Font cache information is mapped from cache files
+ * the configuration is destroyed, the files need to be unmapped
+ */
+ FcCacheList *caches;
/*
* Fontconfig can periodically rescan the system configuration
* and font directories. This rescanning occurs when font
FcDirCacheConsume (FILE *file, FcFontSet *set, FcStrSet *dirs,
const FcChar8 *dir, char *dirname);
-FcCache *
-FcDirCacheMap (int fd, off_t size);
-
void
FcDirCacheUnmap (FcCache *cache);
FcBool
FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
+FcCache *
+FcDirCacheMap (const FcChar8 *dir, FcConfig *config);
+
+FcBool
+FcDirCacheLoad (int fd, off_t size, void *closure);
+
/* fccfg.c */
FcBool
FcConfigAddConfigFile (FcConfig *config,
const FcChar8 *f);
-FcBool
-FcConfigSetCache (FcConfig *config,
- const FcChar8 *c);
-
FcBool
FcConfigAddBlank (FcConfig *config,
FcChar32 blank);
FcFileTime
FcConfigModifiedTime (FcConfig *config);
+FcBool
+FcConfigAddCache (FcConfig *config, FcCache *cache);
+
+/* fcserialize.c */
intptr_t
FcAlignSize (intptr_t size);