X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffcint.h;h=81cde21d5e80bf1d9dded764b0a8c50f29d6c055;hb=6b1fc678ca59df3f3f1ffac0e509cf485c9df0c0;hp=c8ff22838fbeb88303787234f508a9e47601cbac;hpb=0c93b91db0cdf7c5e901477c266b45c8baeadd00;p=fontconfig.git diff --git a/src/fcint.h b/src/fcint.h index c8ff228..81cde21 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -13,9 +13,9 @@ * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR @@ -111,6 +111,10 @@ #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; @@ -313,6 +326,7 @@ typedef struct _FcStrBuf { FcBool failed; int len; int size; + FcChar8 buf_static[16 * sizeof (void *)]; } FcStrBuf; struct _FcCache { @@ -341,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; @@ -485,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; @@ -526,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); @@ -645,6 +672,11 @@ FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c); FcPrivate FcCharSet * FcNameParseCharSet (FcChar8 *string); +FcPrivate FcBool +FcNameUnparseValue (FcStrBuf *buf, + FcValue *v0, + FcChar8 *escape); + FcPrivate FcBool FcNameUnparseValueList (FcStrBuf *buf, FcValueListPtr v, @@ -653,9 +685,6 @@ FcNameUnparseValueList (FcStrBuf *buf, FcPrivate FcCharLeaf * FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4); -FcPrivate FcCharSet * -FcCharSetMerge (FcCharSet *a, const FcCharSet *b); - FcPrivate FcBool FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs); @@ -721,7 +750,7 @@ FcDirScanConfig (FcFontSet *set, /* fcfont.c */ FcPrivate int FcFontDebug (void); - + /* fcfs.c */ FcPrivate FcBool @@ -729,53 +758,11 @@ FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s); FcPrivate FcFontSet * FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s); - -/* fcgram.y */ -FcPrivate int -FcConfigparse (void); - -FcPrivate int -FcConfigwrap (void); - -FcPrivate void -FcConfigerror (char *fmt, ...); - -FcPrivate char * -FcConfigSaveField (const char *field); +/* fcxml.c */ 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); @@ -1015,6 +1002,9 @@ FcStrBufDestroy (FcStrBuf *buf); FcPrivate FcChar8 * FcStrBufDone (FcStrBuf *buf); +FcPrivate FcChar8 * +FcStrBufDoneStatic (FcStrBuf *buf); + FcPrivate FcBool FcStrBufChar (FcStrBuf *buf, FcChar8 c);