]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Replace 'KEITH PACKARD' with 'THE AUTHOR(S)' in license text in all files
[fontconfig.git] / src / fcint.h
index 99ffe927efafedee9590078c2e3fefae3d8870da..157e9738b2c1144c23a235ff207cf041f0f7dfc2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $RCSId: xc/lib/fontconfig/src/fcint.h,v 1.27 2002/08/31 22:17:32 keithp Exp $
+ * fontconfig/src/fcint.h
  *
  * Copyright © 2000 Keith Packard
  *
@@ -13,9 +13,9 @@
  * representations about the suitability of this software for any purpose.  It
  * is provided "as is" without express or implied warranty.
  *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 #include <ctype.h>
 #include <errno.h>
 #include <unistd.h>
+#include <stddef.h>
 #include <sys/types.h>
 #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 */
@@ -310,6 +313,7 @@ typedef struct _FcStrBuf {
     FcBool  failed;
     int            len;
     int            size;
+    FcChar8 buf_static[16 * sizeof (void *)];
 } FcStrBuf;
 
 struct _FcCache {
@@ -320,8 +324,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 +411,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 */
@@ -419,11 +426,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
@@ -474,11 +476,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
@@ -487,6 +484,8 @@ struct _FcConfig {
      */
     time_t     rescanTime;         /* last time information was scanned */
     int                rescanInterval;     /* interval between scans */
+
+    int                ref;                /* reference count */
 };
  
 extern FcPrivate FcConfig      *_fcConfig;
@@ -509,14 +508,30 @@ 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);
     
+FcPrivate void
+FcCacheObjectReference (void *object);
+
+FcPrivate void
+FcCacheObjectDereference (void *object);
+
 FcPrivate void
 FcCacheFini (void);
     
+FcPrivate void
+FcDirCacheReference (FcCache *cache, int nref);
+
+#ifdef _WIN32
+FcPrivate int
+FcStat (const char *file, struct stat *statb)
+#else
+#define FcStat stat
+#endif
+
 /* fccfg.c */
 
 FcPrivate FcBool
@@ -581,7 +596,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
@@ -630,6 +646,16 @@ FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
 FcPrivate FcCharSet *
 FcNameParseCharSet (FcChar8 *string);
 
+FcPrivate FcBool
+FcNameUnparseValue (FcStrBuf    *buf,
+                    FcValue     *v0,
+                   FcChar8     *escape);
+
+FcPrivate FcBool
+FcNameUnparseValueList (FcStrBuf       *buf,
+                       FcValueListPtr  v,
+                       FcChar8         *escape);
+
 FcPrivate FcCharLeaf *
 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
 
@@ -699,22 +725,6 @@ FcDirScanConfig (FcFontSet *set,
 FcPrivate int
 FcFontDebug (void);
     
-/* fcfreetype.c */
-FcPrivate FcBool
-FcFreeTypeIsExclusiveLang (const FcChar8  *lang);
-
-FcPrivate FcBool
-FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
-
-FcPrivate FcChar32
-FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
-
-FcPrivate FcChar32
-FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
-
-FcPrivate const FcCharMap *
-FcFreeTypeGetPrivateMap (FT_Encoding encoding);
-    
 /* fcfs.c */
 
 FcPrivate FcBool
@@ -791,9 +801,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);
 
@@ -861,6 +868,8 @@ FcListPatternMatchAny (const FcPattern *p,
 #define FC_EMBOLDEN_OBJECT     38
 #define FC_EMBEDDED_BITMAP_OBJECT      39
 #define FC_DECORATIVE_OBJECT   40
+#define FC_LCD_FILTER_OBJECT   41
+#define FC_MAX_BASE_OBJECT     FC_LCD_FILTER_OBJECT
 
 FcPrivate FcBool
 FcNameBool (const FcChar8 *v, FcBool *result);
@@ -874,6 +883,9 @@ FcObjectFromName (const char * name);
 FcPrivate const char *
 FcObjectName (FcObject object);
 
+FcPrivate FcObjectSet *
+FcObjectGetSet (void);
+
 FcPrivate FcBool
 FcObjectInit (void);
 
@@ -1006,6 +1018,9 @@ FcStrBufDestroy (FcStrBuf *buf);
 FcPrivate FcChar8 *
 FcStrBufDone (FcStrBuf *buf);
 
+FcPrivate FcChar8 *
+FcStrBufDoneStatic (FcStrBuf *buf);
+
 FcPrivate FcBool
 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
 
@@ -1024,6 +1039,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);