]> git.wh0rd.org - fontconfig.git/blame - src/fcint.h
Merge with HEAD and finish the GCC 4 cleanups (no more warnings!)
[fontconfig.git] / src / fcint.h
CommitLineData
24330d27 1/*
793e946c 2 * $RCSId: xc/lib/fontconfig/src/fcint.h,v 1.27 2002/08/31 22:17:32 keithp Exp $
24330d27 3 *
46b51147 4 * Copyright © 2000 Keith Packard
24330d27
KP
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. Keith Packard makes no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
15 *
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
23 */
24
25#ifndef _FCINT_H_
26#define _FCINT_H_
27
28#include <stdlib.h>
29#include <stdio.h>
30#include <string.h>
31#include <ctype.h>
32#include <errno.h>
33#include <unistd.h>
34#include <sys/types.h>
35#include <sys/stat.h>
179c3995 36#include <time.h>
24330d27
KP
37#include <fontconfig/fontconfig.h>
38#include <fontconfig/fcprivate.h>
be094850 39#include <fontconfig/fcfreetype.h>
24330d27
KP
40#ifdef HAVE_CONFIG_H
41#include <config.h>
42#endif
43
24330d27
KP
44#ifndef FC_CONFIG_PATH
45#define FC_CONFIG_PATH "fonts.conf"
46#endif
47
179c3995
KP
48#define FC_FONT_FILE_INVALID ((FcChar8 *) ".")
49#define FC_FONT_FILE_DIR ((FcChar8 *) ".dir")
50
daeed6e0
TL
51#ifdef _WIN32
52#define FC_SEARCH_PATH_SEPARATOR ';'
53#else
54#define FC_SEARCH_PATH_SEPARATOR ':'
55#endif
56
24330d27
KP
57#define FC_DBG_MATCH 1
58#define FC_DBG_MATCHV 2
59#define FC_DBG_EDIT 4
60#define FC_DBG_FONTSET 8
61#define FC_DBG_CACHE 16
62#define FC_DBG_CACHEV 32
63#define FC_DBG_PARSE 64
64#define FC_DBG_SCAN 128
4c003605 65#define FC_DBG_SCANV 256
24330d27 66#define FC_DBG_MEMORY 512
2d9c79c0 67#define FC_DBG_CONFIG 1024
24330d27
KP
68
69#define FC_MEM_CHARSET 0
d8d73958 70#define FC_MEM_CHARLEAF 1
24330d27
KP
71#define FC_MEM_FONTSET 2
72#define FC_MEM_FONTPTR 3
73#define FC_MEM_OBJECTSET 4
74#define FC_MEM_OBJECTPTR 5
75#define FC_MEM_MATRIX 6
76#define FC_MEM_PATTERN 7
77#define FC_MEM_PATELT 8
78#define FC_MEM_VALLIST 9
79#define FC_MEM_SUBSTATE 10
80#define FC_MEM_STRING 11
81#define FC_MEM_LISTBUCK 12
d8d73958
KP
82#define FC_MEM_STRSET 13
83#define FC_MEM_STRLIST 14
84#define FC_MEM_CONFIG 15
85#define FC_MEM_LANGSET 16
9dac3c59
KP
86#define FC_MEM_ATOMIC 17
87#define FC_MEM_BLANKS 18
88#define FC_MEM_CACHE 19
89#define FC_MEM_STRBUF 20
90#define FC_MEM_SUBST 21
91#define FC_MEM_OBJECTTYPE 22
92#define FC_MEM_CONSTANT 23
93#define FC_MEM_TEST 24
94#define FC_MEM_EXPR 25
95#define FC_MEM_VSTACK 26
96#define FC_MEM_ATTR 27
97#define FC_MEM_PSTACK 28
1c52c0f0 98#define FC_MEM_STATICSTR 29
d8d73958 99
1c52c0f0 100#define FC_MEM_NUM 30
24330d27 101
4c003605 102typedef enum _FcValueBinding {
dda7794f 103 FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
4c003605
KP
104} FcValueBinding;
105
cd2ec1a9 106typedef struct _FcValueListPtr {
4262e0b3 107 int bank;
cd2ec1a9
PL
108 union {
109 int stat;
110 struct _FcValueList *dyn;
111 } u;
112} FcValueListPtr;
113
24330d27 114typedef struct _FcValueList {
cd2ec1a9
PL
115 FcValueListPtr next;
116
24330d27 117 FcValue value;
e709ddfa 118 FcValueBinding binding;
24330d27
KP
119} FcValueList;
120
4262e0b3
PL
121typedef int FcObjectPtr;
122
cd2ec1a9 123typedef struct _FcPatternEltPtr {
4262e0b3 124 int bank;
cd2ec1a9
PL
125 union {
126 int stat;
127 struct _FcPatternElt *dyn;
128 } u;
129} FcPatternEltPtr;
130
24330d27 131typedef struct _FcPatternElt {
cd2ec1a9
PL
132 FcObjectPtr object;
133 FcValueListPtr values;
24330d27
KP
134} FcPatternElt;
135
136struct _FcPattern {
137 int num;
138 int size;
cd2ec1a9 139 FcPatternEltPtr elts;
e709ddfa 140 int ref;
4262e0b3 141 int bank;
24330d27
KP
142};
143
144typedef enum _FcOp {
145 FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet,
146 FcOpNil,
147 FcOpField, FcOpConst,
148 FcOpAssign, FcOpAssignReplace,
149 FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
150 FcOpQuest,
74a623e0
KP
151 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
152 FcOpContains, FcOpListing, FcOpNotContains,
24330d27
KP
153 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
154 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
3f7653c2
KP
155 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
156 FcOpInvalid
24330d27
KP
157} FcOp;
158
159typedef struct _FcExpr {
160 FcOp op;
161 union {
162 int ival;
163 double dval;
ccb3e93b 164 FcChar8 *sval;
24330d27
KP
165 FcMatrix *mval;
166 FcBool bval;
167 FcCharSet *cval;
168 char *field;
ccb3e93b 169 FcChar8 *constant;
24330d27
KP
170 struct {
171 struct _FcExpr *left, *right;
172 } tree;
173 } u;
174} FcExpr;
175
176typedef enum _FcQual {
6f6563ed 177 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
24330d27
KP
178} FcQual;
179
938bc633
KP
180#define FcMatchDefault ((FcMatchKind) -1)
181
24330d27
KP
182typedef struct _FcTest {
183 struct _FcTest *next;
938bc633 184 FcMatchKind kind;
24330d27
KP
185 FcQual qual;
186 const char *field;
187 FcOp op;
188 FcExpr *expr;
189} FcTest;
190
191typedef struct _FcEdit {
192 struct _FcEdit *next;
193 const char *field;
194 FcOp op;
195 FcExpr *expr;
6fff2cda 196 FcValueBinding binding;
24330d27
KP
197} FcEdit;
198
199typedef struct _FcSubst {
200 struct _FcSubst *next;
201 FcTest *test;
202 FcEdit *edit;
203} FcSubst;
204
20ac65ab 205typedef struct _FcCharLeaf {
24330d27 206 FcChar32 map[256/32];
20ac65ab 207} FcCharLeaf;
24330d27 208
d8d73958 209#define FC_REF_CONSTANT -1
82f4243f 210
24330d27 211struct _FcCharSet {
24330d27 212 int ref; /* reference count */
20ac65ab 213 int num; /* size of leaves and numbers arrays */
4262e0b3 214 int bank;
cd2ec1a9
PL
215 union {
216 struct {
217 FcCharLeaf **leaves;
218 FcChar16 *numbers;
219 } dyn;
220 struct {
221 int leafidx_offset;
222 int numbers_offset;
223 } stat;
224 } u;
24330d27
KP
225};
226
179c3995
KP
227struct _FcStrSet {
228 int ref; /* reference count */
229 int num;
230 int size;
4262e0b3 231 FcChar8 **strs;
179c3995
KP
232};
233
234struct _FcStrList {
235 FcStrSet *set;
236 int n;
237};
238
c2e7c611 239typedef struct _FcStrBuf {
24330d27
KP
240 FcChar8 *buf;
241 FcBool allocated;
242 FcBool failed;
243 int len;
244 int size;
c2e7c611 245} FcStrBuf;
24330d27 246
212c9f43
PL
247typedef struct _FcCache {
248 int magic;
4262e0b3
PL
249 int count;
250 int bank;
251 int pattern_count;
252 int patternelt_count;
253 int valuelist_count;
254 int str_count;
255 int langset_count;
256 int charset_count;
257 int charset_numbers_count;
258 int charset_leaf_count;
259 int charset_leaf_idx_count;
212c9f43
PL
260} FcCache;
261
7769c321
KP
262/*
263 * To map adobe glyph names to unicode values, a precomputed hash
264 * table is used
265 */
266
267typedef struct _FcGlyphName {
268 FcChar32 ucs; /* unicode value */
269 FcChar8 name[1]; /* name extends beyond struct */
270} FcGlyphName;
271
192296d8
KP
272/*
273 * To perform case-insensitive string comparisons, a table
274 * is used which holds three different kinds of folding data.
275 *
276 * The first is a range of upper case values mapping to a range
277 * of their lower case equivalents. Within each range, the offset
278 * between upper and lower case is constant.
279 *
280 * The second is a range of upper case values which are interleaved
281 * with their lower case equivalents.
282 *
283 * The third is a set of raw unicode values mapping to a list
284 * of unicode values for comparison purposes. This allows conversion
285 * of ß to "ss" so that SS, ss and ß all match. A separate array
286 * holds the list of unicode values for each entry.
287 *
288 * These are packed into a single table. Using a binary search,
289 * the appropriate entry can be located.
290 */
291
292#define FC_CASE_FOLD_RANGE 0
293#define FC_CASE_FOLD_EVEN_ODD 1
294#define FC_CASE_FOLD_FULL 2
295
296typedef struct _FcCaseFold {
297 FcChar32 upper;
298 FcChar16 method : 2;
299 FcChar16 count : 14;
300 short offset; /* lower - upper for RANGE, table id for FULL */
301} FcCaseFold;
302
2d9c79c0
KP
303#define FC_MAX_FILE_LEN 4096
304
4262e0b3
PL
305#define FC_STORAGE_STATIC 0x80
306#define fc_value_string(v) (((v)->type & FC_STORAGE_STATIC) ? ((FcChar8 *) v) + (v)->u.s_off : (v) -> u.s)
307#define fc_value_charset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcCharSet *)(((char *) v) + (v)->u.c_off) : (v) -> u.c)
308#define fc_value_langset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcLangSet *)(((char *) v) + (v)->u.l_off) : (v) -> u.l)
309
327a7fd4 310/*
f21f40f3 311 * The per-user ~/.fonts.cache-<version> file is loaded into
327a7fd4
KP
312 * this data structure. Each directory gets a substructure
313 * which is validated by comparing the directory timestamp with
314 * that saved in the cache. When valid, the entire directory cache
315 * can be immediately loaded without reading the directory. Otherwise,
316 * the files are checked individually; updated files are loaded into the
317 * cache which is then rewritten to the users home directory
318 */
319
eb0cf671 320#define FC_CACHE_MAGIC 0xFC02FC02
327a7fd4 321
e712133c
KP
322typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
323
e712133c 324struct _FcGlobalCacheDir {
327a7fd4 325 struct _FcGlobalCacheDir *next;
8245771d 326 char *name;
eb0cf671
PL
327 FcCache metadata;
328 off_t offset;
329 void *ent;
e712133c 330};
327a7fd4
KP
331
332typedef struct _FcGlobalCache {
eb0cf671 333 FcGlobalCacheDir *dirs;
327a7fd4 334 FcBool updated;
eb0cf671 335 int fd;
327a7fd4 336} FcGlobalCache;
24330d27 337
134f6011
KP
338struct _FcAtomic {
339 FcChar8 *file; /* original file name */
340 FcChar8 *new; /* temp file name -- write data here */
341 FcChar8 *lck; /* lockfile name (used for locking) */
342 FcChar8 *tmp; /* tmpfile name (used for locking) */
343};
344
24330d27
KP
345struct _FcBlanks {
346 int nblank;
347 int sblank;
348 FcChar32 *blanks;
349};
350
351struct _FcConfig {
352 /*
353 * File names loaded from the configuration -- saved here as the
354 * cache file must be consulted before the directories are scanned,
355 * and those directives may occur in any order
356 */
179c3995 357 FcStrSet *configDirs; /* directories to scan for fonts */
ccb3e93b 358 FcChar8 *cache; /* name of per-user cache file */
24330d27
KP
359 /*
360 * Set of allowed blank chars -- used to
361 * trim fonts of bogus glyphs
362 */
363 FcBlanks *blanks;
179c3995
KP
364 /*
365 * List of directories containing fonts,
366 * built by recursively scanning the set
367 * of configured directories
368 */
369 FcStrSet *fontDirs;
24330d27
KP
370 /*
371 * Names of all of the configuration files used
372 * to create this configuration
373 */
179c3995 374 FcStrSet *configFiles; /* config files loaded */
24330d27
KP
375 /*
376 * Substitution instructions for patterns and fonts;
377 * maxObjects is used to allocate appropriate intermediate storage
378 * while performing a whole set of substitutions
379 */
380 FcSubst *substPattern; /* substitutions for patterns */
381 FcSubst *substFont; /* substitutions for fonts */
382 int maxObjects; /* maximum number of tests in all substs */
d47c9d6e
KP
383 /*
384 * List of patterns used to control font file selection
385 */
386 FcStrSet *acceptGlobs;
387 FcStrSet *rejectGlobs;
4f27c1c0
KP
388 FcFontSet *acceptPatterns;
389 FcFontSet *rejectPatterns;
24330d27
KP
390 /*
391 * The set of fonts loaded from the listed directories; the
392 * order within the set does not determine the font selection,
393 * except in the case of identical matches in which case earlier fonts
394 * match preferrentially
395 */
396 FcFontSet *fonts[FcSetApplication + 1];
179c3995
KP
397 /*
398 * Fontconfig can periodically rescan the system configuration
399 * and font directories. This rescanning occurs when font
400 * listing requests are made, but no more often than rescanInterval
401 * seconds apart.
402 */
403 time_t rescanTime; /* last time information was scanned */
404 int rescanInterval; /* interval between scans */
24330d27
KP
405};
406
6e9fc5de
KP
407extern FcConfig *_fcConfig;
408
69937bd9
KP
409typedef struct _FcCharMap FcCharMap;
410
24330d27
KP
411/* fcblanks.c */
412
413/* fccache.c */
414
1b7be377
PL
415FcGlobalCache *
416FcGlobalCacheCreate (void);
417
418void
419FcGlobalCacheDestroy (FcGlobalCache *cache);
420
421FcBool
eb0cf671
PL
422FcGlobalCacheReadDir (FcFontSet *set,
423 FcStrSet *dirs,
424 FcGlobalCache *cache,
8245771d 425 const char *dir,
eb0cf671 426 FcConfig *config);
1b7be377
PL
427
428void
429FcGlobalCacheLoad (FcGlobalCache *cache,
03a212e5 430 FcStrSet *staleDirs,
1b7be377
PL
431 const FcChar8 *cache_file);
432
433FcBool
434FcGlobalCacheUpdate (FcGlobalCache *cache,
8245771d 435 const char *file,
eb0cf671 436 FcFontSet *set);
1b7be377
PL
437
438FcBool
439FcGlobalCacheSave (FcGlobalCache *cache,
440 const FcChar8 *cache_file);
441
4262e0b3 442FcFontSet *
1b7be377 443FcCacheRead (FcConfig *config, FcGlobalCache * cache);
24330d27
KP
444
445FcBool
2304e38f 446FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
4262e0b3
PL
447
448int
449FcCacheBankToIndex (int bank);
212c9f43 450
24330d27
KP
451/* fccfg.c */
452
179c3995
KP
453FcBool
454FcConfigAddConfigDir (FcConfig *config,
455 const FcChar8 *d);
456
457FcBool
458FcConfigAddFontDir (FcConfig *config,
459 const FcChar8 *d);
460
24330d27 461FcBool
ccb3e93b
KP
462FcConfigAddDir (FcConfig *config,
463 const FcChar8 *d);
24330d27
KP
464
465FcBool
ccb3e93b
KP
466FcConfigAddConfigFile (FcConfig *config,
467 const FcChar8 *f);
24330d27
KP
468
469FcBool
470FcConfigSetCache (FcConfig *config,
ccb3e93b 471 const FcChar8 *c);
24330d27
KP
472
473FcBool
474FcConfigAddBlank (FcConfig *config,
475 FcChar32 blank);
476
477FcBool
478FcConfigAddEdit (FcConfig *config,
479 FcTest *test,
480 FcEdit *edit,
481 FcMatchKind kind);
482
483void
484FcConfigSetFonts (FcConfig *config,
485 FcFontSet *fonts,
486 FcSetName set);
487
488FcBool
4262e0b3 489FcConfigCompareValue (const FcValue *m,
24330d27 490 FcOp op,
4262e0b3 491 const FcValue *v);
24330d27 492
d47c9d6e
KP
493FcBool
494FcConfigGlobAdd (FcConfig *config,
495 const FcChar8 *glob,
496 FcBool accept);
497
498FcBool
499FcConfigAcceptFilename (FcConfig *config,
500 const FcChar8 *filename);
501
4f27c1c0
KP
502FcBool
503FcConfigPatternsAdd (FcConfig *config,
504 FcPattern *pattern,
505 FcBool accept);
506
507FcBool
508FcConfigAcceptFont (FcConfig *config,
509 const FcPattern *font);
510
24330d27 511/* fccharset.c */
4c003605
KP
512FcCharSet *
513FcCharSetFreeze (FcCharSet *cs);
514
34cd0514
CW
515void
516FcCharSetThawAll (void);
517
24330d27 518FcBool
c2e7c611 519FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
24330d27
KP
520
521FcCharSet *
522FcNameParseCharSet (FcChar8 *string);
523
c647f6f1
KP
524FcCharLeaf *
525FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
69937bd9 526
cd2ec1a9 527void
4262e0b3 528FcCharSetNewBank (void);
cd2ec1a9 529
4262e0b3
PL
530int
531FcCharSetNeededBytes (const FcCharSet *c);
cd2ec1a9 532
4262e0b3
PL
533void *
534FcCharSetDistributeBytes (FcCache * metadata,
535 void * block_ptr);
cd2ec1a9 536
4262e0b3
PL
537FcCharSet *
538FcCharSetSerialize(int bank, FcCharSet *c);
cd2ec1a9 539
4262e0b3
PL
540void *
541FcCharSetUnserialize (FcCache metadata, void *block_ptr);
cd2ec1a9
PL
542
543FcCharLeaf *
544FcCharSetGetLeaf(const FcCharSet *c, int i);
545
546FcChar16 *
547FcCharSetGetNumbers(const FcCharSet *c);
548
24330d27 549/* fcdbg.c */
24330d27 550void
cd2ec1a9 551FcValueListPrint (const FcValueListPtr l);
24330d27 552
793e946c
KP
553void
554FcLangSetPrint (const FcLangSet *ls);
555
24330d27
KP
556void
557FcOpPrint (FcOp op);
558
559void
938bc633 560FcTestPrint (const FcTest *test);
24330d27
KP
561
562void
938bc633 563FcExprPrint (const FcExpr *expr);
24330d27
KP
564
565void
938bc633 566FcEditPrint (const FcEdit *edit);
24330d27
KP
567
568void
938bc633 569FcSubstPrint (const FcSubst *subst);
24330d27 570
24330d27
KP
571int
572FcDebug (void);
573
574/* fcdir.c */
24330d27 575
2d9c79c0
KP
576FcBool
577FcFileIsDir (const FcChar8 *file);
578
d47c9d6e
KP
579FcBool
580FcFileScanConfig (FcFontSet *set,
581 FcStrSet *dirs,
582 FcFileCache *cache,
583 FcBlanks *blanks,
584 const FcChar8 *file,
585 FcBool force,
586 FcConfig *config);
587
588FcBool
589FcDirScanConfig (FcFontSet *set,
590 FcStrSet *dirs,
591 FcFileCache *cache,
592 FcBlanks *blanks,
593 const FcChar8 *dir,
594 FcBool force,
595 FcConfig *config);
596
24330d27
KP
597/* fcfont.c */
598int
599FcFontDebug (void);
600
82f4243f 601/* fcfreetype.c */
e50b9ae7
KP
602FcBool
603FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
604
82f4243f
KP
605FcBool
606FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
607
c647f6f1
KP
608FcChar32
609FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
610
611FcChar32
612FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
613
614const FcCharMap *
615FcFreeTypeGetPrivateMap (FT_Encoding encoding);
616
24330d27 617/* fcfs.c */
cd2ec1a9
PL
618
619void
4262e0b3 620FcFontSetNewBank (void);
cd2ec1a9 621
4262e0b3
PL
622int
623FcFontSetNeededBytes (FcFontSet *s);
cd2ec1a9 624
4262e0b3
PL
625void *
626FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
cd2ec1a9 627
212c9f43 628FcBool
4262e0b3 629FcFontSetSerialize (int bank, FcFontSet * s);
212c9f43
PL
630
631FcBool
4262e0b3 632FcFontSetUnserialize(FcCache metadata, FcFontSet * s, void * block_ptr);
212c9f43 633
24330d27
KP
634/* fcgram.y */
635int
636FcConfigparse (void);
637
638int
639FcConfigwrap (void);
640
641void
642FcConfigerror (char *fmt, ...);
643
644char *
645FcConfigSaveField (const char *field);
646
24330d27
KP
647void
648FcTestDestroy (FcTest *test);
649
650FcExpr *
651FcExprCreateInteger (int i);
652
653FcExpr *
654FcExprCreateDouble (double d);
655
656FcExpr *
ccb3e93b 657FcExprCreateString (const FcChar8 *s);
24330d27
KP
658
659FcExpr *
660FcExprCreateMatrix (const FcMatrix *m);
661
662FcExpr *
663FcExprCreateBool (FcBool b);
664
665FcExpr *
666FcExprCreateNil (void);
667
668FcExpr *
669FcExprCreateField (const char *field);
670
671FcExpr *
ccb3e93b 672FcExprCreateConst (const FcChar8 *constant);
24330d27
KP
673
674FcExpr *
675FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
676
677void
678FcExprDestroy (FcExpr *e);
679
24330d27
KP
680void
681FcEditDestroy (FcEdit *e);
682
683/* fcinit.c */
684
685void
686FcMemReport (void);
687
688void
689FcMemAlloc (int kind, int size);
690
691void
692FcMemFree (int kind, int size);
693
82f4243f 694/* fclang.c */
d8d73958
KP
695FcLangSet *
696FcFreeTypeLangSet (const FcCharSet *charset,
e50b9ae7 697 const FcChar8 *exclusiveLang);
82f4243f
KP
698
699FcLangResult
700FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
701
702const FcCharSet *
703FcCharSetForLang (const FcChar8 *lang);
704
d8d73958
KP
705FcLangSet *
706FcLangSetPromote (const FcChar8 *lang);
707
708FcLangSet *
709FcNameParseLangSet (const FcChar8 *string);
710
711FcBool
712FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
713
cd2ec1a9 714void
4262e0b3 715FcLangSetNewBank (void);
cd2ec1a9 716
4262e0b3
PL
717int
718FcLangSetNeededBytes (const FcLangSet *l);
cd2ec1a9 719
4262e0b3
PL
720void *
721FcLangSetDistributeBytes (FcCache * metadata,
722 void * block_ptr);
cd2ec1a9
PL
723
724FcLangSet *
4262e0b3 725FcLangSetSerialize (int bank, FcLangSet *l);
cd2ec1a9 726
4262e0b3
PL
727void *
728FcLangSetUnserialize (FcCache metadata, void *block_ptr);
212c9f43 729
24330d27
KP
730/* fclist.c */
731
4f27c1c0
KP
732FcBool
733FcListPatternMatchAny (const FcPattern *p,
734 const FcPattern *font);
735
24330d27
KP
736/* fcmatch.c */
737
738/* fcname.c */
24330d27
KP
739
740FcBool
ca60d2b5 741FcNameBool (const FcChar8 *v, FcBool *result);
24330d27 742
4262e0b3
PL
743void *
744FcObjectDistributeBytes (FcCache * metadata,
745 void * block_ptr);
746
747FcObjectPtr
748FcObjectToPtr (const char * si);
749
750int
7f37423d
PL
751FcObjectNeededBytes (void);
752
753void *
754FcObjectUnserialize (FcCache metadata, void *block_ptr);
4262e0b3
PL
755
756void
7f37423d 757FcObjectSerialize (void);
4262e0b3 758
7f37423d
PL
759const char *
760FcObjectPtrU (FcObjectPtr p);
761
762int
763FcObjectPtrCompare (FcObjectPtr a, FcObjectPtr b);
764
765void
766FcObjectStaticNameFini (void);
4262e0b3 767
24330d27 768/* fcpat.c */
4262e0b3
PL
769
770FcValue
771FcValueCanonicalize (const FcValue *v);
772
24330d27 773void
cd2ec1a9
PL
774FcValueListDestroy (FcValueListPtr l);
775
24330d27 776FcPatternElt *
e9be9cd1
KP
777FcPatternFindElt (const FcPattern *p, const char *object);
778
779FcPatternElt *
780FcPatternInsertElt (FcPattern *p, const char *object);
24330d27 781
82f4243f
KP
782FcBool
783FcPatternAddWithBinding (FcPattern *p,
784 const char *object,
785 FcValue value,
786 FcValueBinding binding,
787 FcBool append);
788
d8d73958
KP
789FcPattern *
790FcPatternFreeze (FcPattern *p);
791
34cd0514 792void
e1b9d091 793FcPatternFini (void);
34cd0514 794
4f27c1c0
KP
795FcBool
796FcPatternAppend (FcPattern *p, FcPattern *s);
797
8245771d
PL
798const FcChar8 *
799FcStrStaticName (const FcChar8 *name);
cd2ec1a9 800
7f37423d
PL
801FcChar32
802FcStringHash (const FcChar8 *s);
cd2ec1a9 803
cd2ec1a9 804void
4262e0b3 805FcPatternNewBank (void);
cd2ec1a9 806
4262e0b3
PL
807int
808FcPatternNeededBytes (FcPattern *p);
cd2ec1a9 809
4262e0b3
PL
810void *
811FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
cd2ec1a9
PL
812
813FcValueList *
814FcValueListPtrU(FcValueListPtr p);
815
816FcPatternElt *
817FcPatternEltU (FcPatternEltPtr pei);
818
819FcValueListPtr
820FcValueListPtrCreateDynamic(FcValueList * p);
821
cd2ec1a9 822FcPattern *
4262e0b3 823FcPatternSerialize (int bank, FcPattern * p);
212c9f43 824
7f37423d 825void *
4262e0b3 826FcPatternUnserialize (FcCache metadata, void *block_ptr);
212c9f43 827
24330d27
KP
828/* fcrender.c */
829
830/* fcmatrix.c */
327a7fd4 831
4262e0b3 832extern const FcMatrix FcIdentityMatrix;
327a7fd4 833
24330d27
KP
834void
835FcMatrixFree (FcMatrix *mat);
836
837/* fcstr.c */
cd2ec1a9
PL
838void
839FcStrSetSort (FcStrSet * set);
840
ccb3e93b
KP
841FcChar8 *
842FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
24330d27
KP
843
844void
ccb3e93b 845FcStrFree (FcChar8 *s);
24330d27 846
c2e7c611
KP
847void
848FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
849
850void
851FcStrBufDestroy (FcStrBuf *buf);
852
853FcChar8 *
854FcStrBufDone (FcStrBuf *buf);
855
856FcBool
857FcStrBufChar (FcStrBuf *buf, FcChar8 c);
858
859FcBool
860FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
861
862FcBool
863FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
864
82f4243f
KP
865int
866FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
867
11fec41c
KP
868const FcChar8 *
869FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
870
871const FcChar8 *
872FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
873
ff3f1f98
KP
874FcBool
875FcStrUsesHome (const FcChar8 *s);
876
daeed6e0
TL
877FcChar8 *
878FcStrLastSlash (const FcChar8 *path);
879
192296d8
KP
880FcChar32
881FcStrHashIgnoreCase (const FcChar8 *s);
882
24330d27 883#endif /* _FC_INT_H_ */