]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
[int] Define MIN/MAX/ABS macros
[fontconfig.git] / src / fcint.h
index 70836c0752fb6fc2b6f0594767dbdea2a289dd90..81cde21d5e80bf1d9dded764b0a8c50f29d6c055 100644 (file)
 #define FC_BANK_FIRST 1
 #define FC_BANK_LANGS      0xfcfcfcfc
 
+#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              __attribute__((__visibility__("hidden")))
@@ -247,6 +251,15 @@ typedef struct _FcExpr {
     } u;
 } FcExpr;
 
+typedef struct _FcExprPage FcExprPage;
+
+struct _FcExprPage {
+  FcExprPage *next_page;
+  FcExpr *next;
+  FcExpr exprs[(1024 - 2/* two pointers */ - 2/* malloc overhead */) * sizeof (void *) / sizeof (FcExpr)];
+  FcExpr end[0];
+};
+
 typedef enum _FcQual {
     FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
 } FcQual;
@@ -342,6 +355,14 @@ struct _FcCache {
 
 #define FC_SERIALIZE_HASH_SIZE 8191
 
+typedef union _FcAlign {
+    double     d;
+    int                i;
+    intptr_t   ip;
+    FcBool     b;
+    void       *p;
+} FcAlign;
+
 typedef struct _FcSerializeBucket {
     struct _FcSerializeBucket *next;
     const void *object;
@@ -486,6 +507,8 @@ struct _FcConfig {
     int                rescanInterval;     /* interval between scans */
 
     int                ref;                /* reference count */
+
+    FcExprPage *expr_pool;         /* pool of FcExpr's */
 };
  
 extern FcPrivate FcConfig      *_fcConfig;
@@ -527,13 +550,16 @@ FcDirCacheReference (FcCache *cache, int nref);
 
 #ifdef _WIN32
 FcPrivate int
-FcStat (const char *file, struct stat *statb)
+FcStat (const char *file, struct stat *statb);
 #else
 #define FcStat stat
 #endif
 
 /* fccfg.c */
 
+FcPrivate FcExpr *
+FcConfigAllocExpr (FcConfig *config);
+
 FcPrivate FcBool
 FcConfigAddConfigDir (FcConfig     *config,
                      const FcChar8 *d);
@@ -737,36 +763,6 @@ FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
 FcPrivate void
 FcTestDestroy (FcTest *test);
 
-FcPrivate FcExpr *
-FcExprCreateInteger (int i);
-
-FcPrivate FcExpr *
-FcExprCreateDouble (double d);
-
-FcPrivate FcExpr *
-FcExprCreateString (const FcChar8 *s);
-
-FcPrivate FcExpr *
-FcExprCreateMatrix (const FcMatrix *m);
-
-FcPrivate FcExpr *
-FcExprCreateBool (FcBool b);
-
-FcPrivate FcExpr *
-FcExprCreateNil (void);
-
-FcPrivate FcExpr *
-FcExprCreateField (const char *field);
-
-FcPrivate FcExpr *
-FcExprCreateConst (const FcChar8 *constant);
-
-FcPrivate FcExpr *
-FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
-
-FcPrivate void
-FcExprDestroy (FcExpr *e);
-
 FcPrivate void
 FcEditDestroy (FcEdit *e);