]> git.wh0rd.org - fontconfig.git/commitdiff
When fc-cache is run without --force, use directory cache files to speed up
authorPatrick Lam <plam@MIT.EDU>
Wed, 12 Oct 2005 07:55:42 +0000 (07:55 +0000)
committerPatrick Lam <plam@MIT.EDU>
Wed, 12 Oct 2005 07:55:42 +0000 (07:55 +0000)
    fc-cache run time.

src/fccache.c
src/fcdir.c
src/fcint.h

index 0e8c476ffa26b8368acb57a318fb0b9c92a43968..8629385fcf810f081a9570aac5a70100a8a2b9a9 100644 (file)
@@ -46,7 +46,7 @@ FcDirCacheProduce (FcFontSet *set, FcCache * metadata);
 static FcBool
 FcDirCacheConsume (int fd, FcFontSet *set);
 
-static FcBool
+FcBool
 FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir);
 
 static int
@@ -690,7 +690,7 @@ FcCacheRead (FcConfig *config, FcGlobalCache * cache)
 }
 
 /* read serialized state from the cache file */
-static FcBool
+FcBool
 FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir)
 {
     char *cache_file = (char *)FcStrPlus (dir, (FcChar8 *) "/" FC_DIR_CACHE_FILE);
index c494913a05d144230e9e24488924cce9b9311fc0..3b9d23f51b458bf1727643f7ab157e2db893acb0 100644 (file)
@@ -138,6 +138,9 @@ FcDirScanConfig (FcFontSet  *set,
         */
        if (cache && FcGlobalCacheReadDir (set, dirs, cache, (char *)dir, config))
            return FcTrue;
+
+       if (FcDirCacheRead (set, dirs, dir))
+           return FcTrue;
     }
     
     /* freed below */
index 834f08585c4a1f78637fd36b77b55a5d33dbd7bc..1dec72a34897129cde48092d1364af0e921ee0ce 100644 (file)
@@ -445,6 +445,9 @@ 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);