]> git.wh0rd.org - fontconfig.git/blame - src/fcint.h
Leave cache files mapped permanently.
[fontconfig.git] / src / fcint.h
CommitLineData
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
91fe51b4
PL
28#ifdef HAVE_CONFIG_H
29#include <config.h>
30#endif
31
24330d27
KP
32#include <stdlib.h>
33#include <stdio.h>
dc70c15a
PL
34#ifdef HAVE_INTTYPES_H
35#include <inttypes.h>
91fe51b4 36#elif defined(HAVE_STDINT_H)
7fd7221e 37#include <stdint.h>
91fe51b4
PL
38#else
39#error missing C99 integer data types
dc70c15a 40#endif
24330d27
KP
41#include <string.h>
42#include <ctype.h>
43#include <errno.h>
44#include <unistd.h>
45#include <sys/types.h>
46#include <sys/stat.h>
179c3995 47#include <time.h>
24330d27
KP
48#include <fontconfig/fontconfig.h>
49#include <fontconfig/fcprivate.h>
be094850 50#include <fontconfig/fcfreetype.h>
24330d27 51
24330d27
KP
52#ifndef FC_CONFIG_PATH
53#define FC_CONFIG_PATH "fonts.conf"
54#endif
55
daeed6e0
TL
56#ifdef _WIN32
57#define FC_SEARCH_PATH_SEPARATOR ';'
58#else
59#define FC_SEARCH_PATH_SEPARATOR ':'
60#endif
61
24330d27
KP
62#define FC_DBG_MATCH 1
63#define FC_DBG_MATCHV 2
64#define FC_DBG_EDIT 4
65#define FC_DBG_FONTSET 8
66#define FC_DBG_CACHE 16
67#define FC_DBG_CACHEV 32
68#define FC_DBG_PARSE 64
69#define FC_DBG_SCAN 128
4c003605 70#define FC_DBG_SCANV 256
24330d27 71#define FC_DBG_MEMORY 512
2d9c79c0 72#define FC_DBG_CONFIG 1024
7ce19673 73#define FC_DBG_LANGSET 2048
bc5e487f 74#define FC_DBG_OBJTYPES 4096
24330d27
KP
75
76#define FC_MEM_CHARSET 0
d8d73958 77#define FC_MEM_CHARLEAF 1
24330d27
KP
78#define FC_MEM_FONTSET 2
79#define FC_MEM_FONTPTR 3
80#define FC_MEM_OBJECTSET 4
81#define FC_MEM_OBJECTPTR 5
82#define FC_MEM_MATRIX 6
83#define FC_MEM_PATTERN 7
84#define FC_MEM_PATELT 8
85#define FC_MEM_VALLIST 9
86#define FC_MEM_SUBSTATE 10
87#define FC_MEM_STRING 11
88#define FC_MEM_LISTBUCK 12
d8d73958
KP
89#define FC_MEM_STRSET 13
90#define FC_MEM_STRLIST 14
91#define FC_MEM_CONFIG 15
92#define FC_MEM_LANGSET 16
9dac3c59
KP
93#define FC_MEM_ATOMIC 17
94#define FC_MEM_BLANKS 18
95#define FC_MEM_CACHE 19
96#define FC_MEM_STRBUF 20
97#define FC_MEM_SUBST 21
98#define FC_MEM_OBJECTTYPE 22
99#define FC_MEM_CONSTANT 23
100#define FC_MEM_TEST 24
101#define FC_MEM_EXPR 25
102#define FC_MEM_VSTACK 26
103#define FC_MEM_ATTR 27
104#define FC_MEM_PSTACK 28
1c52c0f0 105#define FC_MEM_STATICSTR 29
d8d73958 106
1c52c0f0 107#define FC_MEM_NUM 30
24330d27 108
1c9fdcca
PL
109#define FC_BANK_DYNAMIC 0
110#define FC_BANK_FIRST 1
82f35f8b
PL
111#define FC_BANK_LANGS 0xfcfcfcfc
112
4984242e
KP
113/* slim_internal.h */
114#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__)
115#define FcPrivate __attribute__((__visibility__("hidden")))
116#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
117#define FcPrivate __hidden
118#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
119#define FcPrivate
120#endif
121
4c003605 122typedef enum _FcValueBinding {
dda7794f 123 FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
4c003605
KP
124} FcValueBinding;
125
7ce19673
KP
126/*
127 * Serialized data structures use only offsets instead of pointers
128 * A low bit of 1 indicates an offset.
129 */
130
131/* Is the provided pointer actually an offset? */
132#define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0)
cd2ec1a9 133
7ce19673
KP
134/* Encode offset in a pointer of type t */
135#define FcOffsetEncode(o,t) ((t *) ((o) | 1))
136
137/* Decode a pointer into an offset */
138#define FcOffsetDecode(p) (((intptr_t) (p)) & ~1)
139
140/* Compute pointer offset */
141#define FcPtrToOffset(b,p) ((intptr_t) (p) - (intptr_t) (b))
142
143/* Given base address, offset and type, return a pointer */
144#define FcOffsetToPtr(b,o,t) ((t *) ((intptr_t) (b) + (o)))
145
146/* Given base address, encoded offset and type, return a pointer */
147#define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t)
cd2ec1a9 148
7ce19673
KP
149/* Given base address, pointer and type, return an encoded offset */
150#define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t)
151
152/* Given a structure, offset member and type, return pointer */
153#define FcOffsetMember(s,m,t) FcOffsetToPtr(s,(s)->m,t)
154
155/* Given a structure, encoded offset member and type, return pointer to member */
156#define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t)
157
158/* Given a structure, member and type, convert the member to a pointer */
159#define FcPointerMember(s,m,t) (FcIsEncodedOffset((s)->m) ? \
160 FcEncodedOffsetMember (s,m,t) : \
161 (s)->m)
162
163/*
164 * Serialized values may hold strings, charsets and langsets as pointers,
165 * unfortunately FcValue is an exposed type so we can't just always use
166 * offsets
167 */
168#define FcValueString(v) FcPointerMember(v,u.s,FcChar8)
169#define FcValueCharSet(v) FcPointerMember(v,u.c,const FcCharSet)
170#define FcValueLangSet(v) FcPointerMember(v,u.l,const FcLangSet)
171
172typedef struct _FcValueList *FcValueListPtr;
173
174typedef struct _FcValueList {
175 struct _FcValueList *next;
176 FcValue value;
177 FcValueBinding binding;
24330d27
KP
178} FcValueList;
179
7ce19673
KP
180#define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList)
181
182typedef int FcObject;
4262e0b3 183
7ce19673 184typedef struct _FcPatternElt *FcPatternEltPtr;
cd2ec1a9 185
7ce19673
KP
186/*
187 * Pattern elts are stuck in a structure connected to the pattern,
188 * so they get moved around when the pattern is resized. Hence, the
189 * values field must be a pointer/offset instead of just an offset
190 */
24330d27 191typedef struct _FcPatternElt {
7ce19673
KP
192 FcObject object;
193 FcValueList *values;
24330d27
KP
194} FcPatternElt;
195
7ce19673
KP
196#define FcPatternEltValues(pe) FcPointerMember(pe,values,FcValueList)
197
24330d27
KP
198struct _FcPattern {
199 int num;
200 int size;
7ce19673 201 intptr_t elts_offset;
e709ddfa 202 int ref;
24330d27
KP
203};
204
7ce19673
KP
205#define FcPatternElts(p) FcOffsetMember(p,elts_offset,FcPatternElt)
206
207#define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *)
c0288648 208
7ce19673 209#define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \
09bd9ae2 210 FcEncodedOffsetToPtr(fs, \
c0288648
KP
211 FcFontSetFonts(fs)[i], \
212 FcPattern) : \
213 fs->fonts[i])
7ce19673 214
24330d27
KP
215typedef enum _FcOp {
216 FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet,
217 FcOpNil,
218 FcOpField, FcOpConst,
219 FcOpAssign, FcOpAssignReplace,
220 FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
221 FcOpQuest,
74a623e0
KP
222 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
223 FcOpContains, FcOpListing, FcOpNotContains,
24330d27
KP
224 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
225 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
3f7653c2
KP
226 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
227 FcOpInvalid
24330d27
KP
228} FcOp;
229
230typedef struct _FcExpr {
231 FcOp op;
232 union {
233 int ival;
234 double dval;
ccb3e93b 235 FcChar8 *sval;
24330d27
KP
236 FcMatrix *mval;
237 FcBool bval;
238 FcCharSet *cval;
7ce19673 239 FcObject object;
ccb3e93b 240 FcChar8 *constant;
24330d27
KP
241 struct {
242 struct _FcExpr *left, *right;
243 } tree;
244 } u;
245} FcExpr;
246
247typedef enum _FcQual {
6f6563ed 248 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst
24330d27
KP
249} FcQual;
250
938bc633
KP
251#define FcMatchDefault ((FcMatchKind) -1)
252
24330d27
KP
253typedef struct _FcTest {
254 struct _FcTest *next;
938bc633 255 FcMatchKind kind;
24330d27 256 FcQual qual;
7ce19673 257 FcObject object;
24330d27
KP
258 FcOp op;
259 FcExpr *expr;
260} FcTest;
261
262typedef struct _FcEdit {
263 struct _FcEdit *next;
7ce19673 264 FcObject object;
24330d27
KP
265 FcOp op;
266 FcExpr *expr;
6fff2cda 267 FcValueBinding binding;
24330d27
KP
268} FcEdit;
269
270typedef struct _FcSubst {
271 struct _FcSubst *next;
272 FcTest *test;
273 FcEdit *edit;
274} FcSubst;
275
20ac65ab 276typedef struct _FcCharLeaf {
24330d27 277 FcChar32 map[256/32];
20ac65ab 278} FcCharLeaf;
24330d27 279
d8d73958 280#define FC_REF_CONSTANT -1
82f4243f 281
24330d27 282struct _FcCharSet {
24330d27 283 int ref; /* reference count */
20ac65ab 284 int num; /* size of leaves and numbers arrays */
7ce19673
KP
285 intptr_t leaves_offset;
286 intptr_t numbers_offset;
24330d27
KP
287};
288
7ce19673
KP
289#define FcCharSetLeaves(c) FcOffsetMember(c,leaves_offset,intptr_t)
290#define FcCharSetLeaf(c,i) (FcOffsetToPtr(FcCharSetLeaves(c), \
291 FcCharSetLeaves(c)[i], \
292 FcCharLeaf))
293#define FcCharSetNumbers(c) FcOffsetMember(c,numbers_offset,FcChar16)
294
179c3995
KP
295struct _FcStrSet {
296 int ref; /* reference count */
297 int num;
298 int size;
4262e0b3 299 FcChar8 **strs;
179c3995
KP
300};
301
302struct _FcStrList {
303 FcStrSet *set;
304 int n;
305};
306
c2e7c611 307typedef struct _FcStrBuf {
24330d27
KP
308 FcChar8 *buf;
309 FcBool allocated;
310 FcBool failed;
311 int len;
312 int size;
c2e7c611 313} FcStrBuf;
24330d27 314
4984242e 315struct _FcCache {
bc5e487f
KP
316 int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
317 int version; /* FC_CACHE_CONTENT_VERSION */
c50ea916 318 intptr_t size; /* size of file */
7ce19673
KP
319 intptr_t dir; /* offset to dir name */
320 intptr_t dirs; /* offset to subdirs */
321 int dirs_count; /* number of subdir strings */
322 intptr_t set; /* offset to font set */
4984242e 323};
212c9f43 324
7ce19673
KP
325#define FcCacheDir(c) FcOffsetMember(c,dir,FcChar8)
326#define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t)
327#define FcCacheSet(c) FcOffsetMember(c,set,FcFontSet)
4984242e
KP
328#define FcCacheSubdir(c,i) FcOffsetToPtr (FcCacheDirs(c),\
329 FcCacheDirs(c)[i], \
bc5e487f 330 FcChar8)
7ce19673
KP
331
332/*
333 * Used while constructing a directory cache object
334 */
335
336#define FC_SERIALIZE_HASH_SIZE 8191
337
338typedef struct _FcSerializeBucket {
339 struct _FcSerializeBucket *next;
340 const void *object;
341 intptr_t offset;
342} FcSerializeBucket;
343
bc5e487f
KP
344typedef struct _FcCharSetFreezer FcCharSetFreezer;
345
7ce19673
KP
346typedef struct _FcSerialize {
347 intptr_t size;
bc5e487f 348 FcCharSetFreezer *cs_freezer;
7ce19673
KP
349 void *linear;
350 FcSerializeBucket *buckets[FC_SERIALIZE_HASH_SIZE];
351} FcSerialize;
352
7769c321
KP
353/*
354 * To map adobe glyph names to unicode values, a precomputed hash
355 * table is used
356 */
357
358typedef struct _FcGlyphName {
359 FcChar32 ucs; /* unicode value */
360 FcChar8 name[1]; /* name extends beyond struct */
361} FcGlyphName;
362
192296d8
KP
363/*
364 * To perform case-insensitive string comparisons, a table
365 * is used which holds three different kinds of folding data.
366 *
367 * The first is a range of upper case values mapping to a range
368 * of their lower case equivalents. Within each range, the offset
369 * between upper and lower case is constant.
370 *
371 * The second is a range of upper case values which are interleaved
372 * with their lower case equivalents.
373 *
374 * The third is a set of raw unicode values mapping to a list
375 * of unicode values for comparison purposes. This allows conversion
376 * of ß to "ss" so that SS, ss and ß all match. A separate array
377 * holds the list of unicode values for each entry.
378 *
379 * These are packed into a single table. Using a binary search,
380 * the appropriate entry can be located.
381 */
382
383#define FC_CASE_FOLD_RANGE 0
384#define FC_CASE_FOLD_EVEN_ODD 1
385#define FC_CASE_FOLD_FULL 2
386
387typedef struct _FcCaseFold {
388 FcChar32 upper;
389 FcChar16 method : 2;
390 FcChar16 count : 14;
391 short offset; /* lower - upper for RANGE, table id for FULL */
392} FcCaseFold;
393
2d9c79c0
KP
394#define FC_MAX_FILE_LEN 4096
395
7ce19673
KP
396/* XXX remove these when we're ready */
397
398#define fc_value_string(v) FcValueString(v)
399#define fc_value_charset(v) FcValueCharSet(v)
400#define fc_value_langset(v) FcValueLangSet(v)
401#define fc_storage_type(v) ((v)->type)
4262e0b3 402
44415a07
PL
403#define fc_alignof(type) offsetof (struct { char c; type member; }, member)
404
bc5e487f
KP
405#define FC_CACHE_MAGIC_MMAP 0xFC02FC04
406#define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
407#define FC_CACHE_CONTENT_VERSION 1
327a7fd4 408
134f6011
KP
409struct _FcAtomic {
410 FcChar8 *file; /* original file name */
411 FcChar8 *new; /* temp file name -- write data here */
412 FcChar8 *lck; /* lockfile name (used for locking) */
413 FcChar8 *tmp; /* tmpfile name (used for locking) */
414};
415
24330d27
KP
416struct _FcBlanks {
417 int nblank;
418 int sblank;
419 FcChar32 *blanks;
420};
421
2d3387fd
KP
422typedef struct _FcCacheList {
423 struct _FcCacheList *next;
424 FcCache *cache;
425} FcCacheList;
426
24330d27
KP
427struct _FcConfig {
428 /*
429 * File names loaded from the configuration -- saved here as the
430 * cache file must be consulted before the directories are scanned,
431 * and those directives may occur in any order
432 */
179c3995 433 FcStrSet *configDirs; /* directories to scan for fonts */
24330d27
KP
434 /*
435 * Set of allowed blank chars -- used to
436 * trim fonts of bogus glyphs
437 */
438 FcBlanks *blanks;
179c3995
KP
439 /*
440 * List of directories containing fonts,
441 * built by recursively scanning the set
442 * of configured directories
443 */
444 FcStrSet *fontDirs;
7410e40b
PL
445 /*
446 * List of directories containing cache files.
447 */
448 FcStrSet *cacheDirs;
24330d27
KP
449 /*
450 * Names of all of the configuration files used
451 * to create this configuration
452 */
179c3995 453 FcStrSet *configFiles; /* config files loaded */
24330d27
KP
454 /*
455 * Substitution instructions for patterns and fonts;
456 * maxObjects is used to allocate appropriate intermediate storage
457 * while performing a whole set of substitutions
458 */
459 FcSubst *substPattern; /* substitutions for patterns */
460 FcSubst *substFont; /* substitutions for fonts */
c2c6976d 461 FcSubst *substScan; /* substitutions for scanned fonts */
24330d27 462 int maxObjects; /* maximum number of tests in all substs */
d47c9d6e
KP
463 /*
464 * List of patterns used to control font file selection
465 */
466 FcStrSet *acceptGlobs;
467 FcStrSet *rejectGlobs;
4f27c1c0
KP
468 FcFontSet *acceptPatterns;
469 FcFontSet *rejectPatterns;
24330d27
KP
470 /*
471 * The set of fonts loaded from the listed directories; the
472 * order within the set does not determine the font selection,
473 * except in the case of identical matches in which case earlier fonts
474 * match preferrentially
475 */
476 FcFontSet *fonts[FcSetApplication + 1];
2d3387fd
KP
477 /*
478 * Font cache information is mapped from cache files
479 * the configuration is destroyed, the files need to be unmapped
480 */
481 FcCacheList *caches;
179c3995
KP
482 /*
483 * Fontconfig can periodically rescan the system configuration
484 * and font directories. This rescanning occurs when font
485 * listing requests are made, but no more often than rescanInterval
486 * seconds apart.
487 */
488 time_t rescanTime; /* last time information was scanned */
489 int rescanInterval; /* interval between scans */
24330d27
KP
490};
491
4984242e 492extern FcPrivate FcConfig *_fcConfig;
6e9fc5de 493
2b25f00c
PL
494typedef struct _FcFileTime {
495 time_t time;
496 FcBool set;
497} FcFileTime;
498
69937bd9
KP
499typedef struct _FcCharMap FcCharMap;
500
44415a07
PL
501/* watch out; assumes that v is void * -PL */
502#define ALIGN(v,type) ((void *)(((uintptr_t)(v) + fc_alignof(type) - 1) & ~(fc_alignof(type) - 1)))
7fd7221e 503
24330d27
KP
504/* fcblanks.c */
505
506/* fccache.c */
507
4984242e 508FcPrivate FcCache *
bc5e487f
KP
509FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
510
4984242e 511FcPrivate FcCache *
bc5e487f
KP
512FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, FcStrSet *dirs);
513
4984242e 514FcPrivate FcBool
bc5e487f
KP
515FcDirCacheWrite (FcCache *cache, FcConfig *config);
516
8fe2104a
KP
517FcPrivate void
518FcCacheFini (void);
519
24330d27
KP
520/* fccfg.c */
521
4984242e 522FcPrivate FcBool
179c3995
KP
523FcConfigAddConfigDir (FcConfig *config,
524 const FcChar8 *d);
525
4984242e 526FcPrivate FcBool
179c3995
KP
527FcConfigAddFontDir (FcConfig *config,
528 const FcChar8 *d);
529
4984242e 530FcPrivate FcBool
ccb3e93b
KP
531FcConfigAddDir (FcConfig *config,
532 const FcChar8 *d);
24330d27 533
4984242e 534FcPrivate FcBool
7410e40b
PL
535FcConfigAddCacheDir (FcConfig *config,
536 const FcChar8 *d);
537
4984242e 538FcPrivate FcBool
ccb3e93b
KP
539FcConfigAddConfigFile (FcConfig *config,
540 const FcChar8 *f);
24330d27 541
4984242e 542FcPrivate FcBool
24330d27
KP
543FcConfigAddBlank (FcConfig *config,
544 FcChar32 blank);
545
4984242e 546FcPrivate FcBool
24330d27
KP
547FcConfigAddEdit (FcConfig *config,
548 FcTest *test,
549 FcEdit *edit,
550 FcMatchKind kind);
551
4984242e 552FcPrivate void
24330d27
KP
553FcConfigSetFonts (FcConfig *config,
554 FcFontSet *fonts,
555 FcSetName set);
556
4984242e 557FcPrivate FcBool
4262e0b3 558FcConfigCompareValue (const FcValue *m,
24330d27 559 FcOp op,
4262e0b3 560 const FcValue *v);
24330d27 561
4984242e 562FcPrivate FcBool
d47c9d6e
KP
563FcConfigGlobAdd (FcConfig *config,
564 const FcChar8 *glob,
565 FcBool accept);
566
4984242e 567FcPrivate FcBool
d47c9d6e
KP
568FcConfigAcceptFilename (FcConfig *config,
569 const FcChar8 *filename);
570
4984242e 571FcPrivate FcBool
4f27c1c0
KP
572FcConfigPatternsAdd (FcConfig *config,
573 FcPattern *pattern,
574 FcBool accept);
575
4984242e 576FcPrivate FcBool
4f27c1c0
KP
577FcConfigAcceptFont (FcConfig *config,
578 const FcPattern *font);
579
4984242e 580FcPrivate FcFileTime
2b25f00c
PL
581FcConfigModifiedTime (FcConfig *config);
582
4984242e 583FcPrivate FcBool
2d3387fd
KP
584FcConfigAddCache (FcConfig *config, FcCache *cache);
585
586/* fcserialize.c */
4984242e 587FcPrivate intptr_t
7ce19673
KP
588FcAlignSize (intptr_t size);
589
4984242e 590FcPrivate FcSerialize *
7ce19673
KP
591FcSerializeCreate (void);
592
4984242e 593FcPrivate void
7ce19673
KP
594FcSerializeDestroy (FcSerialize *serialize);
595
4984242e 596FcPrivate FcBool
7ce19673
KP
597FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
598
4984242e 599FcPrivate intptr_t
7ce19673
KP
600FcSerializeReserve (FcSerialize *serialize, int size);
601
4984242e 602FcPrivate intptr_t
7ce19673
KP
603FcSerializeOffset (FcSerialize *serialize, const void *object);
604
4984242e 605FcPrivate void *
7ce19673
KP
606FcSerializePtr (FcSerialize *serialize, const void *object);
607
4984242e 608FcPrivate FcBool
7ce19673
KP
609FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
610
4984242e 611FcPrivate FcLangSet *
7ce19673
KP
612FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
613
24330d27 614/* fccharset.c */
4984242e 615FcPrivate void
82f35f8b
PL
616FcLangCharSetPopulate (void);
617
4984242e 618FcPrivate FcCharSetFreezer *
18b6857c
KP
619FcCharSetFreezerCreate (void);
620
4984242e 621FcPrivate const FcCharSet *
18b6857c
KP
622FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
623
4984242e 624FcPrivate void
bc5e487f 625FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
34cd0514 626
4984242e 627FcPrivate FcBool
c2e7c611 628FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
24330d27 629
4984242e 630FcPrivate FcCharSet *
24330d27
KP
631FcNameParseCharSet (FcChar8 *string);
632
4984242e 633FcPrivate FcCharLeaf *
c647f6f1 634FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
69937bd9 635
4984242e 636FcPrivate FcBool
7ce19673 637FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
cd2ec1a9 638
4984242e 639FcPrivate FcCharSet *
7ce19673 640FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
cd2ec1a9 641
4984242e 642FcPrivate FcChar16 *
cd2ec1a9
PL
643FcCharSetGetNumbers(const FcCharSet *c);
644
24330d27 645/* fcdbg.c */
4984242e 646FcPrivate void
cd2ec1a9 647FcValueListPrint (const FcValueListPtr l);
24330d27 648
4984242e 649FcPrivate void
793e946c
KP
650FcLangSetPrint (const FcLangSet *ls);
651
4984242e 652FcPrivate void
24330d27
KP
653FcOpPrint (FcOp op);
654
4984242e 655FcPrivate void
938bc633 656FcTestPrint (const FcTest *test);
24330d27 657
4984242e 658FcPrivate void
938bc633 659FcExprPrint (const FcExpr *expr);
24330d27 660
4984242e 661FcPrivate void
938bc633 662FcEditPrint (const FcEdit *edit);
24330d27 663
4984242e 664FcPrivate void
938bc633 665FcSubstPrint (const FcSubst *subst);
24330d27 666
4984242e 667FcPrivate void
7ce19673
KP
668FcCharSetPrint (const FcCharSet *c);
669
4984242e 670extern FcPrivate int FcDebugVal;
b97a34b5 671
4984242e 672#define FcDebug() (FcDebugVal)
b97a34b5 673
4984242e 674FcPrivate void
b97a34b5 675FcInitDebug (void);
24330d27 676
90442681 677/* fcdefault.c */
4984242e 678FcPrivate FcChar8 *
90442681
PL
679FcGetDefaultLang (void);
680
24330d27 681/* fcdir.c */
24330d27 682
4984242e 683FcPrivate FcBool
d47c9d6e
KP
684FcFileScanConfig (FcFontSet *set,
685 FcStrSet *dirs,
d47c9d6e
KP
686 FcBlanks *blanks,
687 const FcChar8 *file,
d47c9d6e
KP
688 FcConfig *config);
689
4984242e 690FcPrivate FcBool
d47c9d6e
KP
691FcDirScanConfig (FcFontSet *set,
692 FcStrSet *dirs,
d47c9d6e 693 FcBlanks *blanks,
bc5e487f 694 const FcChar8 *dir,
d47c9d6e
KP
695 FcBool force,
696 FcConfig *config);
697
24330d27 698/* fcfont.c */
4984242e 699FcPrivate int
24330d27
KP
700FcFontDebug (void);
701
82f4243f 702/* fcfreetype.c */
4984242e 703FcPrivate FcBool
e50b9ae7
KP
704FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
705
4984242e 706FcPrivate FcBool
82f4243f
KP
707FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
708
4984242e 709FcPrivate FcChar32
c647f6f1
KP
710FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
711
4984242e 712FcPrivate FcChar32
c647f6f1
KP
713FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
714
4984242e 715FcPrivate const FcCharMap *
c647f6f1
KP
716FcFreeTypeGetPrivateMap (FT_Encoding encoding);
717
24330d27 718/* fcfs.c */
cd2ec1a9 719
4984242e 720FcPrivate FcBool
7ce19673 721FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
212c9f43 722
4984242e 723FcPrivate FcFontSet *
7ce19673
KP
724FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
725
24330d27 726/* fcgram.y */
4984242e 727FcPrivate int
24330d27
KP
728FcConfigparse (void);
729
4984242e 730FcPrivate int
24330d27
KP
731FcConfigwrap (void);
732
4984242e 733FcPrivate void
24330d27
KP
734FcConfigerror (char *fmt, ...);
735
4984242e 736FcPrivate char *
24330d27
KP
737FcConfigSaveField (const char *field);
738
4984242e 739FcPrivate void
24330d27
KP
740FcTestDestroy (FcTest *test);
741
4984242e 742FcPrivate FcExpr *
24330d27
KP
743FcExprCreateInteger (int i);
744
4984242e 745FcPrivate FcExpr *
24330d27
KP
746FcExprCreateDouble (double d);
747
4984242e 748FcPrivate FcExpr *
ccb3e93b 749FcExprCreateString (const FcChar8 *s);
24330d27 750
4984242e 751FcPrivate FcExpr *
24330d27
KP
752FcExprCreateMatrix (const FcMatrix *m);
753
4984242e 754FcPrivate FcExpr *
24330d27
KP
755FcExprCreateBool (FcBool b);
756
4984242e 757FcPrivate FcExpr *
24330d27
KP
758FcExprCreateNil (void);
759
4984242e 760FcPrivate FcExpr *
24330d27
KP
761FcExprCreateField (const char *field);
762
4984242e 763FcPrivate FcExpr *
ccb3e93b 764FcExprCreateConst (const FcChar8 *constant);
24330d27 765
4984242e 766FcPrivate FcExpr *
24330d27
KP
767FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
768
4984242e 769FcPrivate void
24330d27
KP
770FcExprDestroy (FcExpr *e);
771
4984242e 772FcPrivate void
24330d27
KP
773FcEditDestroy (FcEdit *e);
774
775/* fcinit.c */
776
4984242e 777FcPrivate void
24330d27
KP
778FcMemReport (void);
779
4984242e 780FcPrivate void
24330d27
KP
781FcMemAlloc (int kind, int size);
782
4984242e 783FcPrivate void
24330d27
KP
784FcMemFree (int kind, int size);
785
82f4243f 786/* fclang.c */
4984242e 787FcPrivate FcLangSet *
d8d73958 788FcFreeTypeLangSet (const FcCharSet *charset,
e50b9ae7 789 const FcChar8 *exclusiveLang);
82f4243f 790
4984242e 791FcPrivate FcLangResult
82f4243f
KP
792FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
793
4984242e 794FcPrivate const FcCharSet *
82f4243f
KP
795FcCharSetForLang (const FcChar8 *lang);
796
4984242e 797FcPrivate FcLangSet *
d8d73958
KP
798FcLangSetPromote (const FcChar8 *lang);
799
4984242e 800FcPrivate FcLangSet *
d8d73958
KP
801FcNameParseLangSet (const FcChar8 *string);
802
4984242e 803FcPrivate FcBool
d8d73958
KP
804FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
805
4984242e 806FcPrivate FcChar8 *
f57783d2
KP
807FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
808
24330d27
KP
809/* fclist.c */
810
4984242e 811FcPrivate FcBool
4f27c1c0
KP
812FcListPatternMatchAny (const FcPattern *p,
813 const FcPattern *font);
814
24330d27
KP
815/* fcmatch.c */
816
817/* fcname.c */
24330d27 818
7ce19673
KP
819/*
820 * NOTE -- this ordering is part of the cache file format.
821 * It must also match the ordering in fcname.c
822 */
4262e0b3 823
7ce19673
KP
824#define FC_FAMILY_OBJECT 1
825#define FC_FAMILYLANG_OBJECT 2
826#define FC_STYLE_OBJECT 3
827#define FC_STYLELANG_OBJECT 4
828#define FC_FULLNAME_OBJECT 5
829#define FC_FULLNAMELANG_OBJECT 6
830#define FC_SLANT_OBJECT 7
831#define FC_WEIGHT_OBJECT 8
832#define FC_WIDTH_OBJECT 9
833#define FC_SIZE_OBJECT 10
834#define FC_ASPECT_OBJECT 11
835#define FC_PIXEL_SIZE_OBJECT 12
836#define FC_SPACING_OBJECT 13
837#define FC_FOUNDRY_OBJECT 14
838#define FC_ANTIALIAS_OBJECT 15
839#define FC_HINT_STYLE_OBJECT 16
840#define FC_HINTING_OBJECT 17
841#define FC_VERTICAL_LAYOUT_OBJECT 18
842#define FC_AUTOHINT_OBJECT 19
843#define FC_GLOBAL_ADVANCE_OBJECT 20
844#define FC_FILE_OBJECT 21
845#define FC_INDEX_OBJECT 22
846#define FC_RASTERIZER_OBJECT 23
847#define FC_OUTLINE_OBJECT 24
848#define FC_SCALABLE_OBJECT 25
849#define FC_DPI_OBJECT 26
850#define FC_RGBA_OBJECT 27
851#define FC_SCALE_OBJECT 28
852#define FC_MINSPACE_OBJECT 29
853#define FC_CHAR_WIDTH_OBJECT 30
854#define FC_CHAR_HEIGHT_OBJECT 31
855#define FC_MATRIX_OBJECT 32
856#define FC_CHARSET_OBJECT 33
857#define FC_LANG_OBJECT 34
858#define FC_FONTVERSION_OBJECT 35
859#define FC_CAPABILITY_OBJECT 36
860#define FC_FONTFORMAT_OBJECT 37
861#define FC_EMBOLDEN_OBJECT 38
862#define FC_EMBEDDED_BITMAP_OBJECT 39
c2c6976d 863#define FC_DECORATIVE_OBJECT 40
7f37423d 864
4984242e 865FcPrivate FcBool
7ce19673 866FcNameBool (const FcChar8 *v, FcBool *result);
7fd7221e 867
4984242e 868FcPrivate FcBool
7ce19673 869FcObjectValidType (FcObject object, FcType type);
4262e0b3 870
4984242e 871FcPrivate FcObject
7ce19673 872FcObjectFromName (const char * name);
4262e0b3 873
4984242e 874FcPrivate const char *
7ce19673 875FcObjectName (FcObject object);
7f37423d 876
4984242e 877FcPrivate FcBool
09f9f6f6 878FcObjectInit (void);
7f37423d 879
4984242e 880FcPrivate void
09f9f6f6
KP
881FcObjectFini (void);
882
883#define FcObjectCompare(a, b) ((int) a - (int) b)
4262e0b3 884
24330d27 885/* fcpat.c */
4262e0b3 886
4984242e 887FcPrivate FcValue
4262e0b3
PL
888FcValueCanonicalize (const FcValue *v);
889
4984242e 890FcPrivate void
cd2ec1a9
PL
891FcValueListDestroy (FcValueListPtr l);
892
4984242e 893FcPrivate FcPatternElt *
7ce19673 894FcPatternObjectFindElt (const FcPattern *p, FcObject object);
e9be9cd1 895
4984242e 896FcPrivate FcPatternElt *
7ce19673 897FcPatternObjectInsertElt (FcPattern *p, FcObject object);
24330d27 898
4984242e 899FcPrivate FcBool
7ce19673
KP
900FcPatternObjectAddWithBinding (FcPattern *p,
901 FcObject object,
902 FcValue value,
903 FcValueBinding binding,
904 FcBool append);
82f4243f 905
4984242e 906FcPrivate FcBool
7ce19673
KP
907FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
908
4984242e 909FcPrivate FcBool
7ce19673
KP
910FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
911
4984242e 912FcPrivate FcResult
7ce19673
KP
913FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
914
4984242e 915FcPrivate FcBool
7ce19673 916FcPatternObjectDel (FcPattern *p, FcObject object);
34cd0514 917
4984242e 918FcPrivate FcBool
7ce19673 919FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
4f27c1c0 920
4984242e 921FcPrivate FcBool
7ce19673 922FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
cd2ec1a9 923
4984242e 924FcPrivate FcBool
7ce19673 925FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
cd2ec1a9 926
4984242e 927FcPrivate FcBool
7ce19673 928FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
cd2ec1a9 929
4984242e 930FcPrivate FcBool
7ce19673 931FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
cd2ec1a9 932
4984242e 933FcPrivate FcBool
7ce19673 934FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
7fd7221e 935
4984242e 936FcPrivate FcBool
7ce19673 937FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
cd2ec1a9 938
4984242e 939FcPrivate FcBool
7ce19673
KP
940FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
941
4984242e 942FcPrivate FcResult
7ce19673
KP
943FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
944
4984242e 945FcPrivate FcResult
7ce19673 946FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
9ab79bdf 947
4984242e 948FcPrivate FcResult
7ce19673 949FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
9ab79bdf 950
4984242e 951FcPrivate FcResult
7ce19673 952FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
9ab79bdf 953
4984242e 954FcPrivate FcResult
7ce19673 955FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
9ab79bdf 956
4984242e 957FcPrivate FcResult
7ce19673 958FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
cd2ec1a9 959
4984242e 960FcPrivate FcResult
7ce19673
KP
961FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
962
4984242e 963FcPrivate void
7ce19673
KP
964FcPatternFini (void);
965
4984242e 966FcPrivate FcBool
7ce19673
KP
967FcPatternAppend (FcPattern *p, FcPattern *s);
968
4984242e 969FcPrivate const FcChar8 *
7ce19673
KP
970FcStrStaticName (const FcChar8 *name);
971
4984242e 972FcPrivate FcChar32
7ce19673
KP
973FcStringHash (const FcChar8 *s);
974
4984242e 975FcPrivate FcBool
7ce19673 976FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
cd2ec1a9 977
4984242e 978FcPrivate FcPattern *
7ce19673 979FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
212c9f43 980
4984242e 981FcPrivate FcBool
7ce19673
KP
982FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
983
4984242e 984FcPrivate FcValueList *
7ce19673 985FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
212c9f43 986
24330d27
KP
987/* fcrender.c */
988
989/* fcmatrix.c */
327a7fd4 990
4984242e 991extern FcPrivate const FcMatrix FcIdentityMatrix;
327a7fd4 992
4984242e 993FcPrivate void
24330d27
KP
994FcMatrixFree (FcMatrix *mat);
995
996/* fcstr.c */
4984242e 997FcPrivate void
cd2ec1a9
PL
998FcStrSetSort (FcStrSet * set);
999
4984242e 1000FcPrivate void
c2e7c611
KP
1001FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
1002
4984242e 1003FcPrivate void
c2e7c611
KP
1004FcStrBufDestroy (FcStrBuf *buf);
1005
4984242e 1006FcPrivate FcChar8 *
c2e7c611
KP
1007FcStrBufDone (FcStrBuf *buf);
1008
4984242e 1009FcPrivate FcBool
c2e7c611
KP
1010FcStrBufChar (FcStrBuf *buf, FcChar8 c);
1011
4984242e 1012FcPrivate FcBool
c2e7c611
KP
1013FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
1014
4984242e 1015FcPrivate FcBool
c2e7c611
KP
1016FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
1017
4984242e 1018FcPrivate int
82f4243f
KP
1019FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1020
4984242e 1021FcPrivate const FcChar8 *
11fec41c
KP
1022FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1023
4984242e 1024FcPrivate const FcChar8 *
11fec41c
KP
1025FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1026
4984242e 1027FcPrivate FcBool
ff3f1f98
KP
1028FcStrUsesHome (const FcChar8 *s);
1029
4984242e 1030FcPrivate FcChar8 *
daeed6e0
TL
1031FcStrLastSlash (const FcChar8 *path);
1032
4984242e 1033FcPrivate FcChar32
192296d8
KP
1034FcStrHashIgnoreCase (const FcChar8 *s);
1035
4984242e 1036FcPrivate FcChar8 *
0d9e31c8
KP
1037FcStrCanonFilename (const FcChar8 *s);
1038
4984242e 1039FcPrivate FcBool
7ce19673
KP
1040FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
1041
4984242e 1042FcPrivate FcChar8 *
7ce19673
KP
1043FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
1044
24330d27 1045#endif /* _FC_INT_H_ */