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