]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Support localized font family and style names. This has been reported to
[fontconfig.git] / src / fcint.h
index e78fef799f738571af8f714b630744767f6ba2da..4fb89053e545f049ff339883d3b8ae1cd4ed235a 100644 (file)
 #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
@@ -251,16 +245,16 @@ typedef struct _FcStrBuf {
 } 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;
@@ -323,45 +317,22 @@ typedef struct _FcCaseFold {
  * cache which is then rewritten to the users home directory
  */
 
-#define FC_CACHE_MAGIC 0xFC20FC20
-#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 {
@@ -448,70 +419,34 @@ void
 FcGlobalCacheDestroy (FcGlobalCache *cache);
 
 FcBool
-FcGlobalCacheCheckTime (const FcChar8*file, FcGlobalCacheInfo *info);
-
-void
-FcGlobalCacheReferenced (FcGlobalCache     *cache,
-                        FcGlobalCacheInfo  *info);
-
-void
-FcGlobalCacheReferenceSubdir (FcGlobalCache *cache,
-                             const FcChar8 *dir);
-
-FcGlobalCacheDir *
-FcGlobalCacheDirGet (FcGlobalCache  *cache,
-                    const FcChar8  *dir,
-                    int            len,
-                    FcBool         create_missing);
-
-FcBool
-FcGlobalCacheScanDir (FcFontSet                *set,
-                     FcStrSet          *dirs,
-                     FcGlobalCache     *cache,
-                     const FcChar8     *dir,
-                     FcConfig          *config);
-
-FcGlobalCacheFile *
-FcGlobalCacheFileGet (FcGlobalCache *cache,
-                     const FcChar8 *file,
-                     int           id,
-                     int           *count);
-
+FcGlobalCacheReadDir (FcFontSet     *set, 
+                     FcStrSet      *dirs, 
+                     FcGlobalCache *cache, 
+                     const char    *dir, 
+                     FcConfig      *config);
 
 void
 FcGlobalCacheLoad (FcGlobalCache    *cache,
+                   FcStrSet        *staleDirs,
                   const FcChar8    *cache_file);
 
 FcBool
 FcGlobalCacheUpdate (FcGlobalCache  *cache,
-                    const FcChar8  *file,
-                    int            id,
-                    const FcChar8  *name);
+                    const char     *file,
+                    FcFontSet      *set);
 
 FcBool
 FcGlobalCacheSave (FcGlobalCache    *cache,
                   const FcChar8    *cache_file);
 
-void
-FcCacheForce(FcBool force);
-
-FcBool
-FcCacheSerialize (int bank, FcConfig * config);
-
 FcFontSet *
 FcCacheRead (FcConfig *config, FcGlobalCache * cache);
 
 FcBool
-FcDirCacheRead (FcFontSet * set, const FcChar8 *dir);
-
-FcBool
-FcDirCacheWrite (int bank, FcFontSet *set, const FcChar8 *dir);
-
-int
-FcCacheBankCount (void);
+FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
 
 FcBool
-FcCacheHaveBank (int bank);
+FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir);
 
 int
 FcCacheBankToIndex (int bank);
@@ -639,6 +574,10 @@ FcSubstPrint (const FcSubst *subst);
 int
 FcDebug (void);
 
+/* fcdefault.c */
+FcChar8 *
+FcGetDefaultLang (void);
+
 /* fcdir.c */
 
 FcBool
@@ -863,8 +802,8 @@ FcPatternFini (void);
 FcBool
 FcPatternAppend (FcPattern *p, FcPattern *s);
 
-const char *
-FcStrStaticName (const char *name);
+const FcChar8 *
+FcStrStaticName (const FcChar8 *name);
 
 FcChar32
 FcStringHash (const FcChar8 *s);