]> git.wh0rd.org - fontconfig.git/commitdiff
Merge branch 'jhcloos'
authorKeith Packard <keithp@neko.keithp.com>
Sat, 9 Sep 2006 22:49:24 +0000 (15:49 -0700)
committerKeith Packard <keithp@neko.keithp.com>
Sat, 9 Sep 2006 22:49:24 +0000 (15:49 -0700)
40 files changed:
.gitignore
Makefile.am
README
configure.in
fc-arch/Makefile.am
fc-arch/fcarch.tmpl.h
fc-cache/fc-cache.c
fc-case/Makefile.am
fc-cat/Makefile.am
fc-cat/fc-cat.c
fc-glyphname/Makefile.am
fc-lang/Makefile.am
fc-lang/fc-lang.c
fontconfig/fcfreetype.h
fontconfig/fontconfig.h
src/Makefile.am
src/fcatomic.c
src/fcblanks.c
src/fccache.c
src/fccfg.c
src/fccharset.c
src/fcdbg.c
src/fcdefault.c
src/fcdir.c
src/fcfreetype.c
src/fcfs.c
src/fcinit.c
src/fcint.h
src/fclang.c
src/fclist.c
src/fcmatch.c
src/fcmatrix.c
src/fcname.c
src/fcpat.c
src/fcserialize.c
src/fcstr.c
src/fcxml.c
src/ftglue.c
src/ftglue.h
src/makealias [new file with mode: 0755]

index 255a1f97f9cb91d95917c28ef45d81020fd41665..66a71cf2808893c0793b7258c6c292bbd6b64547 100644 (file)
@@ -1,3 +1,5 @@
+fcalias.h
+fcaliastail.h
 tags
 *.tar.gz
 .libs
index a7a60154619b7314263e175fe7426f7b56f613d9..1ebb86978c031dd935ce677a9726e4588a2aa35b 100644 (file)
@@ -85,7 +85,7 @@ $(srcdir)/ChangeLog:
 .PHONY: ChangeLog $(srcdir)/ChangeLog
 
 install-data-local:
-       $(mkinstalldirs) $(DESTDIR)$(configdir)
+       $(mkinstalldirs) $(DESTDIR)$(configdir) $(DESTDIR)$(fc_cachedir)
        if [ -f $(DESTDIR)$(configdir)/fonts.conf ]; then \
          echo "backing up existing $(DESTDIR)$(configdir)/fonts.conf"; \
          mv $(DESTDIR)$(configdir)/fonts.conf $(DESTDIR)$(configdir)/fonts.conf.bak; \
@@ -97,7 +97,7 @@ install-data-local:
          echo " $(INSTALL_DATA) fonts.conf $(DESTDIR)$(configdir)/fonts.conf"; \
          $(INSTALL_DATA) fonts.conf $(DESTDIR)$(configdir)/fonts.conf; \
        fi; fi
-       @(if $(RUN_FC_CACHE_TEST); then \
+       (if $(RUN_FC_CACHE_TEST); then \
            echo " fc-cache/fc-cache -s -f -v"; \
            fc-cache/fc-cache -s -f -v; \
        else \
diff --git a/README b/README
index 9cae1abd23dc398af53fafebcc396f598ff3cc19..288a53b553e7d76f528b8c780061078950ec6e32 100644 (file)
--- a/README
+++ b/README
@@ -1,12 +1,49 @@
                        Fontconfig
        Font configuration and customization library
-                     Version 2.3.96
-                        2006-09-03
+                     Version 2.3.97
+                        2006-09-06
 
 
 Check INSTALL for compilation and installation instructions.
 Report bugs to https://bugs.freedesktop.org in the fontconfig module.
 
+2.3.97
+
+Carl Worth:
+      Rename FcPatternThawAll to FcPatternFini.
+      Add a configuration file that disables hinting for the Lohit Gujarati font
+
+Keith Packard:
+      Various GCC 4 cleanups for signed vs unsigned char
+      Finish INSTALL changes. .gitignore ChangeLog
+      Merge branch 'fc-2_4_branch' to master
+      Remove all .cvsignore files
+      Hide private functions in shared library. Export functionality for utilities.
+      Hide FreeType glue code from library ABI.
+      Can't typecheck values for objects with no known type.
+      Leave cache files mapped permanently.
+      Reference count cache objects.
+      Make cache reference counting more efficient.
+      Oops, fc-lang broke when I added cache referencing.
+      Correct reference count when sharing cache file objects.
+      Eliminate .so PLT entries for local symbols. (thanks to Arjan van de Ven)
+      Update architecture signatures for x86-64 and ppc.
+      Parallel build fix for fcalias.h and fcaliastail.h
+      Charset hashing depended on uniqueness of leaves.
+
+Patrick Lam:
+      file Makefile.am was initially added on branch fc-2_4_branch.
+      Modify config file to use Greek fonts before Asian fonts with Greek glyphs.
+      Use libtool -no-undefined flag on all platforms.
+      file ftglue.c was initially added on branch fc-2_4_branch.
+      2005-11-23 Frederic Crozat <fcrozat@mandriva.com>: reviewed by: plam
+      file 10-fonts-persian.conf was initially added on branch fc-2_4_branch.
+      Sort directory entries while scanning them from disk; prevents Heisenbugs
+      file ln.orth was initially added on branch fc-2_4_branch.
+      Fix typos in orth files. Reported by Denis Jacquerye.
+      On Windows, unlink before rename. Reported by Tim Evans.
+      file fc-match.sgml was initially added on branch fc-2_4_branch.
+
 2.3.96
 
 Keith Packard:
index 5a6309da571971e0a59e923c6cffc86e8d39aaf1..d8afffbbe669d1d4f07128129928211ae52ed60b 100644 (file)
@@ -33,16 +33,19 @@ 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.96)
+AM_INIT_AUTOMAKE(fontconfig, 2.3.97)
 AM_MAINTAINER_MODE
 
 dnl libtool versioning
 
-LT_CURRENT=1
-LT_REVISION=4
+dnl bump revision when fixing bugs
+dnl bump current and age, reset revision to zero when adding APIs
+dnl bump current, leave age, reset revision to zero when changing/removing APIS
+LT_CURRENT=2
+LT_REVISION=0
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
-LT_AGE=0
+LT_AGE=1
 
 LT_VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
 AC_SUBST(LT_VERSION_INFO)
index 8db30bbaa8528d76dca57767a46aba3d9b99b50d..819e37ac93a74df08112c0088383c0b707d62296 100644 (file)
@@ -47,4 +47,11 @@ $(TARG):fc-arch${EXEEXT} $(STMPL) ${top_srcdir}/src/fcint.h ../config.h
        rm -f $(TARG)
        ./fc-arch${EXEEXT} $(ARCHITECTURE) < $(STMPL) > $(TARG)
 
-CLEANFILES=$(TARG)
+ALIAS_FILES = fcalias.h fcaliastail.h
+
+BUILT_SOURCES = $(ALIAS_FILES)
+
+$(ALIAS_FILES): 
+       touch $(ALIAS_FILES)
+
+CLEANFILES=$(TARG) $(ALIAS_FILES)
index 5b0afbcfa6c727352894d599fd0f6366bca741e5..7b20b21c7c9cbd0388f0c3021842686dffba748a 100644 (file)
@@ -30,5 +30,5 @@
 @@@
 @@@ name    endian   char     char*    int      intptr_t Pattern  EltPtr   Elt *    Elt      ObjPtr   VLPtr    Value    Binding  VL *     CharSet  Leaf**   Char16 * Char16   Leaf     Char32   Cache
 x86        78563412_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_0000000c_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_0000001c
-x86-64     78563412
-ppc        12345678
+x86-64     78563412_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000030
+ppc        12345678_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_00000010_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_0000001c
index f20d3a7c07203903d0aa5336b27450c075252860..de29351d4dba90fa1e8711fab18fa690752ea769 100644 (file)
@@ -31,7 +31,7 @@
 #define HAVE_GETOPT 1
 #endif
 
-#include "fcint.h"
+#include <fontconfig/fontconfig.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -130,15 +130,14 @@ nsubdirs (FcStrSet *set)
 static int
 scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose)
 {
-    int                ret = 0;
-    const FcChar8 *dir;
-    FcFontSet  *set;
-    FcStrSet   *subdirs;
-    FcStrList  *sublist;
-    FcCache    *cache;
-    struct stat        statb;
-    FcBool     was_valid;
-    int                i;
+    int                    ret = 0;
+    const FcChar8   *dir;
+    FcStrSet       *subdirs;
+    FcStrList      *sublist;
+    FcCache        *cache;
+    struct stat            statb;
+    FcBool         was_valid;
+    int                    i;
     
     /*
      * Now scan all of the directories into separate databases
@@ -223,19 +222,17 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
            }
        }
 
-       set = FcCacheSet (cache);
-
        if (was_valid)
        {
            if (verbose)
                printf ("skipping, %d fonts, %d dirs\n",
-                       set->nfont, cache->dirs_count);
+                       FcCacheNumFont (cache), FcCacheNumSubdir (cache));
        }
        else
        {
            if (verbose)
                printf ("caching, %d fonts, %d dirs\n", 
-                       set->nfont, cache->dirs_count);
+                       FcCacheNumFont (cache), FcCacheNumSubdir (cache));
 
            if (!FcDirCacheValid (dir))
            {
@@ -253,7 +250,7 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
            FcDirCacheUnload (cache);
            continue;
        }
-       for (i = 0; i < cache->dirs_count; i++)
+       for (i = 0; i < FcCacheNumSubdir (cache); i++)
            FcStrSetAdd (subdirs, FcCacheSubdir (cache, i));
        
        FcDirCacheUnload (cache);
@@ -264,7 +261,6 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
        {
            fprintf (stderr, "%s: Can't create subdir list\n", dir);
            ret++;
-           FcDirCacheUnload (cache);
            continue;
        }
        FcStrSetAdd (processed_dirs, dir);
@@ -311,7 +307,7 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose)
     while ((ent = readdir (d)))
     {
        FcChar8 *file_name;
-       FcChar8 *target_dir;
+       const FcChar8   *target_dir;
 
        if (ent->d_name[0] == '.')
            continue;
index 11da16eabc4eec96da2bc08e933ed1e93f6d51c7..e498da0f5ca686408819966be4cd23c64ddb91a7 100644 (file)
@@ -52,5 +52,12 @@ $(TARG): $(STMPL) fc-case$(EXEEXT) $(SCASEFOLDING)
        rm -f $(TARG)
        ./fc-case$(EXEEXT) $(SCASEFOLDING) < $(STMPL) > $(TARG)
 
-CLEANFILES=$(TARG)
+ALIAS_FILES = fcalias.h fcaliastail.h
+
+BUILT_SOURCES = $(ALIAS_FILES)
+
+$(ALIAS_FILES): 
+       touch $(ALIAS_FILES)
+
+CLEANFILES=$(TARG) $(ALIAS_FILES)
 
index 91e5ad720baf69e46a3d7edd83b96b5aa2cfc52c..828f138b7481c968ded18eb2d85809f1f5dfb804 100644 (file)
@@ -27,7 +27,7 @@ FC_CAT_SRC=${top_srcdir}/fc-cat
 
 SGML = ${FC_CAT_SRC}/fc-cat.sgml
 
-INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS)
+INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS) $(WARN_CFLAGS)
 
 bin_PROGRAMS=fc-cat
 
index bb804ab0271c1af7d8dfc2f59d976c138ddd9622..476798e49d1ba4c675a1c784a66f6501748efff3 100644 (file)
 #define HAVE_GETOPT 1
 #endif
 
-#include "../src/fccache.c"
+#include <fontconfig/fontconfig.h>
 #include "../fc-arch/fcarch.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -173,20 +174,20 @@ usage (char *program)
  */
 
 static const FcChar8 *
-file_base_name (const char *cache, const FcChar8 *file)
+file_base_name (const FcChar8 *cache, const FcChar8 *file)
 {
-    const FcChar8   *cache_slash;
-    int                    cache_len = strlen (cache);
+    int                    cache_len = strlen ((char *) cache);
 
-    if (!strncmp (cache, file, cache_len) && file[cache_len] == '/')
+    if (!strncmp ((char *) cache, (char *) file, cache_len) && file[cache_len] == '/')
        return file + cache_len + 1;
     return file;
 }
 
+#define FC_FONT_FILE_DIR       ((FcChar8 *) ".dir")
+
 static FcBool
-cache_print_set (FcFontSet *set, FcStrSet *dirs, char *base_name, FcBool verbose)
+cache_print_set (FcFontSet *set, FcStrSet *dirs, const FcChar8 *base_name, FcBool verbose)
 {
-    FcPattern      *font;
     FcChar8        *name, *dir;
     const FcChar8   *file, *base;
     int                    ret;
@@ -219,9 +220,7 @@ cache_print_set (FcFontSet *set, FcStrSet *dirs, char *base_name, FcBool verbose
     
     for (n = 0; n < set->nfont; n++)
     {
-       FcPattern   **fonts = FcFontSetFonts (set);
-       FcPattern   *encoded_font = fonts[n];
-       FcPattern   *font = FcEncodedOffsetToPtr (set, encoded_font, FcPattern);
+       FcPattern   *font = set->fonts[n];
 
        if (FcPatternGetString (font, FC_FILE, 0, (FcChar8 **) &file) != FcResultMatch)
            goto bail3;
@@ -321,7 +320,7 @@ main (int argc, char **argv)
     {
        for (; i < argc; i++)
        {
-           if (!FcStrSetAddFilename (args, argv[i]))
+           if (!FcStrSetAddFilename (args, (const FcChar8 *) argv[i]))
            {
                fprintf (stderr, "%s: malloc failure\n", argv[0]);
                return 1;
@@ -356,8 +355,6 @@ main (int argc, char **argv)
     while ((arg = FcStrListNext (arglist)))
     {
        int         j;
-       off_t       size;
-       intptr_t    *cache_dirs;
        FcChar8     *cache_file = NULL;
        struct stat file_stat;
        
@@ -373,17 +370,12 @@ main (int argc, char **argv)
        }
        
        dirs = FcStrSetCreate ();
-       fs = FcCacheSet (cache);
-       cache_dirs = FcCacheDirs (cache);
-       for (j = 0; j < cache->dirs_count; j++) 
+       fs = FcCacheCopySet (cache);
+       for (j = 0; j < FcCacheNumSubdir (cache); j++) 
        {
-           FcStrSetAdd (dirs, FcOffsetToPtr (cache_dirs,
-                                             cache_dirs[j],
-                                             FcChar8));
+           FcStrSetAdd (dirs, FcCacheSubdir (cache, j));
            if (recurse)
-               FcStrSetAdd (args, FcOffsetToPtr (cache_dirs,
-                                             cache_dirs[j],
-                                             FcChar8));
+               FcStrSetAdd (args, FcCacheSubdir (cache, j));
        }
 
        if (verbose)
@@ -398,6 +390,7 @@ main (int argc, char **argv)
 
        FcStrSetDestroy (dirs);
 
+       FcFontSetDestroy (fs);
        FcDirCacheUnload (cache);
        if (cache_file)
            FcStrFree (cache_file);
index eb21101793cc0b21bb212f08f2f4266c83920be0..063ba006b77a2090c18b287809d6a9e5047ba18d 100644 (file)
@@ -47,5 +47,12 @@ $(TARG): $(STMPL) fc-glyphname$(EXEEXT) $(SGLYPHNAME)
        rm -f $(TARG)
        ./fc-glyphname$(EXEEXT) $(SGLYPHNAME) < $(STMPL) > $(TARG)
 
-CLEANFILES=$(TARG)
+ALIAS_FILES = fcalias.h fcaliastail.h
+
+BUILT_SOURCES = $(ALIAS_FILES)
+
+$(ALIAS_FILES): 
+       touch $(ALIAS_FILES)
+
+CLEANFILES=$(TARG) $(ALIAS_FILES)
 
index 5077810cbfcb6f4ab069dabab0eac08e5008dacb..8ca93991b6810e78e8e3094a51c7cca64b668eed 100644 (file)
@@ -46,4 +46,11 @@ $(TARG):$(ORTH) fc-lang${EXEEXT} $(STMPL)
        rm -f $(TARG)
        ./fc-lang${EXEEXT} -d ${srcdir} $(ORTH) < $(STMPL) > $(TARG)
 
-CLEANFILES=$(TARG)
+ALIAS_FILES = fcalias.h fcaliastail.h
+
+BUILT_SOURCES = $(ALIAS_FILES)
+
+$(ALIAS_FILES): 
+       touch $(ALIAS_FILES)
+
+CLEANFILES = $(TARG) $(ALIAS_FILES)
index 69dfac25a76582c82598640ac7fa526ec173bf3d..92a62ce631b27c447750b4896766a647529f917e 100644 (file)
@@ -22,7 +22,6 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-#include "fcint.h"
 #include "fccharset.c"
 #include "fcstr.c"
 #include "fcserialize.c"
@@ -48,6 +47,16 @@ FcMemFree (int kind, int size)
 {
 }
 
+FcPrivate void
+FcCacheObjectReference (void *object)
+{
+}
+
+FcPrivate void
+FcCacheObjectDereference (void *object)
+{
+}
+
 int FcDebugVal;
 
 FcChar8 *
index a6cf2e64c15876503ab05a615a6f023793cb65ac..0c2a81c45532cb67a827a0fdf4d5439a84cfb7b9 100644 (file)
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+#ifndef FcPublic
+#define FcPublic
+#endif
+
 _FCFUNCPROTOBEGIN
 
-FT_UInt
+FcPublic FT_UInt
 FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4);
 
-FcCharSet *
+FcPublic FcCharSet *
 FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing);
     
-FcCharSet *
+FcPublic FcCharSet *
 FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks);
 
-FcResult
+FcPublic FcResult
 FcPatternGetFTFace (const FcPattern *p, const char *object, int n, FT_Face *f);
 
-FcBool
+FcPublic FcBool
 FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f);
 
 _FCFUNCPROTOEND
index 6ca1cf4548773d5d9b0b227906c3a1ccffaefec3..927249a5c07dcb126ce3b376513b40f957a15d38 100644 (file)
@@ -25,6 +25,9 @@
 #ifndef _FONTCONFIG_H_
 #define _FONTCONFIG_H_
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <stdarg.h>
 
 #if defined(__GNUC__) && (__GNUC__ >= 4)
 #define FC_ATTRIBUTE_SENTINEL(x)
 #endif
 
+#ifndef FcPublic
+#define FcPublic
+#endif
+
 typedef unsigned char  FcChar8;
 typedef unsigned short FcChar16;
 typedef unsigned int   FcChar32;
@@ -46,7 +53,7 @@ typedef int           FcBool;
 
 #define FC_MAJOR       2
 #define FC_MINOR       3
-#define FC_REVISION    96
+#define FC_REVISION    97
 
 #define FC_VERSION     ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
 
@@ -271,169 +278,207 @@ typedef struct _FcStrList   FcStrList;
 
 typedef struct _FcStrSet    FcStrSet;
 
-_FCFUNCPROTOBEGIN
+typedef struct _FcCache            FcCache;
 
-FcBool
-FcDirCacheValid (const FcChar8 *cache_file);
+_FCFUNCPROTOBEGIN
 
 /* fcblanks.c */
-FcBlanks *
+FcPublic FcBlanks *
 FcBlanksCreate (void);
 
-void
+FcPublic void
 FcBlanksDestroy (FcBlanks *b);
 
-FcBool
+FcPublic FcBool
 FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
 
-FcBool
+FcPublic FcBool
 FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
 
+/* fccache.c */
+
+FcPublic const FcChar8 *
+FcCacheDir(const FcCache *c);
+
+FcPublic FcFontSet *
+FcCacheCopySet(const FcCache *c);
+
+FcPublic const FcChar8 *
+FcCacheSubdir (const FcCache *c, int i);
+
+FcPublic int
+FcCacheNumSubdir (const FcCache *c);
+
+FcPublic int
+FcCacheNumFont (const FcCache *c);
+
+FcPublic FcBool
+FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
+
+FcPublic FcBool
+FcDirCacheValid (const FcChar8 *cache_file);
+
 /* fccfg.c */
-FcChar8 *
+FcPublic FcChar8 *
 FcConfigHome (void);
 
-FcBool
+FcPublic FcBool
 FcConfigEnableHome (FcBool enable);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcConfigFilename (const FcChar8 *url);
     
-FcConfig *
+FcPublic FcConfig *
 FcConfigCreate (void);
 
-void
+FcPublic void
 FcConfigDestroy (FcConfig *config);
 
-FcBool
+FcPublic FcBool
 FcConfigSetCurrent (FcConfig *config);
 
-FcConfig *
+FcPublic FcConfig *
 FcConfigGetCurrent (void);
 
-FcBool
+FcPublic FcBool
 FcConfigUptoDate (FcConfig *config);
     
-FcBool
+FcPublic FcBool
 FcConfigBuildFonts (FcConfig *config);
 
-FcStrList *
+FcPublic FcStrList *
 FcConfigGetFontDirs (FcConfig   *config);
 
-FcStrList *
+FcPublic FcStrList *
 FcConfigGetConfigDirs (FcConfig   *config);
 
-FcStrList *
+FcPublic FcStrList *
 FcConfigGetConfigFiles (FcConfig    *config);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcConfigGetCache (FcConfig  *config);
 
-FcBlanks *
+FcPublic FcBlanks *
 FcConfigGetBlanks (FcConfig *config);
 
-int
+FcPublic FcStrList *
+FcConfigGetCacheDirs (FcConfig *config);
+
+FcPublic int
 FcConfigGetRescanInverval (FcConfig *config);
 
-FcBool
+FcPublic FcBool
 FcConfigSetRescanInverval (FcConfig *config, int rescanInterval);
 
-FcFontSet *
+FcPublic FcFontSet *
 FcConfigGetFonts (FcConfig     *config,
                  FcSetName     set);
 
-FcBool
+FcPublic FcBool
 FcConfigAppFontAddFile (FcConfig    *config,
                        const FcChar8  *file);
 
-FcBool
+FcPublic FcBool
 FcConfigAppFontAddDir (FcConfig            *config,
                       const FcChar8   *dir);
 
-void
+FcPublic void
 FcConfigAppFontClear (FcConfig     *config);
 
-FcBool
+FcPublic FcBool
 FcConfigSubstituteWithPat (FcConfig    *config,
                           FcPattern    *p,
                           FcPattern    *p_pat,
                           FcMatchKind  kind);
 
-FcBool
+FcPublic FcBool
 FcConfigSubstitute (FcConfig   *config,
                    FcPattern   *p,
                    FcMatchKind kind);
 
 /* fccharset.c */
-FcCharSet *
+FcPublic FcCharSet*
 FcCharSetCreate (void);
 
-void
+/* deprecated alias for FcCharSetCreate */
+FcPublic FcCharSet *
+FcCharSetNew (void);
+    
+FcPublic void
 FcCharSetDestroy (FcCharSet *fcs);
 
-FcBool
+FcPublic FcBool
 FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
 
-FcCharSet *
+FcPublic FcCharSet*
 FcCharSetCopy (FcCharSet *src);
 
-FcBool
+FcPublic FcBool
 FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
 
-FcCharSet *
+FcPublic FcCharSet*
 FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
 
-FcCharSet *
+FcPublic FcCharSet*
 FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
 
-FcCharSet *
+FcPublic FcCharSet*
 FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
 
-FcBool
+FcPublic FcBool
 FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
 
-FcChar32
+FcPublic FcChar32
 FcCharSetCount (const FcCharSet *a);
 
-FcChar32
+FcPublic FcChar32
 FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
 
-FcChar32
+FcPublic FcChar32
 FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
 
-FcBool
+FcPublic FcBool
 FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
 
 #define FC_CHARSET_MAP_SIZE (256/32)
 #define FC_CHARSET_DONE        ((FcChar32) -1)
 
-FcChar32
+FcPublic FcChar32
 FcCharSetFirstPage (const FcCharSet *a, 
                    FcChar32        map[FC_CHARSET_MAP_SIZE],
                    FcChar32        *next);
 
-FcChar32
+FcPublic FcChar32
 FcCharSetNextPage (const FcCharSet  *a, 
                   FcChar32         map[FC_CHARSET_MAP_SIZE],
                   FcChar32         *next);
 
+/*
+ * old coverage API, rather hard to use correctly
+ */
+
+FcPublic FcChar32
+FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
 
 /* fcdbg.c */
-void
+FcPublic void
 FcValuePrint (const FcValue v);
 
-void
+FcPublic void
 FcPatternPrint (const FcPattern *p);
 
-void
+FcPublic void
 FcFontSetPrint (const FcFontSet *s);
 
 /* fcdefault.c */
-void
+FcPublic void
 FcDefaultSubstitute (FcPattern *pattern);
 
 /* fcdir.c */
-FcBool
+FcPublic FcBool
+FcFileIsDir (const FcChar8 *file);
+
+FcPublic FcBool
 FcFileScan (FcFontSet      *set,
            FcStrSet        *dirs,
            FcFileCache     *cache,
@@ -441,7 +486,7 @@ FcFileScan (FcFontSet           *set,
            const FcChar8   *file,
            FcBool          force);
 
-FcBool
+FcPublic FcBool
 FcDirScan (FcFontSet       *set,
           FcStrSet         *dirs,
           FcFileCache      *cache,
@@ -449,147 +494,159 @@ FcDirScan (FcFontSet        *set,
           const FcChar8    *dir,
           FcBool           force);
 
-FcBool
+FcPublic FcBool
 FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
 
+FcPublic FcCache *
+FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
+    
+FcPublic FcCache *
+FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
+
+FcPublic FcCache *
+FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
+
+FcPublic void
+FcDirCacheUnload (FcCache *cache);
+
 /* fcfreetype.c */
-FcPattern *
+FcPublic FcPattern *
 FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
 
 /* fcfs.c */
 
-FcFontSet *
+FcPublic FcFontSet *
 FcFontSetCreate (void);
 
-void
+FcPublic void
 FcFontSetDestroy (FcFontSet *s);
 
-FcBool
+FcPublic FcBool
 FcFontSetAdd (FcFontSet *s, FcPattern *font);
 
 /* fcinit.c */
-FcConfig *
+FcPublic FcConfig *
 FcInitLoadConfig (void);
 
-FcConfig *
+FcPublic FcConfig *
 FcInitLoadConfigAndFonts (void);
 
-FcBool
+FcPublic FcBool
 FcInit (void);
 
-void
+FcPublic void
 FcFini (void);
 
-int
+FcPublic int
 FcGetVersion (void);
 
-FcBool
+FcPublic FcBool
 FcInitReinitialize (void);
 
-FcBool
+FcPublic FcBool
 FcInitBringUptoDate (void);
 
 /* fclang.c */
-FcLangSet *
+FcPublic FcLangSet*
 FcLangSetCreate (void);
 
-void
+FcPublic void
 FcLangSetDestroy (FcLangSet *ls);
 
-FcLangSet *
+FcPublic FcLangSet*
 FcLangSetCopy (const FcLangSet *ls);
 
-FcBool
+FcPublic FcBool
 FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
 
-FcLangResult
+FcPublic FcLangResult
 FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
 
-FcLangResult
+FcPublic FcLangResult
 FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
 
-FcBool
+FcPublic FcBool
 FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
 
-FcBool
+FcPublic FcBool
 FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
 
-FcChar32
+FcPublic FcChar32
 FcLangSetHash (const FcLangSet *ls);
 
 /* fclist.c */
-FcObjectSet *
+FcPublic FcObjectSet *
 FcObjectSetCreate (void);
 
-FcBool
+FcPublic FcBool
 FcObjectSetAdd (FcObjectSet *os, const char *object);
 
-void
+FcPublic void
 FcObjectSetDestroy (FcObjectSet *os);
 
-FcObjectSet *
+FcPublic FcObjectSet *
 FcObjectSetVaBuild (const char *first, va_list va);
 
-FcObjectSet *
+FcPublic FcObjectSet *
 FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
 
-FcFontSet *
+FcPublic FcFontSet *
 FcFontSetList (FcConfig            *config,
               FcFontSet    **sets,
               int          nsets,
               FcPattern    *p,
               FcObjectSet  *os);
 
-FcFontSet *
+FcPublic FcFontSet *
 FcFontList (FcConfig   *config,
            FcPattern   *p,
            FcObjectSet *os);
 
 /* fcatomic.c */
 
-FcAtomic *
+FcPublic FcAtomic *
 FcAtomicCreate (const FcChar8   *file);
 
-FcBool
+FcPublic FcBool
 FcAtomicLock (FcAtomic *atomic);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcAtomicNewFile (FcAtomic *atomic);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcAtomicOrigFile (FcAtomic *atomic);
 
-FcBool
+FcPublic FcBool
 FcAtomicReplaceOrig (FcAtomic *atomic);
 
-void
+FcPublic void
 FcAtomicDeleteNew (FcAtomic *atomic);
 
-void
+FcPublic void
 FcAtomicUnlock (FcAtomic *atomic);
 
-void
+FcPublic void
 FcAtomicDestroy (FcAtomic *atomic);
 
 /* fcmatch.c */
-FcPattern *
+FcPublic FcPattern *
 FcFontSetMatch (FcConfig    *config,
                FcFontSet   **sets,
                int         nsets,
                FcPattern   *p,
                FcResult    *result);
 
-FcPattern *
+FcPublic FcPattern *
 FcFontMatch (FcConfig  *config,
             FcPattern  *p, 
             FcResult   *result);
 
-FcPattern *
+FcPublic FcPattern *
 FcFontRenderPrepare (FcConfig      *config,
                     FcPattern      *pat,
                     FcPattern      *font);
 
-FcFontSet *
+FcPublic FcFontSet *
 FcFontSetSort (FcConfig            *config,
               FcFontSet    **sets,
               int          nsets,
@@ -598,192 +655,198 @@ FcFontSetSort (FcConfig     *config,
               FcCharSet    **csp,
               FcResult     *result);
 
-FcFontSet *
+FcPublic FcFontSet *
 FcFontSort (FcConfig    *config,
            FcPattern    *p,
            FcBool       trim,
            FcCharSet    **csp,
            FcResult     *result);
 
-void
+FcPublic void
 FcFontSetSortDestroy (FcFontSet *fs);
 
 /* fcmatrix.c */
-FcMatrix *
+FcPublic FcMatrix *
 FcMatrixCopy (const FcMatrix *mat);
 
-FcBool
+FcPublic FcBool
 FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
 
-void
+FcPublic void
 FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
 
-void
+FcPublic void
 FcMatrixRotate (FcMatrix *m, double c, double s);
 
-void
+FcPublic void
 FcMatrixScale (FcMatrix *m, double sx, double sy);
 
-void
+FcPublic void
 FcMatrixShear (FcMatrix *m, double sh, double sv);
 
 /* fcname.c */
 
-FcBool
+FcPublic FcBool
 FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
 
-FcBool
+FcPublic FcBool
 FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
     
-const FcObjectType *
+FcPublic const FcObjectType *
 FcNameGetObjectType (const char *object);
 
-FcBool
+FcPublic FcBool
 FcNameRegisterConstants (const FcConstant *consts, int nconsts);
 
-FcBool
+FcPublic FcBool
 FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
     
-const FcConstant *
+FcPublic const FcConstant *
 FcNameGetConstant (FcChar8 *string);
 
-FcBool
+FcPublic FcBool
 FcNameConstant (FcChar8 *string, int *result);
 
-FcPattern *
+FcPublic FcPattern *
 FcNameParse (const FcChar8 *name);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcNameUnparse (FcPattern *pat);
 
 /* fcpat.c */
-FcPattern *
+FcPublic FcPattern *
 FcPatternCreate (void);
 
-FcPattern *
+FcPublic FcPattern *
 FcPatternDuplicate (const FcPattern *p);
 
-void
+FcPublic void
 FcPatternReference (FcPattern *p);
 
-void
+FcPublic void
 FcValueDestroy (FcValue v);
 
-FcBool
+FcPublic FcBool
 FcValueEqual (FcValue va, FcValue vb);
 
-FcValue
+FcPublic FcValue
 FcValueSave (FcValue v);
 
-void
+FcPublic void
 FcPatternDestroy (FcPattern *p);
 
-FcBool
+FcPublic FcBool
 FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
 
-FcBool
+FcPublic FcBool
 FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
 
-FcChar32
+FcPublic FcChar32
 FcPatternHash (const FcPattern *p);
 
-FcBool
+FcPublic FcBool
 FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
     
-FcBool
+FcPublic FcBool
 FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
     
-FcResult
+FcPublic FcResult
 FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
     
-FcBool
+FcPublic FcBool
 FcPatternDel (FcPattern *p, const char *object);
 
-FcBool
+FcPublic FcBool
 FcPatternRemove (FcPattern *p, const char *object, int id);
 
-FcBool
+FcPublic FcBool
 FcPatternAddInteger (FcPattern *p, const char *object, int i);
 
-FcBool
+FcPublic FcBool
 FcPatternAddDouble (FcPattern *p, const char *object, double d);
 
-FcBool
+FcPublic FcBool
 FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
 
-FcBool
+FcPublic FcBool
 FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
 
-FcBool
+FcPublic FcBool
 FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
 
-FcBool
+FcPublic FcBool
 FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
 
-FcBool
+FcPublic FcBool
 FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
 
-FcResult
+FcPublic FcResult
 FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
 
-FcResult
+FcPublic FcResult
 FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
 
-FcResult
+FcPublic FcResult
 FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
 
-FcResult
+FcPublic FcResult
 FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
 
-FcResult
+FcPublic FcResult
 FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
 
-FcResult
+FcPublic FcResult
 FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
 
-FcResult
+FcPublic FcResult
 FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
 
-FcPattern *
+FcPublic FcPattern *
 FcPatternVaBuild (FcPattern *orig, va_list va);
     
-FcPattern *
+FcPublic FcPattern *
 FcPatternBuild (FcPattern *orig, ...) FC_ATTRIBUTE_SENTINEL(0);
 
 /* fcstr.c */
 
-FcChar8 *
+FcPublic FcChar8 *
 FcStrCopy (const FcChar8 *s);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcStrCopyFilename (const FcChar8 *s);
     
+FcPublic FcChar8 *
+FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
+    
+FcPublic void
+FcStrFree (FcChar8 *s);
+
 /* These are ASCII only, suitable only for pattern element names */
 #define FcIsUpper(c)   ((0101 <= (c) && (c) <= 0132))
 #define FcIsLower(c)   ((0141 <= (c) && (c) <= 0172))
 #define FcToLower(c)   (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
 
-FcChar8 *
+FcPublic FcChar8 *
 FcStrDowncase (const FcChar8 *s);
 
-int
+FcPublic int
 FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
 
-int
+FcPublic int
 FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
 
-const FcChar8 *
+FcPublic const FcChar8 *
 FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
 
-const FcChar8 *
+FcPublic const FcChar8 *
 FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
 
-int
+FcPublic int
 FcUtf8ToUcs4 (const FcChar8 *src_orig,
              FcChar32      *dst,
              int           len);
 
-FcBool
+FcPublic FcBool
 FcUtf8Len (const FcChar8    *string,
           int              len,
           int              *nchar,
@@ -791,61 +854,61 @@ FcUtf8Len (const FcChar8    *string,
 
 #define FC_UTF8_MAX_LEN        6
 
-int
+FcPublic int
 FcUcs4ToUtf8 (FcChar32 ucs4,
              FcChar8   dest[FC_UTF8_MAX_LEN]);
 
-int
+FcPublic int
 FcUtf16ToUcs4 (const FcChar8   *src_orig,
               FcEndian         endian,
               FcChar32         *dst,
               int              len);       /* in bytes */
 
-FcBool
+FcPublic FcBool
 FcUtf16Len (const FcChar8   *string,
            FcEndian        endian,
            int             len,            /* in bytes */
            int             *nchar,
            int             *wchar);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcStrDirname (const FcChar8 *file);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcStrBasename (const FcChar8 *file);
 
-FcStrSet *
+FcPublic FcStrSet *
 FcStrSetCreate (void);
 
-FcBool
-FcStrSetMember (FcStrSet *set, const FcChar8 *s);
+FcPublic FcBool
+FcStrSetMember (FcPublic FcStrSet *set, const FcChar8 *s);
 
-FcBool
-FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
+FcPublic FcBool
+FcStrSetEqual (FcPublic FcStrSet *sa, FcPublic FcStrSet *sb);
 
-FcBool
-FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
+FcPublic FcBool
+FcStrSetAdd (FcPublic FcStrSet *set, const FcChar8 *s);
 
-FcBool
-FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
+FcPublic FcBool
+FcStrSetAddFilename (FcPublic FcStrSet *set, const FcChar8 *s);
 
-FcBool
-FcStrSetDel (FcStrSet *set, const FcChar8 *s);
+FcPublic FcBool
+FcStrSetDel (FcPublic FcStrSet *set, const FcChar8 *s);
 
-void
-FcStrSetDestroy (FcStrSet *set);
+FcPublic void
+FcStrSetDestroy (FcPublic FcStrSet *set);
 
-FcStrList *
-FcStrListCreate (FcStrSet *set);
+FcPublic FcStrList *
+FcStrListCreate (FcPublic FcStrSet *set);
 
-FcChar8 *
+FcPublic FcChar8 *
 FcStrListNext (FcStrList *list);
 
-void
+FcPublic void
 FcStrListDone (FcStrList *list);
 
 /* fcxml.c */
-FcBool
+FcPublic FcBool
 FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
 
 _FCFUNCPROTOEND
index 586594c1e024cfd5d8ed43e805c217f95da3aea6..126d01a5aa90b757c2627456fc6006ca480bcf05 100644 (file)
@@ -73,10 +73,14 @@ INCLUDES =                                          \
        -DFC_CACHEDIR='"$(FC_CACHEDIR)"'                \
        -DFONTCONFIG_PATH='"$(CONFDIR)"'
 
-EXTRA_DIST = fontconfig.def.in
+EXTRA_DIST = fontconfig.def.in makealias
 
 noinst_HEADERS=fcint.h
 
+ALIAS_FILES = fcalias.h fcaliastail.h
+
+BUILT_SOURCES = $(ALIAS_FILES)
+
 libfontconfig_la_SOURCES = \
        fcatomic.c \
        fcblanks.c \
@@ -112,3 +116,14 @@ install-data-local: install-ms-import-lib install-libtool-import-lib
 
 uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
 
+PUBLIC_FILES = \
+       $(top_srcdir)/fontconfig/fontconfig.h \
+       $(top_srcdir)/fontconfig/fcfreetype.h \
+       $(top_srcdir)/fontconfig/fcprivate.h
+       
+fcaliastail.h: fcalias.h
+
+fcalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FILES)
+       sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" $(PUBLIC_FILES)
+
+CLEANFILES := $(ALIAS_FILES)
index a8b30f88c5f8aa5c62b0237703339345454e9ab5..9038a5f2eea5351f694e08cc8b3c0fe122332160 100644 (file)
@@ -211,3 +211,6 @@ FcAtomicDestroy (FcAtomic *atomic)
 
     free (atomic);
 }
+#define __fcatomic__
+#include "fcaliastail.h"
+#undef __fcatomic__
index a78e85fe600199d70d9413ef4d33f208cbb71e3b..d52cca72f518271fe241dfb0b3bb781f187438c1 100644 (file)
@@ -90,3 +90,6 @@ FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4)
            return FcTrue;
     return FcFalse;
 }
+#define __fcblanks__
+#include "fcaliastail.h"
+#undef __fcblanks__
index 05dc7eee6ad2f40d48e26eacb1f7ea4441cf002a..11f88a788b2dc84ab5361055aac44f638924ffd7 100644 (file)
@@ -28,6 +28,7 @@
 #include <dirent.h>
 #include <string.h>
 #include <sys/types.h>
+#include <assert.h>
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
 #  include <unistd.h>
 #  include <sys/mman.h>
@@ -134,7 +135,7 @@ FcDirCacheOpenFile (const FcChar8 *cache_file, struct stat *file_stat)
  */
 static FcBool
 FcDirCacheProcess (FcConfig *config, const FcChar8 *dir, 
-                  FcBool (*callback) (int fd, off_t size, void *closure),
+                  FcBool (*callback) (int fd, struct stat *stat, void *closure),
                   void *closure, FcChar8 **cache_file_ret)
 {
     int                fd = -1;
@@ -162,7 +163,7 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
         if (fd >= 0) {
            if (dir_stat.st_mtime <= file_stat.st_mtime)
            {
-               ret = (*callback) (fd, file_stat.st_size, closure);
+               ret = (*callback) (fd, &file_stat, closure);
                if (ret)
                {
                    if (cache_file_ret)
@@ -184,24 +185,246 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
 
 #define FC_CACHE_MIN_MMAP   1024
 
+/*
+ * Skip list element, make sure the 'next' pointer is the last thing
+ * in the structure, it will be allocated large enough to hold all
+ * of the necessary pointers
+ */
+
+typedef struct _FcCacheSkip FcCacheSkip;
+
+struct _FcCacheSkip {
+    FcCache        *cache;
+    int                    ref;
+    intptr_t       size;
+    dev_t          cache_dev;
+    ino_t          cache_ino;
+    time_t         cache_mtime;
+    FcCacheSkip            *next[1];
+};
+
+/*
+ * The head of the skip list; pointers for every possible level
+ * in the skip list, plus the largest level in the list
+ */
+
+#define FC_CACHE_MAX_LEVEL  16
+
+static FcCacheSkip     *fcCacheChains[FC_CACHE_MAX_LEVEL];
+static int             fcCacheMaxLevel;
+
+/*
+ * Generate a random level number, distributed
+ * so that each level is 1/4 as likely as the one before
+ *
+ * Note that level numbers run 1 <= level <= MAX_LEVEL
+ */
+static int
+random_level (void)
+{
+    /* tricky bit -- each bit is '1' 75% of the time */
+    long int   bits = random () | random ();
+    int        level = 0;
+
+    while (++level < FC_CACHE_MAX_LEVEL)
+    {
+       if (bits & 1)
+           break;
+       bits >>= 1;
+    }
+    return level;
+}
+
+/*
+ * Insert cache into the list
+ */
+static FcBool
+FcCacheInsert (FcCache *cache, struct stat *cache_stat)
+{
+    FcCacheSkip    **update[FC_CACHE_MAX_LEVEL];
+    FcCacheSkip    *s, **next;
+    int                    i, level;
+
+    /*
+     * Find links along each chain
+     */
+    next = fcCacheChains;
+    for (i = fcCacheMaxLevel; --i >= 0; )
+    {
+       for (; (s = next[i]); next = s->next)
+           if (s->cache > cache)
+               break;
+        update[i] = &next[i];
+    }
+
+    /*
+     * Create new list element
+     */
+    level = random_level ();
+    if (level > fcCacheMaxLevel)
+    {
+       level = fcCacheMaxLevel + 1;
+       update[fcCacheMaxLevel] = &fcCacheChains[fcCacheMaxLevel];
+       fcCacheMaxLevel = level;
+    }
+    
+    s = malloc (sizeof (FcCacheSkip) + (level - 1) * sizeof (FcCacheSkip *));
+    if (!s)
+       return FcFalse;
+
+    s->cache = cache;
+    s->size = cache->size;
+    s->ref = 1;
+    s->cache_dev = cache_stat->st_dev;
+    s->cache_ino = cache_stat->st_ino;
+    s->cache_mtime = cache_stat->st_mtime;
+    
+    /*
+     * Insert into all fcCacheChains
+     */
+    for (i = 0; i < level; i++)
+    {
+       s->next[i] = *update[i];
+       *update[i] = s;
+    }
+    return FcTrue;
+}
+
+static FcCacheSkip *
+FcCacheFindByAddr (void *object)
+{
+    int            i;
+    FcCacheSkip    **next = fcCacheChains;
+    FcCacheSkip    *s;
+
+    /*
+     * Walk chain pointers one level at a time
+     */
+    for (i = fcCacheMaxLevel; --i >= 0;)
+       while (next[i] && (char *) object >= ((char *) next[i]->cache + next[i]->size))
+           next = next[i]->next;
+    /*
+     * Here we are
+     */
+    s = next[0];
+    if (s && (char *) object < ((char *) s->cache + s->size))
+       return s;
+    return NULL;
+}
+
+static void
+FcCacheRemove (FcCache *cache)
+{
+    FcCacheSkip            **update[FC_CACHE_MAX_LEVEL];
+    FcCacheSkip            *s, **next;
+    int                    i;
+
+    /*
+     * Find links along each chain
+     */
+    next = fcCacheChains;
+    for (i = fcCacheMaxLevel; --i >= 0; )
+    {
+       for (; (s = next[i]); next = s->next)
+           if (s->cache >= cache)
+               break;
+        update[i] = &next[i];
+    }
+    s = next[0];
+    for (i = 0; i < fcCacheMaxLevel && *update[i] == s; i++)
+       *update[i] = s->next[i];
+    while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
+       fcCacheMaxLevel--;
+    free (s);
+}
+
+static FcCache *
+FcCacheFindByStat (struct stat *cache_stat)
+{
+    FcCacheSkip            *s;
+
+    for (s = fcCacheChains[0]; s; s = s->next[0])
+       if (s->cache_dev == cache_stat->st_dev &&
+           s->cache_ino == cache_stat->st_ino &&
+           s->cache_mtime == cache_stat->st_mtime)
+       {
+           s->ref++;
+           return s->cache;
+       }
+    return NULL;
+}
+
+static void
+FcDirCacheDispose (FcCache *cache)
+{
+    switch (cache->magic) {
+    case FC_CACHE_MAGIC_ALLOC:
+       free (cache);
+       break;
+    case FC_CACHE_MAGIC_MMAP:
+#if defined(HAVE_MMAP) || defined(__CYGWIN__)
+       munmap (cache, cache->size);
+#elif defined(_WIN32)
+       UnmapViewOfFile (cache);
+#endif
+       break;
+    }
+    FcCacheRemove (cache);
+}
+
+void
+FcCacheObjectReference (void *object)
+{
+    FcCacheSkip *skip = FcCacheFindByAddr (object);
+
+    if (skip)
+       skip->ref++;
+}
+
+void
+FcCacheObjectDereference (void *object)
+{
+    FcCacheSkip        *skip = FcCacheFindByAddr (object);
+
+    if (skip)
+    {
+       skip->ref--;
+       if (skip->ref <= 0)
+           FcDirCacheDispose (skip->cache);
+    }
+}
+
+void
+FcCacheFini (void)
+{
+    int                    i;
+
+    for (i = 0; i < FC_CACHE_MAX_LEVEL; i++)
+       assert (fcCacheChains[i] == NULL);
+    assert (fcCacheMaxLevel == 0);
+}
+
 /*
  * Map a cache file into memory
  */
 static FcCache *
-FcDirCacheMapFd (int fd, off_t size)
+FcDirCacheMapFd (int fd, struct stat *fd_stat)
 {
-    FcCache    *cache = NULL;
+    FcCache    *cache;
     FcBool     allocated = FcFalse;
 
-    if (size < sizeof (FcCache))
+    if (fd_stat->st_size < sizeof (FcCache))
        return NULL;
+    cache = FcCacheFindByStat (fd_stat);
+    if (cache)
+       return cache;
     /*
      * For small cache files, just read them into memory
      */
-    if (size >= FC_CACHE_MIN_MMAP)
+    if (fd_stat->st_size >= FC_CACHE_MIN_MMAP)
     {
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
-       cache = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0);
+       cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0);
 #elif defined(_WIN32)
        {
            HANDLE hFileMap;
@@ -219,11 +442,11 @@ FcDirCacheMapFd (int fd, off_t size)
     }
     if (!cache)
     {
-       cache = malloc (size);
+       cache = malloc (fd_stat->st_size);
        if (!cache)
            return NULL;
 
-       if (read (fd, cache, size) != size)
+       if (read (fd, cache, fd_stat->st_size) != fd_stat->st_size)
        {
            free (cache);
            return NULL;
@@ -232,14 +455,15 @@ FcDirCacheMapFd (int fd, off_t size)
     } 
     if (cache->magic != FC_CACHE_MAGIC_MMAP || 
        cache->version < FC_CACHE_CONTENT_VERSION ||
-       cache->size != size)
+       cache->size != fd_stat->st_size ||
+       !FcCacheInsert (cache, fd_stat))
     {
        if (allocated)
            free (cache);
        else
        {
 #if defined(HAVE_MMAP) || defined(__CYGWIN__)
-           munmap (cache, size);
+           munmap (cache, fd_stat->st_size);
 #elif defined(_WIN32)
            UnmapViewOfFile (cache);
 #endif
@@ -254,27 +478,25 @@ FcDirCacheMapFd (int fd, off_t size)
     return cache;
 }
 
+void
+FcDirCacheReference (FcCache *cache, int nref)
+{
+    FcCacheSkip *skip = FcCacheFindByAddr (cache);
+
+    if (skip)
+       skip->ref += nref;
+}
+
 void
 FcDirCacheUnload (FcCache *cache)
 {
-    switch (cache->magic) {
-    case FC_CACHE_MAGIC_ALLOC:
-       free (cache);
-       break;
-    case FC_CACHE_MAGIC_MMAP:
-#if defined(HAVE_MMAP) || defined(__CYGWIN__)
-       munmap (cache, cache->size);
-#elif defined(_WIN32)
-       UnmapViewOfFile (cache);
-#endif
-       break;
-    }
+    FcCacheObjectDereference (cache);
 }
 
 static FcBool
-FcDirCacheMapHelper (int fd, off_t size, void *closure)
+FcDirCacheMapHelper (int fd, struct stat *fd_stat, void *closure)
 {
-    FcCache *cache = FcDirCacheMapFd (fd, size);
+    FcCache *cache = FcDirCacheMapFd (fd, fd_stat);
 
     if (!cache)
        return FcFalse;
@@ -303,7 +525,7 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
     fd = FcDirCacheOpenFile (cache_file, file_stat);
     if (fd < 0)
        return NULL;
-    cache = FcDirCacheMapFd (fd, file_stat->st_size);
+    cache = FcDirCacheMapFd (fd, file_stat);
     close (fd);
     return cache;
 }
@@ -313,11 +535,10 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
  * the magic number and the size field
  */
 static FcBool
-FcDirCacheValidateHelper (int fd, off_t size, void *closure)
+FcDirCacheValidateHelper (int fd, struct stat *fd_stat, void *closure)
 {
     FcBool  ret = FcTrue;
     FcCache    c;
-    struct stat        file_stat;
     
     if (read (fd, &c, sizeof (FcCache)) != sizeof (FcCache))
        ret = FcFalse;
@@ -325,9 +546,7 @@ FcDirCacheValidateHelper (int fd, off_t size, void *closure)
        ret = FcFalse;
     else if (c.version < FC_CACHE_CONTENT_VERSION)
        ret = FcFalse;
-    else if (fstat (fd, &file_stat) < 0)
-       ret = FcFalse;
-    else if (file_stat.st_size != c.size)
+    else if (fd_stat->st_size != c.size)
        ret = FcFalse;
     return ret;
 }
@@ -575,6 +794,59 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
     return FcFalse;
 }
 
+/*
+ * Hokey little macro trick to permit the definitions of C functions
+ * with the same name as CPP macros
+ */
+#define args(x...)         (x)
+
+const FcChar8 *
+FcCacheDir args(const FcCache *c)
+{
+    return FcCacheDir (c);
+}
+
+FcFontSet *
+FcCacheCopySet args(const FcCache *c)
+{
+    FcFontSet  *old = FcCacheSet (c);
+    FcFontSet  *new = FcFontSetCreate ();
+    int                i;
+    
+    if (!new)
+       return NULL;
+    for (i = 0; i < old->nfont; i++)
+    {
+       FcPattern   *font = FcFontSetFont (old, i);
+       
+       FcPatternReference (font);
+       if (!FcFontSetAdd (new, font))
+       {
+           FcFontSetDestroy (new);
+           return NULL;
+       }
+    }
+    return new;
+}
+
+const FcChar8 *
+FcCacheSubdir args(const FcCache *c, int i)
+{
+    return FcCacheSubdir (c, i);
+}
+
+int
+FcCacheNumSubdir args(const FcCache *c)
+{
+    return c->dirs_count;
+}
+
+int
+FcCacheNumFont args(const FcCache *c)
+{
+    return FcCacheSet(c)->nfont;
+}
+
 /*
  * This code implements the MD5 message-digest algorithm.
  * The algorithm is due to Ron Rivest. This code was
@@ -818,3 +1090,6 @@ static void MD5Transform(FcChar32 buf[4], FcChar32 in[16])
     buf[2] += c;
     buf[3] += d;
 }
+#define __fccache__
+#include "fcaliastail.h"
+#undef __fccache__
index 2f0d3111b58702b0adfe4a6344d66f4fef4fb6e5..01d381c5f33ea118ad42adf3c8c4cc3b937065e8 100644 (file)
@@ -90,8 +90,6 @@ FcConfigCreate (void)
     for (set = FcSetSystem; set <= FcSetApplication; set++)
        config->fonts[set] = 0;
 
-    config->caches = NULL;
-
     config->rescanTime = time(0);
     config->rescanInterval = 30;    
     
@@ -197,7 +195,6 @@ void
 FcConfigDestroy (FcConfig *config)
 {
     FcSetName  set;
-    FcCacheList        *cl, *cl_next;
 
     if (config == _fcConfig)
        _fcConfig = 0;
@@ -221,13 +218,6 @@ FcConfigDestroy (FcConfig *config)
        if (config->fonts[set])
            FcFontSetDestroy (config->fonts[set]);
 
-    for (cl = config->caches; cl; cl = cl_next)
-    {
-       cl_next = cl->next;
-       FcDirCacheUnload (cl->cache);
-       free (cl);
-    }
-
     free (config);
     FcMemFree (FC_MEM_CONFIG, sizeof (FcConfig));
 }
@@ -239,26 +229,18 @@ FcConfigDestroy (FcConfig *config)
 FcBool
 FcConfigAddCache (FcConfig *config, FcCache *cache)
 {
-    FcCacheList        *cl = malloc (sizeof (FcCacheList));
     FcFontSet  *fs;
     intptr_t   *dirs;
     int                i;
 
-    /*
-     * Add to cache list
-     */
-    if (!cl)
-       return FcFalse;
-    cl->cache = cache;
-    cl->next = config->caches;
-    config->caches = cl;
-
     /*
      * Add fonts
      */
     fs = FcCacheSet (cache);
     if (fs)
     {
+       int     nref = 0;
+       
        for (i = 0; i < fs->nfont; i++)
        {
            FcPattern   *font = FcFontSetFont (fs, i);
@@ -280,8 +262,10 @@ FcConfigAddCache (FcConfig *config, FcCache *cache)
            if (!FcConfigAcceptFont (config, font))
                continue;
                
+           nref++;
            FcFontSetAdd (config->fonts[FcSetSystem], font);
        }
+       FcDirCacheReference (cache, nref);
     }
 
     /*
@@ -338,6 +322,7 @@ FcConfigBuildFonts (FcConfig *config)
        if (!cache)
            continue;
        FcConfigAddCache (config, cache);
+       FcDirCacheUnload (cache);
     }
     
     FcStrListDone (dirlist);
@@ -1979,3 +1964,6 @@ FcConfigAcceptFont (FcConfig          *config,
        return FcFalse;
     return FcTrue;
 }
+#define __fccfg__
+#include "fcaliastail.h"
+#undef __fccfg__
index 3dac4ce6a378d627187245e36959c209778e2283..5da131283d07f17991fbe361c239511282dd9a61 100644 (file)
@@ -43,9 +43,6 @@ FcCharSetCreate (void)
     return fcs;
 }
 
-FcCharSet *
-FcCharSetNew (void);
-    
 FcCharSet *
 FcCharSetNew (void)
 {
@@ -58,7 +55,10 @@ FcCharSetDestroy (FcCharSet *fcs)
     int i;
     
     if (fcs->ref == FC_REF_CONSTANT)
+    {
+       FcCacheObjectDereference (fcs);
        return;
+    }
     if (--fcs->ref > 0)
        return;
     for (i = 0; i < fcs->num; i++)
@@ -309,6 +309,8 @@ FcCharSetCopy (FcCharSet *src)
 {
     if (src->ref != FC_REF_CONSTANT)
        src->ref++;
+    else
+       FcCacheObjectReference (src);
     return src;
 }
 
@@ -693,8 +695,6 @@ FcCharSetFirstPage (const FcCharSet *a,
 /*
  * old coverage API, rather hard to use correctly
  */
-FcChar32
-FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
     
 FcChar32
 FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result)
@@ -1064,8 +1064,8 @@ FcCharSetHash (FcCharSet *fcs)
     int                i;
 
     /* hash in leaves */
-    for (i = 0; i < fcs->num * (int) (sizeof (FcCharLeaf *) / sizeof (FcChar32)); i++)
-       hash = ((hash << 1) | (hash >> 31)) ^ (FcChar32)(FcCharSetLeaf(fcs, i)->map);
+    for (i = 0; i < fcs->num; i++)
+       hash = ((hash << 1) | (hash >> 31)) ^ FcCharLeafHash (FcCharSetLeaf(fcs,i));
     /* hash in numbers */
     for (i = 0; i < fcs->num; i++)
        hash = ((hash << 1) | (hash >> 31)) ^ *FcCharSetNumbers(fcs);
@@ -1358,3 +1358,6 @@ FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs)
     
     return cs_serialized;
 }
+#define __fccharset__
+#include "fcaliastail.h"
+#undef __fccharset__
index 98b57e6c38b16de02745b68a3a00d0f0a25c6f19..68f530e25d294685ccda0d08c5720a3c4e899219 100644 (file)
@@ -412,3 +412,6 @@ FcInitDebug (void)
            FcDebugVal = 0;
     }
 }
+#define __fcdbg__
+#include "fcaliastail.h"
+#undef __fcdbg__
index b69de308843e5d61ac0b7f98800ee28aa4947a35..4e5823bb13406762b5c9fc3e2e5a2bf8a5fd6405 100644 (file)
@@ -91,6 +91,22 @@ FcGetDefaultLang (void)
                lang_local[lang_len + 1 + territory_len] = '\0';
            }
        }
+       else
+       {
+           after = strchr (ctype, '.');
+           if (!after)
+           {
+               after = strchr (ctype, '@');
+               if (!after)
+                   after = ctype + strlen (ctype);
+           }
+           lang_len = after - ctype;
+           if (lang_len + 1 <= (int) sizeof (lang_local))
+           {
+               strncpy (lang_local, ctype, lang_len);
+               lang_local[lang_len] = '\0';
+           }
+       }
     }
 
     /* set default lang to en */
@@ -166,3 +182,6 @@ FcDefaultSubstitute (FcPattern *pattern)
        FcPatternObjectAddInteger (pattern, FC_HINT_STYLE_OBJECT, FC_HINT_FULL);
     }
 }
+#define __fcdefault__
+#include "fcaliastail.h"
+#undef __fcdefault__
index a55c5fd3a47f5d301f58887c6d141b26d663683a..bb5cfc9321d6cf3be09998d97c99ce2dae2ca3f4 100644 (file)
@@ -292,3 +292,6 @@ FcDirSave (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir)
 {
     return FcFalse; /* XXX deprecated */
 }
+#define __fcdir__
+#include "fcaliastail.h"
+#undef __fcdir__
index 3cf1686d96c3f3b5a48ecebc1c5e9295af94e9fa..83c58d6013bd9a36809902dba59b72bf8ea6add8 100644 (file)
@@ -2584,71 +2584,48 @@ FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
        }
        else
        {
-           FT_UInt gindex;
-         
-           /*
-            * Find the first encoded character in the font
-            */
-           if (FT_Get_Char_Index (face, 0))
-           {
-               ucs4 = 0;
-               gindex = 1;
-           }
-           else
-           {
-               ucs4 = FT_Get_Next_Char (face, 0, &gindex);
-               if (!ucs4)
-                   gindex = 0;
-           }
-
-           while (gindex)
+            page = ~0;
+            leaf = NULL;
+            ucs4 = FT_Get_First_Char (face, &glyph);
+            while (glyph != 0)
            {
-               page = ucs4 >> 8;
-               leaf = 0;
-               while ((ucs4 >> 8) == page)
+               if (FcFreeTypeCheckGlyph (face, ucs4, glyph, blanks, &advance))
                {
-                   glyph = FT_Get_Char_Index (face, ucs4);
-                   if (glyph && FcFreeTypeCheckGlyph (face, ucs4, 
-                                                      glyph, blanks, &advance))
+                   if (advance)
                    {
-                       if (advance)
+                       if (!has_advance)
                        {
-                           if (!has_advance)
-                           {
-                               has_advance = FcTrue;
-                               advance_one = advance;
-                           }
-                           else if (!APPROXIMATELY_EQUAL (advance, advance_one))
+                           has_advance = FcTrue;
+                           advance_one = advance;
+                       }
+                       else if (!APPROXIMATELY_EQUAL (advance, advance_one))
+                       {
+                           if (fixed_advance)
                            {
-                               if (fixed_advance)
-                               {
-                                   dual_advance = FcTrue;
-                                   fixed_advance = FcFalse;
-                                   advance_two = advance;
-                               }
-                               else if (!APPROXIMATELY_EQUAL (advance, advance_two))
-                                   dual_advance = FcFalse;
+                               dual_advance = FcTrue;
+                               fixed_advance = FcFalse;
+                               advance_two = advance;
                            }
+                           else if (!APPROXIMATELY_EQUAL (advance, advance_two))
+                               dual_advance = FcFalse;
                        }
+                   }
 
+                   if ((ucs4 >> 8) != page)
+                   {
+                       page = (ucs4 >> 8);
+                       leaf = FcCharSetFindLeafCreate (fcs, ucs4);
                        if (!leaf)
-                       {
-                           leaf = FcCharSetFindLeafCreate (fcs, ucs4);
-                           if (!leaf)
-                               goto bail1;
-                       }
-                       off = ucs4 & 0xff;
-                       leaf->map[off >> 5] |= (1 << (off & 0x1f));
+                           goto bail1;
+                   }
+                   off = ucs4 & 0xff;
+                   leaf->map[off >> 5] |= (1 << (off & 0x1f));
 #ifdef CHECK
-                       if (ucs4 > font_max)
-                           font_max = ucs4;
+                   if (ucs4 > font_max)
+                       font_max = ucs4;
 #endif
-                   }
-                   ucs4++;
                }
-               ucs4 = FT_Get_Next_Char (face, ucs4 - 1, &gindex);
-               if (!ucs4)
-                   gindex = 0;
+               ucs4 = FT_Get_Next_Char (face, ucs4, &glyph);
            }
 #ifdef CHECK
            for (ucs4 = 0; ucs4 < 0x10000; ucs4++)
@@ -2952,3 +2929,7 @@ bail:
     ftglue_free(memory, gpostags);
     return complex;
 }
+
+#define __fcfreetype__
+#include "fcaliastail.h"
+#undef __fcfreetype__
index e9b2d07d4cd918e26980b2531a9f3f6e7336183e..7bea73651c5ee6ab01c1a57165b6ec0897569455 100644 (file)
@@ -130,3 +130,6 @@ FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s)
 
     return s_serialize;
 }
+#define __fcfs__
+#include "fcaliastail.h"
+#undef __fcfs__
index 65702b4421991ca73ec8ae89a54bc5be355adf89..7d2311fae2bdb5fc9112f2ea772c5d731f52ec0d 100644 (file)
@@ -121,6 +121,7 @@ FcFini (void)
        FcConfigDestroy (_fcConfig);
 
     FcPatternFini ();
+    FcCacheFini ();
 }
 
 /*
@@ -262,3 +263,6 @@ FcMemFree (int kind, int size)
            FcMemReport ();
     }
 }
+#define __fcinit__
+#include "fcaliastail.h"
+#undef __fcinit__
index 3b9f3c852697c7259a00ce006a21cf8278a67028..afa37d2cbd3235e4c2c72a4d17905879ec70b8ed 100644 (file)
@@ -53,9 +53,6 @@
 #define FC_CONFIG_PATH "fonts.conf"
 #endif
 
-#define FC_FONT_FILE_INVALID   ((FcChar8 *) ".")
-#define FC_FONT_FILE_DIR       ((FcChar8 *) ".dir")
-
 #ifdef _WIN32
 #define FC_SEARCH_PATH_SEPARATOR ';'
 #else
 #define FC_BANK_FIRST 1
 #define FC_BANK_LANGS      0xfcfcfcfc
 
+/* slim_internal.h */
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
+#define FcPrivate              __attribute__((__visibility__("hidden")))
+#define HAVE_GNUC_ATTRIBUTE 1
+#include "fcalias.h"
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define FcPrivate              __hidden
+#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
+#define FcPrivate
+#endif
+
 typedef enum _FcValueBinding {
     FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
 } FcValueBinding;
@@ -306,7 +314,7 @@ typedef struct _FcStrBuf {
     int            size;
 } FcStrBuf;
 
-typedef struct _FcCache {
+struct _FcCache {
     int                magic;              /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
     int                version;            /* FC_CACHE_CONTENT_VERSION */
     intptr_t   size;               /* size of file */
@@ -314,13 +322,15 @@ typedef struct _FcCache {
     intptr_t   dirs;               /* offset to subdirs */
     int                dirs_count;         /* number of subdir strings */
     intptr_t   set;                /* offset to font set */
-} FcCache;
+};
 
+#undef FcCacheDir
+#undef FcCacheSubdir
 #define FcCacheDir(c)  FcOffsetMember(c,dir,FcChar8)
 #define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t)
 #define FcCacheSet(c)  FcOffsetMember(c,set,FcFontSet)
-#define FcCacheSubdir(c,i)  FcOffsetToPtr (FcCacheDirs(cache),\
-                                          FcCacheDirs(cache)[i], \
+#define FcCacheSubdir(c,i)  FcOffsetToPtr (FcCacheDirs(c),\
+                                          FcCacheDirs(c)[i], \
                                           FcChar8)
 
 /*
@@ -413,11 +423,6 @@ struct _FcBlanks {
     FcChar32   *blanks;
 };
 
-typedef struct _FcCacheList {
-    struct _FcCacheList *next;
-    FcCache            *cache;
-} FcCacheList;
-
 struct _FcConfig {
     /*
      * File names loaded from the configuration -- saved here as the
@@ -468,11 +473,6 @@ struct _FcConfig {
      * match preferrentially
      */
     FcFontSet  *fonts[FcSetApplication + 1];
-    /*
-     * Font cache information is mapped from cache files
-     * the configuration is destroyed, the files need to be unmapped
-     */
-    FcCacheList        *caches;
     /*
      * Fontconfig can periodically rescan the system configuration
      * and font directories.  This rescanning occurs when font
@@ -483,7 +483,7 @@ struct _FcConfig {
     int                rescanInterval;     /* interval between scans */
 };
  
-extern FcConfig        *_fcConfig;
+extern FcPrivate FcConfig      *_fcConfig;
 
 typedef struct _FcFileTime {
     time_t  time;
@@ -499,208 +499,198 @@ typedef struct _FcCharMap FcCharMap;
 
 /* fccache.c */
 
-FcBool
-FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
-
-void
-FcDirCacheUnload (FcCache *cache);
-
-FcCache *
+FcPrivate FcCache *
 FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
 
-FcCache *
-FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
-    
-FcCache *
-FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
-
-FcBool
-FcDirCacheValid (const FcChar8 *dir);
-
-FcCache *
+FcPrivate FcCache *
 FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, FcStrSet *dirs);
 
-FcBool
+FcPrivate FcBool
 FcDirCacheWrite (FcCache *cache, FcConfig *config);
     
+FcPrivate void
+FcCacheObjectReference (void *object);
+
+FcPrivate void
+FcCacheObjectDereference (void *object);
+
+FcPrivate void
+FcCacheFini (void);
+    
+FcPrivate void
+FcDirCacheReference (FcCache *cache, int nref);
+
 /* fccfg.c */
 
-FcBool
+FcPrivate FcBool
 FcConfigAddConfigDir (FcConfig     *config,
                      const FcChar8 *d);
 
-FcBool
+FcPrivate FcBool
 FcConfigAddFontDir (FcConfig       *config,
                    const FcChar8   *d);
 
-FcBool
+FcPrivate FcBool
 FcConfigAddDir (FcConfig       *config,
                const FcChar8   *d);
 
-FcBool
+FcPrivate FcBool
 FcConfigAddCacheDir (FcConfig      *config,
                     const FcChar8  *d);
 
-FcStrList *
-FcConfigGetCacheDirs (FcConfig *config);
-
-FcBool
+FcPrivate FcBool
 FcConfigAddConfigFile (FcConfig                *config,
                       const FcChar8    *f);
 
-FcBool
+FcPrivate FcBool
 FcConfigAddBlank (FcConfig     *config,
                  FcChar32      blank);
 
-FcBool
+FcPrivate FcBool
 FcConfigAddEdit (FcConfig      *config,
                 FcTest         *test,
                 FcEdit         *edit,
                 FcMatchKind    kind);
 
-void
+FcPrivate void
 FcConfigSetFonts (FcConfig     *config,
                  FcFontSet     *fonts,
                  FcSetName     set);
 
-FcBool
+FcPrivate FcBool
 FcConfigCompareValue (const FcValue *m,
                      FcOp          op,
                      const FcValue *v);
 
-FcBool
+FcPrivate FcBool
 FcConfigGlobAdd (FcConfig      *config,
                 const FcChar8  *glob,
                 FcBool         accept);
 
-FcBool
+FcPrivate FcBool
 FcConfigAcceptFilename (FcConfig       *config,
                        const FcChar8   *filename);
 
-FcBool
+FcPrivate FcBool
 FcConfigPatternsAdd (FcConfig  *config,
                     FcPattern  *pattern,
                     FcBool     accept);
 
-FcBool
+FcPrivate FcBool
 FcConfigAcceptFont (FcConfig       *config,
                    const FcPattern *font);
 
-FcFileTime
+FcPrivate FcFileTime
 FcConfigModifiedTime (FcConfig *config);
 
-FcBool
+FcPrivate FcBool
 FcConfigAddCache (FcConfig *config, FcCache *cache);
 
 /* fcserialize.c */
-intptr_t
+FcPrivate intptr_t
 FcAlignSize (intptr_t size);
     
-FcSerialize *
+FcPrivate FcSerialize *
 FcSerializeCreate (void);
 
-void
+FcPrivate void
 FcSerializeDestroy (FcSerialize *serialize);
 
-FcBool
+FcPrivate FcBool
 FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
 
-intptr_t
+FcPrivate intptr_t
 FcSerializeReserve (FcSerialize *serialize, int size);
 
-intptr_t
+FcPrivate intptr_t
 FcSerializeOffset (FcSerialize *serialize, const void *object);
 
-void *
+FcPrivate void *
 FcSerializePtr (FcSerialize *serialize, const void *object);
 
-FcBool
+FcPrivate FcBool
 FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
 
-FcLangSet *
+FcPrivate FcLangSet *
 FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
 
 /* fccharset.c */
-void
+FcPrivate void
 FcLangCharSetPopulate (void);
 
-FcCharSetFreezer *
+FcPrivate FcCharSetFreezer *
 FcCharSetFreezerCreate (void);
 
-const FcCharSet *
+FcPrivate const FcCharSet *
 FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
 
-void
+FcPrivate void
 FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
 
-FcBool
+FcPrivate FcBool
 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
 
-FcCharSet *
+FcPrivate FcCharSet *
 FcNameParseCharSet (FcChar8 *string);
 
-FcCharLeaf *
+FcPrivate FcCharLeaf *
 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
 
-FcBool
+FcPrivate FcBool
 FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
 
-FcCharSet *
+FcPrivate FcCharSet *
 FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
 
-FcChar16 *
+FcPrivate FcChar16 *
 FcCharSetGetNumbers(const FcCharSet *c);
 
 /* fcdbg.c */
-void
+FcPrivate void
 FcValueListPrint (const FcValueListPtr l);
 
-void
+FcPrivate void
 FcLangSetPrint (const FcLangSet *ls);
 
-void
+FcPrivate void
 FcOpPrint (FcOp op);
 
-void
+FcPrivate void
 FcTestPrint (const FcTest *test);
 
-void
+FcPrivate void
 FcExprPrint (const FcExpr *expr);
 
-void
+FcPrivate void
 FcEditPrint (const FcEdit *edit);
 
-void
+FcPrivate void
 FcSubstPrint (const FcSubst *subst);
 
-void
+FcPrivate void
 FcCharSetPrint (const FcCharSet *c);
     
-extern int FcDebugVal;
+extern FcPrivate int FcDebugVal;
 
-static inline int
-FcDebug (void) { return FcDebugVal; }
+#define FcDebug() (FcDebugVal)
 
-void
+FcPrivate void
 FcInitDebug (void);
 
 /* fcdefault.c */
-FcChar8 *
+FcPrivate FcChar8 *
 FcGetDefaultLang (void);
 
 /* fcdir.c */
 
-FcBool
-FcFileIsDir (const FcChar8 *file);
-
-FcBool
+FcPrivate FcBool
 FcFileScanConfig (FcFontSet    *set,
                  FcStrSet      *dirs,
                  FcBlanks      *blanks,
                  const FcChar8 *file,
                  FcConfig      *config);
 
-FcBool
+FcPrivate FcBool
 FcDirScanConfig (FcFontSet     *set,
                 FcStrSet       *dirs,
                 FcBlanks       *blanks,
@@ -708,123 +698,120 @@ FcDirScanConfig (FcFontSet      *set,
                 FcBool         force,
                 FcConfig       *config);
 
-FcCache *
-FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
-
 /* fcfont.c */
-int
+FcPrivate int
 FcFontDebug (void);
     
 /* fcfreetype.c */
-FcBool
+FcPrivate FcBool
 FcFreeTypeIsExclusiveLang (const FcChar8  *lang);
 
-FcBool
+FcPrivate FcBool
 FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
 
-FcChar32
+FcPrivate FcChar32
 FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
 
-FcChar32
+FcPrivate FcChar32
 FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
 
-const FcCharMap *
+FcPrivate const FcCharMap *
 FcFreeTypeGetPrivateMap (FT_Encoding encoding);
     
 /* fcfs.c */
 
-FcBool
+FcPrivate FcBool
 FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
 
-FcFontSet *
+FcPrivate FcFontSet *
 FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
     
 /* fcgram.y */
-int
+FcPrivate int
 FcConfigparse (void);
 
-int
+FcPrivate int
 FcConfigwrap (void);
     
-void
+FcPrivate void
 FcConfigerror (char *fmt, ...);
     
-char *
+FcPrivate char *
 FcConfigSaveField (const char *field);
 
-void
+FcPrivate void
 FcTestDestroy (FcTest *test);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateInteger (int i);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateDouble (double d);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateString (const FcChar8 *s);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateMatrix (const FcMatrix *m);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateBool (FcBool b);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateNil (void);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateField (const char *field);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateConst (const FcChar8 *constant);
 
-FcExpr *
+FcPrivate FcExpr *
 FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
 
-void
+FcPrivate void
 FcExprDestroy (FcExpr *e);
 
-void
+FcPrivate void
 FcEditDestroy (FcEdit *e);
 
 /* fcinit.c */
 
-void
+FcPrivate void
 FcMemReport (void);
 
-void
+FcPrivate void
 FcMemAlloc (int kind, int size);
 
-void
+FcPrivate void
 FcMemFree (int kind, int size);
 
 /* fclang.c */
-FcLangSet *
+FcPrivate FcLangSet *
 FcFreeTypeLangSet (const FcCharSet  *charset, 
                   const FcChar8    *exclusiveLang);
 
-FcLangResult
+FcPrivate FcLangResult
 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
     
-const FcCharSet *
+FcPrivate const FcCharSet *
 FcCharSetForLang (const FcChar8 *lang);
 
-FcLangSet *
+FcPrivate FcLangSet *
 FcLangSetPromote (const FcChar8 *lang);
 
-FcLangSet *
+FcPrivate FcLangSet *
 FcNameParseLangSet (const FcChar8 *string);
 
-FcBool
+FcPrivate FcBool
 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
 
-FcChar8 *
+FcPrivate FcChar8 *
 FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
 
 /* fclist.c */
 
-FcBool
+FcPrivate FcBool
 FcListPatternMatchAny (const FcPattern *p,
                       const FcPattern *font);
 
@@ -878,190 +865,184 @@ FcListPatternMatchAny (const FcPattern *p,
 #define FC_EMBEDDED_BITMAP_OBJECT      39
 #define FC_DECORATIVE_OBJECT   40
 
-FcBool
+FcPrivate FcBool
 FcNameBool (const FcChar8 *v, FcBool *result);
 
-FcBool
+FcPrivate FcBool
 FcObjectValidType (FcObject object, FcType type);
 
-FcObject
+FcPrivate FcObject
 FcObjectFromName (const char * name);
 
-const char *
+FcPrivate const char *
 FcObjectName (FcObject object);
 
-FcBool
+FcPrivate FcBool
 FcObjectInit (void);
 
-void
+FcPrivate void
 FcObjectFini (void);
 
 #define FcObjectCompare(a, b)  ((int) a - (int) b)
 
 /* fcpat.c */
 
-FcValue
+FcPrivate FcValue
 FcValueCanonicalize (const FcValue *v);
 
-void
+FcPrivate void
 FcValueListDestroy (FcValueListPtr l);
 
-FcPatternElt *
+FcPrivate FcPatternElt *
 FcPatternObjectFindElt (const FcPattern *p, FcObject object);
 
-FcPatternElt *
+FcPrivate FcPatternElt *
 FcPatternObjectInsertElt (FcPattern *p, FcObject object);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddWithBinding  (FcPattern      *p,
                                FcObject        object,
                                FcValue         value,
                                FcValueBinding  binding,
                                FcBool          append);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
     
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
     
-FcResult
+FcPrivate FcResult
 FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
     
-FcBool
+FcPrivate FcBool
 FcPatternObjectDel (FcPattern *p, FcObject object);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
 
-FcBool
+FcPrivate FcBool
 FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
 
-FcResult
+FcPrivate FcResult
 FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
 
-FcResult
+FcPrivate FcResult
 FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
 
-FcResult
+FcPrivate FcResult
 FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
 
-FcResult
+FcPrivate FcResult
 FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
 
-FcResult
+FcPrivate FcResult
 FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
 
-FcResult
+FcPrivate FcResult
 FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
 
-FcResult
+FcPrivate FcResult
 FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
 
-void
+FcPrivate void
 FcPatternFini (void);
 
-FcBool
+FcPrivate FcBool
 FcPatternAppend (FcPattern *p, FcPattern *s);
 
-const FcChar8 *
+FcPrivate const FcChar8 *
 FcStrStaticName (const FcChar8 *name);
 
-FcChar32
+FcPrivate FcChar32
 FcStringHash (const FcChar8 *s);
 
-FcBool
+FcPrivate FcBool
 FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
 
-FcPattern *
+FcPrivate FcPattern *
 FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
 
-FcBool
+FcPrivate FcBool
 FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
 
-FcValueList *
+FcPrivate FcValueList *
 FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
 
 /* fcrender.c */
 
 /* fcmatrix.c */
 
-extern const FcMatrix    FcIdentityMatrix;
+extern FcPrivate const FcMatrix    FcIdentityMatrix;
 
-void
+FcPrivate void
 FcMatrixFree (FcMatrix *mat);
 
 /* fcstr.c */
-void
+FcPrivate void
 FcStrSetSort (FcStrSet * set);
 
-FcChar8 *
-FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
-    
-void
-FcStrFree (FcChar8 *s);
-
-void
+FcPrivate void
 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
 
-void
+FcPrivate void
 FcStrBufDestroy (FcStrBuf *buf);
 
-FcChar8 *
+FcPrivate FcChar8 *
 FcStrBufDone (FcStrBuf *buf);
 
-FcBool
+FcPrivate FcBool
 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
 
-FcBool
+FcPrivate FcBool
 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
 
-FcBool
+FcPrivate FcBool
 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
 
-int
+FcPrivate int
 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
 
-const FcChar8 *
+FcPrivate const FcChar8 *
 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
 
-const FcChar8 *
+FcPrivate const FcChar8 *
 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
 
-FcBool
+FcPrivate FcBool
 FcStrUsesHome (const FcChar8 *s);
 
-FcChar8 *
+FcPrivate FcChar8 *
 FcStrLastSlash (const FcChar8  *path);
 
-FcChar32
+FcPrivate FcChar32
 FcStrHashIgnoreCase (const FcChar8 *s);
 
-FcChar8 *
+FcPrivate FcChar8 *
 FcStrCanonFilename (const FcChar8 *s);
 
-FcBool
+FcPrivate FcBool
 FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
 
-FcChar8 *
+FcPrivate FcChar8 *
 FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
 
 #endif /* _FC_INT_H_ */
index f8f6f0b39eb012b63f019f269ab473859feb6ca6..de0862215d435b071df5d12c574e21dacd1247f5 100644 (file)
@@ -727,3 +727,6 @@ FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l)
     *l_serialize = *l;
     return l_serialize;
 }
+#define __fclang__
+#include "fcaliastail.h"
+#undef __fclang__
index c0b7fb0cdfc1b7a2af8b8af3a085687421e12bf4..3de04a009ec645992fbc9f9c151c41a5a150bacc 100644 (file)
@@ -556,3 +556,6 @@ FcFontList (FcConfig        *config,
        sets[nsets++] = config->fonts[FcSetApplication];
     return FcFontSetList (config, sets, nsets, p, os);
 }
+#define __fclist__
+#include "fcaliastail.h"
+#undef __fclist__
index 96587cbc310d41ac6aef92dc683ad5910f015dd5..f0410528e4c0edc42b8710a6dd5801ac243cc2d9 100644 (file)
@@ -835,3 +835,6 @@ FcFontSort (FcConfig        *config,
        sets[nsets++] = config->fonts[FcSetApplication];
     return FcFontSetSort (config, sets, nsets, p, trim, csp, result);
 }
+#define __fcmatch__
+#include "fcaliastail.h"
+#undef __fcmatch__
index 3c4d9fb84a1e332170dc895fcb1813cd9be79cc9..7f551460c44b1b733f156748a7cbd96b3a3999a9 100644 (file)
@@ -115,3 +115,6 @@ FcMatrixShear (FcMatrix *m, double sh, double sv)
     r.yy = 1;
     FcMatrixMultiply (m, &r, m);
 }
+#define __fcmatrix__
+#include "fcaliastail.h"
+#undef __fcmatrix__
index cfc6b31977f46eae0751d7ba894102d1f94def52..21e6da17295c9a8696bdb56c683668563a8caaf0 100644 (file)
@@ -879,3 +879,6 @@ bail0:
     FcStrBufDestroy (&buf);
     return 0;
 }
+#define __fcname__
+#include "fcaliastail.h"
+#undef __fcname__
index 9cd01a02a9303c10ed0d9c578ed850b5d7df8dda..bf34c2e2c4c1869f6c12303792a4f065e60e17e1 100644 (file)
@@ -282,7 +282,13 @@ FcPatternDestroy (FcPattern *p)
     int                    i;
     FcPatternElt    *elts;
     
-    if (p->ref == FC_REF_CONSTANT || --p->ref > 0)
+    if (p->ref == FC_REF_CONSTANT)
+    {
+       FcCacheObjectDereference (p);
+       return;
+    }
+       
+    if (--p->ref > 0)
        return;
 
     elts = FcPatternElts (p);
@@ -938,6 +944,8 @@ FcPatternReference (FcPattern *p)
 {
     if (p->ref != FC_REF_CONSTANT)
        p->ref++;
+    else
+       FcCacheObjectReference (p);
 }
 
 FcPattern *
@@ -1200,3 +1208,6 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl)
     }
     return head_serialized;
 }
+#define __fcpat__
+#include "fcaliastail.h"
+#undef __fcpat__
index d0d35e3413a3c10834839d29e7fb48dcc04de2ea..a66d3889acbf142b62ebe61e8c72f0327d7bcd6f 100644 (file)
@@ -159,3 +159,6 @@ FcStrSerialize (FcSerialize *serialize, const FcChar8 *str)
     strcpy ((char *) str_serialize, (const char *) str);
     return str_serialize;
 }
+#define __fcserialize__
+#include "fcaliastail.h"
+#undef __fcserialize__
index 5faf5790f8ba4e9dd3f1522b0109f16a73e4e8f2..7ec2ab4f5f92f44ecb94814f1efa489312c3b3c4 100644 (file)
@@ -1051,3 +1051,6 @@ FcStrListDone (FcStrList *list)
     free (list);
 }
 
+#define __fcstr__
+#include "fcaliastail.h"
+#undef __fcstr__
index d91e52275161bab71913ac24bb3c12b0e6b44e4c..4087183372a5f4665ba15a910b03e37e36030a20 100644 (file)
@@ -545,6 +545,8 @@ FcTypecheckValue (FcConfigParse *parse, FcType value, FcType type)
        if ((value == FcTypeLangSet && type == FcTypeString) ||
            (value == FcTypeString && type == FcTypeLangSet))
            return;
+       if (type == (FcType) -1)
+           return;
        FcConfigMessage (parse, FcSevereWarning, "saw %s, expected %s",
                         FcTypeName (value), FcTypeName (type));
     }
@@ -2491,3 +2493,6 @@ bail0:
     }
     return FcTrue;
 }
+#define __fcxml__
+#include "fcaliastail.h"
+#undef __fcxml__
index 413a933ab1b02e3b6171ec82faf86632196650fd..9caad7c6a7ab3a45a1176b476bfe8f7c6c4e7da6 100644 (file)
@@ -307,3 +307,6 @@ Exit:
 }                        
 
 #undef QALLOC
+#define __ftglue__
+#include "fcaliastail.h"
+#undef __ftglue__
index 93fd91efd32fffbaed88e1b7a055508d5f9e1da5..b273f30a526ce943b12e740507739f9e5cfece9f 100644 (file)
@@ -43,6 +43,8 @@
 #ifndef __OPENTYPE_FTGLUE_H__
 #define __OPENTYPE_FTGLUE_H__
 
+#include "fcint.h"
+
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
@@ -58,7 +60,7 @@ FT_BEGIN_HEADER
 #define  SET_ERR(c)   ( (error = (c)) != 0 )
 
 #ifndef FTGLUE_API
-#define FTGLUE_API(x)  extern x
+#define FTGLUE_API(x)  extern FcPrivate x
 #endif
 
 #ifndef FTGLUE_APIDEF
diff --git a/src/makealias b/src/makealias
new file mode 100755 (executable)
index 0000000..02167b2
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+SRCDIR=$1
+shift
+HEAD=fcalias.h
+TAIL=fcaliastail.h
+rm -f $HEAD $TAIL
+echo "#if HAVE_GNUC_ATTRIBUTE" >> $TAIL
+cat "$@" | grep '^Fc[^ ]* *(' | sed -e 's/ *(.*$//' |
+while read name; do
+       case $name in
+       FcCacheDir|FcCacheSubdir)
+               ;;
+       *)
+               alias="IA__$name"
+               hattr='__attribute((visibility("hidden")))'
+               echo "extern __typeof ($name) $alias $hattr;" >> $HEAD
+               echo "#define $name $alias" >> $HEAD
+               grep -l -w '^'$name "$SRCDIR"/*.c | sed -e 's/^.*\/\([^.]*\)\.c/#ifdef __\1__/' >> $TAIL
+               echo "#undef $name" >> $TAIL
+               cattr='__attribute((alias("'$alias'"), visibility("default")))'
+               echo "extern __typeof ($name) $name $cattr;" >> $TAIL
+               echo "#endif" >> $TAIL
+               ;;
+       esac
+done
+echo "#endif" >> $TAIL