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