From 2eb843740672da9319c190c48aea2cd98dc92725 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Wed, 12 Oct 2005 07:55:42 +0000 Subject: [PATCH] When fc-cache is run without --force, use directory cache files to speed up fc-cache run time. --- src/fccache.c | 4 ++-- src/fcdir.c | 3 +++ src/fcint.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/fccache.c b/src/fccache.c index 0e8c476..8629385 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -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); diff --git a/src/fcdir.c b/src/fcdir.c index c494913..3b9d23f 100644 --- a/src/fcdir.c +++ b/src/fcdir.c @@ -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 */ diff --git a/src/fcint.h b/src/fcint.h index 834f085..1dec72a 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -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); -- 2.39.2