]> git.wh0rd.org - fontconfig.git/commitdiff
Bump version to 2.3.93. fc-2_3_93
authorPatrick Lam <plam@MIT.EDU>
Wed, 21 Dec 2005 03:31:19 +0000 (03:31 +0000)
committerPatrick Lam <plam@MIT.EDU>
Wed, 21 Dec 2005 03:31:19 +0000 (03:31 +0000)
Use open instead of fopen (requested by Phil Race for Sun).
src/fccache.c (FcDirCacheWrite);
Fix GCC4 warning and Makefile brokenness for /var/cache/fontconfig dir.

ChangeLog
README
configure.in
fc-cache/Makefile.am
fontconfig/fontconfig.h
src/fccache.c
src/fcxml.c

index f296a88ddbf4561a35e9b38eddb5b3c3d7b80305..b9bd677c8791db633220e26585884f4022f44fb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,24 @@
+2005-12-20  Patrick Lam         <plam@mit.edu>
+       * ChangeLog:
+       * README:
+       * configure.in:
+       * fontconfig/fontconfig.h:
+
+       Bump version to 2.3.93.
+
 2005-12-20  Patrick Lam  <plam@mit.edu>
+       * src/fcxml.c (FcConfigParseAndLoad):
+
+       Use open instead of fopen (requested by Phil Race for Sun).
+
+2005-12-20  Patrick Lam         <plam@mit.edu>
+       * src/fccache.c (FcDirCacheWrite);
+       * fc-cache/Makefile.am:
+
+       Fix GCC4 warning and Makefile brokenness for /var/cache/fontconfig
+       dir.
+
+2005-12-20  Patrick Lam         <plam@mit.edu>
        * src/fcfreetype.c (FcFreeTypeQuery):
 
        Restore code to skip over PCF fonts that have no encoded
diff --git a/README b/README
index 9008d5eed07637f072c75c554331ac88013ca86d..81b6bc65a8000a1296ca1a75a0ae40fffe65619d 100644 (file)
--- a/README
+++ b/README
@@ -1,11 +1,24 @@
                        Fontconfig
        Font configuration and customization library
-                     Version 2.3.92
-                        2005-11-04
+                     Version 2.3.93
+                        2005-12-12
 
 Check INSTALL for compilation and installation instructions.
 Report bugs to https://bugs.freedesktop.org in the fontconfig module.
 
+2.3.93
+
+Create cache files in /var/cache/fontconfig with hashed filenames, if
+possible, for added FHS compliance.  
+Make fc-cat read both per-directory and global cache files.  
+Add config file for Persian fonts from Sharif FarsiWeb, Inc.  
+Major performance improvements by Dirk Mueller, Stephen Kulow, and Michael Matz at SuSE: in particular, speed up FcFontSetMatch, and inline many functions.
+Fix treatment of globs in config files, broken since 2.3.2 and discovered by Mathias Clasen.
+Don't use freetype internal headers (patch by Matthias Clasen).  
+Further space improvements: create langsets statically, so that they can live in .rodata.
+Properly align mmapped data structures to make e.g. ia64 happy.  
+Bug fixes.
+
 2.3.92
 
 Fix corrupted caches bugs from 2.3.91 (reported by Mike Fabian).
index 797d27fc48b115cc585d49490308806a6c6f31c2..202e32a4647af82c92bad8fa211d757e73172d94 100644 (file)
@@ -33,7 +33,7 @@ dnl This is the package version number, not the shared library
 dnl version.  This same version number must appear in fontconfig/fontconfig.h
 dnl Yes, it is a pain to synchronize version numbers.  Unfortunately, it's
 dnl not possible to extract the version number here from fontconfig.h
-AM_INIT_AUTOMAKE(fontconfig, 2.3.92)
+AM_INIT_AUTOMAKE(fontconfig, 2.3.93)
 AM_MAINTAINER_MODE
 
 dnl libtool versioning
index fb9a8c9f3bf8e27d443e2d0c22d55f9c4d2b8da8..662320d07646a86720996bad97890cf758694d1b 100644 (file)
@@ -31,6 +31,14 @@ AM_CPPFLAGS = -DPKGCACHEDIR='"${pkgcachedir}"'
 
 pkgcache_DATA=stamp
 
+uninstall-pkgcacheDATA:
+       @$(NORMAL_UNINSTALL)
+       echo " $(RM) -rf '$(DESTDIR)$(pkgcachedir)'"; \
+       $(RM) -rf "$(DESTDIR)$(pkgcachedir)"
+
+clean-generic:
+       $(RM) stamp
+
 stamp:
        touch $@
 
index 515d8672a9efd8ccf8883a3caa22e609b056ce4a..63434d24774b0a57db3433e715f245cb825eddf6 100644 (file)
@@ -46,7 +46,7 @@ typedef int           FcBool;
 
 #define FC_MAJOR       2
 #define FC_MINOR       3
-#define FC_REVISION    92
+#define FC_REVISION    93
 
 #define FC_VERSION     ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
 
index 311fb7d8903022de7dbd5bf0316369294139a9d4..98f6d006bb2a66b0f490b5bd3cdeea11192c36eb 100644 (file)
@@ -669,18 +669,55 @@ FcDirCacheHasCurrentArch (const FcChar8 *dir)
 FcBool
 FcDirCacheUnlink (const FcChar8 *dir)
 {
-    FcChar8     *cache_file = FcStrPlus (dir, (FcChar8 *) "/" FC_DIR_CACHE_FILE);
+    char       *cache_file = (char *)FcStrPlus (dir, (FcChar8 *) "/" FC_DIR_CACHE_FILE);
+    char       *cache_hashed;
+    int                fd, collisions;
     struct stat        cache_stat;
+    char       name_buf[FC_MAX_FILE_LEN];
 
+    /* First remove normal cache file. */
     if (stat ((char *) cache_file, &cache_stat) == 0 &&
        unlink ((char *)cache_file) != 0)
+       goto bail;
+
+    /* Next remove any applicable hashed files. */
+    fd = -1; collisions = 0;
+    do
     {
-       FcStrFree (cache_file);
-        return FcFalse;
+       cache_hashed = FcDirCacheHashName (cache_file, collisions++);
+       if (!cache_hashed)
+           goto bail;
+
+       if (fd > 0)
+           close (fd);
+       fd = open(cache_hashed, O_RDONLY);
+       if (fd == -1)
+       {
+           FcStrFree ((FcChar8 *)cache_file);
+           return FcTrue;
+       }
+
+       FcCacheReadString (fd, name_buf, sizeof (name_buf));
+       if (!strlen(name_buf))
+           goto bail;
+    } while (strcmp (name_buf, cache_file) != 0);
+
+    FcStrFree ((FcChar8 *)cache_file);
+    close (fd);
+
+    if (stat ((char *) cache_hashed, &cache_stat) == 0 &&
+       unlink ((char *)cache_hashed) != 0)
+    {
+       FcStrFree ((FcChar8 *)cache_hashed);
+       goto bail;
     }
 
-    FcStrFree (cache_file);
+    FcStrFree ((FcChar8 *)cache_hashed);
     return FcTrue;
+
+ bail:
+    FcStrFree ((FcChar8 *)cache_file);
+    return FcFalse;
 }
 
 static int
@@ -856,6 +893,8 @@ FcDirCacheOpen (char *cache_file)
        if (fd > 0)
            close (fd);
        fd = open(cache_hashed, O_RDONLY);
+       FcStrFree ((FcChar8 *)cache_hashed);
+
        if (fd == -1)
            return -1;
        FcCacheReadString (fd, name_buf, sizeof (name_buf));
@@ -999,7 +1038,7 @@ FcBool
 FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
 {
     char           *cache_file;
-    char           *cache_to_open;
+    char           *cache_hashed;
     int            fd, fd_orig, i, dirs_count;
     FcAtomic       *atomic;
     FcCache        metadata;
@@ -1020,13 +1059,13 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
     fd = -1; collisions = 0;
     do
     {
-       cache_to_open = FcDirCacheHashName (cache_file, collisions++);
-       if (!cache_to_open)
+       cache_hashed = FcDirCacheHashName (cache_file, collisions++);
+       if (!cache_hashed)
            goto bail0;
 
        if (fd > 0)
            close (fd);
-       fd = open(cache_to_open, O_RDONLY);
+       fd = open(cache_hashed, O_RDONLY);
        if (fd == -1)
            break;
        FcCacheReadString (fd, name_buf, sizeof (name_buf));
@@ -1047,7 +1086,7 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
     if (FcDebug () & FC_DBG_CACHE)
         printf ("FcDirCacheWriteDir cache_file \"%s\"\n", cache_file);
 
-    atomic = FcAtomicCreate ((FcChar8 *)cache_to_open);
+    atomic = FcAtomicCreate ((FcChar8 *)cache_hashed);
     if (!atomic)
        goto bail1;
 
@@ -1056,7 +1095,7 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
        /* Now try rewriting the original version of the file. */
        FcAtomicDestroy (atomic);
 
-       atomic = FcAtomicCreate (cache_file);
+       atomic = FcAtomicCreate ((FcChar8 *)cache_file);
        fd_orig = open (cache_file, O_RDONLY);
        if (fd_orig == -1)
            fd_orig = open((char *)FcAtomicOrigFile (atomic), O_RDONLY);
@@ -1133,6 +1172,7 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
     close(fd);
     if (!FcAtomicReplaceOrig(atomic))
         goto bail5;
+    FcStrFree ((FcChar8 *)cache_hashed);
     FcAtomicUnlock (atomic);
     FcAtomicDestroy (atomic);
     return FcTrue;
@@ -1146,7 +1186,7 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
  bail2:
     FcAtomicDestroy (atomic);
  bail1:
-    free (cache_to_open);
+    FcStrFree ((FcChar8 *)cache_hashed);
  bail0:
     unlink ((char *)cache_file);
     free (cache_file);
index ce92f649cc2d7107f47d9178e17c059b02841020..0aaec1db85663172a0a55a981a5b69c0080b09ee 100644 (file)
@@ -22,6 +22,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <fcntl.h>
 #include <stdarg.h>
 #include "fcint.h"
 #include <dirent.h>
@@ -2355,7 +2356,7 @@ FcConfigParseAndLoad (FcConfig        *config,
 
     XML_Parser     p;
     FcChar8        *filename;
-    FILE           *f;
+    int                    fd;
     int                    len;
     FcConfigParse   parse;
     FcBool         error = FcTrue;
@@ -2393,8 +2394,8 @@ FcConfigParseAndLoad (FcConfig        *config,
     if (FcDebug () & FC_DBG_CONFIG)
        printf ("\tLoading config file %s\n", filename);
 
-    f = fopen ((char *) filename, "r");
-    if (!f) { 
+    fd = open ((char *) filename, O_RDONLY);
+    if (fd == -1) { 
        FcStrFree (filename);
        goto bail0;
     }
@@ -2439,7 +2440,7 @@ FcConfigParseAndLoad (FcConfig        *config,
            goto bail3;
        }
 #endif
-       len = fread (buf, 1, BUFSIZ, f);
+       len = read (fd, buf, BUFSIZ);
        if (len < 0)
        {
            FcConfigMessage (&parse, FcSevereError, "failed reading config file");
@@ -2463,8 +2464,8 @@ bail3:
 bail2:
     XML_ParserFree (p);
 bail1:
-    fclose (f);
-    f = NULL;
+    close (fd);
+    fd = -1;
 bail0:
     if (error && complain)
     {