]> git.wh0rd.org - fontconfig.git/commitdiff
Append version number to cache file names fcpackage_rc3
authorKeith Packard <keithp@keithp.com>
Mon, 26 Aug 2002 19:57:40 +0000 (19:57 +0000)
committerKeith Packard <keithp@keithp.com>
Mon, 26 Aug 2002 19:57:40 +0000 (19:57 +0000)
fontconfig/fontconfig.h
src/fcdir.c
src/fcint.h
src/fontconfig.man

index 73b949ececd3fdc1c8bce17099638642dea02aec..281356281b80ca5ba750494064626ea51a4a483c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.26 2002/08/19 19:32:04 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.28 2002/08/24 20:08:53 keithp Exp $
  *
  * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
  *
@@ -41,6 +41,18 @@ typedef int          FcBool;
 
 #define FC_VERSION     ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
 
+/*
+ * Current font cache file format version
+ * This is appended to the cache files so that multiple
+ * versions of the library will peacefully coexist
+ *
+ * Change this value whenever the disk format for the cache file
+ * changes in any non-compatible way.  Try to avoid such changes as
+ * it means multiple copies of the font information.
+ */
+
+#define FC_CACHE_VERSION    "1"
+
 #define FcTrue         1
 #define FcFalse                0
 
@@ -72,8 +84,8 @@ typedef int           FcBool;
 #define FC_CHARSET         "charset"           /* CharSet */
 #define FC_LANG                    "lang"              /* String OS/2 CodePageRange */
 
-#define FC_DIR_CACHE_FILE          "fonts.cache"
-#define FC_USER_CACHE_FILE         ".fonts.cache"
+#define FC_DIR_CACHE_FILE          "fonts.cache-"FC_CACHE_VERSION
+#define FC_USER_CACHE_FILE         ".fonts.cache-"FC_CACHE_VERSION
 
 /* Adjust outline rasterizer */
 #define FC_CHAR_WIDTH      "charwidth" /* Int */
index 8843da02ff17e04b8fd9e451bd51aeaa9307e259..6c49591609a12eb7545d6b794f9cfbb42050e69d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/fontconfig/src/fcdir.c,v 1.5 2002/05/21 17:06:22 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/src/fcdir.c,v 1.7 2002/07/28 10:50:59 keithp Exp $
  *
  * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
  *
@@ -169,13 +169,13 @@ FcDirScan (FcFontSet          *set,
     if (!force)
     {
        /*
-        * Check fonts.cache file
+        * Check fonts.cache-<version> file
         */
        if (FcDirCacheReadDir (set, dirs, dir))
            return FcTrue;
     
        /*
-        * Check ~/.fonts.cache file
+        * Check ~/.fonts.cache-<version> file
         */
        if (cache && FcGlobalCacheScanDir (set, dirs, cache, dir))
            return FcTrue;
index a5e3f117472933369a121fc4950c66635ceda31d..cd43b767fa77bcc7c9c1a7d20f2fc5277b9d4ddb 100644 (file)
@@ -200,7 +200,7 @@ typedef struct _FcStrBuf {
 } FcStrBuf;
 
 /*
- * The per-user ~/.fonts.cache file is loaded into
+ * 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
index cac9aba995204d07b3da6547b11e12a4d95d9aa4..4d9a6e45a5562ac7f19c52932bb225fc2934ec93 100644 (file)
@@ -1195,7 +1195,8 @@ information.  If it starts with '~', it refers to a file in the users
 home directory.  This file is used to hold information about fonts that
 isn't present in the per-directory cache files.  It is automatically
 maintained by the fontconfig library.  The default for this file 
-is ``~/.fonts.cache''.
+is ``~/.fonts.cache-<version>'', where <version> is the font configuration
+file version number (currently 1).
 
 .SS <include ignore_missing="no">
 This element contains the name of an additional configuration file.  When
@@ -1451,7 +1452,7 @@ is a DTD that describes the format of the configuration files.
 is the conventional location for per-user font configuration, although the
 actual location is specified in the global fonts.conf file.
 
-.B ~/.fonts.cache
+.B ~/.fonts.cache-*
 is the conventional repository of font information that isn't found in the
 per-directory caches.  This file is automatically maintained by fontconfig.