]> git.wh0rd.org - fontconfig.git/blame - src/fcint.h
Hide private functions in shared library. Export functionality for utilities.
[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
24330d27
KP
517/* fccfg.c */
518
4984242e 519FcPrivate FcBool
179c3995
KP
520FcConfigAddConfigDir (FcConfig *config,
521 const FcChar8 *d);
522
4984242e 523FcPrivate FcBool
179c3995
KP
524FcConfigAddFontDir (FcConfig *config,
525 const FcChar8 *d);
526
4984242e 527FcPrivate FcBool
ccb3e93b
KP
528FcConfigAddDir (FcConfig *config,
529 const FcChar8 *d);
24330d27 530
4984242e 531FcPrivate FcBool
7410e40b
PL
532FcConfigAddCacheDir (FcConfig *config,
533 const FcChar8 *d);
534
4984242e 535FcPrivate FcBool
ccb3e93b
KP
536FcConfigAddConfigFile (FcConfig *config,
537 const FcChar8 *f);
24330d27 538
4984242e 539FcPrivate FcBool
24330d27
KP
540FcConfigAddBlank (FcConfig *config,
541 FcChar32 blank);
542
4984242e 543FcPrivate FcBool
24330d27
KP
544FcConfigAddEdit (FcConfig *config,
545 FcTest *test,
546 FcEdit *edit,
547 FcMatchKind kind);
548
4984242e 549FcPrivate void
24330d27
KP
550FcConfigSetFonts (FcConfig *config,
551 FcFontSet *fonts,
552 FcSetName set);
553
4984242e 554FcPrivate FcBool
4262e0b3 555FcConfigCompareValue (const FcValue *m,
24330d27 556 FcOp op,
4262e0b3 557 const FcValue *v);
24330d27 558
4984242e 559FcPrivate FcBool
d47c9d6e
KP
560FcConfigGlobAdd (FcConfig *config,
561 const FcChar8 *glob,
562 FcBool accept);
563
4984242e 564FcPrivate FcBool
d47c9d6e
KP
565FcConfigAcceptFilename (FcConfig *config,
566 const FcChar8 *filename);
567
4984242e 568FcPrivate FcBool
4f27c1c0
KP
569FcConfigPatternsAdd (FcConfig *config,
570 FcPattern *pattern,
571 FcBool accept);
572
4984242e 573FcPrivate FcBool
4f27c1c0
KP
574FcConfigAcceptFont (FcConfig *config,
575 const FcPattern *font);
576
4984242e 577FcPrivate FcFileTime
2b25f00c
PL
578FcConfigModifiedTime (FcConfig *config);
579
4984242e 580FcPrivate FcBool
2d3387fd
KP
581FcConfigAddCache (FcConfig *config, FcCache *cache);
582
583/* fcserialize.c */
4984242e 584FcPrivate intptr_t
7ce19673
KP
585FcAlignSize (intptr_t size);
586
4984242e 587FcPrivate FcSerialize *
7ce19673
KP
588FcSerializeCreate (void);
589
4984242e 590FcPrivate void
7ce19673
KP
591FcSerializeDestroy (FcSerialize *serialize);
592
4984242e 593FcPrivate FcBool
7ce19673
KP
594FcSerializeAlloc (FcSerialize *serialize, const void *object, int size);
595
4984242e 596FcPrivate intptr_t
7ce19673
KP
597FcSerializeReserve (FcSerialize *serialize, int size);
598
4984242e 599FcPrivate intptr_t
7ce19673
KP
600FcSerializeOffset (FcSerialize *serialize, const void *object);
601
4984242e 602FcPrivate void *
7ce19673
KP
603FcSerializePtr (FcSerialize *serialize, const void *object);
604
4984242e 605FcPrivate FcBool
7ce19673
KP
606FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l);
607
4984242e 608FcPrivate FcLangSet *
7ce19673
KP
609FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
610
24330d27 611/* fccharset.c */
4984242e 612FcPrivate void
82f35f8b
PL
613FcLangCharSetPopulate (void);
614
4984242e 615FcPrivate FcCharSetFreezer *
18b6857c
KP
616FcCharSetFreezerCreate (void);
617
4984242e 618FcPrivate const FcCharSet *
18b6857c
KP
619FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs);
620
4984242e 621FcPrivate void
bc5e487f 622FcCharSetFreezerDestroy (FcCharSetFreezer *freezer);
34cd0514 623
4984242e 624FcPrivate FcBool
c2e7c611 625FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
24330d27 626
4984242e 627FcPrivate FcCharSet *
24330d27
KP
628FcNameParseCharSet (FcChar8 *string);
629
4984242e 630FcPrivate FcCharLeaf *
c647f6f1 631FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4);
69937bd9 632
4984242e 633FcPrivate FcBool
7ce19673 634FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs);
cd2ec1a9 635
4984242e 636FcPrivate FcCharSet *
7ce19673 637FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs);
cd2ec1a9 638
4984242e 639FcPrivate FcChar16 *
cd2ec1a9
PL
640FcCharSetGetNumbers(const FcCharSet *c);
641
24330d27 642/* fcdbg.c */
4984242e 643FcPrivate void
cd2ec1a9 644FcValueListPrint (const FcValueListPtr l);
24330d27 645
4984242e 646FcPrivate void
793e946c
KP
647FcLangSetPrint (const FcLangSet *ls);
648
4984242e 649FcPrivate void
24330d27
KP
650FcOpPrint (FcOp op);
651
4984242e 652FcPrivate void
938bc633 653FcTestPrint (const FcTest *test);
24330d27 654
4984242e 655FcPrivate void
938bc633 656FcExprPrint (const FcExpr *expr);
24330d27 657
4984242e 658FcPrivate void
938bc633 659FcEditPrint (const FcEdit *edit);
24330d27 660
4984242e 661FcPrivate void
938bc633 662FcSubstPrint (const FcSubst *subst);
24330d27 663
4984242e 664FcPrivate void
7ce19673
KP
665FcCharSetPrint (const FcCharSet *c);
666
4984242e 667extern FcPrivate int FcDebugVal;
b97a34b5 668
4984242e 669#define FcDebug() (FcDebugVal)
b97a34b5 670
4984242e 671FcPrivate void
b97a34b5 672FcInitDebug (void);
24330d27 673
90442681 674/* fcdefault.c */
4984242e 675FcPrivate FcChar8 *
90442681
PL
676FcGetDefaultLang (void);
677
24330d27 678/* fcdir.c */
24330d27 679
4984242e 680FcPrivate FcBool
d47c9d6e
KP
681FcFileScanConfig (FcFontSet *set,
682 FcStrSet *dirs,
d47c9d6e
KP
683 FcBlanks *blanks,
684 const FcChar8 *file,
d47c9d6e
KP
685 FcConfig *config);
686
4984242e 687FcPrivate FcBool
d47c9d6e
KP
688FcDirScanConfig (FcFontSet *set,
689 FcStrSet *dirs,
d47c9d6e 690 FcBlanks *blanks,
bc5e487f 691 const FcChar8 *dir,
d47c9d6e
KP
692 FcBool force,
693 FcConfig *config);
694
24330d27 695/* fcfont.c */
4984242e 696FcPrivate int
24330d27
KP
697FcFontDebug (void);
698
82f4243f 699/* fcfreetype.c */
4984242e 700FcPrivate FcBool
e50b9ae7
KP
701FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
702
4984242e 703FcPrivate FcBool
82f4243f
KP
704FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
705
4984242e 706FcPrivate FcChar32
c647f6f1
KP
707FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
708
4984242e 709FcPrivate FcChar32
c647f6f1
KP
710FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
711
4984242e 712FcPrivate const FcCharMap *
c647f6f1
KP
713FcFreeTypeGetPrivateMap (FT_Encoding encoding);
714
24330d27 715/* fcfs.c */
cd2ec1a9 716
4984242e 717FcPrivate FcBool
7ce19673 718FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
212c9f43 719
4984242e 720FcPrivate FcFontSet *
7ce19673
KP
721FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
722
24330d27 723/* fcgram.y */
4984242e 724FcPrivate int
24330d27
KP
725FcConfigparse (void);
726
4984242e 727FcPrivate int
24330d27
KP
728FcConfigwrap (void);
729
4984242e 730FcPrivate void
24330d27
KP
731FcConfigerror (char *fmt, ...);
732
4984242e 733FcPrivate char *
24330d27
KP
734FcConfigSaveField (const char *field);
735
4984242e 736FcPrivate void
24330d27
KP
737FcTestDestroy (FcTest *test);
738
4984242e 739FcPrivate FcExpr *
24330d27
KP
740FcExprCreateInteger (int i);
741
4984242e 742FcPrivate FcExpr *
24330d27
KP
743FcExprCreateDouble (double d);
744
4984242e 745FcPrivate FcExpr *
ccb3e93b 746FcExprCreateString (const FcChar8 *s);
24330d27 747
4984242e 748FcPrivate FcExpr *
24330d27
KP
749FcExprCreateMatrix (const FcMatrix *m);
750
4984242e 751FcPrivate FcExpr *
24330d27
KP
752FcExprCreateBool (FcBool b);
753
4984242e 754FcPrivate FcExpr *
24330d27
KP
755FcExprCreateNil (void);
756
4984242e 757FcPrivate FcExpr *
24330d27
KP
758FcExprCreateField (const char *field);
759
4984242e 760FcPrivate FcExpr *
ccb3e93b 761FcExprCreateConst (const FcChar8 *constant);
24330d27 762
4984242e 763FcPrivate FcExpr *
24330d27
KP
764FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right);
765
4984242e 766FcPrivate void
24330d27
KP
767FcExprDestroy (FcExpr *e);
768
4984242e 769FcPrivate void
24330d27
KP
770FcEditDestroy (FcEdit *e);
771
772/* fcinit.c */
773
4984242e 774FcPrivate void
24330d27
KP
775FcMemReport (void);
776
4984242e 777FcPrivate void
24330d27
KP
778FcMemAlloc (int kind, int size);
779
4984242e 780FcPrivate void
24330d27
KP
781FcMemFree (int kind, int size);
782
82f4243f 783/* fclang.c */
4984242e 784FcPrivate FcLangSet *
d8d73958 785FcFreeTypeLangSet (const FcCharSet *charset,
e50b9ae7 786 const FcChar8 *exclusiveLang);
82f4243f 787
4984242e 788FcPrivate FcLangResult
82f4243f
KP
789FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
790
4984242e 791FcPrivate const FcCharSet *
82f4243f
KP
792FcCharSetForLang (const FcChar8 *lang);
793
4984242e 794FcPrivate FcLangSet *
d8d73958
KP
795FcLangSetPromote (const FcChar8 *lang);
796
4984242e 797FcPrivate FcLangSet *
d8d73958
KP
798FcNameParseLangSet (const FcChar8 *string);
799
4984242e 800FcPrivate FcBool
d8d73958
KP
801FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
802
4984242e 803FcPrivate FcChar8 *
f57783d2
KP
804FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
805
24330d27
KP
806/* fclist.c */
807
4984242e 808FcPrivate FcBool
4f27c1c0
KP
809FcListPatternMatchAny (const FcPattern *p,
810 const FcPattern *font);
811
24330d27
KP
812/* fcmatch.c */
813
814/* fcname.c */
24330d27 815
7ce19673
KP
816/*
817 * NOTE -- this ordering is part of the cache file format.
818 * It must also match the ordering in fcname.c
819 */
4262e0b3 820
7ce19673
KP
821#define FC_FAMILY_OBJECT 1
822#define FC_FAMILYLANG_OBJECT 2
823#define FC_STYLE_OBJECT 3
824#define FC_STYLELANG_OBJECT 4
825#define FC_FULLNAME_OBJECT 5
826#define FC_FULLNAMELANG_OBJECT 6
827#define FC_SLANT_OBJECT 7
828#define FC_WEIGHT_OBJECT 8
829#define FC_WIDTH_OBJECT 9
830#define FC_SIZE_OBJECT 10
831#define FC_ASPECT_OBJECT 11
832#define FC_PIXEL_SIZE_OBJECT 12
833#define FC_SPACING_OBJECT 13
834#define FC_FOUNDRY_OBJECT 14
835#define FC_ANTIALIAS_OBJECT 15
836#define FC_HINT_STYLE_OBJECT 16
837#define FC_HINTING_OBJECT 17
838#define FC_VERTICAL_LAYOUT_OBJECT 18
839#define FC_AUTOHINT_OBJECT 19
840#define FC_GLOBAL_ADVANCE_OBJECT 20
841#define FC_FILE_OBJECT 21
842#define FC_INDEX_OBJECT 22
843#define FC_RASTERIZER_OBJECT 23
844#define FC_OUTLINE_OBJECT 24
845#define FC_SCALABLE_OBJECT 25
846#define FC_DPI_OBJECT 26
847#define FC_RGBA_OBJECT 27
848#define FC_SCALE_OBJECT 28
849#define FC_MINSPACE_OBJECT 29
850#define FC_CHAR_WIDTH_OBJECT 30
851#define FC_CHAR_HEIGHT_OBJECT 31
852#define FC_MATRIX_OBJECT 32
853#define FC_CHARSET_OBJECT 33
854#define FC_LANG_OBJECT 34
855#define FC_FONTVERSION_OBJECT 35
856#define FC_CAPABILITY_OBJECT 36
857#define FC_FONTFORMAT_OBJECT 37
858#define FC_EMBOLDEN_OBJECT 38
859#define FC_EMBEDDED_BITMAP_OBJECT 39
c2c6976d 860#define FC_DECORATIVE_OBJECT 40
7f37423d 861
4984242e 862FcPrivate FcBool
7ce19673 863FcNameBool (const FcChar8 *v, FcBool *result);
7fd7221e 864
4984242e 865FcPrivate FcBool
7ce19673 866FcObjectValidType (FcObject object, FcType type);
4262e0b3 867
4984242e 868FcPrivate FcObject
7ce19673 869FcObjectFromName (const char * name);
4262e0b3 870
4984242e 871FcPrivate const char *
7ce19673 872FcObjectName (FcObject object);
7f37423d 873
4984242e 874FcPrivate FcBool
09f9f6f6 875FcObjectInit (void);
7f37423d 876
4984242e 877FcPrivate void
09f9f6f6
KP
878FcObjectFini (void);
879
880#define FcObjectCompare(a, b) ((int) a - (int) b)
4262e0b3 881
24330d27 882/* fcpat.c */
4262e0b3 883
4984242e 884FcPrivate FcValue
4262e0b3
PL
885FcValueCanonicalize (const FcValue *v);
886
4984242e 887FcPrivate void
cd2ec1a9
PL
888FcValueListDestroy (FcValueListPtr l);
889
4984242e 890FcPrivate FcPatternElt *
7ce19673 891FcPatternObjectFindElt (const FcPattern *p, FcObject object);
e9be9cd1 892
4984242e 893FcPrivate FcPatternElt *
7ce19673 894FcPatternObjectInsertElt (FcPattern *p, FcObject object);
24330d27 895
4984242e 896FcPrivate FcBool
7ce19673
KP
897FcPatternObjectAddWithBinding (FcPattern *p,
898 FcObject object,
899 FcValue value,
900 FcValueBinding binding,
901 FcBool append);
82f4243f 902
4984242e 903FcPrivate FcBool
7ce19673
KP
904FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
905
4984242e 906FcPrivate FcBool
7ce19673
KP
907FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
908
4984242e 909FcPrivate FcResult
7ce19673
KP
910FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
911
4984242e 912FcPrivate FcBool
7ce19673 913FcPatternObjectDel (FcPattern *p, FcObject object);
34cd0514 914
4984242e 915FcPrivate FcBool
7ce19673 916FcPatternObjectRemove (FcPattern *p, FcObject object, int id);
4f27c1c0 917
4984242e 918FcPrivate FcBool
7ce19673 919FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i);
cd2ec1a9 920
4984242e 921FcPrivate FcBool
7ce19673 922FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d);
cd2ec1a9 923
4984242e 924FcPrivate FcBool
7ce19673 925FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s);
cd2ec1a9 926
4984242e 927FcPrivate FcBool
7ce19673 928FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s);
cd2ec1a9 929
4984242e 930FcPrivate FcBool
7ce19673 931FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c);
7fd7221e 932
4984242e 933FcPrivate FcBool
7ce19673 934FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
cd2ec1a9 935
4984242e 936FcPrivate FcBool
7ce19673
KP
937FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
938
4984242e 939FcPrivate FcResult
7ce19673
KP
940FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
941
4984242e 942FcPrivate FcResult
7ce19673 943FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d);
9ab79bdf 944
4984242e 945FcPrivate FcResult
7ce19673 946FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s);
9ab79bdf 947
4984242e 948FcPrivate FcResult
7ce19673 949FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s);
9ab79bdf 950
4984242e 951FcPrivate FcResult
7ce19673 952FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c);
9ab79bdf 953
4984242e 954FcPrivate FcResult
7ce19673 955FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
cd2ec1a9 956
4984242e 957FcPrivate FcResult
7ce19673
KP
958FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
959
4984242e 960FcPrivate void
7ce19673
KP
961FcPatternFini (void);
962
4984242e 963FcPrivate FcBool
7ce19673
KP
964FcPatternAppend (FcPattern *p, FcPattern *s);
965
4984242e 966FcPrivate const FcChar8 *
7ce19673
KP
967FcStrStaticName (const FcChar8 *name);
968
4984242e 969FcPrivate FcChar32
7ce19673
KP
970FcStringHash (const FcChar8 *s);
971
4984242e 972FcPrivate FcBool
7ce19673 973FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat);
cd2ec1a9 974
4984242e 975FcPrivate FcPattern *
7ce19673 976FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat);
212c9f43 977
4984242e 978FcPrivate FcBool
7ce19673
KP
979FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat);
980
4984242e 981FcPrivate FcValueList *
7ce19673 982FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat);
212c9f43 983
24330d27
KP
984/* fcrender.c */
985
986/* fcmatrix.c */
327a7fd4 987
4984242e 988extern FcPrivate const FcMatrix FcIdentityMatrix;
327a7fd4 989
4984242e 990FcPrivate void
24330d27
KP
991FcMatrixFree (FcMatrix *mat);
992
993/* fcstr.c */
4984242e 994FcPrivate void
cd2ec1a9
PL
995FcStrSetSort (FcStrSet * set);
996
4984242e 997FcPrivate void
c2e7c611
KP
998FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size);
999
4984242e 1000FcPrivate void
c2e7c611
KP
1001FcStrBufDestroy (FcStrBuf *buf);
1002
4984242e 1003FcPrivate FcChar8 *
c2e7c611
KP
1004FcStrBufDone (FcStrBuf *buf);
1005
4984242e 1006FcPrivate FcBool
c2e7c611
KP
1007FcStrBufChar (FcStrBuf *buf, FcChar8 c);
1008
4984242e 1009FcPrivate FcBool
c2e7c611
KP
1010FcStrBufString (FcStrBuf *buf, const FcChar8 *s);
1011
4984242e 1012FcPrivate FcBool
c2e7c611
KP
1013FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
1014
4984242e 1015FcPrivate int
82f4243f
KP
1016FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1017
4984242e 1018FcPrivate const FcChar8 *
11fec41c
KP
1019FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
1020
4984242e 1021FcPrivate const FcChar8 *
11fec41c
KP
1022FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
1023
4984242e 1024FcPrivate FcBool
ff3f1f98
KP
1025FcStrUsesHome (const FcChar8 *s);
1026
4984242e 1027FcPrivate FcChar8 *
daeed6e0
TL
1028FcStrLastSlash (const FcChar8 *path);
1029
4984242e 1030FcPrivate FcChar32
192296d8
KP
1031FcStrHashIgnoreCase (const FcChar8 *s);
1032
4984242e 1033FcPrivate FcChar8 *
0d9e31c8
KP
1034FcStrCanonFilename (const FcChar8 *s);
1035
4984242e 1036FcPrivate FcBool
7ce19673
KP
1037FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str);
1038
4984242e 1039FcPrivate FcChar8 *
7ce19673
KP
1040FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
1041
24330d27 1042#endif /* _FC_INT_H_ */