From: Mike Frysinger Date: Tue, 8 Nov 2011 01:00:51 +0000 (-0500) Subject: FcStat: export for people to use X-Git-Tag: root-2~1 X-Git-Url: https://git.wh0rd.org/?p=fontconfig.git;a=commitdiff_plain;h=dba33c4399aebdb03a1d11b2bb99a17cb006ead0 FcStat: export for people to use The fc-cache code uses stat() directly, but we already have a FcStat helper to workaround misc issues, so export it and convert fc-cache over. This will be even more important when we add --root support. Signed-off-by: Mike Frysinger --- diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index 98039f7..64eb22a 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -154,7 +154,7 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, continue; } - if (stat ((char *) dir, &statb) == -1) + if (FcStat (dir, &statb) == -1) { switch (errno) { case ENOENT: @@ -304,7 +304,7 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose) else { target_dir = FcCacheDir (cache); - if (stat ((char *) target_dir, &target_stat) < 0) + if (FcStat (target_dir, &target_stat) < 0) { if (verbose) printf ("%s: %s: missing directory: %s \n", diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index 254acc3..cba961d 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -307,6 +307,9 @@ FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4); /* fccache.c */ +FcPublic int +FcStat (const FcChar8 *file, struct stat *statb); + FcPublic const FcChar8 * FcCacheDir(const FcCache *c);