]>
Commit | Line | Data |
---|---|---|
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 | 115 | typedef enum _FcValueBinding { |
dda7794f | 116 | FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame |
4c003605 KP |
117 | } FcValueBinding; |
118 | ||
cd2ec1a9 | 119 | typedef struct _FcValueListPtr { |
4262e0b3 | 120 | int bank; |
cd2ec1a9 PL |
121 | union { |
122 | int stat; | |
123 | struct _FcValueList *dyn; | |
124 | } u; | |
125 | } FcValueListPtr; | |
126 | ||
24330d27 | 127 | typedef struct _FcValueList { |
cd2ec1a9 PL |
128 | FcValueListPtr next; |
129 | ||
24330d27 | 130 | FcValue value; |
e709ddfa | 131 | FcValueBinding binding; |
24330d27 KP |
132 | } FcValueList; |
133 | ||
4262e0b3 PL |
134 | typedef int FcObjectPtr; |
135 | ||
cd2ec1a9 | 136 | typedef struct _FcPatternEltPtr { |
4262e0b3 | 137 | int bank; |
cd2ec1a9 PL |
138 | union { |
139 | int stat; | |
140 | struct _FcPatternElt *dyn; | |
141 | } u; | |
142 | } FcPatternEltPtr; | |
143 | ||
24330d27 | 144 | typedef struct _FcPatternElt { |
cd2ec1a9 PL |
145 | FcObjectPtr object; |
146 | FcValueListPtr values; | |
24330d27 KP |
147 | } FcPatternElt; |
148 | ||
149 | struct _FcPattern { | |
150 | int num; | |
151 | int size; | |
cd2ec1a9 | 152 | FcPatternEltPtr elts; |
e709ddfa | 153 | int ref; |
4262e0b3 | 154 | int bank; |
24330d27 KP |
155 | }; |
156 | ||
157 | typedef 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 | ||
172 | typedef 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 | ||
189 | typedef enum _FcQual { | |
6f6563ed | 190 | FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst |
24330d27 KP |
191 | } FcQual; |
192 | ||
938bc633 KP |
193 | #define FcMatchDefault ((FcMatchKind) -1) |
194 | ||
24330d27 KP |
195 | typedef 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 | ||
204 | typedef 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 | ||
212 | typedef struct _FcSubst { | |
213 | struct _FcSubst *next; | |
214 | FcTest *test; | |
215 | FcEdit *edit; | |
216 | } FcSubst; | |
217 | ||
20ac65ab | 218 | typedef struct _FcCharLeaf { |
24330d27 | 219 | FcChar32 map[256/32]; |
20ac65ab | 220 | } FcCharLeaf; |
24330d27 | 221 | |
d8d73958 | 222 | #define FC_REF_CONSTANT -1 |
82f4243f | 223 | |
24330d27 | 224 | struct _FcCharSet { |
24330d27 | 225 | int ref; /* reference count */ |
20ac65ab | 226 | int num; /* size of leaves and numbers arrays */ |
4262e0b3 | 227 | int bank; |
cd2ec1a9 | 228 | union { |
cd2ec1a9 PL |
229 | struct { |
230 | int leafidx_offset; | |
231 | int numbers_offset; | |
232 | } stat; | |
f23f5f38 PL |
233 | struct { |
234 | FcCharLeaf **leaves; | |
235 | FcChar16 *numbers; | |
236 | } dyn; | |
cd2ec1a9 | 237 | } u; |
24330d27 KP |
238 | }; |
239 | ||
179c3995 KP |
240 | struct _FcStrSet { |
241 | int ref; /* reference count */ | |
242 | int num; | |
243 | int size; | |
4262e0b3 | 244 | FcChar8 **strs; |
179c3995 KP |
245 | }; |
246 | ||
247 | struct _FcStrList { | |
248 | FcStrSet *set; | |
249 | int n; | |
250 | }; | |
251 | ||
c2e7c611 | 252 | typedef 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 | 260 | typedef struct _FcCache { |
31081737 | 261 | int magic; /* FC_CACHE_MAGIC */ |
00f059e9 KP |
262 | int subdirs; /* number of subdir strings */ |
263 | off_t pos; /* position of data block in file */ | |
264 | off_t count; /* number of bytes of data in block */ | |
c7beacf9 PL |
265 | int bank; /* bank ID */ |
266 | int pattern_count; /* number of FcPatterns */ | |
267 | int patternelt_count; /* number of FcPatternElts */ | |
268 | int valuelist_count; /* number of FcValueLists */ | |
a9698bed PL |
269 | int str_count; /* size of strings appearing as FcValues */ |
270 | int langset_count; /* number of FcLangSets */ | |
271 | int charset_count; /* number of FcCharSets */ | |
272 | int charset_numbers_count; | |
4262e0b3 PL |
273 | int charset_leaf_count; |
274 | int charset_leaf_idx_count; | |
212c9f43 PL |
275 | } FcCache; |
276 | ||
7769c321 KP |
277 | /* |
278 | * To map adobe glyph names to unicode values, a precomputed hash | |
279 | * table is used | |
280 | */ | |
281 | ||
282 | typedef struct _FcGlyphName { | |
283 | FcChar32 ucs; /* unicode value */ | |
284 | FcChar8 name[1]; /* name extends beyond struct */ | |
285 | } FcGlyphName; | |
286 | ||
192296d8 KP |
287 | /* |
288 | * To perform case-insensitive string comparisons, a table | |
289 | * is used which holds three different kinds of folding data. | |
290 | * | |
291 | * The first is a range of upper case values mapping to a range | |
292 | * of their lower case equivalents. Within each range, the offset | |
293 | * between upper and lower case is constant. | |
294 | * | |
295 | * The second is a range of upper case values which are interleaved | |
296 | * with their lower case equivalents. | |
297 | * | |
298 | * The third is a set of raw unicode values mapping to a list | |
299 | * of unicode values for comparison purposes. This allows conversion | |
300 | * of ß to "ss" so that SS, ss and ß all match. A separate array | |
301 | * holds the list of unicode values for each entry. | |
302 | * | |
303 | * These are packed into a single table. Using a binary search, | |
304 | * the appropriate entry can be located. | |
305 | */ | |
306 | ||
307 | #define FC_CASE_FOLD_RANGE 0 | |
308 | #define FC_CASE_FOLD_EVEN_ODD 1 | |
309 | #define FC_CASE_FOLD_FULL 2 | |
310 | ||
311 | typedef struct _FcCaseFold { | |
312 | FcChar32 upper; | |
313 | FcChar16 method : 2; | |
314 | FcChar16 count : 14; | |
315 | short offset; /* lower - upper for RANGE, table id for FULL */ | |
316 | } FcCaseFold; | |
317 | ||
2d9c79c0 KP |
318 | #define FC_MAX_FILE_LEN 4096 |
319 | ||
4262e0b3 PL |
320 | #define FC_STORAGE_STATIC 0x80 |
321 | #define fc_value_string(v) (((v)->type & FC_STORAGE_STATIC) ? ((FcChar8 *) v) + (v)->u.s_off : (v) -> u.s) | |
322 | #define fc_value_charset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcCharSet *)(((char *) v) + (v)->u.c_off) : (v) -> u.c) | |
323 | #define fc_value_langset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcLangSet *)(((char *) v) + (v)->u.l_off) : (v) -> u.l) | |
1c9fdcca | 324 | #define fc_storage_type(v) ((v)->type & ~FC_STORAGE_STATIC) |
4262e0b3 | 325 | |
44415a07 PL |
326 | #define fc_alignof(type) offsetof (struct { char c; type member; }, member) |
327 | ||
c1c3ba06 | 328 | #define FC_CACHE_MAGIC 0xFC02FC04 |
327a7fd4 | 329 | |
134f6011 KP |
330 | struct _FcAtomic { |
331 | FcChar8 *file; /* original file name */ | |
332 | FcChar8 *new; /* temp file name -- write data here */ | |
333 | FcChar8 *lck; /* lockfile name (used for locking) */ | |
334 | FcChar8 *tmp; /* tmpfile name (used for locking) */ | |
335 | }; | |
336 | ||
24330d27 KP |
337 | struct _FcBlanks { |
338 | int nblank; | |
339 | int sblank; | |
340 | FcChar32 *blanks; | |
341 | }; | |
342 | ||
343 | struct _FcConfig { | |
344 | /* | |
345 | * File names loaded from the configuration -- saved here as the | |
346 | * cache file must be consulted before the directories are scanned, | |
347 | * and those directives may occur in any order | |
348 | */ | |
179c3995 | 349 | FcStrSet *configDirs; /* directories to scan for fonts */ |
ccb3e93b | 350 | FcChar8 *cache; /* name of per-user cache file */ |
24330d27 KP |
351 | /* |
352 | * Set of allowed blank chars -- used to | |
353 | * trim fonts of bogus glyphs | |
354 | */ | |
355 | FcBlanks *blanks; | |
179c3995 KP |
356 | /* |
357 | * List of directories containing fonts, | |
358 | * built by recursively scanning the set | |
359 | * of configured directories | |
360 | */ | |
361 | FcStrSet *fontDirs; | |
7410e40b PL |
362 | /* |
363 | * List of directories containing cache files. | |
364 | */ | |
365 | FcStrSet *cacheDirs; | |
24330d27 KP |
366 | /* |
367 | * Names of all of the configuration files used | |
368 | * to create this configuration | |
369 | */ | |
179c3995 | 370 | FcStrSet *configFiles; /* config files loaded */ |
24330d27 KP |
371 | /* |
372 | * Substitution instructions for patterns and fonts; | |
373 | * maxObjects is used to allocate appropriate intermediate storage | |
374 | * while performing a whole set of substitutions | |
375 | */ | |
376 | FcSubst *substPattern; /* substitutions for patterns */ | |
377 | FcSubst *substFont; /* substitutions for fonts */ | |
378 | int maxObjects; /* maximum number of tests in all substs */ | |
d47c9d6e KP |
379 | /* |
380 | * List of patterns used to control font file selection | |
381 | */ | |
382 | FcStrSet *acceptGlobs; | |
383 | FcStrSet *rejectGlobs; | |
4f27c1c0 KP |
384 | FcFontSet *acceptPatterns; |
385 | FcFontSet *rejectPatterns; | |
24330d27 KP |
386 | /* |
387 | * The set of fonts loaded from the listed directories; the | |
388 | * order within the set does not determine the font selection, | |
389 | * except in the case of identical matches in which case earlier fonts | |
390 | * match preferrentially | |
391 | */ | |
392 | FcFontSet *fonts[FcSetApplication + 1]; | |
179c3995 KP |
393 | /* |
394 | * Fontconfig can periodically rescan the system configuration | |
395 | * and font directories. This rescanning occurs when font | |
396 | * listing requests are made, but no more often than rescanInterval | |
397 | * seconds apart. | |
398 | */ | |
399 | time_t rescanTime; /* last time information was scanned */ | |
400 | int rescanInterval; /* interval between scans */ | |
24330d27 KP |
401 | }; |
402 | ||
6e9fc5de KP |
403 | extern FcConfig *_fcConfig; |
404 | ||
2b25f00c PL |
405 | typedef struct _FcFileTime { |
406 | time_t time; | |
407 | FcBool set; | |
408 | } FcFileTime; | |
409 | ||
69937bd9 KP |
410 | typedef struct _FcCharMap FcCharMap; |
411 | ||
44415a07 PL |
412 | /* watch out; assumes that v is void * -PL */ |
413 | #define ALIGN(v,type) ((void *)(((uintptr_t)(v) + fc_alignof(type) - 1) & ~(fc_alignof(type) - 1))) | |
7fd7221e | 414 | |
24330d27 KP |
415 | /* fcblanks.c */ |
416 | ||
417 | /* fccache.c */ | |
418 | ||
4262e0b3 | 419 | FcFontSet * |
00f059e9 | 420 | FcCacheRead (FcConfig *config); |
24330d27 KP |
421 | |
422 | FcBool | |
7410e40b | 423 | FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config); |
4262e0b3 | 424 | |
2eb84374 | 425 | FcBool |
cd9bca69 | 426 | FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config); |
2eb84374 | 427 | |
b8948e85 | 428 | extern int *_fcBankId, *_fcBankIdx; |
4262e0b3 | 429 | int |
b8948e85 PL |
430 | FcCacheBankToIndexMTF (int bank); |
431 | ||
44415a07 | 432 | static inline int |
b8948e85 PL |
433 | FcCacheBankToIndex (int bank) |
434 | { | |
19ea60bc | 435 | return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank); |
b8948e85 | 436 | } |
e77c1718 PL |
437 | |
438 | const char * | |
439 | FcCacheFindBankDir (int bank); | |
212c9f43 | 440 | |
24330d27 KP |
441 | /* fccfg.c */ |
442 | ||
179c3995 KP |
443 | FcBool |
444 | FcConfigAddConfigDir (FcConfig *config, | |
445 | const FcChar8 *d); | |
446 | ||
447 | FcBool | |
448 | FcConfigAddFontDir (FcConfig *config, | |
449 | const FcChar8 *d); | |
450 | ||
24330d27 | 451 | FcBool |
ccb3e93b KP |
452 | FcConfigAddDir (FcConfig *config, |
453 | const FcChar8 *d); | |
24330d27 | 454 | |
7410e40b PL |
455 | FcBool |
456 | FcConfigAddCacheDir (FcConfig *config, | |
457 | const FcChar8 *d); | |
458 | ||
459 | FcStrList * | |
460 | FcConfigGetCacheDirs (FcConfig *config); | |
461 | ||
24330d27 | 462 | FcBool |
ccb3e93b KP |
463 | FcConfigAddConfigFile (FcConfig *config, |
464 | const FcChar8 *f); | |
24330d27 KP |
465 | |
466 | FcBool | |
467 | FcConfigSetCache (FcConfig *config, | |
ccb3e93b | 468 | const FcChar8 *c); |
24330d27 KP |
469 | |
470 | FcBool | |
471 | FcConfigAddBlank (FcConfig *config, | |
472 | FcChar32 blank); | |
473 | ||
474 | FcBool | |
475 | FcConfigAddEdit (FcConfig *config, | |
476 | FcTest *test, | |
477 | FcEdit *edit, | |
478 | FcMatchKind kind); | |
479 | ||
480 | void | |
481 | FcConfigSetFonts (FcConfig *config, | |
482 | FcFontSet *fonts, | |
483 | FcSetName set); | |
484 | ||
485 | FcBool | |
4262e0b3 | 486 | FcConfigCompareValue (const FcValue *m, |
24330d27 | 487 | FcOp op, |
4262e0b3 | 488 | const FcValue *v); |
24330d27 | 489 | |
d47c9d6e KP |
490 | FcBool |
491 | FcConfigGlobAdd (FcConfig *config, | |
492 | const FcChar8 *glob, | |
493 | FcBool accept); | |
494 | ||
495 | FcBool | |
496 | FcConfigAcceptFilename (FcConfig *config, | |
497 | const FcChar8 *filename); | |
498 | ||
4f27c1c0 KP |
499 | FcBool |
500 | FcConfigPatternsAdd (FcConfig *config, | |
501 | FcPattern *pattern, | |
502 | FcBool accept); | |
503 | ||
504 | FcBool | |
505 | FcConfigAcceptFont (FcConfig *config, | |
506 | const FcPattern *font); | |
507 | ||
2b25f00c PL |
508 | FcFileTime |
509 | FcConfigModifiedTime (FcConfig *config); | |
510 | ||
24330d27 | 511 | /* fccharset.c */ |
82f35f8b PL |
512 | void |
513 | FcLangCharSetPopulate (void); | |
514 | ||
4c003605 KP |
515 | FcCharSet * |
516 | FcCharSetFreeze (FcCharSet *cs); | |
517 | ||
34cd0514 CW |
518 | void |
519 | FcCharSetThawAll (void); | |
520 | ||
24330d27 | 521 | FcBool |
c2e7c611 | 522 | FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c); |
24330d27 KP |
523 | |
524 | FcCharSet * | |
525 | FcNameParseCharSet (FcChar8 *string); | |
526 | ||
c647f6f1 KP |
527 | FcCharLeaf * |
528 | FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4); | |
69937bd9 | 529 | |
cd2ec1a9 | 530 | void |
4262e0b3 | 531 | FcCharSetNewBank (void); |
cd2ec1a9 | 532 | |
4262e0b3 PL |
533 | int |
534 | FcCharSetNeededBytes (const FcCharSet *c); | |
cd2ec1a9 | 535 | |
7fd7221e PL |
536 | int |
537 | FcCharSetNeededBytesAlign (void); | |
538 | ||
4262e0b3 PL |
539 | void * |
540 | FcCharSetDistributeBytes (FcCache * metadata, | |
541 | void * block_ptr); | |
cd2ec1a9 | 542 | |
4262e0b3 PL |
543 | FcCharSet * |
544 | FcCharSetSerialize(int bank, FcCharSet *c); | |
cd2ec1a9 | 545 | |
4262e0b3 | 546 | void * |
61571f3f | 547 | FcCharSetUnserialize (FcCache * metadata, void *block_ptr); |
cd2ec1a9 PL |
548 | |
549 | FcCharLeaf * | |
550 | FcCharSetGetLeaf(const FcCharSet *c, int i); | |
551 | ||
552 | FcChar16 * | |
553 | FcCharSetGetNumbers(const FcCharSet *c); | |
554 | ||
24330d27 | 555 | /* fcdbg.c */ |
24330d27 | 556 | void |
cd2ec1a9 | 557 | FcValueListPrint (const FcValueListPtr l); |
24330d27 | 558 | |
793e946c KP |
559 | void |
560 | FcLangSetPrint (const FcLangSet *ls); | |
561 | ||
24330d27 KP |
562 | void |
563 | FcOpPrint (FcOp op); | |
564 | ||
565 | void | |
938bc633 | 566 | FcTestPrint (const FcTest *test); |
24330d27 KP |
567 | |
568 | void | |
938bc633 | 569 | FcExprPrint (const FcExpr *expr); |
24330d27 KP |
570 | |
571 | void | |
938bc633 | 572 | FcEditPrint (const FcEdit *edit); |
24330d27 KP |
573 | |
574 | void | |
938bc633 | 575 | FcSubstPrint (const FcSubst *subst); |
24330d27 | 576 | |
b97a34b5 PL |
577 | extern int FcDebugVal; |
578 | ||
44415a07 | 579 | static inline int |
b97a34b5 PL |
580 | FcDebug (void) { return FcDebugVal; } |
581 | ||
582 | void | |
583 | FcInitDebug (void); | |
24330d27 | 584 | |
90442681 PL |
585 | /* fcdefault.c */ |
586 | FcChar8 * | |
587 | FcGetDefaultLang (void); | |
588 | ||
24330d27 | 589 | /* fcdir.c */ |
24330d27 | 590 | |
2d9c79c0 KP |
591 | FcBool |
592 | FcFileIsDir (const FcChar8 *file); | |
593 | ||
d47c9d6e KP |
594 | FcBool |
595 | FcFileScanConfig (FcFontSet *set, | |
596 | FcStrSet *dirs, | |
d47c9d6e KP |
597 | FcBlanks *blanks, |
598 | const FcChar8 *file, | |
599 | FcBool force, | |
600 | FcConfig *config); | |
601 | ||
602 | FcBool | |
603 | FcDirScanConfig (FcFontSet *set, | |
604 | FcStrSet *dirs, | |
d47c9d6e KP |
605 | FcBlanks *blanks, |
606 | const FcChar8 *dir, | |
607 | FcBool force, | |
608 | FcConfig *config); | |
609 | ||
24330d27 KP |
610 | /* fcfont.c */ |
611 | int | |
612 | FcFontDebug (void); | |
613 | ||
82f4243f | 614 | /* fcfreetype.c */ |
e50b9ae7 KP |
615 | FcBool |
616 | FcFreeTypeIsExclusiveLang (const FcChar8 *lang); | |
617 | ||
82f4243f KP |
618 | FcBool |
619 | FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang); | |
620 | ||
c647f6f1 KP |
621 | FcChar32 |
622 | FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map); | |
623 | ||
624 | FcChar32 | |
625 | FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map); | |
626 | ||
627 | const FcCharMap * | |
628 | FcFreeTypeGetPrivateMap (FT_Encoding encoding); | |
629 | ||
24330d27 | 630 | /* fcfs.c */ |
cd2ec1a9 PL |
631 | |
632 | void | |
4262e0b3 | 633 | FcFontSetNewBank (void); |
cd2ec1a9 | 634 | |
4262e0b3 PL |
635 | int |
636 | FcFontSetNeededBytes (FcFontSet *s); | |
cd2ec1a9 | 637 | |
7fd7221e PL |
638 | int |
639 | FcFontSetNeededBytesAlign (void); | |
640 | ||
4262e0b3 PL |
641 | void * |
642 | FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr); | |
cd2ec1a9 | 643 | |
212c9f43 | 644 | FcBool |
4262e0b3 | 645 | FcFontSetSerialize (int bank, FcFontSet * s); |
212c9f43 PL |
646 | |
647 | FcBool | |
61571f3f | 648 | FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr); |
212c9f43 | 649 | |
24330d27 KP |
650 | /* fcgram.y */ |
651 | int | |
652 | FcConfigparse (void); | |
653 | ||
654 | int | |
655 | FcConfigwrap (void); | |
656 | ||
657 | void | |
658 | FcConfigerror (char *fmt, ...); | |
659 | ||
660 | char * | |
661 | FcConfigSaveField (const char *field); | |
662 | ||
24330d27 KP |
663 | void |
664 | FcTestDestroy (FcTest *test); | |
665 | ||
666 | FcExpr * | |
667 | FcExprCreateInteger (int i); | |
668 | ||
669 | FcExpr * | |
670 | FcExprCreateDouble (double d); | |
671 | ||
672 | FcExpr * | |
ccb3e93b | 673 | FcExprCreateString (const FcChar8 *s); |
24330d27 KP |
674 | |
675 | FcExpr * | |
676 | FcExprCreateMatrix (const FcMatrix *m); | |
677 | ||
678 | FcExpr * | |
679 | FcExprCreateBool (FcBool b); | |
680 | ||
681 | FcExpr * | |
682 | FcExprCreateNil (void); | |
683 | ||
684 | FcExpr * | |
685 | FcExprCreateField (const char *field); | |
686 | ||
687 | FcExpr * | |
ccb3e93b | 688 | FcExprCreateConst (const FcChar8 *constant); |
24330d27 KP |
689 | |
690 | FcExpr * | |
691 | FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right); | |
692 | ||
693 | void | |
694 | FcExprDestroy (FcExpr *e); | |
695 | ||
24330d27 KP |
696 | void |
697 | FcEditDestroy (FcEdit *e); | |
698 | ||
699 | /* fcinit.c */ | |
700 | ||
701 | void | |
702 | FcMemReport (void); | |
703 | ||
704 | void | |
705 | FcMemAlloc (int kind, int size); | |
706 | ||
707 | void | |
708 | FcMemFree (int kind, int size); | |
709 | ||
82f4243f | 710 | /* fclang.c */ |
d8d73958 KP |
711 | FcLangSet * |
712 | FcFreeTypeLangSet (const FcCharSet *charset, | |
e50b9ae7 | 713 | const FcChar8 *exclusiveLang); |
82f4243f KP |
714 | |
715 | FcLangResult | |
716 | FcLangCompare (const FcChar8 *s1, const FcChar8 *s2); | |
717 | ||
718 | const FcCharSet * | |
719 | FcCharSetForLang (const FcChar8 *lang); | |
720 | ||
d8d73958 KP |
721 | FcLangSet * |
722 | FcLangSetPromote (const FcChar8 *lang); | |
723 | ||
724 | FcLangSet * | |
725 | FcNameParseLangSet (const FcChar8 *string); | |
726 | ||
727 | FcBool | |
728 | FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls); | |
729 | ||
cd2ec1a9 | 730 | void |
4262e0b3 | 731 | FcLangSetNewBank (void); |
cd2ec1a9 | 732 | |
4262e0b3 PL |
733 | int |
734 | FcLangSetNeededBytes (const FcLangSet *l); | |
cd2ec1a9 | 735 | |
7fd7221e PL |
736 | int |
737 | FcLangSetNeededBytesAlign (void); | |
738 | ||
4262e0b3 PL |
739 | void * |
740 | FcLangSetDistributeBytes (FcCache * metadata, | |
741 | void * block_ptr); | |
cd2ec1a9 PL |
742 | |
743 | FcLangSet * | |
4262e0b3 | 744 | FcLangSetSerialize (int bank, FcLangSet *l); |
cd2ec1a9 | 745 | |
4262e0b3 | 746 | void * |
61571f3f | 747 | FcLangSetUnserialize (FcCache * metadata, void *block_ptr); |
212c9f43 | 748 | |
24330d27 KP |
749 | /* fclist.c */ |
750 | ||
4f27c1c0 KP |
751 | FcBool |
752 | FcListPatternMatchAny (const FcPattern *p, | |
753 | const FcPattern *font); | |
754 | ||
24330d27 KP |
755 | /* fcmatch.c */ |
756 | ||
757 | /* fcname.c */ | |
24330d27 KP |
758 | |
759 | FcBool | |
ca60d2b5 | 760 | FcNameBool (const FcChar8 *v, FcBool *result); |
24330d27 | 761 | |
4262e0b3 PL |
762 | void * |
763 | FcObjectDistributeBytes (FcCache * metadata, | |
764 | void * block_ptr); | |
765 | ||
766 | FcObjectPtr | |
767 | FcObjectToPtr (const char * si); | |
768 | ||
769 | int | |
7f37423d PL |
770 | FcObjectNeededBytes (void); |
771 | ||
7fd7221e PL |
772 | int |
773 | FcObjectNeededBytesAlign (void); | |
774 | ||
7f37423d | 775 | void * |
61571f3f | 776 | FcObjectUnserialize (FcCache * metadata, void *block_ptr); |
4262e0b3 PL |
777 | |
778 | void | |
7f37423d | 779 | FcObjectSerialize (void); |
4262e0b3 | 780 | |
7f37423d PL |
781 | const char * |
782 | FcObjectPtrU (FcObjectPtr p); | |
783 | ||
44415a07 | 784 | static inline int |
9ab79bdf PL |
785 | FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b) |
786 | { | |
787 | return a - b; | |
788 | } | |
7f37423d PL |
789 | |
790 | void | |
791 | FcObjectStaticNameFini (void); | |
4262e0b3 | 792 | |
24330d27 | 793 | /* fcpat.c */ |
4262e0b3 PL |
794 | |
795 | FcValue | |
796 | FcValueCanonicalize (const FcValue *v); | |
797 | ||
24330d27 | 798 | void |
cd2ec1a9 PL |
799 | FcValueListDestroy (FcValueListPtr l); |
800 | ||
24330d27 | 801 | FcPatternElt * |
e9be9cd1 KP |
802 | FcPatternFindElt (const FcPattern *p, const char *object); |
803 | ||
804 | FcPatternElt * | |
805 | FcPatternInsertElt (FcPattern *p, const char *object); | |
24330d27 | 806 | |
82f4243f KP |
807 | FcBool |
808 | FcPatternAddWithBinding (FcPattern *p, | |
809 | const char *object, | |
810 | FcValue value, | |
811 | FcValueBinding binding, | |
812 | FcBool append); | |
813 | ||
34cd0514 | 814 | void |
e1b9d091 | 815 | FcPatternFini (void); |
34cd0514 | 816 | |
4f27c1c0 KP |
817 | FcBool |
818 | FcPatternAppend (FcPattern *p, FcPattern *s); | |
819 | ||
8245771d PL |
820 | const FcChar8 * |
821 | FcStrStaticName (const FcChar8 *name); | |
cd2ec1a9 | 822 | |
7f37423d PL |
823 | FcChar32 |
824 | FcStringHash (const FcChar8 *s); | |
cd2ec1a9 | 825 | |
cd2ec1a9 | 826 | void |
4262e0b3 | 827 | FcPatternNewBank (void); |
cd2ec1a9 | 828 | |
4262e0b3 PL |
829 | int |
830 | FcPatternNeededBytes (FcPattern *p); | |
cd2ec1a9 | 831 | |
7fd7221e PL |
832 | int |
833 | FcPatternNeededBytesAlign (void); | |
834 | ||
4262e0b3 PL |
835 | void * |
836 | FcPatternDistributeBytes (FcCache * metadata, void * block_ptr); | |
cd2ec1a9 | 837 | |
9ab79bdf PL |
838 | /* please don't access these outside of fcpat.c! only visible so that |
839 | * *PtrU can be inlined. */ | |
81fe99fd PL |
840 | extern FcValueList ** _fcValueLists; |
841 | extern FcPatternElt ** _fcPatternElts; | |
9ab79bdf | 842 | |
44415a07 | 843 | static inline FcValueList * |
9ab79bdf PL |
844 | FcValueListPtrU (FcValueListPtr pi) |
845 | { | |
846 | if (pi.bank == FC_BANK_DYNAMIC) | |
847 | return pi.u.dyn; | |
848 | ||
81fe99fd | 849 | return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat]; |
9ab79bdf PL |
850 | } |
851 | ||
44415a07 | 852 | static inline FcPatternElt * |
9ab79bdf PL |
853 | FcPatternEltU (FcPatternEltPtr pei) |
854 | { | |
855 | if (pei.bank == FC_BANK_DYNAMIC) | |
856 | return pei.u.dyn; | |
857 | ||
81fe99fd | 858 | return &_fcPatternElts[FcCacheBankToIndex(pei.bank)][pei.u.stat]; |
9ab79bdf | 859 | } |
cd2ec1a9 | 860 | |
cd2ec1a9 PL |
861 | FcValueListPtr |
862 | FcValueListPtrCreateDynamic(FcValueList * p); | |
863 | ||
cd2ec1a9 | 864 | FcPattern * |
4262e0b3 | 865 | FcPatternSerialize (int bank, FcPattern * p); |
212c9f43 | 866 | |
7f37423d | 867 | void * |
61571f3f | 868 | FcPatternUnserialize (FcCache * metadata, void *block_ptr); |
212c9f43 | 869 | |
24330d27 KP |
870 | /* fcrender.c */ |
871 | ||
872 | /* fcmatrix.c */ | |
327a7fd4 | 873 | |
4262e0b3 | 874 | extern const FcMatrix FcIdentityMatrix; |
327a7fd4 | 875 | |
24330d27 KP |
876 | void |
877 | FcMatrixFree (FcMatrix *mat); | |
878 | ||
879 | /* fcstr.c */ | |
cd2ec1a9 PL |
880 | void |
881 | FcStrSetSort (FcStrSet * set); | |
882 | ||
ccb3e93b KP |
883 | FcChar8 * |
884 | FcStrPlus (const FcChar8 *s1, const FcChar8 *s2); | |
24330d27 KP |
885 | |
886 | void | |
ccb3e93b | 887 | FcStrFree (FcChar8 *s); |
24330d27 | 888 | |
c2e7c611 KP |
889 | void |
890 | FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size); | |
891 | ||
892 | void | |
893 | FcStrBufDestroy (FcStrBuf *buf); | |
894 | ||
895 | FcChar8 * | |
896 | FcStrBufDone (FcStrBuf *buf); | |
897 | ||
898 | FcBool | |
899 | FcStrBufChar (FcStrBuf *buf, FcChar8 c); | |
900 | ||
901 | FcBool | |
902 | FcStrBufString (FcStrBuf *buf, const FcChar8 *s); | |
903 | ||
904 | FcBool | |
905 | FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len); | |
906 | ||
82f4243f KP |
907 | int |
908 | FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); | |
909 | ||
11fec41c KP |
910 | const FcChar8 * |
911 | FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); | |
912 | ||
913 | const FcChar8 * | |
914 | FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); | |
915 | ||
ff3f1f98 KP |
916 | FcBool |
917 | FcStrUsesHome (const FcChar8 *s); | |
918 | ||
daeed6e0 TL |
919 | FcChar8 * |
920 | FcStrLastSlash (const FcChar8 *path); | |
921 | ||
192296d8 KP |
922 | FcChar32 |
923 | FcStrHashIgnoreCase (const FcChar8 *s); | |
924 | ||
24330d27 | 925 | #endif /* _FC_INT_H_ */ |