]> git.wh0rd.org - fontconfig.git/blame - src/fcint.h
Add self to AUTHORS list.
[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,
eb0cf671 451 FcFontSet *set);
1b7be377
PL
452
453FcBool
454FcGlobalCacheSave (FcGlobalCache *cache,
455 const FcChar8 *cache_file);
456
4262e0b3 457FcFontSet *
1b7be377 458FcCacheRead (FcConfig *config, FcGlobalCache * cache);
24330d27
KP
459
460FcBool
2304e38f 461FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
4262e0b3 462
2eb84374
PL
463FcBool
464FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir);
465
b8948e85 466extern int *_fcBankId, *_fcBankIdx;
4262e0b3 467int
b8948e85
PL
468FcCacheBankToIndexMTF (int bank);
469
470static __inline__ int
471FcCacheBankToIndex (int bank)
472{
19ea60bc 473 return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
b8948e85 474}
e77c1718
PL
475
476const char *
477FcCacheFindBankDir (int bank);
212c9f43 478
24330d27
KP
479/* fccfg.c */
480
179c3995
KP
481FcBool
482FcConfigAddConfigDir (FcConfig *config,
483 const FcChar8 *d);
484
485FcBool
486FcConfigAddFontDir (FcConfig *config,
487 const FcChar8 *d);
488
24330d27 489FcBool
ccb3e93b
KP
490FcConfigAddDir (FcConfig *config,
491 const FcChar8 *d);
24330d27
KP
492
493FcBool
ccb3e93b
KP
494FcConfigAddConfigFile (FcConfig *config,
495 const FcChar8 *f);
24330d27
KP
496
497FcBool
498FcConfigSetCache (FcConfig *config,
ccb3e93b 499 const FcChar8 *c);
24330d27
KP
500
501FcBool
502FcConfigAddBlank (FcConfig *config,
503 FcChar32 blank);
504
505FcBool
506FcConfigAddEdit (FcConfig *config,
507 FcTest *test,
508 FcEdit *edit,
509 FcMatchKind kind);
510
511void
512FcConfigSetFonts (FcConfig *config,
513 FcFontSet *fonts,
514 FcSetName set);
515
516FcBool
4262e0b3 517FcConfigCompareValue (const FcValue *m,
24330d27 518 FcOp op,
4262e0b3 519 const FcValue *v);
24330d27 520
d47c9d6e
KP
521FcBool
522FcConfigGlobAdd (FcConfig *config,
523 const FcChar8 *glob,
524 FcBool accept);
525
526FcBool
527FcConfigAcceptFilename (FcConfig *config,
528 const FcChar8 *filename);
529
4f27c1c0
KP
530FcBool
531FcConfigPatternsAdd (FcConfig *config,
532 FcPattern *pattern,
533 FcBool accept);
534
535FcBool
536FcConfigAcceptFont (FcConfig *config,
537 const FcPattern *font);
538
2b25f00c
PL
539FcFileTime
540FcConfigModifiedTime (FcConfig *config);
541
24330d27 542/* fccharset.c */
82f35f8b
PL
543void
544FcLangCharSetPopulate (void);
545
4c003605
KP
546FcCharSet *
547FcCharSetFreeze (FcCharSet *cs);
548
34cd0514
CW
549void
550FcCharSetThawAll (void);
551
24330d27 552FcBool
c2e7c611 553FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
24330d27
KP
554
555FcCharSet *
556FcNameParseCharSet (FcChar8 *string);
557
c647f6f1
KP
558FcCharLeaf *
559FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
69937bd9 560
cd2ec1a9 561void
4262e0b3 562FcCharSetNewBank (void);
cd2ec1a9 563
4262e0b3
PL
564int
565FcCharSetNeededBytes (const FcCharSet *c);
cd2ec1a9 566
7fd7221e
PL
567int
568FcCharSetNeededBytesAlign (void);
569
4262e0b3
PL
570void *
571FcCharSetDistributeBytes (FcCache * metadata,
572 void * block_ptr);
cd2ec1a9 573
4262e0b3
PL
574FcCharSet *
575FcCharSetSerialize(int bank, FcCharSet *c);
cd2ec1a9 576
4262e0b3 577void *
61571f3f 578FcCharSetUnserialize (FcCache * metadata, void *block_ptr);
cd2ec1a9
PL
579
580FcCharLeaf *
581FcCharSetGetLeaf(const FcCharSet *c, int i);
582
583FcChar16 *
584FcCharSetGetNumbers(const FcCharSet *c);
585
24330d27 586/* fcdbg.c */
24330d27 587void
cd2ec1a9 588FcValueListPrint (const FcValueListPtr l);
24330d27 589
793e946c
KP
590void
591FcLangSetPrint (const FcLangSet *ls);
592
24330d27
KP
593void
594FcOpPrint (FcOp op);
595
596void
938bc633 597FcTestPrint (const FcTest *test);
24330d27
KP
598
599void
938bc633 600FcExprPrint (const FcExpr *expr);
24330d27
KP
601
602void
938bc633 603FcEditPrint (const FcEdit *edit);
24330d27
KP
604
605void
938bc633 606FcSubstPrint (const FcSubst *subst);
24330d27 607
b97a34b5
PL
608extern int FcDebugVal;
609
610static __inline__ int
611FcDebug (void) { return FcDebugVal; }
612
613void
614FcInitDebug (void);
24330d27 615
90442681
PL
616/* fcdefault.c */
617FcChar8 *
618FcGetDefaultLang (void);
619
24330d27 620/* fcdir.c */
24330d27 621
2d9c79c0
KP
622FcBool
623FcFileIsDir (const FcChar8 *file);
624
d47c9d6e
KP
625FcBool
626FcFileScanConfig (FcFontSet *set,
627 FcStrSet *dirs,
628 FcFileCache *cache,
629 FcBlanks *blanks,
630 const FcChar8 *file,
631 FcBool force,
632 FcConfig *config);
633
634FcBool
635FcDirScanConfig (FcFontSet *set,
636 FcStrSet *dirs,
637 FcFileCache *cache,
638 FcBlanks *blanks,
639 const FcChar8 *dir,
640 FcBool force,
641 FcConfig *config);
642
24330d27
KP
643/* fcfont.c */
644int
645FcFontDebug (void);
646
82f4243f 647/* fcfreetype.c */
e50b9ae7
KP
648FcBool
649FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
650
82f4243f
KP
651FcBool
652FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
653
c647f6f1
KP
654FcChar32
655FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
656
657FcChar32
658FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
659
660const FcCharMap *
661FcFreeTypeGetPrivateMap (FT_Encoding encoding);
662
24330d27 663/* fcfs.c */
cd2ec1a9
PL
664
665void
4262e0b3 666FcFontSetNewBank (void);
cd2ec1a9 667
4262e0b3
PL
668int
669FcFontSetNeededBytes (FcFontSet *s);
cd2ec1a9 670
7fd7221e
PL
671int
672FcFontSetNeededBytesAlign (void);
673
4262e0b3
PL
674void *
675FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
cd2ec1a9 676
212c9f43 677FcBool
4262e0b3 678FcFontSetSerialize (int bank, FcFontSet * s);
212c9f43
PL
679
680FcBool
61571f3f 681FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr);
212c9f43 682
24330d27
KP
683/* fcgram.y */
684int
685FcConfigparse (void);
686
687int
688FcConfigwrap (void);
689
690void
691FcConfigerror (char *fmt, ...);
692
693char *
694FcConfigSaveField (const char *field);
695
24330d27
KP
696void
697FcTestDestroy (FcTest *test);
698
699FcExpr *
700FcExprCreateInteger (int i);
701
702FcExpr *
703FcExprCreateDouble (double d);
704
705FcExpr *
ccb3e93b 706FcExprCreateString (const FcChar8 *s);
24330d27
KP
707
708FcExpr *
709FcExprCreateMatrix (const FcMatrix *m);
710
711FcExpr *
712FcExprCreateBool (FcBool b);
713
714FcExpr *
715FcExprCreateNil (void);
716
717FcExpr *
718FcExprCreateField (const char *field);
719
720FcExpr *
ccb3e93b 721FcExprCreateConst (const FcChar8 *constant);
24330d27
KP
722
723FcExpr *
724FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
725
726void
727FcExprDestroy (FcExpr *e);
728
24330d27
KP
729void
730FcEditDestroy (FcEdit *e);
731
732/* fcinit.c */
733
734void
735FcMemReport (void);
736
737void
738FcMemAlloc (int kind, int size);
739
740void
741FcMemFree (int kind, int size);
742
82f4243f 743/* fclang.c */
d8d73958
KP
744FcLangSet *
745FcFreeTypeLangSet (const FcCharSet *charset,
e50b9ae7 746 const FcChar8 *exclusiveLang);
82f4243f
KP
747
748FcLangResult
749FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
750
751const FcCharSet *
752FcCharSetForLang (const FcChar8 *lang);
753
d8d73958
KP
754FcLangSet *
755FcLangSetPromote (const FcChar8 *lang);
756
757FcLangSet *
758FcNameParseLangSet (const FcChar8 *string);
759
760FcBool
761FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
762
cd2ec1a9 763void
4262e0b3 764FcLangSetNewBank (void);
cd2ec1a9 765
4262e0b3
PL
766int
767FcLangSetNeededBytes (const FcLangSet *l);
cd2ec1a9 768
7fd7221e
PL
769int
770FcLangSetNeededBytesAlign (void);
771
4262e0b3
PL
772void *
773FcLangSetDistributeBytes (FcCache * metadata,
774 void * block_ptr);
cd2ec1a9
PL
775
776FcLangSet *
4262e0b3 777FcLangSetSerialize (int bank, FcLangSet *l);
cd2ec1a9 778
4262e0b3 779void *
61571f3f 780FcLangSetUnserialize (FcCache * metadata, void *block_ptr);
212c9f43 781
24330d27
KP
782/* fclist.c */
783
4f27c1c0
KP
784FcBool
785FcListPatternMatchAny (const FcPattern *p,
786 const FcPattern *font);
787
24330d27
KP
788/* fcmatch.c */
789
790/* fcname.c */
24330d27
KP
791
792FcBool
ca60d2b5 793FcNameBool (const FcChar8 *v, FcBool *result);
24330d27 794
4262e0b3
PL
795void *
796FcObjectDistributeBytes (FcCache * metadata,
797 void * block_ptr);
798
799FcObjectPtr
800FcObjectToPtr (const char * si);
801
802int
7f37423d
PL
803FcObjectNeededBytes (void);
804
7fd7221e
PL
805int
806FcObjectNeededBytesAlign (void);
807
7f37423d 808void *
61571f3f 809FcObjectUnserialize (FcCache * metadata, void *block_ptr);
4262e0b3
PL
810
811void
7f37423d 812FcObjectSerialize (void);
4262e0b3 813
7f37423d
PL
814const char *
815FcObjectPtrU (FcObjectPtr p);
816
9ab79bdf
PL
817static __inline__ int
818FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
819{
820 return a - b;
821}
7f37423d
PL
822
823void
824FcObjectStaticNameFini (void);
4262e0b3 825
24330d27 826/* fcpat.c */
4262e0b3
PL
827
828FcValue
829FcValueCanonicalize (const FcValue *v);
830
24330d27 831void
cd2ec1a9
PL
832FcValueListDestroy (FcValueListPtr l);
833
24330d27 834FcPatternElt *
e9be9cd1
KP
835FcPatternFindElt (const FcPattern *p, const char *object);
836
837FcPatternElt *
838FcPatternInsertElt (FcPattern *p, const char *object);
24330d27 839
82f4243f
KP
840FcBool
841FcPatternAddWithBinding (FcPattern *p,
842 const char *object,
843 FcValue value,
844 FcValueBinding binding,
845 FcBool append);
846
d8d73958
KP
847FcPattern *
848FcPatternFreeze (FcPattern *p);
849
34cd0514 850void
e1b9d091 851FcPatternFini (void);
34cd0514 852
4f27c1c0
KP
853FcBool
854FcPatternAppend (FcPattern *p, FcPattern *s);
855
e77c1718
PL
856void
857FcPatternAddFullFname (const FcPattern *p, const char *fname);
858
793154ed
PL
859void
860FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig);
e77c1718 861
8245771d
PL
862const FcChar8 *
863FcStrStaticName (const FcChar8 *name);
cd2ec1a9 864
7f37423d
PL
865FcChar32
866FcStringHash (const FcChar8 *s);
cd2ec1a9 867
cd2ec1a9 868void
4262e0b3 869FcPatternNewBank (void);
cd2ec1a9 870
4262e0b3
PL
871int
872FcPatternNeededBytes (FcPattern *p);
cd2ec1a9 873
7fd7221e
PL
874int
875FcPatternNeededBytesAlign (void);
876
4262e0b3
PL
877void *
878FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
cd2ec1a9 879
9ab79bdf
PL
880/* please don't access these outside of fcpat.c! only visible so that
881 * *PtrU can be inlined. */
81fe99fd
PL
882extern FcValueList ** _fcValueLists;
883extern FcPatternElt ** _fcPatternElts;
9ab79bdf
PL
884
885static __inline__ FcValueList *
886FcValueListPtrU (FcValueListPtr pi)
887{
888 if (pi.bank == FC_BANK_DYNAMIC)
889 return pi.u.dyn;
890
81fe99fd 891 return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat];
9ab79bdf
PL
892}
893
894static __inline__ FcPatternElt *
895FcPatternEltU (FcPatternEltPtr pei)
896{
897 if (pei.bank == FC_BANK_DYNAMIC)
898 return pei.u.dyn;
899
81fe99fd 900 return &_fcPatternElts[FcCacheBankToIndex(pei.bank)][pei.u.stat];
9ab79bdf 901}
cd2ec1a9
PL
902
903FcPatternElt *
904FcPatternEltU (FcPatternEltPtr pei);
905
906FcValueListPtr
907FcValueListPtrCreateDynamic(FcValueList * p);
908
cd2ec1a9 909FcPattern *
4262e0b3 910FcPatternSerialize (int bank, FcPattern * p);
212c9f43 911
7f37423d 912void *
61571f3f 913FcPatternUnserialize (FcCache * metadata, void *block_ptr);
212c9f43 914
24330d27
KP
915/* fcrender.c */
916
917/* fcmatrix.c */
327a7fd4 918
4262e0b3 919extern const FcMatrix FcIdentityMatrix;
327a7fd4 920
24330d27
KP
921void
922FcMatrixFree (FcMatrix *mat);
923
924/* fcstr.c */
cd2ec1a9
PL
925void
926FcStrSetSort (FcStrSet * set);
927
ccb3e93b
KP
928FcChar8 *
929FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
24330d27
KP
930
931void
ccb3e93b 932FcStrFree (FcChar8 *s);
24330d27 933
c2e7c611
KP
934void
935FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
936
937void
938FcStrBufDestroy (FcStrBuf *buf);
939
940FcChar8 *
941FcStrBufDone (FcStrBuf *buf);
942
943FcBool
944FcStrBufChar (FcStrBuf *buf, FcChar8 c);
945
946FcBool
947FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
948
949FcBool
950FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
951
82f4243f
KP
952int
953FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
954
11fec41c
KP
955const FcChar8 *
956FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
957
958const FcChar8 *
959FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
960
ff3f1f98
KP
961FcBool
962FcStrUsesHome (const FcChar8 *s);
963
daeed6e0
TL
964FcChar8 *
965FcStrLastSlash (const FcChar8 *path);
966
192296d8
KP
967FcChar32
968FcStrHashIgnoreCase (const FcChar8 *s);
969
24330d27 970#endif /* _FC_INT_H_ */