]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Fix up fc-cache and fc-cat for no global cache changes.
[fontconfig.git] / src / fcint.h
index ae348b86521aabbc26789bb7c1077fad8fe278e9..cb137d389615646d802285ad37a09437a53867d3 100644 (file)
@@ -259,7 +259,9 @@ typedef struct _FcStrBuf {
 
 typedef struct _FcCache {
     int            magic;              /* FC_CACHE_MAGIC */
-    int            count;              /* number of bytes of data in block */
+    int            subdirs;            /* number of subdir strings */
+    off_t   pos;               /* position of data block in file */
+    off_t   count;              /* number of bytes of data in block */
     int     bank;               /* bank ID */
     int     pattern_count;      /* number of FcPatterns */
     int     patternelt_count;   /* number of FcPatternElts */
@@ -323,39 +325,8 @@ typedef struct _FcCaseFold {
 
 #define fc_alignof(type) offsetof (struct { char c; type member; }, member)
 
-/*
- * The per-user ~/.fonts.cache-<version> file is loaded into
- * this data structure.  Each directory gets a substructure
- * which is validated by comparing the directory timestamp with
- * that saved in the cache.  When valid, the entire directory cache
- * can be immediately loaded without reading the directory.  Otherwise,
- * the files are checked individually; updated files are loaded into the
- * cache which is then rewritten to the users home directory
- */
-
 #define FC_CACHE_MAGIC 0xFC02FC04
 
-typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
-
-enum FcGCDirState {
-       FcGCDirDisabled, FcGCDirFileRead, FcGCDirConsumed, FcGCDirUpdated
-};
-struct _FcGlobalCacheDir {
-    struct _FcGlobalCacheDir   *next;
-    char                       *name;
-    FcCache                    metadata;
-    off_t                      offset;
-    FcStrSet                   *subdirs;
-    void                       *ent;
-    enum FcGCDirState          state;
-};
-
-typedef struct _FcGlobalCache {
-    FcGlobalCacheDir           *dirs;
-    FcBool                     updated;
-    int                                fd;
-} FcGlobalCache;
-
 struct _FcAtomic {
     FcChar8    *file;          /* original file name */
     FcChar8    *new;           /* temp file name -- write data here */
@@ -388,6 +359,10 @@ struct _FcConfig {
      * of configured directories
      */
     FcStrSet   *fontDirs;
+    /*
+     * List of directories containing cache files.
+     */
+    FcStrSet   *cacheDirs;
     /*
      * Names of all of the configuration files used
      * to create this configuration
@@ -441,43 +416,16 @@ typedef struct _FcCharMap FcCharMap;
 
 /* fccache.c */
 
-FcGlobalCache *
-FcGlobalCacheCreate (void);
-
-void
-FcGlobalCacheDestroy (FcGlobalCache *cache);
-
-FcBool
-FcGlobalCacheReadDir (FcFontSet     *set, 
-                     FcStrSet      *dirs, 
-                     FcGlobalCache *cache, 
-                     const char    *dir, 
-                     FcConfig      *config);
-
-void
-FcGlobalCacheLoad (FcGlobalCache    *cache,
-                   FcStrSet        *staleDirs,
-                  const FcChar8    *cache_file,
-                  FcConfig         *config);
-
-FcBool
-FcGlobalCacheUpdate (FcGlobalCache  *cache,
-                    FcStrSet       *dirs,
-                    const char     *file,
-                    FcFontSet      *set,
-                    FcConfig       *config);
-
-FcBool
-FcGlobalCacheSave (FcGlobalCache    *cache,
-                  const FcChar8    *cache_file,
-                  FcConfig         *config);
-
 FcFontSet *
-FcCacheRead (FcConfig *config, FcGlobalCache * cache);
+FcCacheRead (FcConfig *config);
 
 FcBool
-FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
+FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
 
+FcBool
+FcDirCacheConsume (FILE *file, FcFontSet *set, FcStrSet *dirs,
+                  const FcChar8 *dir, char *dirname);
+    
 FcBool
 FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
 
@@ -508,6 +456,13 @@ FcBool
 FcConfigAddDir (FcConfig       *config,
                const FcChar8   *d);
 
+FcBool
+FcConfigAddCacheDir (FcConfig      *config,
+                    const FcChar8  *d);
+
+FcStrList *
+FcConfigGetCacheDirs (FcConfig *config);
+
 FcBool
 FcConfigAddConfigFile (FcConfig                *config,
                       const FcChar8    *f);
@@ -643,7 +598,6 @@ FcFileIsDir (const FcChar8 *file);
 FcBool
 FcFileScanConfig (FcFontSet    *set,
                  FcStrSet      *dirs,
-                 FcFileCache   *cache,
                  FcBlanks      *blanks,
                  const FcChar8 *file,
                  FcBool        force,
@@ -652,7 +606,6 @@ FcFileScanConfig (FcFontSet *set,
 FcBool
 FcDirScanConfig (FcFontSet     *set,
                 FcStrSet       *dirs,
-                FcFileCache    *cache,
                 FcBlanks       *blanks,
                 const FcChar8  *dir,
                 FcBool         force,
@@ -862,9 +815,6 @@ FcPatternAddWithBinding  (FcPattern     *p,
                          FcValueBinding    binding,
                          FcBool            append);
 
-FcPattern *
-FcPatternFreeze (FcPattern *p);
-
 void
 FcPatternFini (void);