# define FC_DIR_SEPARATOR_S "/"
#endif
+#ifdef PATH_MAX
+#define FC_PATH_MAX PATH_MAX
+#else
+#define FC_PATH_MAX 128
+#endif
+
#if __GNUC__ >= 4
#define FC_UNUSED __attribute__((unused))
#else
#define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
#define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
-#define FC_ABS(a) ((a) < 0 ? -(a) : (a))
/* slim_internal.h */
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
#define FcPrivate
#endif
-FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
+/* NLS */
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(x) (dgettext(GETTEXT_PACKAGE, x))
+#else
+#define dgettext(d, s) (s)
+#define _(x) (x)
+#endif
+
+#define N_(x) x
-typedef enum _FcValueBinding {
- FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
- /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
- FcValueBindingEnd = INT_MAX
-} FcValueBinding;
+FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
#define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
#define FcFree(s) (free ((FcChar8 *) (s)))
FcValueBinding binding;
} FcEdit;
+typedef void (* FcDestroyFunc) (void *data);
+
+typedef struct _FcPtrList FcPtrList;
+/* need to sync with FcConfigFileInfoIter at fontconfig.h */
+typedef struct _FcPtrListIter {
+ void *dummy1;
+ void *dummy2;
+ void *dummy3;
+} FcPtrListIter;
+
typedef enum _FcRuleType {
FcRuleUnknown, FcRuleTest, FcRuleEdit
} FcRuleType;
} u;
} FcRule;
-typedef struct _FcSubst {
- struct _FcSubst *next;
- FcRule *rule;
-} FcSubst;
+typedef struct _FcRuleSet {
+ FcRef ref;
+ FcChar8 *name;
+ FcChar8 *description;
+ FcChar8 *domain;
+ FcBool enabled;
+ FcPtrList *subst[FcMatchKindEnd];
+} FcRuleSet;
typedef struct _FcCharLeaf {
FcChar32 map[256/32];
FcChar8 buf_static[16 * sizeof (void *)];
} FcStrBuf;
+typedef struct _FcHashTable FcHashTable;
+
+typedef FcChar32 (* FcHashFunc) (const void *data);
+typedef int (* FcCompareFunc) (const void *v1, const void *v2);
+typedef FcBool (* FcCopyFunc) (const void *src, void **dest);
+
+
struct _FcCache {
unsigned int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
int version; /* FC_CACHE_VERSION_NUMBER */
FcChar8 *tmp; /* tmpfile name (used for locking) */
};
-struct _FcBlanks {
- int nblank;
- int sblank;
- FcChar32 *blanks;
-};
-
struct _FcConfig {
/*
* File names loaded from the configuration -- saved here as the
*/
FcStrSet *configDirs; /* directories to scan for fonts */
/*
- * Set of allowed blank chars -- used to
- * trim fonts of bogus glyphs
- */
- FcBlanks *blanks;
- /*
* List of directories containing fonts,
* built by recursively scanning the set
* of configured directories
* Substitution instructions for patterns and fonts;
* maxObjects is used to allocate appropriate intermediate storage
* while performing a whole set of substitutions
+ *
+ * 0.. substitutions for patterns
+ * 1.. substitutions for fonts
+ * 2.. substitutions for scanned fonts
*/
- FcSubst *substPattern; /* substitutions for patterns */
- FcSubst *substFont; /* substitutions for fonts */
- FcSubst *substScan; /* substitutions for scanned fonts */
+ FcPtrList *subst[FcMatchKindEnd];
int maxObjects; /* maximum number of tests in all substs */
/*
* List of patterns used to control font file selection
FcExprPage *expr_pool; /* pool of FcExpr's */
FcChar8 *sysRoot; /* override the system root directory */
+ FcStrSet *availConfigFiles; /* config files available */
+ FcPtrList *rulesetList; /* List of rulesets being installed */
+ FcHashTable *uuid_table; /* UUID table for cachedirs */
+ FcHashTable *alias_table; /* alias table for cachedirs */
};
typedef struct _FcFileTime {
} u;
};
-/* fcblanks.c */
-
/* fccache.c */
FcPrivate FcCache *
const FcChar8 *d);
FcPrivate FcBool
-FcConfigAddDir (FcConfig *config,
- const FcChar8 *d);
-
-FcPrivate FcBool
FcConfigAddCacheDir (FcConfig *config,
const FcChar8 *d);
FcConfigAddCache (FcConfig *config, FcCache *cache,
FcSetName set, FcStrSet *dirSet);
+FcPrivate FcRuleSet *
+FcRuleSetCreate (const FcChar8 *name);
+
+FcPrivate void
+FcRuleSetDestroy (FcRuleSet *rs);
+
+FcPrivate void
+FcRuleSetReference (FcRuleSet *rs);
+
+FcPrivate void
+FcRuleSetEnable (FcRuleSet *rs,
+ FcBool flag);
+
+FcPrivate void
+FcRuleSetAddDescription (FcRuleSet *rs,
+ const FcChar8 *domain,
+ const FcChar8 *description);
+
+FcPrivate int
+FcRuleSetAdd (FcRuleSet *rs,
+ FcRule *rule,
+ FcMatchKind kind);
+
/* fcserialize.c */
FcPrivate intptr_t
FcAlignSize (intptr_t size);
FcPrivate FcBool
FcMakeDirectory (const FcChar8 *dir);
+FcPrivate ssize_t
+FcReadLink (const FcChar8 *pathname,
+ FcChar8 *buf,
+ size_t bufsiz);
+
/* fcdbg.c */
FcPrivate void
FcEditPrint (const FcEdit *edit);
FcPrivate void
-FcSubstPrint (const FcSubst *subst);
+FcRulePrint (const FcRule *rule);
FcPrivate void
FcCharSetPrint (const FcCharSet *c);
FcPrivate FcBool
FcFileScanConfig (FcFontSet *set,
FcStrSet *dirs,
- FcBlanks *blanks,
const FcChar8 *file,
FcConfig *config);
FcPrivate FcBool
FcDirScanConfig (FcFontSet *set,
FcStrSet *dirs,
- FcBlanks *blanks,
const FcChar8 *dir,
FcBool force,
FcConfig *config);
FcPrivate FcFontSet *
FcFontSetDeserialize (const FcFontSet *set);
+/* fcplist.c */
+FcPrivate FcPtrList *
+FcPtrListCreate (FcDestroyFunc func);
+
+FcPrivate void
+FcPtrListDestroy (FcPtrList *list);
+
+FcPrivate void
+FcPtrListIterInit (const FcPtrList *list,
+ FcPtrListIter *iter);
+
+FcPrivate void
+FcPtrListIterInitAtLast (FcPtrList *list,
+ FcPtrListIter *iter);
+
+FcPrivate FcBool
+FcPtrListIterNext (const FcPtrList *list,
+ FcPtrListIter *iter);
+
+FcPrivate FcBool
+FcPtrListIterIsValid (const FcPtrList *list,
+ const FcPtrListIter *iter);
+
+FcPrivate void *
+FcPtrListIterGetValue (const FcPtrList *list,
+ const FcPtrListIter *iter);
+
+FcPrivate FcBool
+FcPtrListIterAdd (FcPtrList *list,
+ FcPtrListIter *iter,
+ void *data);
+
+FcPrivate FcBool
+FcPtrListIterRemove (FcPtrList *list,
+ FcPtrListIter *iter);
+
/* fcinit.c */
FcPrivate FcConfig *
FcInitLoadOwnConfig (FcConfig *config);
FcPrivate FcChar8 *
FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
+FcPrivate FcBool
+FcConfigParseOnly (FcConfig *config,
+ const FcChar8 *name,
+ FcBool complain);
+
+FcPrivate FcChar8 *
+FcConfigRealFilename (FcConfig *config,
+ const FcChar8 *url);
+
/* fclist.c */
FcPrivate FcBool
FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
FcPrivate FcResult
+FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b);
+
+FcPrivate FcResult
FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
FcPrivate FcBool
FcPrivate const FcObjectType *
FcObjectLookupOtherTypeByName (const char *str);
+/* fchash.c */
+FcPrivate FcBool
+FcHashStrCopy (const void *src,
+ void **dest);
+
+FcPrivate FcBool
+FcHashUuidCopy (const void *src,
+ void **dest);
+
+FcPrivate void
+FcHashUuidFree (void *data);
+
+FcPrivate FcHashTable *
+FcHashTableCreate (FcHashFunc hash_func,
+ FcCompareFunc compare_func,
+ FcCopyFunc key_copy_func,
+ FcCopyFunc value_copy_func,
+ FcDestroyFunc key_destroy_func,
+ FcDestroyFunc value_destroy_func);
+
+FcPrivate void
+FcHashTableDestroy (FcHashTable *table);
+
+FcPrivate FcBool
+FcHashTableFind (FcHashTable *table,
+ const void *key,
+ void **value);
+
+FcPrivate FcBool
+FcHashTableAdd (FcHashTable *table,
+ void *key,
+ void *value);
+
+FcPrivate FcBool
+FcHashTableReplace (FcHashTable *table,
+ void *key,
+ void *value);
+
#endif /* _FC_INT_H_ */