return 0;
}
-typedef struct _FcFileTime {
- time_t time;
- FcBool set;
-} FcFileTime;
-
static FcFileTime
FcConfigNewestFile (FcStrSet *files)
{
return newest;
}
+FcFileTime
+FcConfigModifiedTime (FcConfig *config)
+{
+ if (!config)
+ {
+ FcFileTime v = { 0, FcFalse };
+ config = FcConfigGetCurrent ();
+ if (!config)
+ return v;
+ }
+ return FcConfigNewestFile (config->configFiles);
+}
+
FcBool
FcConfigUptoDate (FcConfig *config)
{
goto bail2;
if (config->cache)
- FcGlobalCacheLoad (cache, oldDirs, config->cache);
+ FcGlobalCacheLoad (cache, oldDirs, config->cache, config);
cached_fonts = FcCacheRead(config, cache);
if (!cached_fonts)
for (i = 0; i < oldDirs->num; i++)
{
if (FcDebug () & FC_DBG_FONTSET)
- printf ("scan dir %s\n", dir);
+ printf ("scan dir %s\n", oldDirs->strs[i]);
FcDirScanConfig (fonts, config->fontDirs, cache,
config->blanks, oldDirs->strs[i],
FcFalse, config);
for (i = 0; i < cached_fonts->nfont; i++)
{
- if (FcConfigAcceptFont (config, cached_fonts->fonts[i]))
+ FcChar8 *cfn;
+ FcPatternGetString (cached_fonts->fonts[i], FC_FILE, 0, &cfn);
+
+ if (FcConfigAcceptFont (config, cached_fonts->fonts[i]) &&
+ (cfn && FcConfigAcceptFilename (config, cfn)))
FcFontSetAdd (fonts, cached_fonts->fonts[i]);
cached_fonts->fonts[i] = 0; /* prevent free in FcFontSetDestroy */
FcConfigValues (FcPattern *p, FcExpr *e, FcValueBinding binding)
{
FcValueList *l;
- FcValueListPtr lp;
if (!e)
return 0;
l->next = FcValueListPtrCreateDynamic(0);
}
l->binding = binding;
- lp = FcValueListPtrCreateDynamic(l);
- while (FcValueListPtrU(lp) && FcValueListPtrU(lp)->value.type == FcTypeVoid)
+ if (l->value.type == FcTypeVoid)
{
- FcValueListPtr next = FcValueListPtrU(lp)->next;
+ FcValueList *next = FcValueListPtrU(l->next);
- if (lp.bank == FC_BANK_DYNAMIC)
- {
- FcMemFree (FC_MEM_VALLIST, sizeof (FcValueList));
- free (l);
- }
- lp = next;
+ FcMemFree (FC_MEM_VALLIST, sizeof (FcValueList));
+ free (l);
+ l = next;
}
+
return l;
}
home = getenv ("USERPROFILE");
#endif
- return home;
+ return (FcChar8 *) home;
}
return 0;
}