- /*
- * Check the cache
- */
- if (cache)
- {
- if ((cache_file = FcGlobalCacheFileGet (cache, file, id, &count)))
- {
- /*
- * Found a cache entry for the file
- */
- if (FcGlobalCacheCheckTime (file, &cache_file->info))
- {
- name = cache_file->name;
- need_scan = FcFalse;
- FcGlobalCacheReferenced (cache, &cache_file->info);
- /* "." means the file doesn't contain a font */
- if (FcStrCmp (name, FC_FONT_FILE_INVALID) != 0)
- {
- font = FcNameParse (name);
- if (font)
- if (!FcPatternAddString (font, FC_FILE, file))
- ret = FcFalse;
- }
- }
- }
- else if ((cache_dir = FcGlobalCacheDirGet (cache, file,
- strlen ((const char *) file),
- FcFalse)))
- {
- if (FcGlobalCacheCheckTime (cache_dir->info.file,
- &cache_dir->info))
- {
- font = 0;
- need_scan = FcFalse;
- FcGlobalCacheReferenced (cache, &cache_dir->info);
- if (!FcStrSetAdd (dirs, file))
- ret = FcFalse;
- }
- }
- }