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