]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Fix parallel build in doc directory.
[fontconfig.git] / src / fcint.h
index 7dab169a49378cd9688a2a3f96af6c3876d1da52..62a04b8e5266016f7dc2b4c22dc7b29aefde45f0 100644 (file)
@@ -46,8 +46,8 @@
 #include <sys/stat.h>
 #include <time.h>
 #include <fontconfig/fontconfig.h>
-#include <fontconfig/fcprivate.h>
 #include <fontconfig/fcfreetype.h>
+#include "fcdeprecate.h"
 
 #ifndef FC_CONFIG_PATH
 #define FC_CONFIG_PATH "fonts.conf"
 #define FC_BANK_LANGS      0xfcfcfcfc
 
 /* slim_internal.h */
-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
 #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 */
@@ -320,8 +322,11 @@ struct _FcCache {
     intptr_t   dirs;               /* offset to subdirs */
     int                dirs_count;         /* number of subdir strings */
     intptr_t   set;                /* offset to font set */
+    int                mtime;              /* low bits of directory mtime */
 };
 
+#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)
@@ -404,7 +409,7 @@ typedef struct _FcCaseFold {
 
 #define FC_CACHE_MAGIC_MMAP        0xFC02FC04
 #define FC_CACHE_MAGIC_ALLOC       0xFC02FC05
-#define FC_CACHE_CONTENT_VERSION    1
+#define FC_CACHE_CONTENT_VERSION    2
 
 struct _FcAtomic {
     FcChar8    *file;          /* original file name */
@@ -491,6 +496,100 @@ typedef struct _FcCharMap FcCharMap;
 /* watch out; assumes that v is void * -PL */
 #define ALIGN(v,type) ((void *)(((uintptr_t)(v) + fc_alignof(type) - 1) & ~(fc_alignof(type) - 1)))
 
+/*
+ * I tried this with functions that took va_list* arguments
+ * but portability concerns made me change these functions
+ * into macros (sigh).
+ */
+
+#define FcPatternVapBuild(result, orig, va)                        \
+{                                                                  \
+    FcPattern  *__p__ = (orig);                                    \
+    const char *__o__;                                             \
+    FcValue    __v__;                                              \
+                                                                   \
+    if (!__p__)                                                            \
+    {                                                              \
+       __p__ = FcPatternCreate ();                                 \
+       if (!__p__)                                                 \
+           goto _FcPatternVapBuild_bail0;                          \
+    }                                                              \
+    for (;;)                                                       \
+    {                                                              \
+       __o__ = va_arg (va, const char *);                          \
+       if (!__o__)                                                 \
+           break;                                                  \
+       __v__.type = va_arg (va, FcType);                           \
+       switch (__v__.type) {                                       \
+       case FcTypeVoid:                                            \
+           goto _FcPatternVapBuild_bail1;                          \
+       case FcTypeInteger:                                         \
+           __v__.u.i = va_arg (va, int);                           \
+           break;                                                  \
+       case FcTypeDouble:                                          \
+           __v__.u.d = va_arg (va, double);                        \
+           break;                                                  \
+       case FcTypeString:                                          \
+           __v__.u.s = va_arg (va, const FcChar8 *);               \
+           break;                                                  \
+       case FcTypeBool:                                            \
+           __v__.u.b = va_arg (va, FcBool);                        \
+           break;                                                  \
+       case FcTypeMatrix:                                          \
+           __v__.u.m = va_arg (va, const FcMatrix *);              \
+           break;                                                  \
+       case FcTypeCharSet:                                         \
+           __v__.u.c = va_arg (va, const FcCharSet *);             \
+           break;                                                  \
+       case FcTypeFTFace:                                          \
+           __v__.u.f = va_arg (va, FT_Face);                       \
+           break;                                                  \
+       case FcTypeLangSet:                                         \
+           __v__.u.l = va_arg (va, const FcLangSet *);             \
+           break;                                                  \
+       }                                                           \
+       if (!FcPatternAdd (__p__, __o__, __v__, FcTrue))            \
+           goto _FcPatternVapBuild_bail1;                          \
+    }                                                              \
+    result = __p__;                                                \
+    goto _FcPatternVapBuild_return;                                \
+                                                                   \
+_FcPatternVapBuild_bail1:                                          \
+    if (!orig)                                                     \
+       FcPatternDestroy (__p__);                                   \
+_FcPatternVapBuild_bail0:                                          \
+    result = (void*)0;                                             \
+                                                                   \
+_FcPatternVapBuild_return:                                         \
+    ;                                                              \
+}
+
+
+#define FcObjectSetVapBuild(__ret__, __first__, __va__)                \
+{                                                                      \
+    FcObjectSet    *__os__;                                            \
+    const char     *__ob__;                                            \
+                                                                       \
+    __ret__ = 0;                                                       \
+    __os__ = FcObjectSetCreate ();                                     \
+    if (!__os__)                                                       \
+       goto _FcObjectSetVapBuild_bail0;                                \
+    __ob__ = __first__;                                                        \
+    while (__ob__)                                                     \
+    {                                                                  \
+       if (!FcObjectSetAdd (__os__, __ob__))                           \
+           goto _FcObjectSetVapBuild_bail1;                            \
+       __ob__ = va_arg (__va__, const char *);                         \
+    }                                                                  \
+    __ret__ = __os__;                                                  \
+                                                                       \
+_FcObjectSetVapBuild_bail1:                                            \
+    if (!__ret__ && __os__)                                            \
+       FcObjectSetDestroy (__os__);                                    \
+_FcObjectSetVapBuild_bail0:                                            \
+    ;                                                                  \
+}
+
 /* fcblanks.c */
 
 /* fccache.c */
@@ -499,7 +598,7 @@ FcPrivate FcCache *
 FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
 
 FcPrivate FcCache *
-FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, FcStrSet *dirs);
+FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
 
 FcPrivate FcBool
 FcDirCacheWrite (FcCache *cache, FcConfig *config);
@@ -513,7 +612,7 @@ FcCacheObjectDereference (void *object);
 FcPrivate void
 FcCacheFini (void);
     
-void
+FcPrivate void
 FcDirCacheReference (FcCache *cache, int nref);
 
 /* fccfg.c */
@@ -580,7 +679,8 @@ FcPrivate FcFileTime
 FcConfigModifiedTime (FcConfig *config);
 
 FcPrivate FcBool
-FcConfigAddCache (FcConfig *config, FcCache *cache);
+FcConfigAddCache (FcConfig *config, FcCache *cache, 
+                 FcSetName set, FcStrSet *dirSet);
 
 /* fcserialize.c */
 FcPrivate intptr_t
@@ -790,9 +890,6 @@ FcFreeTypeLangSet (const FcCharSet  *charset,
 FcPrivate FcLangResult
 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
     
-FcPrivate const FcCharSet *
-FcCharSetForLang (const FcChar8 *lang);
-
 FcPrivate FcLangSet *
 FcLangSetPromote (const FcChar8 *lang);
 
@@ -860,6 +957,7 @@ FcListPatternMatchAny (const FcPattern *p,
 #define FC_EMBOLDEN_OBJECT     38
 #define FC_EMBEDDED_BITMAP_OBJECT      39
 #define FC_DECORATIVE_OBJECT   40
+#define FC_MAX_BASE_OBJECT     FC_DECORATIVE_OBJECT
 
 FcPrivate FcBool
 FcNameBool (const FcChar8 *v, FcBool *result);
@@ -1023,6 +1121,9 @@ FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
 FcPrivate const FcChar8 *
 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
 
+FcPrivate const FcChar8 *
+FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2);
+
 FcPrivate FcBool
 FcStrUsesHome (const FcChar8 *s);