]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Revert ABI changes from version 2.3
[fontconfig.git] / src / fcint.h
index 2f656cb2d84bb93565eaf9677d15a776011bdc93..0bc5df2b47e679fce828652351e0daa8b1df8187 100644 (file)
@@ -199,11 +199,12 @@ struct _FcPattern {
 #define FcPatternElts(p)       FcOffsetMember(p,elts_offset,FcPatternElt)
 
 #define FcFontSetFonts(fs)     FcPointerMember(fs,fonts,FcPattern *)
-/*
+
 #define FcFontSetFont(fs,i)    (FcIsEncodedOffset((fs)->fonts) ? \
-                                FcOffsetToPtr(FcFontSetFonts(fs), \
-                                              FcFontSetFonts(fs)[i]) : \
-                                fs->fonts[i])*/
+                                FcEncodedOffsetToPtr(FcFontSetFonts(fs), \
+                                                     FcFontSetFonts(fs)[i], \
+                                                     FcPattern) : \
+                                fs->fonts[i])
                                                
 typedef enum _FcOp {
     FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet, 
@@ -307,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 */
@@ -404,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
@@ -411,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
@@ -454,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
@@ -490,9 +500,21 @@ FcBool
 FcDirCacheConsume (FILE *file, FcFontSet *set, FcStrSet *dirs,
                   const FcChar8 *dir, char *dirname);
     
+void
+FcDirCacheUnmap (FcCache *cache);
+
 FcBool
 FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
  
+FcCache *
+FcDirCacheMap (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
+    
+FcBool
+FcDirCacheLoad (int fd, off_t size, void *closure);
+    
+FcBool
+FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
+
 /* fccfg.c */
 
 FcBool
@@ -518,10 +540,6 @@ FcBool
 FcConfigAddConfigFile (FcConfig                *config,
                       const FcChar8    *f);
 
-FcBool
-FcConfigSetCache (FcConfig     *config,
-                 const FcChar8 *c);
-
 FcBool
 FcConfigAddBlank (FcConfig     *config,
                  FcChar32      blank);
@@ -563,6 +581,10 @@ FcConfigAcceptFont (FcConfig           *config,
 FcFileTime
 FcConfigModifiedTime (FcConfig *config);
 
+FcBool
+FcConfigAddCache (FcConfig *config, FcCache *cache);
+
+/* fcserialize.c */
 intptr_t
 FcAlignSize (intptr_t size);
     
@@ -784,6 +806,9 @@ FcNameParseLangSet (const FcChar8 *string);
 FcBool
 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
 
+FcChar8 *
+FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
+
 /* fclist.c */
 
 FcBool
@@ -851,10 +876,13 @@ FcObjectFromName (const char * name);
 const char *
 FcObjectName (FcObject object);
 
-#define FcObjectCompare(a, b)  ((int) a - (int) b)
+FcBool
+FcObjectInit (void);
 
 void
-FcObjectStaticNameFini (void);
+FcObjectFini (void);
+
+#define FcObjectCompare(a, b)  ((int) a - (int) b)
 
 /* fcpat.c */