* Verify the saved timestamp for a file
*/
FcBool
-FcGlobalCacheCheckTime (FcGlobalCacheInfo *info)
+FcGlobalCacheCheckTime (const FcChar8 *file, FcGlobalCacheInfo *info)
{
struct stat statb;
- if (stat ((char *) info->file, &statb) < 0)
+ if (stat ((char *) file, &statb) < 0)
{
if (FcDebug () & FC_DBG_CACHE)
- printf (" file missing\n");
+ printf (" file %s missing\n", file);
return FcFalse;
}
if (statb.st_mtime != info->time)
* See if the timestamp recorded in the global cache
* matches the directory time, if not, return False
*/
- if (!FcGlobalCacheCheckTime (&d->info))
+ if (!FcGlobalCacheCheckTime (d->info.file, &d->info))
{
if (FcDebug () & FC_DBG_CACHE)
printf ("\tdir cache entry time mismatch\n");
}
}
if (count)
- *count = max;
+ *count = max + 1;
return match;
}
/*
* Found a cache entry for the file
*/
- if (FcGlobalCacheCheckTime (&cache_file->info))
+ if (FcGlobalCacheCheckTime (file, &cache_file->info))
{
name = cache_file->name;
need_scan = FcFalse;
strlen ((const char *) file),
FcFalse)))
{
- if (FcGlobalCacheCheckTime (&cache_dir->info))
+ if (FcGlobalCacheCheckTime (cache_dir->info.file,
+ &cache_dir->info))
{
font = 0;
need_scan = FcFalse;
strcat ((char *) file, "/");
base = file + strlen ((char *) file);
+ if (FcDebug () & FC_DBG_SCAN)
+ printf ("\tScanning dir %s\n", dir);
+
d = opendir ((char *) dir);
if (!d)
FcGlobalCacheDestroy (FcGlobalCache *cache);
FcBool
-FcGlobalCacheCheckTime (FcGlobalCacheInfo *info);
+FcGlobalCacheCheckTime (const FcChar8*file, FcGlobalCacheInfo *info);
void
FcGlobalCacheReferenced (FcGlobalCache *cache,