]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Make FcCompareString and FcCompareFamily less expensive. Only add a value
[fontconfig.git] / src / fcint.h
index e29b447d54a666ebcc8134b965b6c27205b53859..1b545bca8d99323ce16ded7a099d1401ff584245 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <string.h>
 #include <ctype.h>
 #include <errno.h>
 
 #define FC_MEM_NUM         30
 
+#define FC_BANK_LANGS      0xfcfcfcfc
+
 typedef enum _FcValueBinding {
     FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
 } FcValueBinding;
@@ -245,16 +248,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,7 +326,7 @@ typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
 
 struct _FcGlobalCacheDir {
     struct _FcGlobalCacheDir   *next;
-    FcChar8                    *name;
+    char                       *name;
     FcCache                    metadata;
     off_t                      offset;
     void                       *ent;
@@ -406,8 +409,15 @@ struct _FcConfig {
  
 extern FcConfig        *_fcConfig;
 
+typedef struct _FcFileTime {
+    time_t  time;
+    FcBool  set;
+} FcFileTime;
+
 typedef struct _FcCharMap FcCharMap;
 
+#define ALIGN(v,type) ((__typeof__(v))(((uintptr_t)(v) + __alignof__(type) - 1) & ~(__alignof__(type) - 1)))
+
 /* fcblanks.c */
 
 /* fccache.c */
@@ -422,17 +432,18 @@ FcBool
 FcGlobalCacheReadDir (FcFontSet     *set, 
                      FcStrSet      *dirs, 
                      FcGlobalCache *cache, 
-                     const FcChar8 *dir, 
+                     const char    *dir, 
                      FcConfig      *config);
 
 void
 FcGlobalCacheLoad (FcGlobalCache    *cache,
                    FcStrSet        *staleDirs,
-                  const FcChar8    *cache_file);
+                  const FcChar8    *cache_file,
+                  FcConfig         *config);
 
 FcBool
 FcGlobalCacheUpdate (FcGlobalCache  *cache,
-                    const FcChar8  *file,
+                    const char     *file,
                     FcFontSet      *set);
 
 FcBool
@@ -445,8 +456,14 @@ FcCacheRead (FcConfig *config, FcGlobalCache * cache);
 FcBool
 FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
 
+FcBool
+FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir);
+
 int
 FcCacheBankToIndex (int bank);
+
+const char *
+FcCacheFindBankDir (int bank);
  
 /* fccfg.c */
 
@@ -508,7 +525,13 @@ FcBool
 FcConfigAcceptFont (FcConfig       *config,
                    const FcPattern *font);
 
+FcFileTime
+FcConfigModifiedTime (FcConfig *config);
+
 /* fccharset.c */
+void
+FcLangCharSetPopulate (void);
+
 FcCharSet *
 FcCharSetFreeze (FcCharSet *cs);
 
@@ -530,6 +553,9 @@ FcCharSetNewBank (void);
 int
 FcCharSetNeededBytes (const FcCharSet *c);
 
+int
+FcCharSetNeededBytesAlign (void);
+
 void *
 FcCharSetDistributeBytes (FcCache * metadata,
                          void * block_ptr);
@@ -568,8 +594,17 @@ FcEditPrint (const FcEdit *edit);
 void
 FcSubstPrint (const FcSubst *subst);
 
-int
-FcDebug (void);
+extern int FcDebugVal;
+
+static __inline__ int
+FcDebug (void) { return FcDebugVal; }
+
+void
+FcInitDebug (void);
+
+/* fcdefault.c */
+FcChar8 *
+FcGetDefaultLang (void);
 
 /* fcdir.c */
 
@@ -622,6 +657,9 @@ FcFontSetNewBank (void);
 int
 FcFontSetNeededBytes (FcFontSet *s);
 
+int
+FcFontSetNeededBytesAlign (void);
+
 void *
 FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
 
@@ -717,6 +755,9 @@ FcLangSetNewBank (void);
 int
 FcLangSetNeededBytes (const FcLangSet *l);
 
+int
+FcLangSetNeededBytesAlign (void);
+
 void *
 FcLangSetDistributeBytes (FcCache * metadata,
                          void * block_ptr);
@@ -750,6 +791,9 @@ FcObjectToPtr (const char * si);
 int
 FcObjectNeededBytes (void);
 
+int
+FcObjectNeededBytesAlign (void);
+
 void *
 FcObjectUnserialize (FcCache metadata, void *block_ptr);
 
@@ -795,8 +839,14 @@ FcPatternFini (void);
 FcBool
 FcPatternAppend (FcPattern *p, FcPattern *s);
 
-const char *
-FcStrStaticName (const char *name);
+void
+FcPatternAddFullFname (const FcPattern *p, const char *fname);
+
+void
+FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig);
+
+const FcChar8 *
+FcStrStaticName (const FcChar8 *name);
 
 FcChar32
 FcStringHash (const FcChar8 *s);
@@ -807,6 +857,9 @@ FcPatternNewBank (void);
 int
 FcPatternNeededBytes (FcPattern *p);
 
+int
+FcPatternNeededBytesAlign (void);
+
 void *
 FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);