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