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