summaryrefslogtreecommitdiff
path: root/src/fccfg.c
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2006-08-04 16:13:00 +0000
committerPatrick Lam <plam@MIT.EDU>2006-08-04 16:13:00 +0000
commit7410e40bd93beb4ab1a577d084112413431cede2 (patch)
tree036eeeccf20ddd740b3c3a18e169951f5f45abdf /src/fccfg.c
parent62a4a8459adaf26833e1dad0ee96ea5a4b8c3d54 (diff)
2006-08-04 Keith Packard (keithp@keithp.com) reviewed by: plam
Make cache directories configurable. Simplify and correct some code which deals with per-directory caches.
Diffstat (limited to 'src/fccfg.c')
-rw-r--r--src/fccfg.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/fccfg.c b/src/fccfg.c
index 32e0084..8eb82e5 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -100,13 +100,17 @@ FcConfigCreate (void)
if (!FcConfigSetCache (config, cache_dir))
{
FcStrFree (cache_dir);
- goto bail6;
+ goto bail8;
}
FcStrFree (cache_dir);
}
}
#endif
+ config->cacheDirs = FcStrSetCreate ();
+ if (!config->cacheDirs)
+ goto bail9;
+
config->blanks = 0;
config->substPattern = 0;
@@ -120,6 +124,8 @@ FcConfigCreate (void)
return config;
+bail9:
+ FcStrFree (config->cache);
bail8:
FcFontSetDestroy (config->rejectPatterns);
bail7:
@@ -226,6 +232,7 @@ FcConfigDestroy (FcConfig *config)
FcStrSetDestroy (config->configDirs);
FcStrSetDestroy (config->fontDirs);
+ FcStrSetDestroy (config->cacheDirs);
FcStrSetDestroy (config->configFiles);
FcStrSetDestroy (config->acceptGlobs);
FcStrSetDestroy (config->rejectGlobs);
@@ -513,6 +520,25 @@ FcConfigGetFontDirs (FcConfig *config)
}
FcBool
+FcConfigAddCacheDir (FcConfig *config,
+ const FcChar8 *d)
+{
+ return FcStrSetAddFilename (config->cacheDirs, d);
+}
+
+FcStrList *
+FcConfigGetCacheDirs (FcConfig *config)
+{
+ if (!config)
+ {
+ config = FcConfigGetCurrent ();
+ if (!config)
+ return 0;
+ }
+ return FcStrListCreate (config->cacheDirs);
+}
+
+FcBool
FcConfigAddConfigFile (FcConfig *config,
const FcChar8 *f)
{