]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Use intptr_t instead of off_t inside FcCache structure.
[fontconfig.git] / src / fcint.h
index c62a5bb370fddf7694e0e3a92d1ed0bce223b255..1b92d75270bc63dcf83f75bb278d3cc50abe49d8 100644 (file)
@@ -308,7 +308,7 @@ typedef struct _FcStrBuf {
 
 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 */
@@ -405,6 +405,11 @@ struct _FcBlanks {
     FcChar32   *blanks;
 };
 
+typedef struct _FcCacheList {
+    struct _FcCacheList *next;
+    FcCache            *cache;
+} FcCacheList;
+
 struct _FcConfig {
     /*
      * File names loaded from the configuration -- saved here as the
@@ -412,7 +417,6 @@ struct _FcConfig {
      * 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
@@ -455,6 +459,11 @@ struct _FcConfig {
      * 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
@@ -491,15 +500,18 @@ FcBool
 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
@@ -525,10 +537,6 @@ FcBool
 FcConfigAddConfigFile (FcConfig                *config,
                       const FcChar8    *f);
 
-FcBool
-FcConfigSetCache (FcConfig     *config,
-                 const FcChar8 *c);
-
 FcBool
 FcConfigAddBlank (FcConfig     *config,
                  FcChar32      blank);
@@ -570,6 +578,10 @@ FcConfigAcceptFont (FcConfig           *config,
 FcFileTime
 FcConfigModifiedTime (FcConfig *config);
 
+FcBool
+FcConfigAddCache (FcConfig *config, FcCache *cache);
+
+/* fcserialize.c */
 intptr_t
 FcAlignSize (intptr_t size);