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