#include <config.h>
#endif
-/* unused */
-typedef struct _FcSymbolic {
- const char *name;
- int value;
-} FcSymbolic;
-
#ifndef FC_CONFIG_PATH
#define FC_CONFIG_PATH "fonts.conf"
#endif
} FcStrBuf;
typedef struct _FcCache {
- int magic;
- int count;
- int bank;
- int pattern_count;
- int patternelt_count;
- int valuelist_count;
- int str_count;
- int langset_count;
- int charset_count;
- int charset_numbers_count;
+ int magic; /* 0xFC02FC02 */
+ int count; /* number of bytes of data in block */
+ int bank; /* bank ID */
+ int pattern_count; /* number of FcPatterns */
+ int patternelt_count; /* number of FcPatternElts */
+ int valuelist_count; /* number of FcValueLists */
+ int str_count; /* size of strings appearing as FcValues */
+ int langset_count; /* number of FcLangSets */
+ int charset_count; /* number of FcCharSets */
+ int charset_numbers_count;
int charset_leaf_count;
int charset_leaf_idx_count;
} FcCache;
* cache which is then rewritten to the users home directory
*/
-#define FC_CACHE_MAGIC 0x12345678
-#define FC_GLOBAL_CACHE_DIR_HASH_SIZE 37
-#define FC_GLOBAL_CACHE_FILE_HASH_SIZE 67
-
-typedef struct _FcGlobalCacheInfo {
- unsigned int hash;
- FcChar8 *file;
- time_t time;
- FcBool referenced;
-} FcGlobalCacheInfo;
-
-typedef struct _FcGlobalCacheFile {
- struct _FcGlobalCacheFile *next;
- FcGlobalCacheInfo info;
- int id;
- FcChar8 *name;
-} FcGlobalCacheFile;
+#define FC_CACHE_MAGIC 0xFC02FC02
typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
-typedef struct _FcGlobalCacheSubdir {
- struct _FcGlobalCacheSubdir *next;
- FcGlobalCacheDir *ent;
-} FcGlobalCacheSubdir;
-
struct _FcGlobalCacheDir {
struct _FcGlobalCacheDir *next;
- FcGlobalCacheInfo info;
- int len;
- FcGlobalCacheFile *ents[FC_GLOBAL_CACHE_FILE_HASH_SIZE];
- FcGlobalCacheSubdir *subdirs;
+ char *name;
+ FcCache metadata;
+ off_t offset;
+ void *ent;
};
typedef struct _FcGlobalCache {
- FcGlobalCacheDir *ents[FC_GLOBAL_CACHE_DIR_HASH_SIZE];
+ FcGlobalCacheDir *dirs;
FcBool updated;
- FcBool broken;
- int entries;
- int referenced;
+ int fd;
} FcGlobalCache;
struct _FcAtomic {
/* fccache.c */
+FcGlobalCache *
+FcGlobalCacheCreate (void);
+
void
-FcCacheForce(FcBool force);
+FcGlobalCacheDestroy (FcGlobalCache *cache);
FcBool
-FcCacheSerialize (int bank, FcConfig * config);
+FcGlobalCacheReadDir (FcFontSet *set,
+ FcStrSet *dirs,
+ FcGlobalCache *cache,
+ const char *dir,
+ FcConfig *config);
-FcFontSet *
-FcCacheRead (FcConfig *config);
+void
+FcGlobalCacheLoad (FcGlobalCache *cache,
+ FcStrSet *staleDirs,
+ const FcChar8 *cache_file);
FcBool
-FcDirCacheRead (FcFontSet * set, const FcChar8 *dir);
+FcGlobalCacheUpdate (FcGlobalCache *cache,
+ const char *file,
+ FcFontSet *set);
FcBool
-FcDirCacheWrite (int bank, FcFontSet *set, const FcChar8 *dir);
+FcGlobalCacheSave (FcGlobalCache *cache,
+ const FcChar8 *cache_file);
-int
-FcCacheBankCount (void);
+FcFontSet *
+FcCacheRead (FcConfig *config, FcGlobalCache * cache);
FcBool
-FcCacheHaveBank (int bank);
+FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
+
+FcBool
+FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir);
int
FcCacheBankToIndex (int bank);
FcBool
FcNameBool (const FcChar8 *v, FcBool *result);
-void
-FcObjectNewBank(void);
-
void *
FcObjectDistributeBytes (FcCache * metadata,
void * block_ptr);
FcObjectToPtr (const char * si);
int
-FcObjectNeededBytes (FcObjectPtr p);
+FcObjectNeededBytes (void);
+
+void *
+FcObjectUnserialize (FcCache metadata, void *block_ptr);
void
-FcObjectUnserialize (FcCache metadata, FcConfig * config, void *block_ptr);
+FcObjectSerialize (void);
-FcObjectPtr
-FcObjectSerialize (FcObjectPtr s);
+const char *
+FcObjectPtrU (FcObjectPtr p);
+
+int
+FcObjectPtrCompare (FcObjectPtr a, FcObjectPtr b);
+
+void
+FcObjectStaticNameFini (void);
/* fcpat.c */
FcBool
FcPatternAppend (FcPattern *p, FcPattern *s);
-const char *
-FcObjectStaticName (const char *name);
-
-const char *
-FcObjectPtrU (FcObjectPtr p);
+const FcChar8 *
+FcStrStaticName (const FcChar8 *name);
-int
-FcObjectPtrCompare (FcObjectPtr a, FcObjectPtr b);
+FcChar32
+FcStringHash (const FcChar8 *s);
void
FcPatternNewBank (void);
FcPattern *
FcPatternSerialize (int bank, FcPattern * p);
-FcPattern *
+void *
FcPatternUnserialize (FcCache metadata, void *block_ptr);
/* fcrender.c */