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