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