]> git.wh0rd.org - fontconfig.git/blob - src/fcint.h
Add documentation for FcConfigNormalizeFontDir.
[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; /* 0xFC02FC02 */
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 0xFC02FC02
328
329 typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
330
331 struct _FcGlobalCacheDir {
332 struct _FcGlobalCacheDir *next;
333 char *name;
334 FcCache metadata;
335 off_t offset;
336 FcStrSet *subdirs;
337 void *ent;
338 };
339
340 typedef struct _FcGlobalCache {
341 FcGlobalCacheDir *dirs;
342 FcBool updated;
343 int fd;
344 } FcGlobalCache;
345
346 struct _FcAtomic {
347 FcChar8 *file; /* original file name */
348 FcChar8 *new; /* temp file name -- write data here */
349 FcChar8 *lck; /* lockfile name (used for locking) */
350 FcChar8 *tmp; /* tmpfile name (used for locking) */
351 };
352
353 struct _FcBlanks {
354 int nblank;
355 int sblank;
356 FcChar32 *blanks;
357 };
358
359 struct _FcConfig {
360 /*
361 * File names loaded from the configuration -- saved here as the
362 * cache file must be consulted before the directories are scanned,
363 * and those directives may occur in any order
364 */
365 FcStrSet *configDirs; /* directories to scan for fonts */
366 FcChar8 *cache; /* name of per-user cache file */
367 /*
368 * Set of allowed blank chars -- used to
369 * trim fonts of bogus glyphs
370 */
371 FcBlanks *blanks;
372 /*
373 * List of directories containing fonts,
374 * built by recursively scanning the set
375 * of configured directories
376 */
377 FcStrSet *fontDirs;
378 /*
379 * Names of all of the configuration files used
380 * to create this configuration
381 */
382 FcStrSet *configFiles; /* config files loaded */
383 /*
384 * Substitution instructions for patterns and fonts;
385 * maxObjects is used to allocate appropriate intermediate storage
386 * while performing a whole set of substitutions
387 */
388 FcSubst *substPattern; /* substitutions for patterns */
389 FcSubst *substFont; /* substitutions for fonts */
390 int maxObjects; /* maximum number of tests in all substs */
391 /*
392 * List of patterns used to control font file selection
393 */
394 FcStrSet *acceptGlobs;
395 FcStrSet *rejectGlobs;
396 FcFontSet *acceptPatterns;
397 FcFontSet *rejectPatterns;
398 /*
399 * The set of fonts loaded from the listed directories; the
400 * order within the set does not determine the font selection,
401 * except in the case of identical matches in which case earlier fonts
402 * match preferrentially
403 */
404 FcFontSet *fonts[FcSetApplication + 1];
405 /*
406 * Fontconfig can periodically rescan the system configuration
407 * and font directories. This rescanning occurs when font
408 * listing requests are made, but no more often than rescanInterval
409 * seconds apart.
410 */
411 time_t rescanTime; /* last time information was scanned */
412 int rescanInterval; /* interval between scans */
413 };
414
415 extern FcConfig *_fcConfig;
416
417 typedef struct _FcFileTime {
418 time_t time;
419 FcBool set;
420 } FcFileTime;
421
422 typedef struct _FcCharMap FcCharMap;
423
424 #define ALIGN(v,type) ((__typeof__(v))(((uintptr_t)(v) + __alignof__(type) - 1) & ~(__alignof__(type) - 1)))
425
426 /* fcblanks.c */
427
428 /* fccache.c */
429
430 FcGlobalCache *
431 FcGlobalCacheCreate (void);
432
433 void
434 FcGlobalCacheDestroy (FcGlobalCache *cache);
435
436 FcBool
437 FcGlobalCacheReadDir (FcFontSet *set,
438 FcStrSet *dirs,
439 FcGlobalCache *cache,
440 const char *dir,
441 FcConfig *config);
442
443 void
444 FcGlobalCacheLoad (FcGlobalCache *cache,
445 FcStrSet *staleDirs,
446 const FcChar8 *cache_file,
447 FcConfig *config);
448
449 FcBool
450 FcGlobalCacheUpdate (FcGlobalCache *cache,
451 FcStrSet *dirs,
452 const char *file,
453 FcFontSet *set,
454 FcConfig *config);
455
456 FcBool
457 FcGlobalCacheSave (FcGlobalCache *cache,
458 const FcChar8 *cache_file,
459 FcConfig *config);
460
461 FcFontSet *
462 FcCacheRead (FcConfig *config, FcGlobalCache * cache);
463
464 FcBool
465 FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
466
467 FcBool
468 FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
469
470 extern int *_fcBankId, *_fcBankIdx;
471 int
472 FcCacheBankToIndexMTF (int bank);
473
474 static __inline__ int
475 FcCacheBankToIndex (int bank)
476 {
477 return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
478 }
479
480 const char *
481 FcCacheFindBankDir (int bank);
482
483 /* fccfg.c */
484
485 FcBool
486 FcConfigAddConfigDir (FcConfig *config,
487 const FcChar8 *d);
488
489 FcBool
490 FcConfigAddFontDir (FcConfig *config,
491 const FcChar8 *d);
492
493 FcBool
494 FcConfigAddDir (FcConfig *config,
495 const FcChar8 *d);
496
497 FcBool
498 FcConfigAddConfigFile (FcConfig *config,
499 const FcChar8 *f);
500
501 FcBool
502 FcConfigSetCache (FcConfig *config,
503 const FcChar8 *c);
504
505 FcBool
506 FcConfigAddBlank (FcConfig *config,
507 FcChar32 blank);
508
509 FcBool
510 FcConfigAddEdit (FcConfig *config,
511 FcTest *test,
512 FcEdit *edit,
513 FcMatchKind kind);
514
515 void
516 FcConfigSetFonts (FcConfig *config,
517 FcFontSet *fonts,
518 FcSetName set);
519
520 FcBool
521 FcConfigCompareValue (const FcValue *m,
522 FcOp op,
523 const FcValue *v);
524
525 FcBool
526 FcConfigGlobAdd (FcConfig *config,
527 const FcChar8 *glob,
528 FcBool accept);
529
530 FcBool
531 FcConfigAcceptFilename (FcConfig *config,
532 const FcChar8 *filename);
533
534 FcBool
535 FcConfigPatternsAdd (FcConfig *config,
536 FcPattern *pattern,
537 FcBool accept);
538
539 FcBool
540 FcConfigAcceptFont (FcConfig *config,
541 const FcPattern *font);
542
543 FcFileTime
544 FcConfigModifiedTime (FcConfig *config);
545
546 /* fccharset.c */
547 void
548 FcLangCharSetPopulate (void);
549
550 FcCharSet *
551 FcCharSetFreeze (FcCharSet *cs);
552
553 void
554 FcCharSetThawAll (void);
555
556 FcBool
557 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
558
559 FcCharSet *
560 FcNameParseCharSet (FcChar8 *string);
561
562 FcCharLeaf *
563 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
564
565 void
566 FcCharSetNewBank (void);
567
568 int
569 FcCharSetNeededBytes (const FcCharSet *c);
570
571 int
572 FcCharSetNeededBytesAlign (void);
573
574 void *
575 FcCharSetDistributeBytes (FcCache * metadata,
576 void * block_ptr);
577
578 FcCharSet *
579 FcCharSetSerialize(int bank, FcCharSet *c);
580
581 void *
582 FcCharSetUnserialize (FcCache * metadata, void *block_ptr);
583
584 FcCharLeaf *
585 FcCharSetGetLeaf(const FcCharSet *c, int i);
586
587 FcChar16 *
588 FcCharSetGetNumbers(const FcCharSet *c);
589
590 /* fcdbg.c */
591 void
592 FcValueListPrint (const FcValueListPtr l);
593
594 void
595 FcLangSetPrint (const FcLangSet *ls);
596
597 void
598 FcOpPrint (FcOp op);
599
600 void
601 FcTestPrint (const FcTest *test);
602
603 void
604 FcExprPrint (const FcExpr *expr);
605
606 void
607 FcEditPrint (const FcEdit *edit);
608
609 void
610 FcSubstPrint (const FcSubst *subst);
611
612 extern int FcDebugVal;
613
614 static __inline__ int
615 FcDebug (void) { return FcDebugVal; }
616
617 void
618 FcInitDebug (void);
619
620 /* fcdefault.c */
621 FcChar8 *
622 FcGetDefaultLang (void);
623
624 /* fcdir.c */
625
626 FcBool
627 FcFileIsDir (const FcChar8 *file);
628
629 FcBool
630 FcFileScanConfig (FcFontSet *set,
631 FcStrSet *dirs,
632 FcFileCache *cache,
633 FcBlanks *blanks,
634 const FcChar8 *file,
635 FcBool force,
636 FcConfig *config);
637
638 FcBool
639 FcDirScanConfig (FcFontSet *set,
640 FcStrSet *dirs,
641 FcFileCache *cache,
642 FcBlanks *blanks,
643 const FcChar8 *dir,
644 FcBool force,
645 FcConfig *config);
646
647 /* fcfont.c */
648 int
649 FcFontDebug (void);
650
651 /* fcfreetype.c */
652 FcBool
653 FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
654
655 FcBool
656 FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
657
658 FcChar32
659 FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
660
661 FcChar32
662 FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
663
664 const FcCharMap *
665 FcFreeTypeGetPrivateMap (FT_Encoding encoding);
666
667 /* fcfs.c */
668
669 void
670 FcFontSetNewBank (void);
671
672 int
673 FcFontSetNeededBytes (FcFontSet *s);
674
675 int
676 FcFontSetNeededBytesAlign (void);
677
678 void *
679 FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
680
681 FcBool
682 FcFontSetSerialize (int bank, FcFontSet * s);
683
684 FcBool
685 FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr);
686
687 /* fcgram.y */
688 int
689 FcConfigparse (void);
690
691 int
692 FcConfigwrap (void);
693
694 void
695 FcConfigerror (char *fmt, ...);
696
697 char *
698 FcConfigSaveField (const char *field);
699
700 void
701 FcTestDestroy (FcTest *test);
702
703 FcExpr *
704 FcExprCreateInteger (int i);
705
706 FcExpr *
707 FcExprCreateDouble (double d);
708
709 FcExpr *
710 FcExprCreateString (const FcChar8 *s);
711
712 FcExpr *
713 FcExprCreateMatrix (const FcMatrix *m);
714
715 FcExpr *
716 FcExprCreateBool (FcBool b);
717
718 FcExpr *
719 FcExprCreateNil (void);
720
721 FcExpr *
722 FcExprCreateField (const char *field);
723
724 FcExpr *
725 FcExprCreateConst (const FcChar8 *constant);
726
727 FcExpr *
728 FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
729
730 void
731 FcExprDestroy (FcExpr *e);
732
733 void
734 FcEditDestroy (FcEdit *e);
735
736 /* fcinit.c */
737
738 void
739 FcMemReport (void);
740
741 void
742 FcMemAlloc (int kind, int size);
743
744 void
745 FcMemFree (int kind, int size);
746
747 /* fclang.c */
748 FcLangSet *
749 FcFreeTypeLangSet (const FcCharSet *charset,
750 const FcChar8 *exclusiveLang);
751
752 FcLangResult
753 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
754
755 const FcCharSet *
756 FcCharSetForLang (const FcChar8 *lang);
757
758 FcLangSet *
759 FcLangSetPromote (const FcChar8 *lang);
760
761 FcLangSet *
762 FcNameParseLangSet (const FcChar8 *string);
763
764 FcBool
765 FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
766
767 void
768 FcLangSetNewBank (void);
769
770 int
771 FcLangSetNeededBytes (const FcLangSet *l);
772
773 int
774 FcLangSetNeededBytesAlign (void);
775
776 void *
777 FcLangSetDistributeBytes (FcCache * metadata,
778 void * block_ptr);
779
780 FcLangSet *
781 FcLangSetSerialize (int bank, FcLangSet *l);
782
783 void *
784 FcLangSetUnserialize (FcCache * metadata, void *block_ptr);
785
786 /* fclist.c */
787
788 FcBool
789 FcListPatternMatchAny (const FcPattern *p,
790 const FcPattern *font);
791
792 /* fcmatch.c */
793
794 /* fcname.c */
795
796 FcBool
797 FcNameBool (const FcChar8 *v, FcBool *result);
798
799 void *
800 FcObjectDistributeBytes (FcCache * metadata,
801 void * block_ptr);
802
803 FcObjectPtr
804 FcObjectToPtr (const char * si);
805
806 int
807 FcObjectNeededBytes (void);
808
809 int
810 FcObjectNeededBytesAlign (void);
811
812 void *
813 FcObjectUnserialize (FcCache * metadata, void *block_ptr);
814
815 void
816 FcObjectSerialize (void);
817
818 const char *
819 FcObjectPtrU (FcObjectPtr p);
820
821 static __inline__ int
822 FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
823 {
824 return a - b;
825 }
826
827 void
828 FcObjectStaticNameFini (void);
829
830 /* fcpat.c */
831
832 FcValue
833 FcValueCanonicalize (const FcValue *v);
834
835 void
836 FcValueListDestroy (FcValueListPtr l);
837
838 FcPatternElt *
839 FcPatternFindElt (const FcPattern *p, const char *object);
840
841 FcPatternElt *
842 FcPatternInsertElt (FcPattern *p, const char *object);
843
844 FcBool
845 FcPatternAddWithBinding (FcPattern *p,
846 const char *object,
847 FcValue value,
848 FcValueBinding binding,
849 FcBool append);
850
851 FcPattern *
852 FcPatternFreeze (FcPattern *p);
853
854 void
855 FcPatternFini (void);
856
857 FcBool
858 FcPatternAppend (FcPattern *p, FcPattern *s);
859
860 void
861 FcPatternAddFullFname (const FcPattern *p, const char *fname);
862
863 void
864 FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig);
865
866 const FcChar8 *
867 FcStrStaticName (const FcChar8 *name);
868
869 FcChar32
870 FcStringHash (const FcChar8 *s);
871
872 void
873 FcPatternNewBank (void);
874
875 int
876 FcPatternNeededBytes (FcPattern *p);
877
878 int
879 FcPatternNeededBytesAlign (void);
880
881 void *
882 FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
883
884 /* please don't access these outside of fcpat.c! only visible so that
885 * *PtrU can be inlined. */
886 extern FcValueList ** _fcValueLists;
887 extern FcPatternElt ** _fcPatternElts;
888
889 static __inline__ FcValueList *
890 FcValueListPtrU (FcValueListPtr pi)
891 {
892 if (pi.bank == FC_BANK_DYNAMIC)
893 return pi.u.dyn;
894
895 return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat];
896 }
897
898 static __inline__ FcPatternElt *
899 FcPatternEltU (FcPatternEltPtr pei)
900 {
901 if (pei.bank == FC_BANK_DYNAMIC)
902 return pei.u.dyn;
903
904 return &_fcPatternElts[FcCacheBankToIndex(pei.bank)][pei.u.stat];
905 }
906
907 FcPatternElt *
908 FcPatternEltU (FcPatternEltPtr pei);
909
910 FcValueListPtr
911 FcValueListPtrCreateDynamic(FcValueList * p);
912
913 FcPattern *
914 FcPatternSerialize (int bank, FcPattern * p);
915
916 void *
917 FcPatternUnserialize (FcCache * metadata, void *block_ptr);
918
919 /* fcrender.c */
920
921 /* fcmatrix.c */
922
923 extern const FcMatrix FcIdentityMatrix;
924
925 void
926 FcMatrixFree (FcMatrix *mat);
927
928 /* fcstr.c */
929 void
930 FcStrSetSort (FcStrSet * set);
931
932 FcChar8 *
933 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
934
935 void
936 FcStrFree (FcChar8 *s);
937
938 void
939 FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
940
941 void
942 FcStrBufDestroy (FcStrBuf *buf);
943
944 FcChar8 *
945 FcStrBufDone (FcStrBuf *buf);
946
947 FcBool
948 FcStrBufChar (FcStrBuf *buf, FcChar8 c);
949
950 FcBool
951 FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
952
953 FcBool
954 FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
955
956 int
957 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
958
959 const FcChar8 *
960 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
961
962 const FcChar8 *
963 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
964
965 FcBool
966 FcStrUsesHome (const FcChar8 *s);
967
968 FcChar8 *
969 FcStrLastSlash (const FcChar8 *path);
970
971 FcChar32
972 FcStrHashIgnoreCase (const FcChar8 *s);
973
974 #endif /* _FC_INT_H_ */