Bump version to 2.3.93.

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.
This commit is contained in:
Patrick Lam 2005-12-21 03:31:19 +00:00
parent 6f767cec49
commit 3bfae75d44
7 changed files with 103 additions and 21 deletions

View File

@ -1,3 +1,23 @@
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):

17
README
View File

@ -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).

View 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

View 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 $@

View 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))

View 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;
}
FcStrFree (cache_file);
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 ((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);

View 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)
{