12c393a42Smrg/*
20d39df38Smrg * fontconfig/src/fcint.h
32c393a42Smrg *
42c393a42Smrg * Copyright © 2000 Keith Packard
52c393a42Smrg *
62c393a42Smrg * Permission to use, copy, modify, distribute, and sell this software and its
72c393a42Smrg * documentation for any purpose is hereby granted without fee, provided that
82c393a42Smrg * the above copyright notice appear in all copies and that both that
92c393a42Smrg * copyright notice and this permission notice appear in supporting
10898dab68Smrg * documentation, and that the name of the author(s) not be used in
112c393a42Smrg * advertising or publicity pertaining to distribution of the software without
12898dab68Smrg * specific, written prior permission.  The authors make no
132c393a42Smrg * representations about the suitability of this software for any purpose.  It
142c393a42Smrg * is provided "as is" without express or implied warranty.
152c393a42Smrg *
160d39df38Smrg * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
172c393a42Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
180d39df38Smrg * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
192c393a42Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
202c393a42Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
212c393a42Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
222c393a42Smrg * PERFORMANCE OF THIS SOFTWARE.
232c393a42Smrg */
242c393a42Smrg
252c393a42Smrg#ifndef _FCINT_H_
262c393a42Smrg#define _FCINT_H_
272c393a42Smrg
282c393a42Smrg#ifdef HAVE_CONFIG_H
292c393a42Smrg#include <config.h>
302c393a42Smrg#endif
312c393a42Smrg
325e61939bSmrg#include "fcstdint.h"
335e61939bSmrg
342c393a42Smrg#include <stdlib.h>
352c393a42Smrg#include <stdio.h>
362c393a42Smrg#include <string.h>
372c393a42Smrg#include <ctype.h>
385e61939bSmrg#include <assert.h>
392c393a42Smrg#include <errno.h>
40d91dd368Smrg#include <limits.h>
4118bd4a06Smrg#include <float.h>
4218bd4a06Smrg#include <math.h>
437872e0a1Smrg#ifdef HAVE_UNISTD_H
442c393a42Smrg#include <unistd.h>
457872e0a1Smrg#endif
462c393a42Smrg#include <stddef.h>
472c393a42Smrg#include <sys/types.h>
482c393a42Smrg#include <sys/stat.h>
492c393a42Smrg#include <time.h>
502c393a42Smrg#include <fontconfig/fontconfig.h>
512c393a42Smrg#include <fontconfig/fcprivate.h>
522c393a42Smrg#include "fcdeprecate.h"
535e61939bSmrg#include "fcmutex.h"
545e61939bSmrg#include "fcatomic.h"
552c393a42Smrg
562c393a42Smrg#ifndef FC_CONFIG_PATH
572c393a42Smrg#define FC_CONFIG_PATH "fonts.conf"
582c393a42Smrg#endif
592c393a42Smrg
607872e0a1Smrg#ifdef _WIN32
617872e0a1Smrg#define FC_LIKELY(expr) (expr)
627872e0a1Smrg#define FC_UNLIKELY(expr) (expr)
637872e0a1Smrg#else
647872e0a1Smrg#define FC_LIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 1))
657872e0a1Smrg#define FC_UNLIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 0))
667872e0a1Smrg#endif
677872e0a1Smrg
682c393a42Smrg#ifdef _WIN32
695e61939bSmrg#  include "fcwindows.h"
70898dab68Smrgtypedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT);
71898dab68Smrgtypedef HRESULT (WINAPI *pfnSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
72898dab68Smrgextern pfnGetSystemWindowsDirectory pGetSystemWindowsDirectory;
73898dab68Smrgextern pfnSHGetFolderPathA pSHGetFolderPathA;
74898dab68Smrg#  define FC_SEARCH_PATH_SEPARATOR ';'
75898dab68Smrg#  define FC_DIR_SEPARATOR         '\\'
76898dab68Smrg#  define FC_DIR_SEPARATOR_S       "\\"
772c393a42Smrg#else
78898dab68Smrg#  define FC_SEARCH_PATH_SEPARATOR ':'
79898dab68Smrg#  define FC_DIR_SEPARATOR         '/'
80898dab68Smrg#  define FC_DIR_SEPARATOR_S       "/"
812c393a42Smrg#endif
822c393a42Smrg
8318bd4a06Smrg#ifdef PATH_MAX
8418bd4a06Smrg#define FC_PATH_MAX	PATH_MAX
8518bd4a06Smrg#else
8618bd4a06Smrg#define FC_PATH_MAX	128
8718bd4a06Smrg#endif
8818bd4a06Smrg
895e61939bSmrg#if __GNUC__ >= 4
905e61939bSmrg#define FC_UNUSED	__attribute__((unused))
915e61939bSmrg#else
925e61939bSmrg#define FC_UNUSED
935e61939bSmrg#endif
945e61939bSmrg
957872e0a1Smrg#ifndef FC_UINT64_FORMAT
967872e0a1Smrg#define FC_UINT64_FORMAT	"llu"
977872e0a1Smrg#endif
987872e0a1Smrg
992c393a42Smrg#define FC_DBG_MATCH	1
1002c393a42Smrg#define FC_DBG_MATCHV	2
1012c393a42Smrg#define FC_DBG_EDIT	4
1022c393a42Smrg#define FC_DBG_FONTSET	8
1032c393a42Smrg#define FC_DBG_CACHE	16
1042c393a42Smrg#define FC_DBG_CACHEV	32
1052c393a42Smrg#define FC_DBG_PARSE	64
1062c393a42Smrg#define FC_DBG_SCAN	128
1072c393a42Smrg#define FC_DBG_SCANV	256
1082c393a42Smrg#define FC_DBG_CONFIG	1024
1092c393a42Smrg#define FC_DBG_LANGSET	2048
11018bd4a06Smrg#define FC_DBG_MATCH2	4096
1112c393a42Smrg
112d91dd368Smrg#define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1] FC_UNUSED
113898dab68Smrg#define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond))
114898dab68Smrg#define FC_ASSERT_STATIC(_cond) _FC_ASSERT_STATIC0 (__LINE__, (_cond))
115898dab68Smrg
1160d39df38Smrg#define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
1170d39df38Smrg#define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
1182c393a42Smrg
1192c393a42Smrg/* slim_internal.h */
1202c393a42Smrg#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
1212c393a42Smrg#define FcPrivate		__attribute__((__visibility__("hidden")))
1222c393a42Smrg#define HAVE_GNUC_ATTRIBUTE 1
1232c393a42Smrg#include "fcalias.h"
1242c393a42Smrg#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
1252c393a42Smrg#define FcPrivate		__hidden
1262c393a42Smrg#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
1272c393a42Smrg#define FcPrivate
1282c393a42Smrg#endif
1292c393a42Smrg
1301887081fSmrg/* NLS */
1311887081fSmrg#ifdef ENABLE_NLS
1321887081fSmrg#include <libintl.h>
1331887081fSmrg#define _(x)		(dgettext(GETTEXT_PACKAGE, x))
1341887081fSmrg#else
1351887081fSmrg#define dgettext(d, s)	(s)
1361887081fSmrg#define _(x)		(x)
1371887081fSmrg#endif
1385e61939bSmrg
1391887081fSmrg#define N_(x)	x
1401887081fSmrg
1411887081fSmrgFC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
1422c393a42Smrg
1435e61939bSmrg#define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
1445e61939bSmrg#define FcFree(s) (free ((FcChar8 *) (s)))
1455e61939bSmrg
1462c393a42Smrg/*
1472c393a42Smrg * Serialized data structures use only offsets instead of pointers
1482c393a42Smrg * A low bit of 1 indicates an offset.
1492c393a42Smrg */
150898dab68Smrg
1512c393a42Smrg/* Is the provided pointer actually an offset? */
1522c393a42Smrg#define FcIsEncodedOffset(p)	((((intptr_t) (p)) & 1) != 0)
1532c393a42Smrg
1542c393a42Smrg/* Encode offset in a pointer of type t */
1557872e0a1Smrg#define FcOffsetEncode(o,t)	((t *) (intptr_t) ((o) | 1))
1562c393a42Smrg
1572c393a42Smrg/* Decode a pointer into an offset */
1582c393a42Smrg#define FcOffsetDecode(p)	(((intptr_t) (p)) & ~1)
1592c393a42Smrg
1602c393a42Smrg/* Compute pointer offset */
1617872e0a1Smrg#define FcPtrToOffset(b,p)	((ptrdiff_t) ((intptr_t) (p) - (intptr_t) (b)))
1622c393a42Smrg
1632c393a42Smrg/* Given base address, offset and type, return a pointer */
1647872e0a1Smrg#define FcOffsetToPtr(b,o,t)	((t *) ((intptr_t) (b) + (ptrdiff_t) (o)))
1652c393a42Smrg
1662c393a42Smrg/* Given base address, encoded offset and type, return a pointer */
1672c393a42Smrg#define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t)
1682c393a42Smrg
1692c393a42Smrg/* Given base address, pointer and type, return an encoded offset */
1702c393a42Smrg#define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t)
1712c393a42Smrg
1722c393a42Smrg/* Given a structure, offset member and type, return pointer */
1732c393a42Smrg#define FcOffsetMember(s,m,t)	    FcOffsetToPtr(s,(s)->m,t)
1742c393a42Smrg
1752c393a42Smrg/* Given a structure, encoded offset member and type, return pointer to member */
1762c393a42Smrg#define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t)
1772c393a42Smrg
1782c393a42Smrg/* Given a structure, member and type, convert the member to a pointer */
1792c393a42Smrg#define FcPointerMember(s,m,t)	(FcIsEncodedOffset((s)->m) ? \
1802c393a42Smrg				 FcEncodedOffsetMember (s,m,t) : \
1812c393a42Smrg				 (s)->m)
1822c393a42Smrg
1832c393a42Smrg/*
1842c393a42Smrg * Serialized values may hold strings, charsets and langsets as pointers,
1852c393a42Smrg * unfortunately FcValue is an exposed type so we can't just always use
1862c393a42Smrg * offsets
1872c393a42Smrg */
1882c393a42Smrg#define FcValueString(v)	FcPointerMember(v,u.s,FcChar8)
1892c393a42Smrg#define FcValueCharSet(v)	FcPointerMember(v,u.c,const FcCharSet)
1902c393a42Smrg#define FcValueLangSet(v)	FcPointerMember(v,u.l,const FcLangSet)
19118bd4a06Smrg#define FcValueRange(v)		FcPointerMember(v,u.r,const FcRange)
1922c393a42Smrg
1932c393a42Smrgtypedef struct _FcValueList *FcValueListPtr;
1942c393a42Smrg
1952c393a42Smrgtypedef struct _FcValueList {
1962c393a42Smrg    struct _FcValueList	*next;
1972c393a42Smrg    FcValue		value;
1982c393a42Smrg    FcValueBinding	binding;
1992c393a42Smrg} FcValueList;
2002c393a42Smrg
2012c393a42Smrg#define FcValueListNext(vl)	FcPointerMember(vl,next,FcValueList)
20246bb3e47Smrg
2032c393a42Smrgtypedef int FcObject;
2042c393a42Smrg
205d91dd368Smrg/* The 1024 is to leave some room for future added internal objects, such
206d91dd368Smrg * that caches from newer fontconfig can still be used with older fontconfig
207d91dd368Smrg * without getting confused. */
208d91dd368Smrg#define FC_EXT_OBJ_INDEX	1024
209d91dd368Smrg#define FC_OBJ_ID(_n_)	((_n_) & (~FC_EXT_OBJ_INDEX))
210d91dd368Smrg
2112c393a42Smrgtypedef struct _FcPatternElt *FcPatternEltPtr;
2122c393a42Smrg
2132c393a42Smrg/*
214898dab68Smrg * Pattern elts are stuck in a structure connected to the pattern,
2152c393a42Smrg * so they get moved around when the pattern is resized. Hence, the
2162c393a42Smrg * values field must be a pointer/offset instead of just an offset
2172c393a42Smrg */
2182c393a42Smrgtypedef struct _FcPatternElt {
2192c393a42Smrg    FcObject		object;
2202c393a42Smrg    FcValueList		*values;
2212c393a42Smrg} FcPatternElt;
2222c393a42Smrg
2232c393a42Smrg#define FcPatternEltValues(pe)	FcPointerMember(pe,values,FcValueList)
2242c393a42Smrg
2252c393a42Smrgstruct _FcPattern {
2262c393a42Smrg    int		    num;
2272c393a42Smrg    int		    size;
2282c393a42Smrg    intptr_t	    elts_offset;
2295e61939bSmrg    FcRef	    ref;
2302c393a42Smrg};
2312c393a42Smrg
2322c393a42Smrg#define FcPatternElts(p)	FcOffsetMember(p,elts_offset,FcPatternElt)
2332c393a42Smrg
2342c393a42Smrg#define FcFontSetFonts(fs)	FcPointerMember(fs,fonts,FcPattern *)
2352c393a42Smrg
2362c393a42Smrg#define FcFontSetFont(fs,i)	(FcIsEncodedOffset((fs)->fonts) ? \
2372c393a42Smrg				 FcEncodedOffsetToPtr(fs, \
2382c393a42Smrg						      FcFontSetFonts(fs)[i], \
2392c393a42Smrg						      FcPattern) : \
2402c393a42Smrg				 fs->fonts[i])
24146bb3e47Smrg
2422c393a42Smrgtypedef enum _FcOp {
243898dab68Smrg    FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpRange, FcOpBool, FcOpCharSet, FcOpLangSet,
2442c393a42Smrg    FcOpNil,
2452c393a42Smrg    FcOpField, FcOpConst,
246898dab68Smrg    FcOpAssign, FcOpAssignReplace,
2472c393a42Smrg    FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
2485e61939bSmrg    FcOpDelete, FcOpDeleteAll,
2492c393a42Smrg    FcOpQuest,
250898dab68Smrg    FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
2512c393a42Smrg    FcOpContains, FcOpListing, FcOpNotContains,
2522c393a42Smrg    FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
2532c393a42Smrg    FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
2542c393a42Smrg    FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
2552c393a42Smrg    FcOpInvalid
2562c393a42Smrg} FcOp;
2572c393a42Smrg
258898dab68Smrgtypedef enum _FcOpFlags {
2591887081fSmrg	FcOpFlagIgnoreBlanks = 1U << 0
260898dab68Smrg} FcOpFlags;
261898dab68Smrg
262898dab68Smrg#define FC_OP_GET_OP(_x_)	((_x_) & 0xffff)
263898dab68Smrg#define FC_OP_GET_FLAGS(_x_)	(((_x_) & 0xffff0000) >> 16)
264898dab68Smrg#define FC_OP(_x_,_f_)		(FC_OP_GET_OP (_x_) | ((_f_) << 16))
265898dab68Smrg
2665e61939bSmrgtypedef struct _FcExprMatrix {
2675e61939bSmrg  struct _FcExpr *xx, *xy, *yx, *yy;
2685e61939bSmrg} FcExprMatrix;
2695e61939bSmrg
2705e61939bSmrgtypedef struct _FcExprName {
2715e61939bSmrg  FcObject	object;
2725e61939bSmrg  FcMatchKind	kind;
2735e61939bSmrg} FcExprName;
2745e61939bSmrg
27518bd4a06Smrgstruct _FcRange {
27618bd4a06Smrg    double begin;
27718bd4a06Smrg    double end;
27818bd4a06Smrg};
27918bd4a06Smrg
2805e61939bSmrg
2812c393a42Smrgtypedef struct _FcExpr {
2822c393a42Smrg    FcOp   op;
2832c393a42Smrg    union {
28418bd4a06Smrg	int		ival;
28518bd4a06Smrg	double		dval;
28618bd4a06Smrg	const FcChar8	*sval;
28718bd4a06Smrg	FcExprMatrix	*mexpr;
28818bd4a06Smrg	FcBool		bval;
28918bd4a06Smrg	FcCharSet	*cval;
29018bd4a06Smrg	FcLangSet	*lval;
29118bd4a06Smrg	FcRange		*rval;
29218bd4a06Smrg
29318bd4a06Smrg	FcExprName	name;
29418bd4a06Smrg	const FcChar8	*constant;
2952c393a42Smrg	struct {
2962c393a42Smrg	    struct _FcExpr *left, *right;
2972c393a42Smrg	} tree;
2982c393a42Smrg    } u;
2992c393a42Smrg} FcExpr;
3002c393a42Smrg
3010d39df38Smrgtypedef struct _FcExprPage FcExprPage;
3020d39df38Smrg
3030d39df38Smrgstruct _FcExprPage {
3040d39df38Smrg  FcExprPage *next_page;
3050d39df38Smrg  FcExpr *next;
3060d39df38Smrg  FcExpr exprs[(1024 - 2/* two pointers */ - 2/* malloc overhead */) * sizeof (void *) / sizeof (FcExpr)];
307898dab68Smrg  FcExpr end[FLEXIBLE_ARRAY_MEMBER];
3080d39df38Smrg};
3090d39df38Smrg
3102c393a42Smrgtypedef enum _FcQual {
3112c393a42Smrg    FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
3122c393a42Smrg} FcQual;
3132c393a42Smrg
3142c393a42Smrg#define FcMatchDefault	((FcMatchKind) -1)
3152c393a42Smrg
3162c393a42Smrgtypedef struct _FcTest {
3172c393a42Smrg    FcMatchKind		kind;
3182c393a42Smrg    FcQual		qual;
3192c393a42Smrg    FcObject		object;
3202c393a42Smrg    FcOp		op;
3212c393a42Smrg    FcExpr		*expr;
3222c393a42Smrg} FcTest;
3232c393a42Smrg
3242c393a42Smrgtypedef struct _FcEdit {
3252c393a42Smrg    FcObject	    object;
3262c393a42Smrg    FcOp	    op;
3272c393a42Smrg    FcExpr	    *expr;
3282c393a42Smrg    FcValueBinding  binding;
3292c393a42Smrg} FcEdit;
3302c393a42Smrg
3311887081fSmrgtypedef void (* FcDestroyFunc) (void *data);
3321887081fSmrg
3331887081fSmrgtypedef struct _FcPtrList	FcPtrList;
3341887081fSmrg/* need to sync with FcConfigFileInfoIter at fontconfig.h */
3351887081fSmrgtypedef struct _FcPtrListIter {
3361887081fSmrg    void *dummy1;
3371887081fSmrg    void *dummy2;
3381887081fSmrg    void *dummy3;
3391887081fSmrg} FcPtrListIter;
3401887081fSmrg
341d91dd368Smrgtypedef enum _FcRuleType {
342d91dd368Smrg    FcRuleUnknown, FcRuleTest, FcRuleEdit
343d91dd368Smrg} FcRuleType;
344d91dd368Smrg
345d91dd368Smrgtypedef struct _FcRule {
346d91dd368Smrg    struct _FcRule *next;
347d91dd368Smrg    FcRuleType      type;
348d91dd368Smrg    union {
349d91dd368Smrg	FcTest *test;
350d91dd368Smrg	FcEdit *edit;
351d91dd368Smrg    } u;
352d91dd368Smrg} FcRule;
353d91dd368Smrg
3541887081fSmrgtypedef struct _FcRuleSet {
3551887081fSmrg    FcRef	ref;
3561887081fSmrg    FcChar8	*name;
3571887081fSmrg    FcChar8	*description;
3581887081fSmrg    FcChar8	*domain;
3591887081fSmrg    FcBool	enabled;
3601887081fSmrg    FcPtrList	*subst[FcMatchKindEnd];
3611887081fSmrg} FcRuleSet;
3622c393a42Smrg
3632c393a42Smrgtypedef struct _FcCharLeaf {
3642c393a42Smrg    FcChar32	map[256/32];
3652c393a42Smrg} FcCharLeaf;
3662c393a42Smrg
3672c393a42Smrgstruct _FcCharSet {
3685e61939bSmrg    FcRef	    ref;	/* reference count */
3692c393a42Smrg    int		    num;	/* size of leaves and numbers arrays */
3702c393a42Smrg    intptr_t	    leaves_offset;
3712c393a42Smrg    intptr_t	    numbers_offset;
3722c393a42Smrg};
3732c393a42Smrg
3742c393a42Smrg#define FcCharSetLeaves(c)	FcOffsetMember(c,leaves_offset,intptr_t)
3752c393a42Smrg#define FcCharSetLeaf(c,i)	(FcOffsetToPtr(FcCharSetLeaves(c), \
3762c393a42Smrg					       FcCharSetLeaves(c)[i], \
3772c393a42Smrg					       FcCharLeaf))
3782c393a42Smrg#define FcCharSetNumbers(c)	FcOffsetMember(c,numbers_offset,FcChar16)
3792c393a42Smrg
38018bd4a06Smrg#define FCSS_DEFAULT            0 /* default behavior */
38118bd4a06Smrg#define FCSS_ALLOW_DUPLICATES   1 /* allows for duplicate strings in the set */
38218bd4a06Smrg#define FCSS_GROW_BY_64         2 /* grows buffer by 64 elements instead of 1 */
38318bd4a06Smrg
38418bd4a06Smrg#define FcStrSetHasControlBit(s,c)  (s->control & c)
38518bd4a06Smrg#define FcStrSetHasControlBits(s,c) ( (c) == (s->control & (c)) )
38618bd4a06Smrg
3872c393a42Smrgstruct _FcStrSet {
3885e61939bSmrg    FcRef	    ref;	/* reference count */
3892c393a42Smrg    int		    num;
3902c393a42Smrg    int		    size;
3912c393a42Smrg    FcChar8	    **strs;
39218bd4a06Smrg    unsigned int    control;    /* control bits for set behavior */
3932c393a42Smrg};
3942c393a42Smrg
3952c393a42Smrgstruct _FcStrList {
3962c393a42Smrg    FcStrSet	    *set;
3972c393a42Smrg    int		    n;
3982c393a42Smrg};
3992c393a42Smrg
4002c393a42Smrgtypedef struct _FcStrBuf {
4012c393a42Smrg    FcChar8 *buf;
4022c393a42Smrg    FcBool  allocated;
4032c393a42Smrg    FcBool  failed;
4042c393a42Smrg    int	    len;
4052c393a42Smrg    int	    size;
4060d39df38Smrg    FcChar8 buf_static[16 * sizeof (void *)];
4072c393a42Smrg} FcStrBuf;
4082c393a42Smrg
4091887081fSmrgtypedef struct _FcHashTable	FcHashTable;
4101887081fSmrg
41132c2f8aeSmrgtypedef FcChar32 (* FcHashFunc)	   (const FcChar8 *data);
41232c2f8aeSmrgtypedef int	 (* FcCompareFunc) (const FcChar8 *v1, const FcChar8 *v2);
4131887081fSmrgtypedef FcBool	 (* FcCopyFunc)	   (const void *src, void **dest);
4141887081fSmrg
4151887081fSmrg
4162c393a42Smrgstruct _FcCache {
4175e61939bSmrg    unsigned int magic;              /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
41818bd4a06Smrg    int		version;	    /* FC_CACHE_VERSION_NUMBER */
4192c393a42Smrg    intptr_t	size;		    /* size of file */
4202c393a42Smrg    intptr_t	dir;		    /* offset to dir name */
4212c393a42Smrg    intptr_t	dirs;		    /* offset to subdirs */
4222c393a42Smrg    int		dirs_count;	    /* number of subdir strings */
4232c393a42Smrg    intptr_t	set;		    /* offset to font set */
424898dab68Smrg    int		checksum;	    /* checksum of directory state */
42518bd4a06Smrg    int64_t	checksum_nano;	    /* checksum of directory state */
4262c393a42Smrg};
4272c393a42Smrg
4282c393a42Smrg#undef FcCacheDir
4292c393a42Smrg#undef FcCacheSubdir
4302c393a42Smrg#define FcCacheDir(c)	FcOffsetMember(c,dir,FcChar8)
4312c393a42Smrg#define FcCacheDirs(c)	FcOffsetMember(c,dirs,intptr_t)
4322c393a42Smrg#define FcCacheSet(c)	FcOffsetMember(c,set,FcFontSet)
4332c393a42Smrg#define FcCacheSubdir(c,i)  FcOffsetToPtr (FcCacheDirs(c),\
4342c393a42Smrg					   FcCacheDirs(c)[i], \
4352c393a42Smrg					   FcChar8)
4362c393a42Smrg
4372c393a42Smrg/*
4382c393a42Smrg * Used while constructing a directory cache object
4392c393a42Smrg */
4402c393a42Smrg
4410d39df38Smrgtypedef union _FcAlign {
4420d39df38Smrg    double	d;
4430d39df38Smrg    int		i;
4440d39df38Smrg    intptr_t	ip;
4450d39df38Smrg    FcBool	b;
4460d39df38Smrg    void	*p;
4470d39df38Smrg} FcAlign;
4480d39df38Smrg
4492c393a42Smrgtypedef struct _FcSerializeBucket {
4507872e0a1Smrg    const void	*object; /* key */
4517872e0a1Smrg    uintptr_t	hash;    /* hash of key */
4527872e0a1Smrg    intptr_t	offset;  /* value */
4532c393a42Smrg} FcSerializeBucket;
4542c393a42Smrg
4552c393a42Smrgtypedef struct _FcCharSetFreezer FcCharSetFreezer;
4562c393a42Smrg
4572c393a42Smrgtypedef struct _FcSerialize {
4582c393a42Smrg    intptr_t		size;
4592c393a42Smrg    FcCharSetFreezer	*cs_freezer;
4602c393a42Smrg    void		*linear;
4617872e0a1Smrg    FcSerializeBucket	*buckets;
4627872e0a1Smrg    size_t		buckets_count;
4637872e0a1Smrg    size_t		buckets_used;
4647872e0a1Smrg    size_t		buckets_used_max;
4652c393a42Smrg} FcSerialize;
466898dab68Smrg
4672c393a42Smrg/*
4682c393a42Smrg * To map adobe glyph names to unicode values, a precomputed hash
4692c393a42Smrg * table is used
4702c393a42Smrg */
4712c393a42Smrg
4722c393a42Smrgtypedef struct _FcGlyphName {
4732c393a42Smrg    FcChar32	ucs;		/* unicode value */
4742c393a42Smrg    FcChar8	name[1];	/* name extends beyond struct */
4752c393a42Smrg} FcGlyphName;
4762c393a42Smrg
4772c393a42Smrg/*
4782c393a42Smrg * To perform case-insensitive string comparisons, a table
4792c393a42Smrg * is used which holds three different kinds of folding data.
480898dab68Smrg *
4812c393a42Smrg * The first is a range of upper case values mapping to a range
4822c393a42Smrg * of their lower case equivalents.  Within each range, the offset
4832c393a42Smrg * between upper and lower case is constant.
4842c393a42Smrg *
4852c393a42Smrg * The second is a range of upper case values which are interleaved
4862c393a42Smrg * with their lower case equivalents.
487898dab68Smrg *
4882c393a42Smrg * The third is a set of raw unicode values mapping to a list
4892c393a42Smrg * of unicode values for comparison purposes.  This allows conversion
4902c393a42Smrg * of ß to "ss" so that SS, ss and ß all match.  A separate array
4912c393a42Smrg * holds the list of unicode values for each entry.
4922c393a42Smrg *
4932c393a42Smrg * These are packed into a single table.  Using a binary search,
4942c393a42Smrg * the appropriate entry can be located.
4952c393a42Smrg */
4962c393a42Smrg
4972c393a42Smrg#define FC_CASE_FOLD_RANGE	    0
4982c393a42Smrg#define FC_CASE_FOLD_EVEN_ODD	    1
4992c393a42Smrg#define FC_CASE_FOLD_FULL	    2
5002c393a42Smrg
5012c393a42Smrgtypedef struct _FcCaseFold {
5022c393a42Smrg    FcChar32	upper;
5032c393a42Smrg    FcChar16	method : 2;
5042c393a42Smrg    FcChar16	count : 14;
5052c393a42Smrg    short    	offset;	    /* lower - upper for RANGE, table id for FULL */
5062c393a42Smrg} FcCaseFold;
5072c393a42Smrg
5082c393a42Smrg#define FC_MAX_FILE_LEN	    4096
5092c393a42Smrg
5102c393a42Smrg#define FC_CACHE_MAGIC_MMAP	    0xFC02FC04
5112c393a42Smrg#define FC_CACHE_MAGIC_ALLOC	    0xFC02FC05
5122c393a42Smrg
5132c393a42Smrgstruct _FcAtomic {
5142c393a42Smrg    FcChar8	*file;		/* original file name */
5152c393a42Smrg    FcChar8	*new;		/* temp file name -- write data here */
5162c393a42Smrg    FcChar8	*lck;		/* lockfile name (used for locking) */
5172c393a42Smrg    FcChar8	*tmp;		/* tmpfile name (used for locking) */
5182c393a42Smrg};
5192c393a42Smrg
5202c393a42Smrgstruct _FcConfig {
5212c393a42Smrg    /*
5222c393a42Smrg     * File names loaded from the configuration -- saved here as the
5232c393a42Smrg     * cache file must be consulted before the directories are scanned,
5242c393a42Smrg     * and those directives may occur in any order
5252c393a42Smrg     */
5262c393a42Smrg    FcStrSet	*configDirs;	    /* directories to scan for fonts */
5272c393a42Smrg    /*
5282c393a42Smrg     * List of directories containing fonts,
529898dab68Smrg     * built by recursively scanning the set
5302c393a42Smrg     * of configured directories
5312c393a42Smrg     */
5322c393a42Smrg    FcStrSet	*fontDirs;
5332c393a42Smrg    /*
5342c393a42Smrg     * List of directories containing cache files.
5352c393a42Smrg     */
5362c393a42Smrg    FcStrSet	*cacheDirs;
5372c393a42Smrg    /*
5382c393a42Smrg     * Names of all of the configuration files used
5392c393a42Smrg     * to create this configuration
5402c393a42Smrg     */
5412c393a42Smrg    FcStrSet	*configFiles;	    /* config files loaded */
5422c393a42Smrg    /*
5432c393a42Smrg     * Substitution instructions for patterns and fonts;
5442c393a42Smrg     * maxObjects is used to allocate appropriate intermediate storage
5452c393a42Smrg     * while performing a whole set of substitutions
5461887081fSmrg     *
5471887081fSmrg     * 0.. substitutions for patterns
5481887081fSmrg     * 1.. substitutions for fonts
5491887081fSmrg     * 2.. substitutions for scanned fonts
5502c393a42Smrg     */
5511887081fSmrg    FcPtrList	*subst[FcMatchKindEnd];
5522c393a42Smrg    int		maxObjects;	    /* maximum number of tests in all substs */
5532c393a42Smrg    /*
5542c393a42Smrg     * List of patterns used to control font file selection
5552c393a42Smrg     */
5562c393a42Smrg    FcStrSet	*acceptGlobs;
5572c393a42Smrg    FcStrSet	*rejectGlobs;
5582c393a42Smrg    FcFontSet	*acceptPatterns;
5592c393a42Smrg    FcFontSet	*rejectPatterns;
5602c393a42Smrg    /*
5612c393a42Smrg     * The set of fonts loaded from the listed directories; the
5622c393a42Smrg     * order within the set does not determine the font selection,
5632c393a42Smrg     * except in the case of identical matches in which case earlier fonts
5642c393a42Smrg     * match preferrentially
5652c393a42Smrg     */
5662c393a42Smrg    FcFontSet	*fonts[FcSetApplication + 1];
5672c393a42Smrg    /*
5682c393a42Smrg     * Fontconfig can periodically rescan the system configuration
5692c393a42Smrg     * and font directories.  This rescanning occurs when font
5702c393a42Smrg     * listing requests are made, but no more often than rescanInterval
5712c393a42Smrg     * seconds apart.
5722c393a42Smrg     */
5732c393a42Smrg    time_t	rescanTime;	    /* last time information was scanned */
5742c393a42Smrg    int		rescanInterval;	    /* interval between scans */
5750d39df38Smrg
5765e61939bSmrg    FcRef	ref;                /* reference count */
5770d39df38Smrg
5785e61939bSmrg    FcExprPage  *expr_pool;	    /* pool of FcExpr's */
579898dab68Smrg
5805e61939bSmrg    FcChar8     *sysRoot;	    /* override the system root directory */
5811887081fSmrg    FcStrSet	*availConfigFiles;  /* config files available */
5821887081fSmrg    FcPtrList	*rulesetList;	    /* List of rulesets being installed */
5835e61939bSmrg};
5842c393a42Smrg
5852c393a42Smrgtypedef struct _FcFileTime {
5862c393a42Smrg    time_t  time;
5872c393a42Smrg    FcBool  set;
5882c393a42Smrg} FcFileTime;
5892c393a42Smrg
5902c393a42Smrgtypedef struct _FcCharMap FcCharMap;
5912c393a42Smrg
592898dab68Smrgtypedef struct _FcStatFS    FcStatFS;
593898dab68Smrg
594898dab68Smrgstruct _FcStatFS {
595898dab68Smrg    FcBool is_remote_fs;
596898dab68Smrg    FcBool is_mtime_broken;
597898dab68Smrg};
598898dab68Smrg
5995e61939bSmrgtypedef struct _FcValuePromotionBuffer FcValuePromotionBuffer;
6005e61939bSmrg
6015e61939bSmrgstruct _FcValuePromotionBuffer {
6025e61939bSmrg  union {
6035e61939bSmrg    double d;
6045e61939bSmrg    int i;
6055e61939bSmrg    long l;
6065e61939bSmrg    char c[256]; /* Enlarge as needed */
6075e61939bSmrg  } u;
6085e61939bSmrg};
6095e61939bSmrg
6102c393a42Smrg/* fccache.c */
6112c393a42Smrg
6122c393a42SmrgFcPrivate FcCache *
6132c393a42SmrgFcDirCacheScan (const FcChar8 *dir, FcConfig *config);
6142c393a42Smrg
6152c393a42SmrgFcPrivate FcCache *
6162c393a42SmrgFcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
6172c393a42Smrg
618b2a52337SmrgFcPrivate FcCache *
619b2a52337SmrgFcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
620b2a52337Smrg
6212c393a42SmrgFcPrivate FcBool
6222c393a42SmrgFcDirCacheWrite (FcCache *cache, FcConfig *config);
623898dab68Smrg
624898dab68SmrgFcPrivate FcBool
625898dab68SmrgFcDirCacheCreateTagFile (const FcChar8 *cache_dir);
626898dab68Smrg
6272c393a42SmrgFcPrivate void
6282c393a42SmrgFcCacheObjectReference (void *object);
6292c393a42Smrg
6302c393a42SmrgFcPrivate void
6312c393a42SmrgFcCacheObjectDereference (void *object);
6322c393a42Smrg
6331887081fSmrgFcPrivate void *
6341887081fSmrgFcCacheAllocate (FcCache *cache, size_t len);
6351887081fSmrg
6362c393a42SmrgFcPrivate void
6372c393a42SmrgFcCacheFini (void);
638898dab68Smrg
6391887081fSmrg
6402c393a42SmrgFcPrivate void
6412c393a42SmrgFcDirCacheReference (FcCache *cache, int nref);
6422c393a42Smrg
64318bd4a06SmrgFcPrivate int
64418bd4a06SmrgFcDirCacheLock (const FcChar8 *dir,
64518bd4a06Smrg		FcConfig      *config);
64618bd4a06Smrg
64718bd4a06SmrgFcPrivate void
64818bd4a06SmrgFcDirCacheUnlock (int fd);
64918bd4a06Smrg
6502c393a42Smrg/* fccfg.c */
6512c393a42Smrg
6525e61939bSmrgFcPrivate FcBool
6535e61939bSmrgFcConfigInit (void);
6545e61939bSmrg
6555e61939bSmrgFcPrivate void
6565e61939bSmrgFcConfigFini (void);
6575e61939bSmrg
658898dab68SmrgFcPrivate FcChar8 *
659898dab68SmrgFcConfigXdgCacheHome (void);
660898dab68Smrg
661898dab68SmrgFcPrivate FcChar8 *
662898dab68SmrgFcConfigXdgConfigHome (void);
663898dab68Smrg
664898dab68SmrgFcPrivate FcChar8 *
665898dab68SmrgFcConfigXdgDataHome (void);
666898dab68Smrg
6677872e0a1SmrgFcPrivate FcStrSet *
6687872e0a1SmrgFcConfigXdgDataDirs (void);
6697872e0a1Smrg
6700d39df38SmrgFcPrivate FcExpr *
6710d39df38SmrgFcConfigAllocExpr (FcConfig *config);
6720d39df38Smrg
6732c393a42SmrgFcPrivate FcBool
6742c393a42SmrgFcConfigAddConfigDir (FcConfig	    *config,
6752c393a42Smrg		      const FcChar8 *d);
6762c393a42Smrg
6772c393a42SmrgFcPrivate FcBool
6782c393a42SmrgFcConfigAddFontDir (FcConfig	    *config,
6797872e0a1Smrg		    const FcChar8   *d,
6807872e0a1Smrg		    const FcChar8   *m,
6817872e0a1Smrg		    const FcChar8   *salt);
6827872e0a1Smrg
6837872e0a1SmrgFcPrivate FcBool
6847872e0a1SmrgFcConfigResetFontDirs (FcConfig *config);
6857872e0a1Smrg
6867872e0a1SmrgFcPrivate FcChar8 *
6877872e0a1SmrgFcConfigMapFontPath(FcConfig		*config,
6887872e0a1Smrg		    const FcChar8	*path);
6897872e0a1Smrg
6907872e0a1SmrgFcPrivate const FcChar8 *
6917872e0a1SmrgFcConfigMapSalt (FcConfig      *config,
6927872e0a1Smrg		 const FcChar8 *path);
6932c393a42Smrg
6942c393a42SmrgFcPrivate FcBool
6952c393a42SmrgFcConfigAddCacheDir (FcConfig	    *config,
6962c393a42Smrg		     const FcChar8  *d);
6972c393a42Smrg
6982c393a42SmrgFcPrivate FcBool
6992c393a42SmrgFcConfigAddConfigFile (FcConfig		*config,
7002c393a42Smrg		       const FcChar8	*f);
7012c393a42Smrg
7022c393a42SmrgFcPrivate FcBool
7032c393a42SmrgFcConfigAddBlank (FcConfig	*config,
7042c393a42Smrg		  FcChar32    	blank);
7052c393a42Smrg
706d91dd368SmrgFcBool
707d91dd368SmrgFcConfigAddRule (FcConfig	*config,
708d91dd368Smrg		 FcRule		*rule,
7092c393a42Smrg		 FcMatchKind	kind);
7102c393a42Smrg
7112c393a42SmrgFcPrivate void
7122c393a42SmrgFcConfigSetFonts (FcConfig	*config,
7132c393a42Smrg		  FcFontSet	*fonts,
7142c393a42Smrg		  FcSetName	set);
7152c393a42Smrg
7162c393a42SmrgFcPrivate FcBool
7172c393a42SmrgFcConfigCompareValue (const FcValue *m,
718d91dd368Smrg		      unsigned int   op_,
7192c393a42Smrg		      const FcValue *v);
7202c393a42Smrg
7212c393a42SmrgFcPrivate FcBool
7222c393a42SmrgFcConfigGlobAdd (FcConfig	*config,
7232c393a42Smrg		 const FcChar8	*glob,
7242c393a42Smrg		 FcBool		accept);
7252c393a42Smrg
7262c393a42SmrgFcPrivate FcBool
7272c393a42SmrgFcConfigAcceptFilename (FcConfig	*config,
7282c393a42Smrg			const FcChar8	*filename);
7292c393a42Smrg
7302c393a42SmrgFcPrivate FcBool
7312c393a42SmrgFcConfigPatternsAdd (FcConfig	*config,
7322c393a42Smrg		     FcPattern	*pattern,
7332c393a42Smrg		     FcBool	accept);
7342c393a42Smrg
7352c393a42SmrgFcPrivate FcBool
7362c393a42SmrgFcConfigAcceptFont (FcConfig	    *config,
7372c393a42Smrg		    const FcPattern *font);
7382c393a42Smrg
7392c393a42SmrgFcPrivate FcFileTime
7402c393a42SmrgFcConfigModifiedTime (FcConfig *config);
7412c393a42Smrg
7422c393a42SmrgFcPrivate FcBool
743898dab68SmrgFcConfigAddCache (FcConfig *config, FcCache *cache,
7441887081fSmrg		  FcSetName set, FcStrSet *dirSet, FcChar8 *forDir);
7451887081fSmrg
7461887081fSmrgFcPrivate FcRuleSet *
7471887081fSmrgFcRuleSetCreate (const FcChar8 *name);
7481887081fSmrg
7491887081fSmrgFcPrivate void
7501887081fSmrgFcRuleSetDestroy (FcRuleSet *rs);
7511887081fSmrg
7521887081fSmrgFcPrivate void
7531887081fSmrgFcRuleSetReference (FcRuleSet *rs);
7541887081fSmrg
7551887081fSmrgFcPrivate void
7561887081fSmrgFcRuleSetEnable (FcRuleSet	*rs,
7571887081fSmrg		 FcBool		flag);
7581887081fSmrg
7591887081fSmrgFcPrivate void
7601887081fSmrgFcRuleSetAddDescription (FcRuleSet	*rs,
7611887081fSmrg			 const FcChar8	*domain,
7621887081fSmrg			 const FcChar8	*description);
7631887081fSmrg
7641887081fSmrgFcPrivate int
7651887081fSmrgFcRuleSetAdd (FcRuleSet		*rs,
7661887081fSmrg	      FcRule		*rule,
7671887081fSmrg	      FcMatchKind	kind);
7682c393a42Smrg
7692c393a42Smrg/* fcserialize.c */
7702c393a42SmrgFcPrivate intptr_t
7712c393a42SmrgFcAlignSize (intptr_t size);
772898dab68Smrg
7732c393a42SmrgFcPrivate FcSerialize *
7742c393a42SmrgFcSerializeCreate (void);
7752c393a42Smrg
7762c393a42SmrgFcPrivate void
7772c393a42SmrgFcSerializeDestroy (FcSerialize *serialize);
7782c393a42Smrg
7792c393a42SmrgFcPrivate FcBool
7802c393a42SmrgFcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
7812c393a42Smrg
7822c393a42SmrgFcPrivate intptr_t
7832c393a42SmrgFcSerializeReserve (FcSerialize *serialize, int size);
7842c393a42Smrg
7852c393a42SmrgFcPrivate intptr_t
7862c393a42SmrgFcSerializeOffset (FcSerialize *serialize, const void *object);
7872c393a42Smrg
7882c393a42SmrgFcPrivate void *
7892c393a42SmrgFcSerializePtr (FcSerialize *serialize, const void *object);
7902c393a42Smrg
7912c393a42SmrgFcPrivate FcBool
7922c393a42SmrgFcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
7932c393a42Smrg
7942c393a42SmrgFcPrivate FcLangSet *
7952c393a42SmrgFcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
7962c393a42Smrg
7972c393a42Smrg/* fccharset.c */
79818bd4a06SmrgFcPrivate FcCharSet *
79918bd4a06SmrgFcCharSetPromote (FcValuePromotionBuffer *vbuf);
80018bd4a06Smrg
8012c393a42SmrgFcPrivate void
8022c393a42SmrgFcLangCharSetPopulate (void);
8032c393a42Smrg
8042c393a42SmrgFcPrivate FcCharSetFreezer *
8052c393a42SmrgFcCharSetFreezerCreate (void);
8062c393a42Smrg
8072c393a42SmrgFcPrivate const FcCharSet *
8082c393a42SmrgFcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
8092c393a42Smrg
8102c393a42SmrgFcPrivate void
8112c393a42SmrgFcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
8122c393a42Smrg
8132c393a42SmrgFcPrivate FcBool
8142c393a42SmrgFcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
8152c393a42Smrg
8162c393a42SmrgFcPrivate FcCharSet *
8172c393a42SmrgFcNameParseCharSet (FcChar8 *string);
8182c393a42Smrg
8190d39df38SmrgFcPrivate FcBool
8200d39df38SmrgFcNameUnparseValue (FcStrBuf    *buf,
8210d39df38Smrg                    FcValue     *v0,
8220d39df38Smrg		    FcChar8     *escape);
8230d39df38Smrg
8240d39df38SmrgFcPrivate FcBool
8250d39df38SmrgFcNameUnparseValueList (FcStrBuf	*buf,
8260d39df38Smrg			FcValueListPtr	v,
8270d39df38Smrg			FcChar8		*escape);
8280d39df38Smrg
8292c393a42SmrgFcPrivate FcCharLeaf *
8302c393a42SmrgFcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
8312c393a42Smrg
8322c393a42SmrgFcPrivate FcBool
8332c393a42SmrgFcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
8342c393a42Smrg
8352c393a42SmrgFcPrivate FcCharSet *
8362c393a42SmrgFcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
8372c393a42Smrg
8382c393a42SmrgFcPrivate FcChar16 *
8392c393a42SmrgFcCharSetGetNumbers(const FcCharSet *c);
8402c393a42Smrg
8415e61939bSmrg/* fccompat.c */
8425e61939bSmrgFcPrivate int
8435e61939bSmrgFcOpen(const char *pathname, int flags, ...);
8445e61939bSmrg
8455e61939bSmrgFcPrivate int
8465e61939bSmrgFcMakeTempfile (char *template);
8475e61939bSmrg
8485e61939bSmrgFcPrivate int32_t
8495e61939bSmrgFcRandom (void);
8505e61939bSmrg
851d91dd368SmrgFcPrivate FcBool
852d91dd368SmrgFcMakeDirectory (const FcChar8 *dir);
853d91dd368Smrg
8541887081fSmrgFcPrivate ssize_t
8551887081fSmrgFcReadLink (const FcChar8 *pathname,
8561887081fSmrg	    FcChar8       *buf,
8571887081fSmrg	    size_t         bufsiz);
8581887081fSmrg
8592c393a42Smrg/* fcdbg.c */
8605e61939bSmrg
8615e61939bSmrgFcPrivate void
8625e61939bSmrgFcValuePrintFile (FILE *f, const FcValue v);
8635e61939bSmrg
8642c393a42SmrgFcPrivate void
865898dab68SmrgFcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark);
866898dab68Smrg
867898dab68SmrgFcPrivate void
868898dab68SmrgFcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos);
869898dab68Smrg
870898dab68SmrgFcPrivate void
871898dab68SmrgFcValueListPrint (FcValueListPtr l);
8722c393a42Smrg
8732c393a42SmrgFcPrivate void
8742c393a42SmrgFcLangSetPrint (const FcLangSet *ls);
8752c393a42Smrg
8762c393a42SmrgFcPrivate void
8772c393a42SmrgFcOpPrint (FcOp op);
8782c393a42Smrg
8792c393a42SmrgFcPrivate void
8802c393a42SmrgFcTestPrint (const FcTest *test);
8812c393a42Smrg
8822c393a42SmrgFcPrivate void
8832c393a42SmrgFcExprPrint (const FcExpr *expr);
8842c393a42Smrg
8852c393a42SmrgFcPrivate void
8862c393a42SmrgFcEditPrint (const FcEdit *edit);
8872c393a42Smrg
8882c393a42SmrgFcPrivate void
8891887081fSmrgFcRulePrint (const FcRule *rule);
8902c393a42Smrg
8912c393a42SmrgFcPrivate void
8922c393a42SmrgFcCharSetPrint (const FcCharSet *c);
893898dab68Smrg
89418bd4a06SmrgFcPrivate void
89518bd4a06SmrgFcPatternPrint2 (FcPattern *p1, FcPattern *p2, const FcObjectSet *os);
89618bd4a06Smrg
8972c393a42Smrgextern FcPrivate int FcDebugVal;
8982c393a42Smrg
8992c393a42Smrg#define FcDebug() (FcDebugVal)
9002c393a42Smrg
9012c393a42SmrgFcPrivate void
9022c393a42SmrgFcInitDebug (void);
9032c393a42Smrg
9042c393a42Smrg/* fcdefault.c */
9052c393a42SmrgFcPrivate FcChar8 *
9062c393a42SmrgFcGetDefaultLang (void);
9072c393a42Smrg
9085e61939bSmrgFcPrivate FcChar8 *
9095e61939bSmrgFcGetPrgname (void);
9105e61939bSmrg
91146bb3e47SmrgFcPrivate FcChar8 *
91246bb3e47SmrgFcGetDesktopName (void);
91346bb3e47Smrg
9145e61939bSmrgFcPrivate void
9155e61939bSmrgFcDefaultFini (void);
9165e61939bSmrg
9172c393a42Smrg/* fcdir.c */
9182c393a42Smrg
9195e61939bSmrgFcPrivate FcBool
9205e61939bSmrgFcFileIsLink (const FcChar8 *file);
9215e61939bSmrg
922d91dd368SmrgFcPrivate FcBool
923d91dd368SmrgFcFileIsFile (const FcChar8 *file);
924d91dd368Smrg
9252c393a42SmrgFcPrivate FcBool
9262c393a42SmrgFcFileScanConfig (FcFontSet	*set,
9272c393a42Smrg		  FcStrSet	*dirs,
9282c393a42Smrg		  const FcChar8 *file,
9292c393a42Smrg		  FcConfig	*config);
9302c393a42Smrg
9312c393a42SmrgFcPrivate FcBool
9322c393a42SmrgFcDirScanConfig (FcFontSet	*set,
9332c393a42Smrg		 FcStrSet	*dirs,
9342c393a42Smrg		 const FcChar8	*dir,
9352c393a42Smrg		 FcBool		force,
9362c393a42Smrg		 FcConfig	*config);
9372c393a42Smrg
9382c393a42Smrg/* fcfont.c */
9392c393a42SmrgFcPrivate int
9402c393a42SmrgFcFontDebug (void);
9410d39df38Smrg
9422c393a42Smrg/* fcfs.c */
9432c393a42Smrg
9442c393a42SmrgFcPrivate FcBool
9452c393a42SmrgFcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
9462c393a42Smrg
9472c393a42SmrgFcPrivate FcFontSet *
9482c393a42SmrgFcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
9492c393a42Smrg
950b2a52337SmrgFcPrivate FcFontSet *
951b2a52337SmrgFcFontSetDeserialize (const FcFontSet *set);
952b2a52337Smrg
9531887081fSmrg/* fcplist.c */
9541887081fSmrgFcPrivate FcPtrList *
9551887081fSmrgFcPtrListCreate (FcDestroyFunc func);
9561887081fSmrg
9571887081fSmrgFcPrivate void
9581887081fSmrgFcPtrListDestroy (FcPtrList *list);
9591887081fSmrg
9601887081fSmrgFcPrivate void
9611887081fSmrgFcPtrListIterInit (const FcPtrList	*list,
9621887081fSmrg		   FcPtrListIter	*iter);
9631887081fSmrg
9641887081fSmrgFcPrivate void
9651887081fSmrgFcPtrListIterInitAtLast (FcPtrList	*list,
9661887081fSmrg			 FcPtrListIter	*iter);
9671887081fSmrg
9681887081fSmrgFcPrivate FcBool
9691887081fSmrgFcPtrListIterNext (const FcPtrList	*list,
9701887081fSmrg		   FcPtrListIter	*iter);
9711887081fSmrg
9721887081fSmrgFcPrivate FcBool
9731887081fSmrgFcPtrListIterIsValid (const FcPtrList		*list,
9741887081fSmrg		      const FcPtrListIter	*iter);
9751887081fSmrg
9761887081fSmrgFcPrivate void *
9771887081fSmrgFcPtrListIterGetValue (const FcPtrList		*list,
9781887081fSmrg		       const FcPtrListIter	*iter);
9791887081fSmrg
9801887081fSmrgFcPrivate FcBool
9811887081fSmrgFcPtrListIterAdd (FcPtrList	*list,
9821887081fSmrg		  FcPtrListIter	*iter,
9831887081fSmrg		void		*data);
9841887081fSmrg
9851887081fSmrgFcPrivate FcBool
9861887081fSmrgFcPtrListIterRemove (FcPtrList		*list,
9871887081fSmrg		     FcPtrListIter	*iter);
9881887081fSmrg
9892c393a42Smrg/* fcinit.c */
9905e61939bSmrgFcPrivate FcConfig *
9915e61939bSmrgFcInitLoadOwnConfig (FcConfig *config);
9922c393a42Smrg
9935e61939bSmrgFcPrivate FcConfig *
9945e61939bSmrgFcInitLoadOwnConfigAndFonts (FcConfig *config);
9952c393a42Smrg
9965e61939bSmrg/* fcxml.c */
99718bd4a06SmrgFcPrivate void
99818bd4a06SmrgFcConfigPathFini (void);
99918bd4a06Smrg
10002c393a42SmrgFcPrivate void
10015e61939bSmrgFcTestDestroy (FcTest *test);
10022c393a42Smrg
10032c393a42SmrgFcPrivate void
10045e61939bSmrgFcEditDestroy (FcEdit *e);
10052c393a42Smrg
1006d91dd368Smrgvoid
1007d91dd368SmrgFcRuleDestroy (FcRule *rule);
1008d91dd368Smrg
10092c393a42Smrg/* fclang.c */
10102c393a42SmrgFcPrivate FcLangSet *
1011898dab68SmrgFcFreeTypeLangSet (const FcCharSet  *charset,
10122c393a42Smrg		   const FcChar8    *exclusiveLang);
10132c393a42Smrg
10142c393a42SmrgFcPrivate FcLangResult
10152c393a42SmrgFcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
1016898dab68Smrg
10172c393a42SmrgFcPrivate FcLangSet *
10185e61939bSmrgFcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *buf);
10192c393a42Smrg
10202c393a42SmrgFcPrivate FcLangSet *
10212c393a42SmrgFcNameParseLangSet (const FcChar8 *string);
10222c393a42Smrg
10232c393a42SmrgFcPrivate FcBool
10242c393a42SmrgFcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
10252c393a42Smrg
10262c393a42SmrgFcPrivate FcChar8 *
10272c393a42SmrgFcNameUnparseEscaped (FcPattern *pat, FcBool escape);
10282c393a42Smrg
10291887081fSmrgFcPrivate FcBool
10301887081fSmrgFcConfigParseOnly (FcConfig		*config,
10311887081fSmrg		   const FcChar8	*name,
10321887081fSmrg		   FcBool		complain);
10331887081fSmrg
10341887081fSmrgFcPrivate FcChar8 *
10351887081fSmrgFcConfigRealFilename (FcConfig		*config,
10361887081fSmrg		      const FcChar8	*url);
10371887081fSmrg
10382c393a42Smrg/* fclist.c */
10392c393a42Smrg
10402c393a42SmrgFcPrivate FcBool
10412c393a42SmrgFcListPatternMatchAny (const FcPattern *p,
10422c393a42Smrg		       const FcPattern *font);
10432c393a42Smrg
10442c393a42Smrg/* fcmatch.c */
10452c393a42Smrg
10462c393a42Smrg/* fcname.c */
10472c393a42Smrg
10485e61939bSmrgenum {
10495e61939bSmrg  FC_INVALID_OBJECT = 0,
10505e61939bSmrg#define FC_OBJECT(NAME, Type, Cmp) FC_##NAME##_OBJECT,
10515e61939bSmrg#include "fcobjs.h"
10525e61939bSmrg#undef FC_OBJECT
10535e61939bSmrg  FC_ONE_AFTER_MAX_BASE_OBJECT
10545e61939bSmrg#define FC_MAX_BASE_OBJECT (FC_ONE_AFTER_MAX_BASE_OBJECT - 1)
10555e61939bSmrg};
10562c393a42Smrg
10577872e0a1SmrgFcPrivate FcBool
10587872e0a1SmrgFcNameConstantWithObjectCheck (const FcChar8 *string, const char *object, int *result);
10597872e0a1Smrg
10602c393a42SmrgFcPrivate FcBool
10612c393a42SmrgFcNameBool (const FcChar8 *v, FcBool *result);
10622c393a42Smrg
10632c393a42SmrgFcPrivate FcBool
10642c393a42SmrgFcObjectValidType (FcObject object, FcType type);
10652c393a42Smrg
10662c393a42SmrgFcPrivate FcObject
10672c393a42SmrgFcObjectFromName (const char * name);
10682c393a42Smrg
10692c393a42SmrgFcPrivate const char *
10702c393a42SmrgFcObjectName (FcObject object);
10712c393a42Smrg
10720d39df38SmrgFcPrivate FcObjectSet *
10730d39df38SmrgFcObjectGetSet (void);
10740d39df38Smrg
10752c393a42Smrg#define FcObjectCompare(a, b)	((int) a - (int) b)
10762c393a42Smrg
10772c393a42Smrg/* fcpat.c */
10782c393a42Smrg
10792c393a42SmrgFcPrivate FcValue
10802c393a42SmrgFcValueCanonicalize (const FcValue *v);
10812c393a42Smrg
1082898dab68SmrgFcPrivate FcValueListPtr
1083898dab68SmrgFcValueListCreate (void);
1084898dab68Smrg
10852c393a42SmrgFcPrivate void
10862c393a42SmrgFcValueListDestroy (FcValueListPtr l);
10872c393a42Smrg
1088898dab68SmrgFcPrivate FcValueListPtr
1089898dab68SmrgFcValueListPrepend (FcValueListPtr vallist,
1090898dab68Smrg		    FcValue        value,
1091898dab68Smrg		    FcValueBinding binding);
1092898dab68Smrg
1093898dab68SmrgFcPrivate FcValueListPtr
1094898dab68SmrgFcValueListAppend (FcValueListPtr vallist,
1095898dab68Smrg		   FcValue        value,
1096898dab68Smrg		   FcValueBinding binding);
1097898dab68Smrg
1098898dab68SmrgFcPrivate FcValueListPtr
1099898dab68SmrgFcValueListDuplicate(FcValueListPtr orig);
1100898dab68Smrg
11012c393a42SmrgFcPrivate FcPatternElt *
11022c393a42SmrgFcPatternObjectFindElt (const FcPattern *p, FcObject object);
11032c393a42Smrg
11042c393a42SmrgFcPrivate FcPatternElt *
11052c393a42SmrgFcPatternObjectInsertElt (FcPattern *p, FcObject object);
11062c393a42Smrg
1107898dab68SmrgFcPrivate FcBool
1108898dab68SmrgFcPatternObjectListAdd (FcPattern	*p,
1109898dab68Smrg			FcObject	object,
1110898dab68Smrg			FcValueListPtr	list,
1111898dab68Smrg			FcBool		append);
1112898dab68Smrg
11132c393a42SmrgFcPrivate FcBool
11142c393a42SmrgFcPatternObjectAddWithBinding  (FcPattern	*p,
11152c393a42Smrg				FcObject	object,
11162c393a42Smrg				FcValue		value,
11172c393a42Smrg				FcValueBinding  binding,
11182c393a42Smrg				FcBool		append);
11192c393a42Smrg
11202c393a42SmrgFcPrivate FcBool
11212c393a42SmrgFcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
1122898dab68Smrg
11232c393a42SmrgFcPrivate FcBool
11242c393a42SmrgFcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
1125898dab68Smrg
11261887081fSmrgFcPrivate FcResult
11271887081fSmrgFcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b);
11281887081fSmrg
11292c393a42SmrgFcPrivate FcResult
11302c393a42SmrgFcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
1131898dab68Smrg
11322c393a42SmrgFcPrivate FcBool
11332c393a42SmrgFcPatternObjectDel (FcPattern *p, FcObject object);
11342c393a42Smrg
11352c393a42SmrgFcPrivate FcBool
11362c393a42SmrgFcPatternObjectRemove (FcPattern *p, FcObject object, int id);
11372c393a42Smrg
11382c393a42SmrgFcPrivate FcBool
11392c393a42SmrgFcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
11402c393a42Smrg
11412c393a42SmrgFcPrivate FcBool
11422c393a42SmrgFcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
11432c393a42Smrg
11442c393a42SmrgFcPrivate FcBool
11452c393a42SmrgFcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
11462c393a42Smrg
11472c393a42SmrgFcPrivate FcBool
11482c393a42SmrgFcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
11492c393a42Smrg
11502c393a42SmrgFcPrivate FcBool
11512c393a42SmrgFcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
11522c393a42Smrg
11532c393a42SmrgFcPrivate FcBool
11542c393a42SmrgFcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
11552c393a42Smrg
11562c393a42SmrgFcPrivate FcBool
11572c393a42SmrgFcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
11582c393a42Smrg
115918bd4a06SmrgFcPrivate FcBool
116018bd4a06SmrgFcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r);
116118bd4a06Smrg
11622c393a42SmrgFcPrivate FcResult
11632c393a42SmrgFcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
11642c393a42Smrg
11652c393a42SmrgFcPrivate FcResult
11662c393a42SmrgFcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
11672c393a42Smrg
11682c393a42SmrgFcPrivate FcResult
11692c393a42SmrgFcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
11702c393a42Smrg
11712c393a42SmrgFcPrivate FcResult
11722c393a42SmrgFcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
11732c393a42Smrg
11742c393a42SmrgFcPrivate FcResult
11752c393a42SmrgFcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
11762c393a42Smrg
11772c393a42SmrgFcPrivate FcResult
11782c393a42SmrgFcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
11792c393a42Smrg
11802c393a42SmrgFcPrivate FcResult
11812c393a42SmrgFcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
11822c393a42Smrg
118318bd4a06SmrgFcPrivate FcResult
118418bd4a06SmrgFcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r);
118518bd4a06Smrg
11862c393a42SmrgFcPrivate FcBool
11872c393a42SmrgFcPatternAppend (FcPattern *p, FcPattern *s);
11882c393a42Smrg
118918bd4a06SmrgFcPrivate int
119018bd4a06SmrgFcPatternPosition (const FcPattern *p, const char *object);
119118bd4a06Smrg
11921887081fSmrgFcPrivate FcBool
11931887081fSmrgFcPatternFindObjectIter (const FcPattern *pat, FcPatternIter *iter, FcObject object);
11941887081fSmrg
11951887081fSmrgFcPrivate FcObject
11961887081fSmrgFcPatternIterGetObjectId (const FcPattern *pat, FcPatternIter *iter);
11971887081fSmrg
11981887081fSmrgFcPrivate FcValueListPtr
11991887081fSmrgFcPatternIterGetValues (const FcPattern *pat, FcPatternIter *iter);
12001887081fSmrg
12011887081fSmrgFcPrivate FcPattern *
12021887081fSmrgFcPatternCacheRewriteFile (const FcPattern *pat, FcCache *cache, const FcChar8 *relocated_font_file);
12031887081fSmrg
12042c393a42SmrgFcPrivate FcChar32
12052c393a42SmrgFcStringHash (const FcChar8 *s);
12062c393a42Smrg
12072c393a42SmrgFcPrivate FcBool
12082c393a42SmrgFcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
12092c393a42Smrg
12102c393a42SmrgFcPrivate FcPattern *
12112c393a42SmrgFcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
12122c393a42Smrg
12132c393a42SmrgFcPrivate FcBool
12142c393a42SmrgFcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
12152c393a42Smrg
12162c393a42SmrgFcPrivate FcValueList *
12172c393a42SmrgFcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
12182c393a42Smrg
12192c393a42Smrg/* fcrender.c */
12202c393a42Smrg
12212c393a42Smrg/* fcmatrix.c */
12222c393a42Smrg
12232c393a42Smrgextern FcPrivate const FcMatrix    FcIdentityMatrix;
12242c393a42Smrg
12252c393a42SmrgFcPrivate void
12262c393a42SmrgFcMatrixFree (FcMatrix *mat);
12272c393a42Smrg
122818bd4a06Smrg/* fcrange.c */
122918bd4a06Smrg
123018bd4a06SmrgFcPrivate FcRange *
123118bd4a06SmrgFcRangePromote (double v, FcValuePromotionBuffer *vbuf);
123218bd4a06Smrg
123318bd4a06SmrgFcPrivate FcBool
123418bd4a06SmrgFcRangeIsInRange (const FcRange *a, const FcRange *b);
123518bd4a06Smrg
123618bd4a06SmrgFcPrivate FcBool
123718bd4a06SmrgFcRangeCompare (FcOp op, const FcRange *a, const FcRange *b);
123818bd4a06Smrg
123918bd4a06SmrgFcPrivate FcChar32
124018bd4a06SmrgFcRangeHash (const FcRange *r);
124118bd4a06Smrg
124218bd4a06SmrgFcPrivate FcBool
124318bd4a06SmrgFcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r);
124418bd4a06Smrg
124518bd4a06SmrgFcPrivate FcRange *
124618bd4a06SmrgFcRangeSerialize (FcSerialize *serialize, const FcRange *r);
124718bd4a06Smrg
1248898dab68Smrg/* fcstat.c */
1249898dab68Smrg
1250898dab68SmrgFcPrivate int
1251898dab68SmrgFcStat (const FcChar8 *file, struct stat *statb);
1252898dab68Smrg
1253898dab68SmrgFcPrivate int
1254898dab68SmrgFcStatChecksum (const FcChar8 *file, struct stat *statb);
1255898dab68Smrg
1256898dab68SmrgFcPrivate FcBool
1257898dab68SmrgFcIsFsMmapSafe (int fd);
1258898dab68Smrg
1259898dab68SmrgFcPrivate FcBool
1260898dab68SmrgFcIsFsMtimeBroken (const FcChar8 *dir);
1261898dab68Smrg
12622c393a42Smrg/* fcstr.c */
126318bd4a06SmrgFcPrivate FcStrSet *
126418bd4a06SmrgFcStrSetCreateEx (unsigned int control);
126518bd4a06Smrg
12667872e0a1SmrgFcPrivate FcBool
12677872e0a1SmrgFcStrSetInsert (FcStrSet *set, const FcChar8 *s, int pos);
12687872e0a1Smrg
1269898dab68SmrgFcPrivate FcBool
1270898dab68SmrgFcStrSetAddLangs (FcStrSet *strs, const char *languages);
1271898dab68Smrg
12722c393a42SmrgFcPrivate void
12732c393a42SmrgFcStrSetSort (FcStrSet * set);
12742c393a42Smrg
12757872e0a1SmrgFcPrivate FcBool
12767872e0a1SmrgFcStrSetMemberAB (FcStrSet *set, const FcChar8 *a, FcChar8 *b, FcChar8 **ret);
12777872e0a1Smrg
12787872e0a1SmrgFcPrivate FcBool
12797872e0a1SmrgFcStrSetAddTriple (FcStrSet *set, const FcChar8 *a, const FcChar8 *b, const FcChar8 *c);
12807872e0a1Smrg
12817872e0a1SmrgFcPrivate const FcChar8 *
12827872e0a1SmrgFcStrTripleSecond (FcChar8 *s);
12837872e0a1Smrg
12847872e0a1SmrgFcPrivate const FcChar8 *
12857872e0a1SmrgFcStrTripleThird (FcChar8 *str);
12867872e0a1Smrg
12877872e0a1SmrgFcPrivate FcBool
12887872e0a1SmrgFcStrSetAddFilenamePairWithSalt (FcStrSet *strs, const FcChar8 *d, const FcChar8 *m, const FcChar8 *salt);
12897872e0a1Smrg
12907872e0a1SmrgFcPrivate FcBool
12917872e0a1SmrgFcStrSetDeleteAll (FcStrSet *set);
12927872e0a1Smrg
12932c393a42SmrgFcPrivate void
12942c393a42SmrgFcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
12952c393a42Smrg
12962c393a42SmrgFcPrivate void
12972c393a42SmrgFcStrBufDestroy (FcStrBuf *buf);
12982c393a42Smrg
12992c393a42SmrgFcPrivate FcChar8 *
13002c393a42SmrgFcStrBufDone (FcStrBuf *buf);
13012c393a42Smrg
13020d39df38SmrgFcPrivate FcChar8 *
13030d39df38SmrgFcStrBufDoneStatic (FcStrBuf *buf);
13040d39df38Smrg
13052c393a42SmrgFcPrivate FcBool
13062c393a42SmrgFcStrBufChar (FcStrBuf *buf, FcChar8 c);
13072c393a42Smrg
13082c393a42SmrgFcPrivate FcBool
13092c393a42SmrgFcStrBufString (FcStrBuf *buf, const FcChar8 *s);
13102c393a42Smrg
13112c393a42SmrgFcPrivate FcBool
13122c393a42SmrgFcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
13132c393a42Smrg
13142c393a42SmrgFcPrivate int
13152c393a42SmrgFcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
13162c393a42Smrg
13175e61939bSmrgFcPrivate int
13185e61939bSmrgFcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
13195e61939bSmrg
13202c393a42SmrgFcPrivate const FcChar8 *
13212c393a42SmrgFcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
13222c393a42Smrg
13232c393a42SmrgFcPrivate const FcChar8 *
13242c393a42SmrgFcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
13252c393a42Smrg
13262c393a42SmrgFcPrivate const FcChar8 *
13272c393a42SmrgFcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2);
13282c393a42Smrg
13295e61939bSmrgFcPrivate int
13305e61939bSmrgFcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
13315e61939bSmrg
13325e61939bSmrgFcPrivate FcBool
13335e61939bSmrgFcStrGlobMatch (const FcChar8 *glob,
13345e61939bSmrg		const FcChar8 *string);
13355e61939bSmrg
13362c393a42SmrgFcPrivate FcBool
13372c393a42SmrgFcStrUsesHome (const FcChar8 *s);
13382c393a42Smrg
13391887081fSmrgFcPrivate FcBool
13401887081fSmrgFcStrIsAbsoluteFilename (const FcChar8 *s);
13411887081fSmrg
13422c393a42SmrgFcPrivate FcChar8 *
13432c393a42SmrgFcStrLastSlash (const FcChar8  *path);
13442c393a42Smrg
13452c393a42SmrgFcPrivate FcChar32
13462c393a42SmrgFcStrHashIgnoreCase (const FcChar8 *s);
13472c393a42Smrg
13487872e0a1SmrgFcPrivate FcChar32
13497872e0a1SmrgFcStrHashIgnoreBlanksAndCase (const FcChar8 *s);
13507872e0a1Smrg
13517872e0a1SmrgFcPrivate FcChar8 *
13527872e0a1SmrgFcStrRealPath (const FcChar8 *path);
13537872e0a1Smrg
13542c393a42SmrgFcPrivate FcChar8 *
13552c393a42SmrgFcStrCanonFilename (const FcChar8 *s);
13562c393a42Smrg
13572c393a42SmrgFcPrivate FcBool
13582c393a42SmrgFcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
13592c393a42Smrg
13602c393a42SmrgFcPrivate FcChar8 *
13612c393a42SmrgFcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
13622c393a42Smrg
13635e61939bSmrg/* fcobjs.c */
13645e61939bSmrg
136518bd4a06SmrgFcPrivate void
136618bd4a06SmrgFcObjectFini (void);
136718bd4a06Smrg
13685e61939bSmrgFcPrivate FcObject
13695e61939bSmrgFcObjectLookupIdByName (const char *str);
13705e61939bSmrg
13715e61939bSmrgFcPrivate FcObject
13725e61939bSmrgFcObjectLookupBuiltinIdByName (const char *str);
13735e61939bSmrg
13745e61939bSmrgFcPrivate const char *
13755e61939bSmrgFcObjectLookupOtherNameById (FcObject id);
13765e61939bSmrg
13775e61939bSmrgFcPrivate const FcObjectType *
13785e61939bSmrgFcObjectLookupOtherTypeById (FcObject id);
13795e61939bSmrg
13805e61939bSmrgFcPrivate const FcObjectType *
13815e61939bSmrgFcObjectLookupOtherTypeByName (const char *str);
13825e61939bSmrg
13831887081fSmrg/* fchash.c */
13841887081fSmrgFcPrivate FcBool
13851887081fSmrgFcHashStrCopy (const void  *src,
13861887081fSmrg	       void       **dest);
13871887081fSmrg
13881887081fSmrgFcPrivate FcBool
13891887081fSmrgFcHashUuidCopy (const void  *src,
13901887081fSmrg		void       **dest);
13911887081fSmrg
13921887081fSmrgFcPrivate void
13931887081fSmrgFcHashUuidFree (void *data);
13941887081fSmrg
13951887081fSmrgFcPrivate FcHashTable *
13961887081fSmrgFcHashTableCreate (FcHashFunc    hash_func,
13971887081fSmrg		   FcCompareFunc compare_func,
13981887081fSmrg		   FcCopyFunc    key_copy_func,
13991887081fSmrg		   FcCopyFunc    value_copy_func,
14001887081fSmrg		   FcDestroyFunc key_destroy_func,
14011887081fSmrg		   FcDestroyFunc value_destroy_func);
14021887081fSmrg
14031887081fSmrgFcPrivate void
14041887081fSmrgFcHashTableDestroy (FcHashTable *table);
14051887081fSmrg
14061887081fSmrgFcPrivate FcBool
14071887081fSmrgFcHashTableFind (FcHashTable  *table,
14081887081fSmrg		 const void   *key,
14091887081fSmrg		 void        **value);
14101887081fSmrg
14111887081fSmrgFcPrivate FcBool
14121887081fSmrgFcHashTableAdd (FcHashTable *table,
14131887081fSmrg		void        *key,
14141887081fSmrg		void        *value);
14151887081fSmrg
14161887081fSmrgFcPrivate FcBool
14171887081fSmrgFcHashTableReplace (FcHashTable *table,
14181887081fSmrg		    void        *key,
14191887081fSmrg		    void        *value);
14201887081fSmrg
14211887081fSmrgFcPrivate FcBool
14221887081fSmrgFcHashTableRemove (FcHashTable *table,
14231887081fSmrg		   void        *key);
14241887081fSmrg
14252c393a42Smrg#endif /* _FC_INT_H_ */
1426