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