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