]> git.wh0rd.org - fontconfig.git/blame - src/fcint.h
Add documentation for FcConfigNormalizeFontDir.
[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")
c60ec7cc 51#define FC_GLOBAL_MAGIC_COOKIE "GLOBAL"
179c3995 52
daeed6e0
TL
53#ifdef _WIN32
54#define FC_SEARCH_PATH_SEPARATOR ';'
55#else
56#define FC_SEARCH_PATH_SEPARATOR ':'
57#endif
58
24330d27
KP
59#define FC_DBG_MATCH 1
60#define FC_DBG_MATCHV 2
61#define FC_DBG_EDIT 4
62#define FC_DBG_FONTSET 8
63#define FC_DBG_CACHE 16
64#define FC_DBG_CACHEV 32
65#define FC_DBG_PARSE 64
66#define FC_DBG_SCAN 128
4c003605 67#define FC_DBG_SCANV 256
24330d27 68#define FC_DBG_MEMORY 512
2d9c79c0 69#define FC_DBG_CONFIG 1024
24330d27
KP
70
71#define FC_MEM_CHARSET 0
d8d73958 72#define FC_MEM_CHARLEAF 1
24330d27
KP
73#define FC_MEM_FONTSET 2
74#define FC_MEM_FONTPTR 3
75#define FC_MEM_OBJECTSET 4
76#define FC_MEM_OBJECTPTR 5
77#define FC_MEM_MATRIX 6
78#define FC_MEM_PATTERN 7
79#define FC_MEM_PATELT 8
80#define FC_MEM_VALLIST 9
81#define FC_MEM_SUBSTATE 10
82#define FC_MEM_STRING 11
83#define FC_MEM_LISTBUCK 12
d8d73958
KP
84#define FC_MEM_STRSET 13
85#define FC_MEM_STRLIST 14
86#define FC_MEM_CONFIG 15
87#define FC_MEM_LANGSET 16
9dac3c59
KP
88#define FC_MEM_ATOMIC 17
89#define FC_MEM_BLANKS 18
90#define FC_MEM_CACHE 19
91#define FC_MEM_STRBUF 20
92#define FC_MEM_SUBST 21
93#define FC_MEM_OBJECTTYPE 22
94#define FC_MEM_CONSTANT 23
95#define FC_MEM_TEST 24
96#define FC_MEM_EXPR 25
97#define FC_MEM_VSTACK 26
98#define FC_MEM_ATTR 27
99#define FC_MEM_PSTACK 28
1c52c0f0 100#define FC_MEM_STATICSTR 29
d8d73958 101
1c52c0f0 102#define FC_MEM_NUM 30
24330d27 103
1c9fdcca
PL
104#define FC_BANK_DYNAMIC 0
105#define FC_BANK_FIRST 1
82f35f8b
PL
106#define FC_BANK_LANGS 0xfcfcfcfc
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 253typedef struct _FcCache {
c7beacf9
PL
254 int magic; /* 0xFC02FC02 */
255 int count; /* number of bytes of data in block */
256 int bank; /* bank ID */
257 int pattern_count; /* number of FcPatterns */
258 int patternelt_count; /* number of FcPatternElts */
259 int valuelist_count; /* number of FcValueLists */
a9698bed
PL
260 int str_count; /* size of strings appearing as FcValues */
261 int langset_count; /* number of FcLangSets */
262 int charset_count; /* number of FcCharSets */
263 int charset_numbers_count;
4262e0b3
PL
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)
1c9fdcca 315#define fc_storage_type(v) ((v)->type & ~FC_STORAGE_STATIC)
4262e0b3 316
327a7fd4 317/*
f21f40f3 318 * The per-user ~/.fonts.cache-<version> file is loaded into
327a7fd4
KP
319 * this data structure. Each directory gets a substructure
320 * which is validated by comparing the directory timestamp with
321 * that saved in the cache. When valid, the entire directory cache
322 * can be immediately loaded without reading the directory. Otherwise,
323 * the files are checked individually; updated files are loaded into the
324 * cache which is then rewritten to the users home directory
325 */
326
eb0cf671 327#define FC_CACHE_MAGIC 0xFC02FC02
327a7fd4 328
e712133c
KP
329typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
330
e712133c 331struct _FcGlobalCacheDir {
327a7fd4 332 struct _FcGlobalCacheDir *next;
8245771d 333 char *name;
eb0cf671
PL
334 FcCache metadata;
335 off_t offset;
971cf180 336 FcStrSet *subdirs;
eb0cf671 337 void *ent;
e712133c 338};
327a7fd4
KP
339
340typedef struct _FcGlobalCache {
eb0cf671 341 FcGlobalCacheDir *dirs;
327a7fd4 342 FcBool updated;
eb0cf671 343 int fd;
327a7fd4 344} FcGlobalCache;
24330d27 345
134f6011
KP
346struct _FcAtomic {
347 FcChar8 *file; /* original file name */
348 FcChar8 *new; /* temp file name -- write data here */
349 FcChar8 *lck; /* lockfile name (used for locking) */
350 FcChar8 *tmp; /* tmpfile name (used for locking) */
351};
352
24330d27
KP
353struct _FcBlanks {
354 int nblank;
355 int sblank;
356 FcChar32 *blanks;
357};
358
359struct _FcConfig {
360 /*
361 * File names loaded from the configuration -- saved here as the
362 * cache file must be consulted before the directories are scanned,
363 * and those directives may occur in any order
364 */
179c3995 365 FcStrSet *configDirs; /* directories to scan for fonts */
ccb3e93b 366 FcChar8 *cache; /* name of per-user cache file */
24330d27
KP
367 /*
368 * Set of allowed blank chars -- used to
369 * trim fonts of bogus glyphs
370 */
371 FcBlanks *blanks;
179c3995
KP
372 /*
373 * List of directories containing fonts,
374 * built by recursively scanning the set
375 * of configured directories
376 */
377 FcStrSet *fontDirs;
24330d27
KP
378 /*
379 * Names of all of the configuration files used
380 * to create this configuration
381 */
179c3995 382 FcStrSet *configFiles; /* config files loaded */
24330d27
KP
383 /*
384 * Substitution instructions for patterns and fonts;
385 * maxObjects is used to allocate appropriate intermediate storage
386 * while performing a whole set of substitutions
387 */
388 FcSubst *substPattern; /* substitutions for patterns */
389 FcSubst *substFont; /* substitutions for fonts */
390 int maxObjects; /* maximum number of tests in all substs */
d47c9d6e
KP
391 /*
392 * List of patterns used to control font file selection
393 */
394 FcStrSet *acceptGlobs;
395 FcStrSet *rejectGlobs;
4f27c1c0
KP
396 FcFontSet *acceptPatterns;
397 FcFontSet *rejectPatterns;
24330d27
KP
398 /*
399 * The set of fonts loaded from the listed directories; the
400 * order within the set does not determine the font selection,
401 * except in the case of identical matches in which case earlier fonts
402 * match preferrentially
403 */
404 FcFontSet *fonts[FcSetApplication + 1];
179c3995
KP
405 /*
406 * Fontconfig can periodically rescan the system configuration
407 * and font directories. This rescanning occurs when font
408 * listing requests are made, but no more often than rescanInterval
409 * seconds apart.
410 */
411 time_t rescanTime; /* last time information was scanned */
412 int rescanInterval; /* interval between scans */
24330d27
KP
413};
414
6e9fc5de
KP
415extern FcConfig *_fcConfig;
416
2b25f00c
PL
417typedef struct _FcFileTime {
418 time_t time;
419 FcBool set;
420} FcFileTime;
421
69937bd9
KP
422typedef struct _FcCharMap FcCharMap;
423
7fd7221e
PL
424#define ALIGN(v,type) ((__typeof__(v))(((uintptr_t)(v) + __alignof__(type) - 1) & ~(__alignof__(type) - 1)))
425
24330d27
KP
426/* fcblanks.c */
427
428/* fccache.c */
429
1b7be377
PL
430FcGlobalCache *
431FcGlobalCacheCreate (void);
432
433void
434FcGlobalCacheDestroy (FcGlobalCache *cache);
435
436FcBool
eb0cf671
PL
437FcGlobalCacheReadDir (FcFontSet *set,
438 FcStrSet *dirs,
439 FcGlobalCache *cache,
8245771d 440 const char *dir,
eb0cf671 441 FcConfig *config);
1b7be377
PL
442
443void
444FcGlobalCacheLoad (FcGlobalCache *cache,
03a212e5 445 FcStrSet *staleDirs,
2b25f00c
PL
446 const FcChar8 *cache_file,
447 FcConfig *config);
1b7be377
PL
448
449FcBool
450FcGlobalCacheUpdate (FcGlobalCache *cache,
971cf180 451 FcStrSet *dirs,
8245771d 452 const char *file,
8a0b0ed6
PL
453 FcFontSet *set,
454 FcConfig *config);
1b7be377
PL
455
456FcBool
457FcGlobalCacheSave (FcGlobalCache *cache,
8a0b0ed6
PL
458 const FcChar8 *cache_file,
459 FcConfig *config);
1b7be377 460
4262e0b3 461FcFontSet *
1b7be377 462FcCacheRead (FcConfig *config, FcGlobalCache * cache);
24330d27
KP
463
464FcBool
2304e38f 465FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
4262e0b3 466
2eb84374 467FcBool
cd9bca69 468FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
2eb84374 469
b8948e85 470extern int *_fcBankId, *_fcBankIdx;
4262e0b3 471int
b8948e85
PL
472FcCacheBankToIndexMTF (int bank);
473
474static __inline__ int
475FcCacheBankToIndex (int bank)
476{
19ea60bc 477 return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
b8948e85 478}
e77c1718
PL
479
480const char *
481FcCacheFindBankDir (int bank);
212c9f43 482
24330d27
KP
483/* fccfg.c */
484
179c3995
KP
485FcBool
486FcConfigAddConfigDir (FcConfig *config,
487 const FcChar8 *d);
488
489FcBool
490FcConfigAddFontDir (FcConfig *config,
491 const FcChar8 *d);
492
24330d27 493FcBool
ccb3e93b
KP
494FcConfigAddDir (FcConfig *config,
495 const FcChar8 *d);
24330d27
KP
496
497FcBool
ccb3e93b
KP
498FcConfigAddConfigFile (FcConfig *config,
499 const FcChar8 *f);
24330d27
KP
500
501FcBool
502FcConfigSetCache (FcConfig *config,
ccb3e93b 503 const FcChar8 *c);
24330d27
KP
504
505FcBool
506FcConfigAddBlank (FcConfig *config,
507 FcChar32 blank);
508
509FcBool
510FcConfigAddEdit (FcConfig *config,
511 FcTest *test,
512 FcEdit *edit,
513 FcMatchKind kind);
514
515void
516FcConfigSetFonts (FcConfig *config,
517 FcFontSet *fonts,
518 FcSetName set);
519
520FcBool
4262e0b3 521FcConfigCompareValue (const FcValue *m,
24330d27 522 FcOp op,
4262e0b3 523 const FcValue *v);
24330d27 524
d47c9d6e
KP
525FcBool
526FcConfigGlobAdd (FcConfig *config,
527 const FcChar8 *glob,
528 FcBool accept);
529
530FcBool
531FcConfigAcceptFilename (FcConfig *config,
532 const FcChar8 *filename);
533
4f27c1c0
KP
534FcBool
535FcConfigPatternsAdd (FcConfig *config,
536 FcPattern *pattern,
537 FcBool accept);
538
539FcBool
540FcConfigAcceptFont (FcConfig *config,
541 const FcPattern *font);
542
2b25f00c
PL
543FcFileTime
544FcConfigModifiedTime (FcConfig *config);
545
24330d27 546/* fccharset.c */
82f35f8b
PL
547void
548FcLangCharSetPopulate (void);
549
4c003605
KP
550FcCharSet *
551FcCharSetFreeze (FcCharSet *cs);
552
34cd0514
CW
553void
554FcCharSetThawAll (void);
555
24330d27 556FcBool
c2e7c611 557FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
24330d27
KP
558
559FcCharSet *
560FcNameParseCharSet (FcChar8 *string);
561
c647f6f1
KP
562FcCharLeaf *
563FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
69937bd9 564
cd2ec1a9 565void
4262e0b3 566FcCharSetNewBank (void);
cd2ec1a9 567
4262e0b3
PL
568int
569FcCharSetNeededBytes (const FcCharSet *c);
cd2ec1a9 570
7fd7221e
PL
571int
572FcCharSetNeededBytesAlign (void);
573
4262e0b3
PL
574void *
575FcCharSetDistributeBytes (FcCache * metadata,
576 void * block_ptr);
cd2ec1a9 577
4262e0b3
PL
578FcCharSet *
579FcCharSetSerialize(int bank, FcCharSet *c);
cd2ec1a9 580
4262e0b3 581void *
61571f3f 582FcCharSetUnserialize (FcCache * metadata, void *block_ptr);
cd2ec1a9
PL
583
584FcCharLeaf *
585FcCharSetGetLeaf(const FcCharSet *c, int i);
586
587FcChar16 *
588FcCharSetGetNumbers(const FcCharSet *c);
589
24330d27 590/* fcdbg.c */
24330d27 591void
cd2ec1a9 592FcValueListPrint (const FcValueListPtr l);
24330d27 593
793e946c
KP
594void
595FcLangSetPrint (const FcLangSet *ls);
596
24330d27
KP
597void
598FcOpPrint (FcOp op);
599
600void
938bc633 601FcTestPrint (const FcTest *test);
24330d27
KP
602
603void
938bc633 604FcExprPrint (const FcExpr *expr);
24330d27
KP
605
606void
938bc633 607FcEditPrint (const FcEdit *edit);
24330d27
KP
608
609void
938bc633 610FcSubstPrint (const FcSubst *subst);
24330d27 611
b97a34b5
PL
612extern int FcDebugVal;
613
614static __inline__ int
615FcDebug (void) { return FcDebugVal; }
616
617void
618FcInitDebug (void);
24330d27 619
90442681
PL
620/* fcdefault.c */
621FcChar8 *
622FcGetDefaultLang (void);
623
24330d27 624/* fcdir.c */
24330d27 625
2d9c79c0
KP
626FcBool
627FcFileIsDir (const FcChar8 *file);
628
d47c9d6e
KP
629FcBool
630FcFileScanConfig (FcFontSet *set,
631 FcStrSet *dirs,
632 FcFileCache *cache,
633 FcBlanks *blanks,
634 const FcChar8 *file,
635 FcBool force,
636 FcConfig *config);
637
638FcBool
639FcDirScanConfig (FcFontSet *set,
640 FcStrSet *dirs,
641 FcFileCache *cache,
642 FcBlanks *blanks,
643 const FcChar8 *dir,
644 FcBool force,
645 FcConfig *config);
646
24330d27
KP
647/* fcfont.c */
648int
649FcFontDebug (void);
650
82f4243f 651/* fcfreetype.c */
e50b9ae7
KP
652FcBool
653FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
654
82f4243f
KP
655FcBool
656FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
657
c647f6f1
KP
658FcChar32
659FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
660
661FcChar32
662FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
663
664const FcCharMap *
665FcFreeTypeGetPrivateMap (FT_Encoding encoding);
666
24330d27 667/* fcfs.c */
cd2ec1a9
PL
668
669void
4262e0b3 670FcFontSetNewBank (void);
cd2ec1a9 671
4262e0b3
PL
672int
673FcFontSetNeededBytes (FcFontSet *s);
cd2ec1a9 674
7fd7221e
PL
675int
676FcFontSetNeededBytesAlign (void);
677
4262e0b3
PL
678void *
679FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
cd2ec1a9 680
212c9f43 681FcBool
4262e0b3 682FcFontSetSerialize (int bank, FcFontSet * s);
212c9f43
PL
683
684FcBool
61571f3f 685FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr);
212c9f43 686
24330d27
KP
687/* fcgram.y */
688int
689FcConfigparse (void);
690
691int
692FcConfigwrap (void);
693
694void
695FcConfigerror (char *fmt, ...);
696
697char *
698FcConfigSaveField (const char *field);
699
24330d27
KP
700void
701FcTestDestroy (FcTest *test);
702
703FcExpr *
704FcExprCreateInteger (int i);
705
706FcExpr *
707FcExprCreateDouble (double d);
708
709FcExpr *
ccb3e93b 710FcExprCreateString (const FcChar8 *s);
24330d27
KP
711
712FcExpr *
713FcExprCreateMatrix (const FcMatrix *m);
714
715FcExpr *
716FcExprCreateBool (FcBool b);
717
718FcExpr *
719FcExprCreateNil (void);
720
721FcExpr *
722FcExprCreateField (const char *field);
723
724FcExpr *
ccb3e93b 725FcExprCreateConst (const FcChar8 *constant);
24330d27
KP
726
727FcExpr *
728FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
729
730void
731FcExprDestroy (FcExpr *e);
732
24330d27
KP
733void
734FcEditDestroy (FcEdit *e);
735
736/* fcinit.c */
737
738void
739FcMemReport (void);
740
741void
742FcMemAlloc (int kind, int size);
743
744void
745FcMemFree (int kind, int size);
746
82f4243f 747/* fclang.c */
d8d73958
KP
748FcLangSet *
749FcFreeTypeLangSet (const FcCharSet *charset,
e50b9ae7 750 const FcChar8 *exclusiveLang);
82f4243f
KP
751
752FcLangResult
753FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
754
755const FcCharSet *
756FcCharSetForLang (const FcChar8 *lang);
757
d8d73958
KP
758FcLangSet *
759FcLangSetPromote (const FcChar8 *lang);
760
761FcLangSet *
762FcNameParseLangSet (const FcChar8 *string);
763
764FcBool
765FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
766
cd2ec1a9 767void
4262e0b3 768FcLangSetNewBank (void);
cd2ec1a9 769
4262e0b3
PL
770int
771FcLangSetNeededBytes (const FcLangSet *l);
cd2ec1a9 772
7fd7221e
PL
773int
774FcLangSetNeededBytesAlign (void);
775
4262e0b3
PL
776void *
777FcLangSetDistributeBytes (FcCache * metadata,
778 void * block_ptr);
cd2ec1a9
PL
779
780FcLangSet *
4262e0b3 781FcLangSetSerialize (int bank, FcLangSet *l);
cd2ec1a9 782
4262e0b3 783void *
61571f3f 784FcLangSetUnserialize (FcCache * metadata, void *block_ptr);
212c9f43 785
24330d27
KP
786/* fclist.c */
787
4f27c1c0
KP
788FcBool
789FcListPatternMatchAny (const FcPattern *p,
790 const FcPattern *font);
791
24330d27
KP
792/* fcmatch.c */
793
794/* fcname.c */
24330d27
KP
795
796FcBool
ca60d2b5 797FcNameBool (const FcChar8 *v, FcBool *result);
24330d27 798
4262e0b3
PL
799void *
800FcObjectDistributeBytes (FcCache * metadata,
801 void * block_ptr);
802
803FcObjectPtr
804FcObjectToPtr (const char * si);
805
806int
7f37423d
PL
807FcObjectNeededBytes (void);
808
7fd7221e
PL
809int
810FcObjectNeededBytesAlign (void);
811
7f37423d 812void *
61571f3f 813FcObjectUnserialize (FcCache * metadata, void *block_ptr);
4262e0b3
PL
814
815void
7f37423d 816FcObjectSerialize (void);
4262e0b3 817
7f37423d
PL
818const char *
819FcObjectPtrU (FcObjectPtr p);
820
9ab79bdf
PL
821static __inline__ int
822FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
823{
824 return a - b;
825}
7f37423d
PL
826
827void
828FcObjectStaticNameFini (void);
4262e0b3 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
e77c1718
PL
860void
861FcPatternAddFullFname (const FcPattern *p, const char *fname);
862
793154ed
PL
863void
864FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig);
e77c1718 865
8245771d
PL
866const FcChar8 *
867FcStrStaticName (const FcChar8 *name);
cd2ec1a9 868
7f37423d
PL
869FcChar32
870FcStringHash (const FcChar8 *s);
cd2ec1a9 871
cd2ec1a9 872void
4262e0b3 873FcPatternNewBank (void);
cd2ec1a9 874
4262e0b3
PL
875int
876FcPatternNeededBytes (FcPattern *p);
cd2ec1a9 877
7fd7221e
PL
878int
879FcPatternNeededBytesAlign (void);
880
4262e0b3
PL
881void *
882FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
cd2ec1a9 883
9ab79bdf
PL
884/* please don't access these outside of fcpat.c! only visible so that
885 * *PtrU can be inlined. */
81fe99fd
PL
886extern FcValueList ** _fcValueLists;
887extern FcPatternElt ** _fcPatternElts;
9ab79bdf
PL
888
889static __inline__ FcValueList *
890FcValueListPtrU (FcValueListPtr pi)
891{
892 if (pi.bank == FC_BANK_DYNAMIC)
893 return pi.u.dyn;
894
81fe99fd 895 return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat];
9ab79bdf
PL
896}
897
898static __inline__ FcPatternElt *
899FcPatternEltU (FcPatternEltPtr pei)
900{
901 if (pei.bank == FC_BANK_DYNAMIC)
902 return pei.u.dyn;
903
81fe99fd 904 return &_fcPatternElts[FcCacheBankToIndex(pei.bank)][pei.u.stat];
9ab79bdf 905}
cd2ec1a9
PL
906
907FcPatternElt *
908FcPatternEltU (FcPatternEltPtr pei);
909
910FcValueListPtr
911FcValueListPtrCreateDynamic(FcValueList * p);
912
cd2ec1a9 913FcPattern *
4262e0b3 914FcPatternSerialize (int bank, FcPattern * p);
212c9f43 915
7f37423d 916void *
61571f3f 917FcPatternUnserialize (FcCache * metadata, void *block_ptr);
212c9f43 918
24330d27
KP
919/* fcrender.c */
920
921/* fcmatrix.c */
327a7fd4 922
4262e0b3 923extern const FcMatrix FcIdentityMatrix;
327a7fd4 924
24330d27
KP
925void
926FcMatrixFree (FcMatrix *mat);
927
928/* fcstr.c */
cd2ec1a9
PL
929void
930FcStrSetSort (FcStrSet * set);
931
ccb3e93b
KP
932FcChar8 *
933FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
24330d27
KP
934
935void
ccb3e93b 936FcStrFree (FcChar8 *s);
24330d27 937
c2e7c611
KP
938void
939FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
940
941void
942FcStrBufDestroy (FcStrBuf *buf);
943
944FcChar8 *
945FcStrBufDone (FcStrBuf *buf);
946
947FcBool
948FcStrBufChar (FcStrBuf *buf, FcChar8 c);
949
950FcBool
951FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
952
953FcBool
954FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
955
82f4243f
KP
956int
957FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
958
11fec41c
KP
959const FcChar8 *
960FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
961
962const FcChar8 *
963FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
964
ff3f1f98
KP
965FcBool
966FcStrUsesHome (const FcChar8 *s);
967
daeed6e0
TL
968FcChar8 *
969FcStrLastSlash (const FcChar8 *path);
970
192296d8
KP
971FcChar32
972FcStrHashIgnoreCase (const FcChar8 *s);
973
24330d27 974#endif /* _FC_INT_H_ */