FcConfig *config)
{
int id;
+#if 0
FcChar8 *name;
+ FcGlobalCacheFile *cache_file;
+ FcGlobalCacheDir *cache_dir;
+#endif
FcPattern *font;
FcBool ret = FcTrue;
FcBool isDir;
int count = 0;
- FcGlobalCacheFile *cache_file;
- FcGlobalCacheDir *cache_dir;
FcBool need_scan;
if (config && !FcConfigAcceptFilename (config, file))
{
need_scan = FcTrue;
font = 0;
+#if 0
/*
* Check the cache
*/
}
}
}
+#endif
/*
* Nothing in the cache, scan the file
*/
isDir = FcTrue;
ret = FcStrSetAdd (dirs, file);
}
+#if 0
/*
* Update the cache
*/
FcStrFree (unparse);
}
}
+#endif
}
/*
* Add the font
ret = FcFalse;
}
}
+ else if (font)
+ FcPatternDestroy (font);
id++;
} while (font && ret && id < count);
return ret;
if (!force)
{
+#if 0
/*
* Check fonts.cache-<version> file
*/
*/
if (cache && FcGlobalCacheScanDir (set, dirs, cache, dir, config))
return FcTrue;
+#endif
}
/* freed below */
* Now that the directory has been scanned,
* add the cache entry
*/
+#if 0
if (ret && cache)
FcGlobalCacheUpdate (cache, dir, 0, 0);
+#endif
return ret;
}
}
FcBool
-FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
+FcDirSave (FcFontSet *set, const FcChar8 *dir)
{
- return FcDirCacheWriteDir (set, dirs, dir);
+ static int rand_state = 0;
+ int bank;
+
+ if (!rand_state)
+ rand_state = time(0L);
+ bank = rand_r(&rand_state);
+
+ while (FcCacheHaveBank(bank))
+ bank = rand_r(&rand_state);
+
+ return FcDirCacheWrite (bank, set, dir);
}