summaryrefslogtreecommitdiff
path: root/fc-cat
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2005-12-09 16:36:45 +0000
committerPatrick Lam <plam@MIT.EDU>2005-12-09 16:36:45 +0000
commitea44e2184198aba956e39ae63a4914544c9719fe (patch)
treeab8fb172d3b0e371c930e9fb45b10b5d92e31a0a /fc-cat
parent204da5a8b88a73e54a9bab0537db7ff4fe8c6374 (diff)
Migrate cache files from fonts directories to /var/cache/fontconfig. This
helps make fontconfig FHS-compliant, but requires that all caches get rebuilt. Also, autogen.sh now needs the additional parameter --localstatedir=/var.
Diffstat (limited to 'fc-cat')
-rw-r--r--fc-cat/Makefile.am2
-rw-r--r--fc-cat/fc-cat.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/fc-cat/Makefile.am b/fc-cat/Makefile.am
index cf340090..55a755e4 100644
--- a/fc-cat/Makefile.am
+++ b/fc-cat/Makefile.am
@@ -27,6 +27,8 @@ FC_CAT_SRC=${top_srcdir}/fc-cat
SGML = ${FC_CAT_SRC}/fc-cat.sgml
+AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"'
+
INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS)
bin_PROGRAMS=fc-cat
diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c
index 1414bc89..f088e458 100644
--- a/fc-cat/fc-cat.c
+++ b/fc-cat/fc-cat.c
@@ -184,7 +184,8 @@ FcCacheGlobalFileReadAndPrint (FcFontSet * set, FcStrSet *dirs, char * dir, char
if (fd == -1)
goto bail;
- current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name);
+ current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name,
+ FcTrue);
if (current_arch_start < 0)
goto bail1;
@@ -225,6 +226,7 @@ FcCacheFileRead (FcFontSet * set, FcStrSet *dirs, char * dir, char *cache_file)
char candidate_arch_machine_name[9+MACHINE_SIGNATURE_SIZE];
off_t current_arch_start = 0;
char subdirName[FC_MAX_FILE_LEN + 1 + 12 + 1];
+ char name_buf[8192];
if (!cache_file)
goto bail;
@@ -234,7 +236,14 @@ FcCacheFileRead (FcFontSet * set, FcStrSet *dirs, char * dir, char *cache_file)
if (fd == -1)
goto bail;
- current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name);
+ FcCacheReadString (fd, name_buf, sizeof (name_buf));
+ if (!strlen (name_buf))
+ goto bail;
+ printf ("fc-cat: printing directory cache contents for dir %s\n",
+ name_buf);
+
+ current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name,
+ FcFalse);
if (current_arch_start < 0)
goto bail1;