]> git.wh0rd.org - fontconfig.git/blob - src/fcint.h
Remove stuff we don't use, make get_{char,short,long} functions of ftglue
[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 #ifdef HAVE_INTTYPES_H
31 #include <inttypes.h>
32 #else
33 #include <stdint.h>
34 #endif
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>
41 #include <time.h>
42 #include <fontconfig/fontconfig.h>
43 #include <fontconfig/fcprivate.h>
44 #include <fontconfig/fcfreetype.h>
45 #ifdef HAVE_CONFIG_H
46 #include <config.h>
47 #endif
48
49 #ifndef FC_CONFIG_PATH
50 #define FC_CONFIG_PATH "fonts.conf"
51 #endif
52
53 #define FC_FONT_FILE_INVALID ((FcChar8 *) ".")
54 #define FC_FONT_FILE_DIR ((FcChar8 *) ".dir")
55 #define FC_GLOBAL_MAGIC_COOKIE "GLOBAL"
56
57 #ifdef _WIN32
58 #define FC_SEARCH_PATH_SEPARATOR ';'
59 #else
60 #define FC_SEARCH_PATH_SEPARATOR ':'
61 #endif
62
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
71 #define FC_DBG_SCANV 256
72 #define FC_DBG_MEMORY 512
73 #define FC_DBG_CONFIG 1024
74
75 #define FC_MEM_CHARSET 0
76 #define FC_MEM_CHARLEAF 1
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
88 #define FC_MEM_STRSET 13
89 #define FC_MEM_STRLIST 14
90 #define FC_MEM_CONFIG 15
91 #define FC_MEM_LANGSET 16
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
104 #define FC_MEM_STATICSTR 29
105
106 #define FC_MEM_NUM 30
107
108 #define FC_BANK_DYNAMIC 0
109 #define FC_BANK_FIRST 1
110 #define FC_BANK_LANGS 0xfcfcfcfc
111
112 typedef enum _FcValueBinding {
113 FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
114 } FcValueBinding;
115
116 typedef struct _FcValueListPtr {
117 int bank;
118 union {
119 int stat;
120 struct _FcValueList *dyn;
121 } u;
122 } FcValueListPtr;
123
124 typedef struct _FcValueList {
125 FcValueListPtr next;
126
127 FcValue value;
128 FcValueBinding binding;
129 } FcValueList;
130
131 typedef int FcObjectPtr;
132
133 typedef struct _FcPatternEltPtr {
134 int bank;
135 union {
136 int stat;
137 struct _FcPatternElt *dyn;
138 } u;
139 } FcPatternEltPtr;
140
141 typedef struct _FcPatternElt {
142 FcObjectPtr object;
143 FcValueListPtr values;
144 } FcPatternElt;
145
146 struct _FcPattern {
147 int num;
148 int size;
149 FcPatternEltPtr elts;
150 int ref;
151 int bank;
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,
161 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
162 FcOpContains, FcOpListing, FcOpNotContains,
163 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
164 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
165 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
166 FcOpInvalid
167 } FcOp;
168
169 typedef struct _FcExpr {
170 FcOp op;
171 union {
172 int ival;
173 double dval;
174 FcChar8 *sval;
175 FcMatrix *mval;
176 FcBool bval;
177 FcCharSet *cval;
178 char *field;
179 FcChar8 *constant;
180 struct {
181 struct _FcExpr *left, *right;
182 } tree;
183 } u;
184 } FcExpr;
185
186 typedef enum _FcQual {
187 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
188 } FcQual;
189
190 #define FcMatchDefault ((FcMatchKind) -1)
191
192 typedef struct _FcTest {
193 struct _FcTest *next;
194 FcMatchKind kind;
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;
206 FcValueBinding binding;
207 } FcEdit;
208
209 typedef struct _FcSubst {
210 struct _FcSubst *next;
211 FcTest *test;
212 FcEdit *edit;
213 } FcSubst;
214
215 typedef struct _FcCharLeaf {
216 FcChar32 map[256/32];
217 } FcCharLeaf;
218
219 #define FC_REF_CONSTANT -1
220
221 struct _FcCharSet {
222 int ref; /* reference count */
223 int num; /* size of leaves and numbers arrays */
224 int bank;
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;
235 };
236
237 struct _FcStrSet {
238 int ref; /* reference count */
239 int num;
240 int size;
241 FcChar8 **strs;
242 };
243
244 struct _FcStrList {
245 FcStrSet *set;
246 int n;
247 };
248
249 typedef struct _FcStrBuf {
250 FcChar8 *buf;
251 FcBool allocated;
252 FcBool failed;
253 int len;
254 int size;
255 } FcStrBuf;
256
257 typedef struct _FcCache {
258 int magic; /* FC_CACHE_MAGIC */
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 */
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;
268 int charset_leaf_count;
269 int charset_leaf_idx_count;
270 } FcCache;
271
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
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
313 #define FC_MAX_FILE_LEN 4096
314
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)
319 #define fc_storage_type(v) ((v)->type & ~FC_STORAGE_STATIC)
320
321 /*
322 * The per-user ~/.fonts.cache-<version> file is loaded into
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
331 #define FC_CACHE_MAGIC 0xFC02FC03
332
333 typedef struct _FcGlobalCacheDir FcGlobalCacheDir;
334
335 enum FcGCDirState {
336 FcGCDirDisabled, FcGCDirFileRead, FcGCDirConsumed, FcGCDirUpdated
337 };
338 struct _FcGlobalCacheDir {
339 struct _FcGlobalCacheDir *next;
340 char *name;
341 FcCache metadata;
342 off_t offset;
343 FcStrSet *subdirs;
344 void *ent;
345 enum FcGCDirState state;
346 };
347
348 typedef struct _FcGlobalCache {
349 FcGlobalCacheDir *dirs;
350 FcBool updated;
351 int fd;
352 } FcGlobalCache;
353
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
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 */
373 FcStrSet *configDirs; /* directories to scan for fonts */
374 FcChar8 *cache; /* name of per-user cache file */
375 /*
376 * Set of allowed blank chars -- used to
377 * trim fonts of bogus glyphs
378 */
379 FcBlanks *blanks;
380 /*
381 * List of directories containing fonts,
382 * built by recursively scanning the set
383 * of configured directories
384 */
385 FcStrSet *fontDirs;
386 /*
387 * Names of all of the configuration files used
388 * to create this configuration
389 */
390 FcStrSet *configFiles; /* config files loaded */
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 */
399 /*
400 * List of patterns used to control font file selection
401 */
402 FcStrSet *acceptGlobs;
403 FcStrSet *rejectGlobs;
404 FcFontSet *acceptPatterns;
405 FcFontSet *rejectPatterns;
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];
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 */
421 };
422
423 extern FcConfig *_fcConfig;
424
425 typedef struct _FcFileTime {
426 time_t time;
427 FcBool set;
428 } FcFileTime;
429
430 typedef struct _FcCharMap FcCharMap;
431
432 #define ALIGN(v,type) ((__typeof__(v))(((uintptr_t)(v) + __alignof__(type) - 1) & ~(__alignof__(type) - 1)))
433
434 /* fcblanks.c */
435
436 /* fccache.c */
437
438 FcGlobalCache *
439 FcGlobalCacheCreate (void);
440
441 void
442 FcGlobalCacheDestroy (FcGlobalCache *cache);
443
444 FcBool
445 FcGlobalCacheReadDir (FcFontSet *set,
446 FcStrSet *dirs,
447 FcGlobalCache *cache,
448 const char *dir,
449 FcConfig *config);
450
451 void
452 FcGlobalCacheLoad (FcGlobalCache *cache,
453 FcStrSet *staleDirs,
454 const FcChar8 *cache_file,
455 FcConfig *config);
456
457 FcBool
458 FcGlobalCacheUpdate (FcGlobalCache *cache,
459 FcStrSet *dirs,
460 const char *file,
461 FcFontSet *set,
462 FcConfig *config);
463
464 FcBool
465 FcGlobalCacheSave (FcGlobalCache *cache,
466 const FcChar8 *cache_file,
467 FcConfig *config);
468
469 FcFontSet *
470 FcCacheRead (FcConfig *config, FcGlobalCache * cache);
471
472 FcBool
473 FcDirCacheWrite (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir);
474
475 FcBool
476 FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
477
478 extern int *_fcBankId, *_fcBankIdx;
479 int
480 FcCacheBankToIndexMTF (int bank);
481
482 static __inline__ int
483 FcCacheBankToIndex (int bank)
484 {
485 return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
486 }
487
488 const char *
489 FcCacheFindBankDir (int bank);
490
491 /* fccfg.c */
492
493 FcBool
494 FcConfigAddConfigDir (FcConfig *config,
495 const FcChar8 *d);
496
497 FcBool
498 FcConfigAddFontDir (FcConfig *config,
499 const FcChar8 *d);
500
501 FcBool
502 FcConfigAddDir (FcConfig *config,
503 const FcChar8 *d);
504
505 FcBool
506 FcConfigAddConfigFile (FcConfig *config,
507 const FcChar8 *f);
508
509 FcBool
510 FcConfigSetCache (FcConfig *config,
511 const FcChar8 *c);
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
529 FcConfigCompareValue (const FcValue *m,
530 FcOp op,
531 const FcValue *v);
532
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
542 FcBool
543 FcConfigPatternsAdd (FcConfig *config,
544 FcPattern *pattern,
545 FcBool accept);
546
547 FcBool
548 FcConfigAcceptFont (FcConfig *config,
549 const FcPattern *font);
550
551 FcFileTime
552 FcConfigModifiedTime (FcConfig *config);
553
554 /* fccharset.c */
555 void
556 FcLangCharSetPopulate (void);
557
558 FcCharSet *
559 FcCharSetFreeze (FcCharSet *cs);
560
561 void
562 FcCharSetThawAll (void);
563
564 FcBool
565 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
566
567 FcCharSet *
568 FcNameParseCharSet (FcChar8 *string);
569
570 FcCharLeaf *
571 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
572
573 void
574 FcCharSetNewBank (void);
575
576 int
577 FcCharSetNeededBytes (const FcCharSet *c);
578
579 int
580 FcCharSetNeededBytesAlign (void);
581
582 void *
583 FcCharSetDistributeBytes (FcCache * metadata,
584 void * block_ptr);
585
586 FcCharSet *
587 FcCharSetSerialize(int bank, FcCharSet *c);
588
589 void *
590 FcCharSetUnserialize (FcCache * metadata, void *block_ptr);
591
592 FcCharLeaf *
593 FcCharSetGetLeaf(const FcCharSet *c, int i);
594
595 FcChar16 *
596 FcCharSetGetNumbers(const FcCharSet *c);
597
598 /* fcdbg.c */
599 void
600 FcValueListPrint (const FcValueListPtr l);
601
602 void
603 FcLangSetPrint (const FcLangSet *ls);
604
605 void
606 FcOpPrint (FcOp op);
607
608 void
609 FcTestPrint (const FcTest *test);
610
611 void
612 FcExprPrint (const FcExpr *expr);
613
614 void
615 FcEditPrint (const FcEdit *edit);
616
617 void
618 FcSubstPrint (const FcSubst *subst);
619
620 extern int FcDebugVal;
621
622 static __inline__ int
623 FcDebug (void) { return FcDebugVal; }
624
625 void
626 FcInitDebug (void);
627
628 /* fcdefault.c */
629 FcChar8 *
630 FcGetDefaultLang (void);
631
632 /* fcdir.c */
633
634 FcBool
635 FcFileIsDir (const FcChar8 *file);
636
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
655 /* fcfont.c */
656 int
657 FcFontDebug (void);
658
659 /* fcfreetype.c */
660 FcBool
661 FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
662
663 FcBool
664 FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
665
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
675 /* fcfs.c */
676
677 void
678 FcFontSetNewBank (void);
679
680 int
681 FcFontSetNeededBytes (FcFontSet *s);
682
683 int
684 FcFontSetNeededBytesAlign (void);
685
686 void *
687 FcFontSetDistributeBytes (FcCache * metadata, void * block_ptr);
688
689 FcBool
690 FcFontSetSerialize (int bank, FcFontSet * s);
691
692 FcBool
693 FcFontSetUnserialize(FcCache * metadata, FcFontSet * s, void * block_ptr);
694
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
708 void
709 FcTestDestroy (FcTest *test);
710
711 FcExpr *
712 FcExprCreateInteger (int i);
713
714 FcExpr *
715 FcExprCreateDouble (double d);
716
717 FcExpr *
718 FcExprCreateString (const FcChar8 *s);
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 *
733 FcExprCreateConst (const FcChar8 *constant);
734
735 FcExpr *
736 FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
737
738 void
739 FcExprDestroy (FcExpr *e);
740
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
755 /* fclang.c */
756 FcLangSet *
757 FcFreeTypeLangSet (const FcCharSet *charset,
758 const FcChar8 *exclusiveLang);
759
760 FcLangResult
761 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
762
763 const FcCharSet *
764 FcCharSetForLang (const FcChar8 *lang);
765
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
775 void
776 FcLangSetNewBank (void);
777
778 int
779 FcLangSetNeededBytes (const FcLangSet *l);
780
781 int
782 FcLangSetNeededBytesAlign (void);
783
784 void *
785 FcLangSetDistributeBytes (FcCache * metadata,
786 void * block_ptr);
787
788 FcLangSet *
789 FcLangSetSerialize (int bank, FcLangSet *l);
790
791 void *
792 FcLangSetUnserialize (FcCache * metadata, void *block_ptr);
793
794 /* fclist.c */
795
796 FcBool
797 FcListPatternMatchAny (const FcPattern *p,
798 const FcPattern *font);
799
800 /* fcmatch.c */
801
802 /* fcname.c */
803
804 FcBool
805 FcNameBool (const FcChar8 *v, FcBool *result);
806
807 void *
808 FcObjectDistributeBytes (FcCache * metadata,
809 void * block_ptr);
810
811 FcObjectPtr
812 FcObjectToPtr (const char * si);
813
814 int
815 FcObjectNeededBytes (void);
816
817 int
818 FcObjectNeededBytesAlign (void);
819
820 void *
821 FcObjectUnserialize (FcCache * metadata, void *block_ptr);
822
823 void
824 FcObjectSerialize (void);
825
826 const char *
827 FcObjectPtrU (FcObjectPtr p);
828
829 static __inline__ int
830 FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
831 {
832 return a - b;
833 }
834
835 void
836 FcObjectStaticNameFini (void);
837
838 /* fcpat.c */
839
840 FcValue
841 FcValueCanonicalize (const FcValue *v);
842
843 void
844 FcValueListDestroy (FcValueListPtr l);
845
846 FcPatternElt *
847 FcPatternFindElt (const FcPattern *p, const char *object);
848
849 FcPatternElt *
850 FcPatternInsertElt (FcPattern *p, const char *object);
851
852 FcBool
853 FcPatternAddWithBinding (FcPattern *p,
854 const char *object,
855 FcValue value,
856 FcValueBinding binding,
857 FcBool append);
858
859 FcPattern *
860 FcPatternFreeze (FcPattern *p);
861
862 void
863 FcPatternFini (void);
864
865 FcBool
866 FcPatternAppend (FcPattern *p, FcPattern *s);
867
868 void
869 FcPatternAddFullFname (const FcPattern *p, const char *fname);
870
871 void
872 FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig);
873
874 const FcChar8 *
875 FcStrStaticName (const FcChar8 *name);
876
877 FcChar32
878 FcStringHash (const FcChar8 *s);
879
880 void
881 FcPatternNewBank (void);
882
883 int
884 FcPatternNeededBytes (FcPattern *p);
885
886 int
887 FcPatternNeededBytesAlign (void);
888
889 void *
890 FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
891
892 /* please don't access these outside of fcpat.c! only visible so that
893 * *PtrU can be inlined. */
894 extern FcValueList ** _fcValueLists;
895 extern FcPatternElt ** _fcPatternElts;
896
897 static __inline__ FcValueList *
898 FcValueListPtrU (FcValueListPtr pi)
899 {
900 if (pi.bank == FC_BANK_DYNAMIC)
901 return pi.u.dyn;
902
903 return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat];
904 }
905
906 static __inline__ FcPatternElt *
907 FcPatternEltU (FcPatternEltPtr pei)
908 {
909 if (pei.bank == FC_BANK_DYNAMIC)
910 return pei.u.dyn;
911
912 return &_fcPatternElts[FcCacheBankToIndex(pei.bank)][pei.u.stat];
913 }
914
915 FcValueListPtr
916 FcValueListPtrCreateDynamic(FcValueList * p);
917
918 FcPattern *
919 FcPatternSerialize (int bank, FcPattern * p);
920
921 void *
922 FcPatternUnserialize (FcCache * metadata, void *block_ptr);
923
924 /* fcrender.c */
925
926 /* fcmatrix.c */
927
928 extern const FcMatrix FcIdentityMatrix;
929
930 void
931 FcMatrixFree (FcMatrix *mat);
932
933 /* fcstr.c */
934 void
935 FcStrSetSort (FcStrSet * set);
936
937 FcChar8 *
938 FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
939
940 void
941 FcStrFree (FcChar8 *s);
942
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
961 int
962 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
963
964 const FcChar8 *
965 FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
966
967 const FcChar8 *
968 FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
969
970 FcBool
971 FcStrUsesHome (const FcChar8 *s);
972
973 FcChar8 *
974 FcStrLastSlash (const FcChar8 *path);
975
976 FcChar32
977 FcStrHashIgnoreCase (const FcChar8 *s);
978
979 #endif /* _FC_INT_H_ */