(root)/
fontconfig-2.14.2/
src/
fcint.h
       1  /*
       2   * fontconfig/src/fcint.h
       3   *
       4   * Copyright © 2000 Keith Packard
       5   *
       6   * Permission to use, copy, modify, distribute, and sell this software and its
       7   * documentation for any purpose is hereby granted without fee, provided that
       8   * the above copyright notice appear in all copies and that both that
       9   * copyright notice and this permission notice appear in supporting
      10   * documentation, and that the name of the author(s) not be used in
      11   * advertising or publicity pertaining to distribution of the software without
      12   * specific, written prior permission.  The authors make no
      13   * representations about the suitability of this software for any purpose.  It
      14   * is provided "as is" without express or implied warranty.
      15   *
      16   * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
      17   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
      18   * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
      19   * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
      20   * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
      21   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
      22   * PERFORMANCE OF THIS SOFTWARE.
      23   */
      24  
      25  #ifndef _FCINT_H_
      26  #define _FCINT_H_
      27  
      28  #ifdef HAVE_CONFIG_H
      29  #include <config.h>
      30  #endif
      31  
      32  #include "fcstdint.h"
      33  
      34  #include <stdlib.h>
      35  #include <stdio.h>
      36  #include <string.h>
      37  #include <ctype.h>
      38  #include <assert.h>
      39  #include <errno.h>
      40  #include <limits.h>
      41  #include <float.h>
      42  #include <math.h>
      43  #ifdef HAVE_UNISTD_H
      44  #include <unistd.h>
      45  #endif
      46  #include <stddef.h>
      47  #include <sys/types.h>
      48  #include <sys/stat.h>
      49  #include <time.h>
      50  #include <fontconfig/fontconfig.h>
      51  #include <fontconfig/fcprivate.h>
      52  #include "fcdeprecate.h"
      53  #include "fcmutex.h"
      54  #include "fcatomic.h"
      55  
      56  #ifndef FC_CONFIG_PATH
      57  #define FC_CONFIG_PATH "fonts.conf"
      58  #endif
      59  
      60  #ifdef _WIN32
      61  #define FC_LIKELY(expr) (expr)
      62  #define FC_UNLIKELY(expr) (expr)
      63  #else
      64  #define FC_LIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 1))
      65  #define FC_UNLIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 0))
      66  #endif
      67  
      68  #ifdef _WIN32
      69  #  include "fcwindows.h"
      70  typedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT);
      71  typedef HRESULT (WINAPI *pfnSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
      72  extern pfnGetSystemWindowsDirectory pGetSystemWindowsDirectory;
      73  extern pfnSHGetFolderPathA pSHGetFolderPathA;
      74  #  define FC_SEARCH_PATH_SEPARATOR ';'
      75  #  define FC_DIR_SEPARATOR         '\\'
      76  #  define FC_DIR_SEPARATOR_S       "\\"
      77  #else
      78  #  define FC_SEARCH_PATH_SEPARATOR ':'
      79  #  define FC_DIR_SEPARATOR         '/'
      80  #  define FC_DIR_SEPARATOR_S       "/"
      81  #endif
      82  
      83  #ifdef PATH_MAX
      84  #define FC_PATH_MAX	PATH_MAX
      85  #else
      86  #define FC_PATH_MAX	128
      87  #endif
      88  
      89  #if __GNUC__ >= 4
      90  #define FC_UNUSED	__attribute__((unused))
      91  #else
      92  #define FC_UNUSED
      93  #endif
      94  
      95  #ifndef FC_UINT64_FORMAT
      96  #define FC_UINT64_FORMAT	"llu"
      97  #endif
      98  
      99  #define FC_DBG_MATCH	1
     100  #define FC_DBG_MATCHV	2
     101  #define FC_DBG_EDIT	4
     102  #define FC_DBG_FONTSET	8
     103  #define FC_DBG_CACHE	16
     104  #define FC_DBG_CACHEV	32
     105  #define FC_DBG_PARSE	64
     106  #define FC_DBG_SCAN	128
     107  #define FC_DBG_SCANV	256
     108  #define FC_DBG_CONFIG	1024
     109  #define FC_DBG_LANGSET	2048
     110  #define FC_DBG_MATCH2	4096
     111  
     112  #define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1] FC_UNUSED
     113  #define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond))
     114  #define FC_ASSERT_STATIC(_cond) _FC_ASSERT_STATIC0 (__LINE__, (_cond))
     115  
     116  #define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
     117  #define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
     118  
     119  /* slim_internal.h */
     120  #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
     121  #define FcPrivate		__attribute__((__visibility__("hidden")))
     122  #define HAVE_GNUC_ATTRIBUTE 1
     123  #include "fcalias.h"
     124  #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
     125  #define FcPrivate		__hidden
     126  #else /* not gcc >= 3.3 and not Sun Studio >= 8 */
     127  #define FcPrivate
     128  #endif
     129  
     130  /* NLS */
     131  #ifdef ENABLE_NLS
     132  #include <libintl.h>
     133  #define _(x)		(dgettext(GETTEXT_PACKAGE, x))
     134  #else
     135  #define dgettext(d, s)	(s)
     136  #define _(x)		(x)
     137  #endif
     138  
     139  #define N_(x)	x
     140  
     141  FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
     142  
     143  #define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
     144  #define FcFree(s) (free ((FcChar8 *) (s)))
     145  
     146  /*
     147   * Serialized data structures use only offsets instead of pointers
     148   * A low bit of 1 indicates an offset.
     149   */
     150  
     151  /* Is the provided pointer actually an offset? */
     152  #define FcIsEncodedOffset(p)	((((intptr_t) (p)) & 1) != 0)
     153  
     154  /* Encode offset in a pointer of type t */
     155  #define FcOffsetEncode(o,t)	((t *) (intptr_t) ((o) | 1))
     156  
     157  /* Decode a pointer into an offset */
     158  #define FcOffsetDecode(p)	(((intptr_t) (p)) & ~1)
     159  
     160  /* Compute pointer offset */
     161  #define FcPtrToOffset(b,p)	((ptrdiff_t) ((intptr_t) (p) - (intptr_t) (b)))
     162  
     163  /* Given base address, offset and type, return a pointer */
     164  #define FcOffsetToPtr(b,o,t)	((t *) ((intptr_t) (b) + (ptrdiff_t) (o)))
     165  
     166  /* Given base address, encoded offset and type, return a pointer */
     167  #define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t)
     168  
     169  /* Given base address, pointer and type, return an encoded offset */
     170  #define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t)
     171  
     172  /* Given a structure, offset member and type, return pointer */
     173  #define FcOffsetMember(s,m,t)	    FcOffsetToPtr(s,(s)->m,t)
     174  
     175  /* Given a structure, encoded offset member and type, return pointer to member */
     176  #define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t)
     177  
     178  /* Given a structure, member and type, convert the member to a pointer */
     179  #define FcPointerMember(s,m,t)	(FcIsEncodedOffset((s)->m) ? \
     180  				 FcEncodedOffsetMember (s,m,t) : \
     181  				 (s)->m)
     182  
     183  /*
     184   * Serialized values may hold strings, charsets and langsets as pointers,
     185   * unfortunately FcValue is an exposed type so we can't just always use
     186   * offsets
     187   */
     188  #define FcValueString(v)	FcPointerMember(v,u.s,FcChar8)
     189  #define FcValueCharSet(v)	FcPointerMember(v,u.c,const FcCharSet)
     190  #define FcValueLangSet(v)	FcPointerMember(v,u.l,const FcLangSet)
     191  #define FcValueRange(v)		FcPointerMember(v,u.r,const FcRange)
     192  
     193  typedef struct _FcValueList *FcValueListPtr;
     194  
     195  typedef struct _FcValueList {
     196      struct _FcValueList	*next;
     197      FcValue		value;
     198      FcValueBinding	binding;
     199  } FcValueList;
     200  
     201  #define FcValueListNext(vl)	FcPointerMember(vl,next,FcValueList)
     202  
     203  typedef int FcObject;
     204  
     205  /* The 1024 is to leave some room for future added internal objects, such
     206   * that caches from newer fontconfig can still be used with older fontconfig
     207   * without getting confused. */
     208  #define FC_EXT_OBJ_INDEX	1024
     209  #define FC_OBJ_ID(_n_)	((_n_) & (~FC_EXT_OBJ_INDEX))
     210  
     211  typedef struct _FcPatternElt *FcPatternEltPtr;
     212  
     213  /*
     214   * Pattern elts are stuck in a structure connected to the pattern,
     215   * so they get moved around when the pattern is resized. Hence, the
     216   * values field must be a pointer/offset instead of just an offset
     217   */
     218  typedef struct _FcPatternElt {
     219      FcObject		object;
     220      FcValueList		*values;
     221  } FcPatternElt;
     222  
     223  #define FcPatternEltValues(pe)	FcPointerMember(pe,values,FcValueList)
     224  
     225  struct _FcPattern {
     226      int		    num;
     227      int		    size;
     228      intptr_t	    elts_offset;
     229      FcRef	    ref;
     230  };
     231  
     232  #define FcPatternElts(p)	FcOffsetMember(p,elts_offset,FcPatternElt)
     233  
     234  #define FcFontSetFonts(fs)	FcPointerMember(fs,fonts,FcPattern *)
     235  
     236  #define FcFontSetFont(fs,i)	(FcIsEncodedOffset((fs)->fonts) ? \
     237  				 FcEncodedOffsetToPtr(fs, \
     238  						      FcFontSetFonts(fs)[i], \
     239  						      FcPattern) : \
     240  				 fs->fonts[i])
     241  
     242  typedef enum _FcOp {
     243      FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpRange, FcOpBool, FcOpCharSet, FcOpLangSet,
     244      FcOpNil,
     245      FcOpField, FcOpConst,
     246      FcOpAssign, FcOpAssignReplace,
     247      FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
     248      FcOpDelete, FcOpDeleteAll,
     249      FcOpQuest,
     250      FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
     251      FcOpContains, FcOpListing, FcOpNotContains,
     252      FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
     253      FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
     254      FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
     255      FcOpInvalid
     256  } FcOp;
     257  
     258  typedef enum _FcOpFlags {
     259  	FcOpFlagIgnoreBlanks = 1U << 0
     260  } FcOpFlags;
     261  
     262  #define FC_OP_GET_OP(_x_)	((_x_) & 0xffff)
     263  #define FC_OP_GET_FLAGS(_x_)	(((_x_) & 0xffff0000) >> 16)
     264  #define FC_OP(_x_,_f_)		(FC_OP_GET_OP (_x_) | ((_f_) << 16))
     265  
     266  typedef struct _FcExprMatrix {
     267    struct _FcExpr *xx, *xy, *yx, *yy;
     268  } FcExprMatrix;
     269  
     270  typedef struct _FcExprName {
     271    FcObject	object;
     272    FcMatchKind	kind;
     273  } FcExprName;
     274  
     275  struct _FcRange {
     276      double begin;
     277      double end;
     278  };
     279  
     280  
     281  typedef struct _FcExpr {
     282      FcOp   op;
     283      union {
     284  	int		ival;
     285  	double		dval;
     286  	const FcChar8	*sval;
     287  	FcExprMatrix	*mexpr;
     288  	FcBool		bval;
     289  	FcCharSet	*cval;
     290  	FcLangSet	*lval;
     291  	FcRange		*rval;
     292  
     293  	FcExprName	name;
     294  	const FcChar8	*constant;
     295  	struct {
     296  	    struct _FcExpr *left, *right;
     297  	} tree;
     298      } u;
     299  } FcExpr;
     300  
     301  typedef struct _FcExprPage FcExprPage;
     302  
     303  struct _FcExprPage {
     304    FcExprPage *next_page;
     305    FcExpr *next;
     306    FcExpr exprs[(1024 - 2/* two pointers */ - 2/* malloc overhead */) * sizeof (void *) / sizeof (FcExpr)];
     307    FcExpr end[FLEXIBLE_ARRAY_MEMBER];
     308  };
     309  
     310  typedef enum _FcQual {
     311      FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
     312  } FcQual;
     313  
     314  #define FcMatchDefault	((FcMatchKind) -1)
     315  
     316  typedef struct _FcTest {
     317      FcMatchKind		kind;
     318      FcQual		qual;
     319      FcObject		object;
     320      FcOp		op;
     321      FcExpr		*expr;
     322  } FcTest;
     323  
     324  typedef struct _FcEdit {
     325      FcObject	    object;
     326      FcOp	    op;
     327      FcExpr	    *expr;
     328      FcValueBinding  binding;
     329  } FcEdit;
     330  
     331  typedef void (* FcDestroyFunc) (void *data);
     332  
     333  typedef struct _FcPtrList	FcPtrList;
     334  /* need to sync with FcConfigFileInfoIter at fontconfig.h */
     335  typedef struct _FcPtrListIter {
     336      void *dummy1;
     337      void *dummy2;
     338      void *dummy3;
     339  } FcPtrListIter;
     340  
     341  typedef enum _FcRuleType {
     342      FcRuleUnknown, FcRuleTest, FcRuleEdit
     343  } FcRuleType;
     344  
     345  typedef struct _FcRule {
     346      struct _FcRule *next;
     347      FcRuleType      type;
     348      union {
     349  	FcTest *test;
     350  	FcEdit *edit;
     351      } u;
     352  } FcRule;
     353  
     354  typedef struct _FcRuleSet {
     355      FcRef	ref;
     356      FcChar8	*name;
     357      FcChar8	*description;
     358      FcChar8	*domain;
     359      FcBool	enabled;
     360      FcPtrList	*subst[FcMatchKindEnd];
     361  } FcRuleSet;
     362  
     363  typedef struct _FcCharLeaf {
     364      FcChar32	map[256/32];
     365  } FcCharLeaf;
     366  
     367  struct _FcCharSet {
     368      FcRef	    ref;	/* reference count */
     369      int		    num;	/* size of leaves and numbers arrays */
     370      intptr_t	    leaves_offset;
     371      intptr_t	    numbers_offset;
     372  };
     373  
     374  #define FcCharSetLeaves(c)	FcOffsetMember(c,leaves_offset,intptr_t)
     375  #define FcCharSetLeaf(c,i)	(FcOffsetToPtr(FcCharSetLeaves(c), \
     376  					       FcCharSetLeaves(c)[i], \
     377  					       FcCharLeaf))
     378  #define FcCharSetNumbers(c)	FcOffsetMember(c,numbers_offset,FcChar16)
     379  
     380  #define FCSS_DEFAULT            0 /* default behavior */
     381  #define FCSS_ALLOW_DUPLICATES   1 /* allows for duplicate strings in the set */
     382  #define FCSS_GROW_BY_64         2 /* grows buffer by 64 elements instead of 1 */
     383  
     384  #define FcStrSetHasControlBit(s,c)  (s->control & c)
     385  #define FcStrSetHasControlBits(s,c) ( (c) == (s->control & (c)) )
     386  
     387  struct _FcStrSet {
     388      FcRef	    ref;	/* reference count */
     389      int		    num;
     390      int		    size;
     391      FcChar8	    **strs;
     392      unsigned int    control;    /* control bits for set behavior */
     393  };
     394  
     395  struct _FcStrList {
     396      FcStrSet	    *set;
     397      int		    n;
     398  };
     399  
     400  typedef struct _FcStrBuf {
     401      FcChar8 *buf;
     402      FcBool  allocated;
     403      FcBool  failed;
     404      int	    len;
     405      int	    size;
     406      FcChar8 buf_static[16 * sizeof (void *)];
     407  } FcStrBuf;
     408  
     409  typedef struct _FcHashTable	FcHashTable;
     410  
     411  typedef FcChar32 (* FcHashFunc)	   (const void *data);
     412  typedef int	 (* FcCompareFunc) (const void *v1, const void *v2);
     413  typedef FcBool	 (* FcCopyFunc)	   (const void *src, void **dest);
     414  
     415  
     416  struct _FcCache {
     417      unsigned int magic;              /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
     418      int		version;	    /* FC_CACHE_VERSION_NUMBER */
     419      intptr_t	size;		    /* size of file */
     420      intptr_t	dir;		    /* offset to dir name */
     421      intptr_t	dirs;		    /* offset to subdirs */
     422      int		dirs_count;	    /* number of subdir strings */
     423      intptr_t	set;		    /* offset to font set */
     424      int		checksum;	    /* checksum of directory state */
     425      int64_t	checksum_nano;	    /* checksum of directory state */
     426  };
     427  
     428  #undef FcCacheDir
     429  #undef FcCacheSubdir
     430  #define FcCacheDir(c)	FcOffsetMember(c,dir,FcChar8)
     431  #define FcCacheDirs(c)	FcOffsetMember(c,dirs,intptr_t)
     432  #define FcCacheSet(c)	FcOffsetMember(c,set,FcFontSet)
     433  #define FcCacheSubdir(c,i)  FcOffsetToPtr (FcCacheDirs(c),\
     434  					   FcCacheDirs(c)[i], \
     435  					   FcChar8)
     436  
     437  /*
     438   * Used while constructing a directory cache object
     439   */
     440  
     441  typedef union _FcAlign {
     442      double	d;
     443      int		i;
     444      intptr_t	ip;
     445      FcBool	b;
     446      void	*p;
     447  } FcAlign;
     448  
     449  typedef struct _FcSerializeBucket {
     450      const void	*object; /* key */
     451      uintptr_t	hash;    /* hash of key */
     452      intptr_t	offset;  /* value */
     453  } FcSerializeBucket;
     454  
     455  typedef struct _FcCharSetFreezer FcCharSetFreezer;
     456  
     457  typedef struct _FcSerialize {
     458      intptr_t		size;
     459      FcCharSetFreezer	*cs_freezer;
     460      void		*linear;
     461      FcSerializeBucket	*buckets;
     462      size_t		buckets_count;
     463      size_t		buckets_used;
     464      size_t		buckets_used_max;
     465  } FcSerialize;
     466  
     467  /*
     468   * To map adobe glyph names to unicode values, a precomputed hash
     469   * table is used
     470   */
     471  
     472  typedef struct _FcGlyphName {
     473      FcChar32	ucs;		/* unicode value */
     474      FcChar8	name[1];	/* name extends beyond struct */
     475  } FcGlyphName;
     476  
     477  /*
     478   * To perform case-insensitive string comparisons, a table
     479   * is used which holds three different kinds of folding data.
     480   *
     481   * The first is a range of upper case values mapping to a range
     482   * of their lower case equivalents.  Within each range, the offset
     483   * between upper and lower case is constant.
     484   *
     485   * The second is a range of upper case values which are interleaved
     486   * with their lower case equivalents.
     487   *
     488   * The third is a set of raw unicode values mapping to a list
     489   * of unicode values for comparison purposes.  This allows conversion
     490   * of ß to "ss" so that SS, ss and ß all match.  A separate array
     491   * holds the list of unicode values for each entry.
     492   *
     493   * These are packed into a single table.  Using a binary search,
     494   * the appropriate entry can be located.
     495   */
     496  
     497  #define FC_CASE_FOLD_RANGE	    0
     498  #define FC_CASE_FOLD_EVEN_ODD	    1
     499  #define FC_CASE_FOLD_FULL	    2
     500  
     501  typedef struct _FcCaseFold {
     502      FcChar32	upper;
     503      FcChar16	method : 2;
     504      FcChar16	count : 14;
     505      short    	offset;	    /* lower - upper for RANGE, table id for FULL */
     506  } FcCaseFold;
     507  
     508  #define FC_MAX_FILE_LEN	    4096
     509  
     510  #define FC_CACHE_MAGIC_MMAP	    0xFC02FC04
     511  #define FC_CACHE_MAGIC_ALLOC	    0xFC02FC05
     512  
     513  struct _FcAtomic {
     514      FcChar8	*file;		/* original file name */
     515      FcChar8	*new;		/* temp file name -- write data here */
     516      FcChar8	*lck;		/* lockfile name (used for locking) */
     517      FcChar8	*tmp;		/* tmpfile name (used for locking) */
     518  };
     519  
     520  struct _FcConfig {
     521      /*
     522       * File names loaded from the configuration -- saved here as the
     523       * cache file must be consulted before the directories are scanned,
     524       * and those directives may occur in any order
     525       */
     526      FcStrSet	*configDirs;	    /* directories to scan for fonts */
     527      FcStrSet	*configMapDirs;	    /* mapped names to generate cache entries */
     528      /*
     529       * List of directories containing fonts,
     530       * built by recursively scanning the set
     531       * of configured directories
     532       */
     533      FcStrSet	*fontDirs;
     534      /*
     535       * List of directories containing cache files.
     536       */
     537      FcStrSet	*cacheDirs;
     538      /*
     539       * Names of all of the configuration files used
     540       * to create this configuration
     541       */
     542      FcStrSet	*configFiles;	    /* config files loaded */
     543      /*
     544       * Substitution instructions for patterns and fonts;
     545       * maxObjects is used to allocate appropriate intermediate storage
     546       * while performing a whole set of substitutions
     547       *
     548       * 0.. substitutions for patterns
     549       * 1.. substitutions for fonts
     550       * 2.. substitutions for scanned fonts
     551       */
     552      FcPtrList	*subst[FcMatchKindEnd];
     553      int		maxObjects;	    /* maximum number of tests in all substs */
     554      /*
     555       * List of patterns used to control font file selection
     556       */
     557      FcStrSet	*acceptGlobs;
     558      FcStrSet	*rejectGlobs;
     559      FcFontSet	*acceptPatterns;
     560      FcFontSet	*rejectPatterns;
     561      /*
     562       * The set of fonts loaded from the listed directories; the
     563       * order within the set does not determine the font selection,
     564       * except in the case of identical matches in which case earlier fonts
     565       * match preferrentially
     566       */
     567      FcFontSet	*fonts[FcSetApplication + 1];
     568      /*
     569       * Fontconfig can periodically rescan the system configuration
     570       * and font directories.  This rescanning occurs when font
     571       * listing requests are made, but no more often than rescanInterval
     572       * seconds apart.
     573       */
     574      time_t	rescanTime;	    /* last time information was scanned */
     575      int		rescanInterval;	    /* interval between scans */
     576  
     577      FcRef	ref;                /* reference count */
     578  
     579      FcExprPage  *expr_pool;	    /* pool of FcExpr's */
     580  
     581      FcChar8     *sysRoot;	    /* override the system root directory */
     582      FcStrSet	*availConfigFiles;  /* config files available */
     583      FcPtrList	*rulesetList;	    /* List of rulesets being installed */
     584  };
     585  
     586  typedef struct _FcFileTime {
     587      time_t  time;
     588      FcBool  set;
     589  } FcFileTime;
     590  
     591  typedef struct _FcCharMap FcCharMap;
     592  
     593  typedef struct _FcStatFS    FcStatFS;
     594  
     595  struct _FcStatFS {
     596      FcBool is_remote_fs;
     597      FcBool is_mtime_broken;
     598  };
     599  
     600  typedef struct _FcValuePromotionBuffer FcValuePromotionBuffer;
     601  
     602  struct _FcValuePromotionBuffer {
     603    union {
     604      double d;
     605      int i;
     606      long l;
     607      char c[256]; /* Enlarge as needed */
     608    } u;
     609  };
     610  
     611  /* fccache.c */
     612  
     613  FcPrivate FcCache *
     614  FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
     615  
     616  FcPrivate FcCache *
     617  FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
     618  
     619  FcPrivate FcCache *
     620  FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
     621  
     622  FcPrivate FcBool
     623  FcDirCacheWrite (FcCache *cache, FcConfig *config);
     624  
     625  FcPrivate FcBool
     626  FcDirCacheCreateTagFile (const FcChar8 *cache_dir);
     627  
     628  FcPrivate void
     629  FcCacheObjectReference (void *object);
     630  
     631  FcPrivate void
     632  FcCacheObjectDereference (void *object);
     633  
     634  FcPrivate void *
     635  FcCacheAllocate (FcCache *cache, size_t len);
     636  
     637  FcPrivate void
     638  FcCacheFini (void);
     639  
     640  
     641  FcPrivate void
     642  FcDirCacheReference (FcCache *cache, int nref);
     643  
     644  FcPrivate int
     645  FcDirCacheLock (const FcChar8 *dir,
     646  		FcConfig      *config);
     647  
     648  FcPrivate void
     649  FcDirCacheUnlock (int fd);
     650  
     651  /* fccfg.c */
     652  
     653  FcPrivate FcBool
     654  FcConfigInit (void);
     655  
     656  FcPrivate void
     657  FcConfigFini (void);
     658  
     659  FcPrivate FcChar8 *
     660  FcConfigXdgCacheHome (void);
     661  
     662  FcPrivate FcChar8 *
     663  FcConfigXdgConfigHome (void);
     664  
     665  FcPrivate FcChar8 *
     666  FcConfigXdgDataHome (void);
     667  
     668  FcPrivate FcStrSet *
     669  FcConfigXdgDataDirs (void);
     670  
     671  FcPrivate FcExpr *
     672  FcConfigAllocExpr (FcConfig *config);
     673  
     674  FcPrivate FcBool
     675  FcConfigAddConfigDir (FcConfig	    *config,
     676  		      const FcChar8 *d);
     677  
     678  FcPrivate FcBool
     679  FcConfigAddFontDir (FcConfig	    *config,
     680  		    const FcChar8   *d,
     681  		    const FcChar8   *m,
     682  		    const FcChar8   *salt);
     683  
     684  FcPrivate FcBool
     685  FcConfigResetFontDirs (FcConfig *config);
     686  
     687  FcPrivate FcChar8 *
     688  FcConfigMapFontPath(FcConfig		*config,
     689  		    const FcChar8	*path);
     690  
     691  FcPrivate const FcChar8 *
     692  FcConfigMapSalt (FcConfig      *config,
     693  		 const FcChar8 *path);
     694  
     695  FcPrivate FcBool
     696  FcConfigAddCacheDir (FcConfig	    *config,
     697  		     const FcChar8  *d);
     698  
     699  FcPrivate FcBool
     700  FcConfigAddConfigFile (FcConfig		*config,
     701  		       const FcChar8	*f);
     702  
     703  FcPrivate FcBool
     704  FcConfigAddBlank (FcConfig	*config,
     705  		  FcChar32    	blank);
     706  
     707  FcBool
     708  FcConfigAddRule (FcConfig	*config,
     709  		 FcRule		*rule,
     710  		 FcMatchKind	kind);
     711  
     712  FcPrivate void
     713  FcConfigSetFonts (FcConfig	*config,
     714  		  FcFontSet	*fonts,
     715  		  FcSetName	set);
     716  
     717  FcPrivate FcBool
     718  FcConfigCompareValue (const FcValue *m,
     719  		      unsigned int   op_,
     720  		      const FcValue *v);
     721  
     722  FcPrivate FcBool
     723  FcConfigGlobAdd (FcConfig	*config,
     724  		 const FcChar8	*glob,
     725  		 FcBool		accept);
     726  
     727  FcPrivate FcBool
     728  FcConfigAcceptFilename (FcConfig	*config,
     729  			const FcChar8	*filename);
     730  
     731  FcPrivate FcBool
     732  FcConfigPatternsAdd (FcConfig	*config,
     733  		     FcPattern	*pattern,
     734  		     FcBool	accept);
     735  
     736  FcPrivate FcBool
     737  FcConfigAcceptFont (FcConfig	    *config,
     738  		    const FcPattern *font);
     739  
     740  FcPrivate FcFileTime
     741  FcConfigModifiedTime (FcConfig *config);
     742  
     743  FcPrivate FcBool
     744  FcConfigAddCache (FcConfig *config, FcCache *cache,
     745  		  FcSetName set, FcStrSet *dirSet, FcChar8 *forDir);
     746  
     747  FcPrivate FcRuleSet *
     748  FcRuleSetCreate (const FcChar8 *name);
     749  
     750  FcPrivate void
     751  FcRuleSetDestroy (FcRuleSet *rs);
     752  
     753  FcPrivate void
     754  FcRuleSetReference (FcRuleSet *rs);
     755  
     756  FcPrivate void
     757  FcRuleSetEnable (FcRuleSet	*rs,
     758  		 FcBool		flag);
     759  
     760  FcPrivate void
     761  FcRuleSetAddDescription (FcRuleSet	*rs,
     762  			 const FcChar8	*domain,
     763  			 const FcChar8	*description);
     764  
     765  FcPrivate int
     766  FcRuleSetAdd (FcRuleSet		*rs,
     767  	      FcRule		*rule,
     768  	      FcMatchKind	kind);
     769  
     770  /* fcserialize.c */
     771  FcPrivate intptr_t
     772  FcAlignSize (intptr_t size);
     773  
     774  FcPrivate FcSerialize *
     775  FcSerializeCreate (void);
     776  
     777  FcPrivate void
     778  FcSerializeDestroy (FcSerialize *serialize);
     779  
     780  FcPrivate FcBool
     781  FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
     782  
     783  FcPrivate intptr_t
     784  FcSerializeReserve (FcSerialize *serialize, int size);
     785  
     786  FcPrivate intptr_t
     787  FcSerializeOffset (FcSerialize *serialize, const void *object);
     788  
     789  FcPrivate void *
     790  FcSerializePtr (FcSerialize *serialize, const void *object);
     791  
     792  FcPrivate FcBool
     793  FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
     794  
     795  FcPrivate FcLangSet *
     796  FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
     797  
     798  /* fccharset.c */
     799  FcPrivate FcCharSet *
     800  FcCharSetPromote (FcValuePromotionBuffer *vbuf);
     801  
     802  FcPrivate void
     803  FcLangCharSetPopulate (void);
     804  
     805  FcPrivate FcCharSetFreezer *
     806  FcCharSetFreezerCreate (void);
     807  
     808  FcPrivate const FcCharSet *
     809  FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
     810  
     811  FcPrivate void
     812  FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
     813  
     814  FcPrivate FcBool
     815  FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
     816  
     817  FcPrivate FcCharSet *
     818  FcNameParseCharSet (FcChar8 *string);
     819  
     820  FcPrivate FcBool
     821  FcNameUnparseValue (FcStrBuf    *buf,
     822                      FcValue     *v0,
     823  		    FcChar8     *escape);
     824  
     825  FcPrivate FcBool
     826  FcNameUnparseValueList (FcStrBuf	*buf,
     827  			FcValueListPtr	v,
     828  			FcChar8		*escape);
     829  
     830  FcPrivate FcCharLeaf *
     831  FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
     832  
     833  FcPrivate FcBool
     834  FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
     835  
     836  FcPrivate FcCharSet *
     837  FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
     838  
     839  FcPrivate FcChar16 *
     840  FcCharSetGetNumbers(const FcCharSet *c);
     841  
     842  /* fccompat.c */
     843  FcPrivate int
     844  FcOpen(const char *pathname, int flags, ...);
     845  
     846  FcPrivate int
     847  FcMakeTempfile (char *template);
     848  
     849  FcPrivate int32_t
     850  FcRandom (void);
     851  
     852  FcPrivate FcBool
     853  FcMakeDirectory (const FcChar8 *dir);
     854  
     855  FcPrivate ssize_t
     856  FcReadLink (const FcChar8 *pathname,
     857  	    FcChar8       *buf,
     858  	    size_t         bufsiz);
     859  
     860  /* fcdbg.c */
     861  
     862  FcPrivate void
     863  FcValuePrintFile (FILE *f, const FcValue v);
     864  
     865  FcPrivate void
     866  FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark);
     867  
     868  FcPrivate void
     869  FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos);
     870  
     871  FcPrivate void
     872  FcValueListPrint (FcValueListPtr l);
     873  
     874  FcPrivate void
     875  FcLangSetPrint (const FcLangSet *ls);
     876  
     877  FcPrivate void
     878  FcOpPrint (FcOp op);
     879  
     880  FcPrivate void
     881  FcTestPrint (const FcTest *test);
     882  
     883  FcPrivate void
     884  FcExprPrint (const FcExpr *expr);
     885  
     886  FcPrivate void
     887  FcEditPrint (const FcEdit *edit);
     888  
     889  FcPrivate void
     890  FcRulePrint (const FcRule *rule);
     891  
     892  FcPrivate void
     893  FcCharSetPrint (const FcCharSet *c);
     894  
     895  FcPrivate void
     896  FcPatternPrint2 (FcPattern *p1, FcPattern *p2, const FcObjectSet *os);
     897  
     898  extern FcPrivate int FcDebugVal;
     899  
     900  #define FcDebug() (FcDebugVal)
     901  
     902  FcPrivate void
     903  FcInitDebug (void);
     904  
     905  /* fcdefault.c */
     906  FcPrivate FcChar8 *
     907  FcGetDefaultLang (void);
     908  
     909  FcPrivate FcChar8 *
     910  FcGetPrgname (void);
     911  
     912  FcPrivate FcChar8 *
     913  FcGetDesktopName (void);
     914  
     915  FcPrivate void
     916  FcDefaultFini (void);
     917  
     918  /* fcdir.c */
     919  
     920  FcPrivate FcBool
     921  FcFileIsLink (const FcChar8 *file);
     922  
     923  FcPrivate FcBool
     924  FcFileIsFile (const FcChar8 *file);
     925  
     926  FcPrivate FcBool
     927  FcFileScanConfig (FcFontSet	*set,
     928  		  FcStrSet	*dirs,
     929  		  const FcChar8 *file,
     930  		  FcConfig	*config);
     931  
     932  FcPrivate FcBool
     933  FcDirScanConfig (FcFontSet	*set,
     934  		 FcStrSet	*dirs,
     935  		 const FcChar8	*dir,
     936  		 FcBool		force,
     937  		 FcConfig	*config);
     938  
     939  /* fcfont.c */
     940  FcPrivate int
     941  FcFontDebug (void);
     942  
     943  /* fcfs.c */
     944  
     945  FcPrivate FcBool
     946  FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
     947  
     948  FcPrivate FcFontSet *
     949  FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
     950  
     951  FcPrivate FcFontSet *
     952  FcFontSetDeserialize (const FcFontSet *set);
     953  
     954  /* fcplist.c */
     955  FcPrivate FcPtrList *
     956  FcPtrListCreate (FcDestroyFunc func);
     957  
     958  FcPrivate void
     959  FcPtrListDestroy (FcPtrList *list);
     960  
     961  FcPrivate void
     962  FcPtrListIterInit (const FcPtrList	*list,
     963  		   FcPtrListIter	*iter);
     964  
     965  FcPrivate void
     966  FcPtrListIterInitAtLast (FcPtrList	*list,
     967  			 FcPtrListIter	*iter);
     968  
     969  FcPrivate FcBool
     970  FcPtrListIterNext (const FcPtrList	*list,
     971  		   FcPtrListIter	*iter);
     972  
     973  FcPrivate FcBool
     974  FcPtrListIterIsValid (const FcPtrList		*list,
     975  		      const FcPtrListIter	*iter);
     976  
     977  FcPrivate void *
     978  FcPtrListIterGetValue (const FcPtrList		*list,
     979  		       const FcPtrListIter	*iter);
     980  
     981  FcPrivate FcBool
     982  FcPtrListIterAdd (FcPtrList	*list,
     983  		  FcPtrListIter	*iter,
     984  		void		*data);
     985  
     986  FcPrivate FcBool
     987  FcPtrListIterRemove (FcPtrList		*list,
     988  		     FcPtrListIter	*iter);
     989  
     990  /* fcinit.c */
     991  FcPrivate FcConfig *
     992  FcInitLoadOwnConfig (FcConfig *config);
     993  
     994  FcPrivate FcConfig *
     995  FcInitLoadOwnConfigAndFonts (FcConfig *config);
     996  
     997  /* fcxml.c */
     998  FcPrivate void
     999  FcConfigPathFini (void);
    1000  
    1001  FcPrivate void
    1002  FcTestDestroy (FcTest *test);
    1003  
    1004  FcPrivate void
    1005  FcEditDestroy (FcEdit *e);
    1006  
    1007  void
    1008  FcRuleDestroy (FcRule *rule);
    1009  
    1010  /* fclang.c */
    1011  FcPrivate FcLangSet *
    1012  FcFreeTypeLangSet (const FcCharSet  *charset,
    1013  		   const FcChar8    *exclusiveLang);
    1014  
    1015  FcPrivate FcLangResult
    1016  FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
    1017  
    1018  FcPrivate FcLangSet *
    1019  FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *buf);
    1020  
    1021  FcPrivate FcLangSet *
    1022  FcNameParseLangSet (const FcChar8 *string);
    1023  
    1024  FcPrivate FcBool
    1025  FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
    1026  
    1027  FcPrivate FcChar8 *
    1028  FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
    1029  
    1030  FcPrivate FcBool
    1031  FcConfigParseOnly (FcConfig		*config,
    1032  		   const FcChar8	*name,
    1033  		   FcBool		complain);
    1034  
    1035  FcPrivate FcChar8 *
    1036  FcConfigRealFilename (FcConfig		*config,
    1037  		      const FcChar8	*url);
    1038  
    1039  /* fclist.c */
    1040  
    1041  FcPrivate FcBool
    1042  FcListPatternMatchAny (const FcPattern *p,
    1043  		       const FcPattern *font);
    1044  
    1045  /* fcmatch.c */
    1046  
    1047  /* fcname.c */
    1048  
    1049  enum {
    1050    FC_INVALID_OBJECT = 0,
    1051  #define FC_OBJECT(NAME, Type, Cmp) FC_##NAME##_OBJECT,
    1052  #include "fcobjs.h"
    1053  #undef FC_OBJECT
    1054    FC_ONE_AFTER_MAX_BASE_OBJECT
    1055  #define FC_MAX_BASE_OBJECT (FC_ONE_AFTER_MAX_BASE_OBJECT - 1)
    1056  };
    1057  
    1058  FcPrivate FcBool
    1059  FcNameConstantWithObjectCheck (const FcChar8 *string, const char *object, int *result);
    1060  
    1061  FcPrivate FcBool
    1062  FcNameBool (const FcChar8 *v, FcBool *result);
    1063  
    1064  FcPrivate FcBool
    1065  FcObjectValidType (FcObject object, FcType type);
    1066  
    1067  FcPrivate FcObject
    1068  FcObjectFromName (const char * name);
    1069  
    1070  FcPrivate const char *
    1071  FcObjectName (FcObject object);
    1072  
    1073  FcPrivate FcObjectSet *
    1074  FcObjectGetSet (void);
    1075  
    1076  #define FcObjectCompare(a, b)	((int) a - (int) b)
    1077  
    1078  /* fcpat.c */
    1079  
    1080  FcPrivate FcValue
    1081  FcValueCanonicalize (const FcValue *v);
    1082  
    1083  FcPrivate FcValueListPtr
    1084  FcValueListCreate (void);
    1085  
    1086  FcPrivate void
    1087  FcValueListDestroy (FcValueListPtr l);
    1088  
    1089  FcPrivate FcValueListPtr
    1090  FcValueListPrepend (FcValueListPtr vallist,
    1091  		    FcValue        value,
    1092  		    FcValueBinding binding);
    1093  
    1094  FcPrivate FcValueListPtr
    1095  FcValueListAppend (FcValueListPtr vallist,
    1096  		   FcValue        value,
    1097  		   FcValueBinding binding);
    1098  
    1099  FcPrivate FcValueListPtr
    1100  FcValueListDuplicate(FcValueListPtr orig);
    1101  
    1102  FcPrivate FcPatternElt *
    1103  FcPatternObjectFindElt (const FcPattern *p, FcObject object);
    1104  
    1105  FcPrivate FcPatternElt *
    1106  FcPatternObjectInsertElt (FcPattern *p, FcObject object);
    1107  
    1108  FcPrivate FcBool
    1109  FcPatternObjectListAdd (FcPattern	*p,
    1110  			FcObject	object,
    1111  			FcValueListPtr	list,
    1112  			FcBool		append);
    1113  
    1114  FcPrivate FcBool
    1115  FcPatternObjectAddWithBinding  (FcPattern	*p,
    1116  				FcObject	object,
    1117  				FcValue		value,
    1118  				FcValueBinding  binding,
    1119  				FcBool		append);
    1120  
    1121  FcPrivate FcBool
    1122  FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
    1123  
    1124  FcPrivate FcBool
    1125  FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
    1126  
    1127  FcPrivate FcResult
    1128  FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b);
    1129  
    1130  FcPrivate FcResult
    1131  FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
    1132  
    1133  FcPrivate FcBool
    1134  FcPatternObjectDel (FcPattern *p, FcObject object);
    1135  
    1136  FcPrivate FcBool
    1137  FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
    1138  
    1139  FcPrivate FcBool
    1140  FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
    1141  
    1142  FcPrivate FcBool
    1143  FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
    1144  
    1145  FcPrivate FcBool
    1146  FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
    1147  
    1148  FcPrivate FcBool
    1149  FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
    1150  
    1151  FcPrivate FcBool
    1152  FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
    1153  
    1154  FcPrivate FcBool
    1155  FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
    1156  
    1157  FcPrivate FcBool
    1158  FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
    1159  
    1160  FcPrivate FcBool
    1161  FcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r);
    1162  
    1163  FcPrivate FcResult
    1164  FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
    1165  
    1166  FcPrivate FcResult
    1167  FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
    1168  
    1169  FcPrivate FcResult
    1170  FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
    1171  
    1172  FcPrivate FcResult
    1173  FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
    1174  
    1175  FcPrivate FcResult
    1176  FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
    1177  
    1178  FcPrivate FcResult
    1179  FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
    1180  
    1181  FcPrivate FcResult
    1182  FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
    1183  
    1184  FcPrivate FcResult
    1185  FcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r);
    1186  
    1187  FcPrivate FcBool
    1188  FcPatternAppend (FcPattern *p, FcPattern *s);
    1189  
    1190  FcPrivate int
    1191  FcPatternPosition (const FcPattern *p, const char *object);
    1192  
    1193  FcPrivate FcBool
    1194  FcPatternFindObjectIter (const FcPattern *pat, FcPatternIter *iter, FcObject object);
    1195  
    1196  FcPrivate FcObject
    1197  FcPatternIterGetObjectId (const FcPattern *pat, FcPatternIter *iter);
    1198  
    1199  FcPrivate FcValueListPtr
    1200  FcPatternIterGetValues (const FcPattern *pat, FcPatternIter *iter);
    1201  
    1202  FcPrivate FcPattern *
    1203  FcPatternCacheRewriteFile (const FcPattern *pat, FcCache *cache, const FcChar8 *relocated_font_file);
    1204  
    1205  FcPrivate FcChar32
    1206  FcStringHash (const FcChar8 *s);
    1207  
    1208  FcPrivate FcBool
    1209  FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
    1210  
    1211  FcPrivate FcPattern *
    1212  FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
    1213  
    1214  FcPrivate FcBool
    1215  FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
    1216  
    1217  FcPrivate FcValueList *
    1218  FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
    1219  
    1220  /* fcrender.c */
    1221  
    1222  /* fcmatrix.c */
    1223  
    1224  extern FcPrivate const FcMatrix    FcIdentityMatrix;
    1225  
    1226  FcPrivate void
    1227  FcMatrixFree (FcMatrix *mat);
    1228  
    1229  /* fcrange.c */
    1230  
    1231  FcPrivate FcRange *
    1232  FcRangePromote (double v, FcValuePromotionBuffer *vbuf);
    1233  
    1234  FcPrivate FcBool
    1235  FcRangeIsInRange (const FcRange *a, const FcRange *b);
    1236  
    1237  FcPrivate FcBool
    1238  FcRangeCompare (FcOp op, const FcRange *a, const FcRange *b);
    1239  
    1240  FcPrivate FcChar32
    1241  FcRangeHash (const FcRange *r);
    1242  
    1243  FcPrivate FcBool
    1244  FcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r);
    1245  
    1246  FcPrivate FcRange *
    1247  FcRangeSerialize (FcSerialize *serialize, const FcRange *r);
    1248  
    1249  /* fcstat.c */
    1250  
    1251  FcPrivate int
    1252  FcStat (const FcChar8 *file, struct stat *statb);
    1253  
    1254  FcPrivate int
    1255  FcStatChecksum (const FcChar8 *file, struct stat *statb);
    1256  
    1257  FcPrivate FcBool
    1258  FcIsFsMmapSafe (int fd);
    1259  
    1260  FcPrivate FcBool
    1261  FcIsFsMtimeBroken (const FcChar8 *dir);
    1262  
    1263  /* fcstr.c */
    1264  FcPrivate FcStrSet *
    1265  FcStrSetCreateEx (unsigned int control);
    1266  
    1267  FcPrivate FcBool
    1268  FcStrSetInsert (FcStrSet *set, const FcChar8 *s, int pos);
    1269  
    1270  FcPrivate FcBool
    1271  FcStrSetAddLangs (FcStrSet *strs, const char *languages);
    1272  
    1273  FcPrivate void
    1274  FcStrSetSort (FcStrSet * set);
    1275  
    1276  FcPrivate FcBool
    1277  FcStrSetMemberAB (FcStrSet *set, const FcChar8 *a, FcChar8 *b, FcChar8 **ret);
    1278  
    1279  FcPrivate FcBool
    1280  FcStrSetAddTriple (FcStrSet *set, const FcChar8 *a, const FcChar8 *b, const FcChar8 *c);
    1281  
    1282  FcPrivate const FcChar8 *
    1283  FcStrTripleSecond (FcChar8 *s);
    1284  
    1285  FcPrivate const FcChar8 *
    1286  FcStrTripleThird (FcChar8 *str);
    1287  
    1288  FcPrivate FcBool
    1289  FcStrSetAddFilenamePairWithSalt (FcStrSet *strs, const FcChar8 *d, const FcChar8 *m, const FcChar8 *salt);
    1290  
    1291  FcPrivate FcBool
    1292  FcStrSetDeleteAll (FcStrSet *set);
    1293  
    1294  FcPrivate void
    1295  FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
    1296  
    1297  FcPrivate void
    1298  FcStrBufDestroy (FcStrBuf *buf);
    1299  
    1300  FcPrivate FcChar8 *
    1301  FcStrBufDone (FcStrBuf *buf);
    1302  
    1303  FcPrivate FcChar8 *
    1304  FcStrBufDoneStatic (FcStrBuf *buf);
    1305  
    1306  FcPrivate FcBool
    1307  FcStrBufChar (FcStrBuf *buf, FcChar8 c);
    1308  
    1309  FcPrivate FcBool
    1310  FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
    1311  
    1312  FcPrivate FcBool
    1313  FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
    1314  
    1315  FcPrivate int
    1316  FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
    1317  
    1318  FcPrivate int
    1319  FcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
    1320  
    1321  FcPrivate const FcChar8 *
    1322  FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
    1323  
    1324  FcPrivate const FcChar8 *
    1325  FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
    1326  
    1327  FcPrivate const FcChar8 *
    1328  FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2);
    1329  
    1330  FcPrivate int
    1331  FcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
    1332  
    1333  FcPrivate FcBool
    1334  FcStrGlobMatch (const FcChar8 *glob,
    1335  		const FcChar8 *string);
    1336  
    1337  FcPrivate FcBool
    1338  FcStrUsesHome (const FcChar8 *s);
    1339  
    1340  FcPrivate FcBool
    1341  FcStrIsAbsoluteFilename (const FcChar8 *s);
    1342  
    1343  FcPrivate FcChar8 *
    1344  FcStrLastSlash (const FcChar8  *path);
    1345  
    1346  FcPrivate FcChar32
    1347  FcStrHashIgnoreCase (const FcChar8 *s);
    1348  
    1349  FcPrivate FcChar32
    1350  FcStrHashIgnoreBlanksAndCase (const FcChar8 *s);
    1351  
    1352  FcPrivate FcChar8 *
    1353  FcStrRealPath (const FcChar8 *path);
    1354  
    1355  FcPrivate FcChar8 *
    1356  FcStrCanonFilename (const FcChar8 *s);
    1357  
    1358  FcPrivate FcBool
    1359  FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
    1360  
    1361  FcPrivate FcChar8 *
    1362  FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
    1363  
    1364  /* fcobjs.c */
    1365  
    1366  FcPrivate void
    1367  FcObjectFini (void);
    1368  
    1369  FcPrivate FcObject
    1370  FcObjectLookupIdByName (const char *str);
    1371  
    1372  FcPrivate FcObject
    1373  FcObjectLookupBuiltinIdByName (const char *str);
    1374  
    1375  FcPrivate const char *
    1376  FcObjectLookupOtherNameById (FcObject id);
    1377  
    1378  FcPrivate const FcObjectType *
    1379  FcObjectLookupOtherTypeById (FcObject id);
    1380  
    1381  FcPrivate const FcObjectType *
    1382  FcObjectLookupOtherTypeByName (const char *str);
    1383  
    1384  /* fchash.c */
    1385  FcPrivate FcBool
    1386  FcHashStrCopy (const void  *src,
    1387  	       void       **dest);
    1388  
    1389  FcPrivate FcBool
    1390  FcHashUuidCopy (const void  *src,
    1391  		void       **dest);
    1392  
    1393  FcPrivate void
    1394  FcHashUuidFree (void *data);
    1395  
    1396  FcPrivate FcHashTable *
    1397  FcHashTableCreate (FcHashFunc    hash_func,
    1398  		   FcCompareFunc compare_func,
    1399  		   FcCopyFunc    key_copy_func,
    1400  		   FcCopyFunc    value_copy_func,
    1401  		   FcDestroyFunc key_destroy_func,
    1402  		   FcDestroyFunc value_destroy_func);
    1403  
    1404  FcPrivate void
    1405  FcHashTableDestroy (FcHashTable *table);
    1406  
    1407  FcPrivate FcBool
    1408  FcHashTableFind (FcHashTable  *table,
    1409  		 const void   *key,
    1410  		 void        **value);
    1411  
    1412  FcPrivate FcBool
    1413  FcHashTableAdd (FcHashTable *table,
    1414  		void        *key,
    1415  		void        *value);
    1416  
    1417  FcPrivate FcBool
    1418  FcHashTableReplace (FcHashTable *table,
    1419  		    void        *key,
    1420  		    void        *value);
    1421  
    1422  FcPrivate FcBool
    1423  FcHashTableRemove (FcHashTable *table,
    1424  		   void        *key);
    1425  
    1426  #endif /* _FC_INT_H_ */