#include <ctype.h>
#include <assert.h>
#include <errno.h>
+#include <limits.h>
#include <unistd.h>
#include <stddef.h>
#include <sys/types.h>
#include "fcdeprecate.h"
#include "fcmutex.h"
#include "fcatomic.h"
-#include <ft2build.h>
-#include FT_FREETYPE_H
#ifndef FC_CONFIG_PATH
#define FC_CONFIG_PATH "fonts.conf"
#define FC_DBG_CONFIG 1024
#define FC_DBG_LANGSET 2048
-#define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
+#define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1] FC_UNUSED
#define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond))
#define FC_ASSERT_STATIC(_cond) _FC_ASSERT_STATIC0 (__LINE__, (_cond))
FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
typedef enum _FcValueBinding {
- FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
+ FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
+ /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
+ FcValueBindingEnd = INT_MAX
} FcValueBinding;
#define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
typedef int FcObject;
+/* The 1024 is to leave some room for future added internal objects, such
+ * that caches from newer fontconfig can still be used with older fontconfig
+ * without getting confused. */
+#define FC_EXT_OBJ_INDEX 1024
+#define FC_OBJ_ID(_n_) ((_n_) & (~FC_EXT_OBJ_INDEX))
+
typedef struct _FcPatternElt *FcPatternEltPtr;
/*
#define FcMatchDefault ((FcMatchKind) -1)
typedef struct _FcTest {
- struct _FcTest *next;
FcMatchKind kind;
FcQual qual;
FcObject object;
} FcTest;
typedef struct _FcEdit {
- struct _FcEdit *next;
FcObject object;
FcOp op;
FcExpr *expr;
FcValueBinding binding;
} FcEdit;
+typedef enum _FcRuleType {
+ FcRuleUnknown, FcRuleTest, FcRuleEdit
+} FcRuleType;
+
+typedef struct _FcRule {
+ struct _FcRule *next;
+ FcRuleType type;
+ union {
+ FcTest *test;
+ FcEdit *edit;
+ } u;
+} FcRule;
+
typedef struct _FcSubst {
struct _FcSubst *next;
- FcTest *test;
- FcEdit *edit;
+ FcRule *rule;
} FcSubst;
typedef struct _FcCharLeaf {
FcPrivate FcCache *
FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
+FcPrivate FcCache *
+FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
+
FcPrivate FcBool
FcDirCacheWrite (FcCache *cache, FcConfig *config);
FcConfigAddBlank (FcConfig *config,
FcChar32 blank);
-FcPrivate FcBool
-FcConfigAddEdit (FcConfig *config,
- FcTest *test,
- FcEdit *edit,
+FcBool
+FcConfigAddRule (FcConfig *config,
+ FcRule *rule,
FcMatchKind kind);
FcPrivate void
FcPrivate FcBool
FcConfigCompareValue (const FcValue *m,
- FcOp op,
+ unsigned int op_,
const FcValue *v);
FcPrivate FcBool
FcPrivate int32_t
FcRandom (void);
+FcPrivate FcBool
+FcMakeDirectory (const FcChar8 *dir);
+
/* fcdbg.c */
FcPrivate void
FcFileIsLink (const FcChar8 *file);
FcPrivate FcBool
+FcFileIsFile (const FcChar8 *file);
+
+FcPrivate FcBool
FcFileScanConfig (FcFontSet *set,
FcStrSet *dirs,
FcBlanks *blanks,
FcPrivate FcFontSet *
FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
+FcPrivate FcFontSet *
+FcFontSetDeserialize (const FcFontSet *set);
+
/* fchash.c */
FcPrivate FcChar8 *
FcHashGetSHA256Digest (const FcChar8 *input_strings,
size_t len);
+
FcPrivate FcChar8 *
-FcHashGetSHA256DigestFromFace (const FT_Face face);
+FcHashGetSHA256DigestFromFile (const FcChar8 *filename);
+
+FcPrivate FcChar8 *
+FcHashGetSHA256DigestFromMemory (const char *fontdata,
+ size_t length);
/* fcinit.c */
FcPrivate FcConfig *
FcPrivate void
FcEditDestroy (FcEdit *e);
+void
+FcRuleDestroy (FcRule *rule);
+
/* fclang.c */
FcPrivate FcLangSet *
FcFreeTypeLangSet (const FcCharSet *charset,
FcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
FcPrivate FcBool
+FcStrGlobMatch (const FcChar8 *glob,
+ const FcChar8 *string);
+
+FcPrivate FcBool
FcStrUsesHome (const FcChar8 *s);
FcPrivate FcChar8 *