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