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