1/* 2 * fontconfig/src/fcint.h 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 the author(s) not be used in 11 * advertising or publicity pertaining to distribution of the software without 12 * specific, written prior permission. The authors make 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 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 18 * EVENT SHALL THE AUTHOR(S) 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#ifdef HAVE_CONFIG_H 29#include <config.h> 30#endif 31 32#include "fcstdint.h" 33 34#include <stdlib.h> 35#include <stdio.h> 36#include <string.h> 37#include <ctype.h> 38#include <assert.h> 39#include <errno.h> 40#include <limits.h> 41#include <float.h> 42#include <math.h> 43#ifdef HAVE_UNISTD_H 44#include <unistd.h> 45#endif 46#include <stddef.h> 47#include <sys/types.h> 48#include <sys/stat.h> 49#include <time.h> 50#include <fontconfig/fontconfig.h> 51#include <fontconfig/fcprivate.h> 52#include "fcdeprecate.h" 53#include "fcmutex.h" 54#include "fcatomic.h" 55 56#ifndef FC_CONFIG_PATH 57#define FC_CONFIG_PATH "fonts.conf" 58#endif 59 60#ifdef _WIN32 61#define FC_LIKELY(expr) (expr) 62#define FC_UNLIKELY(expr) (expr) 63#else 64#define FC_LIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 1)) 65#define FC_UNLIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 0)) 66#endif 67 68#ifdef _WIN32 69# include "fcwindows.h" 70typedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT); 71typedef HRESULT (WINAPI *pfnSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR); 72extern pfnGetSystemWindowsDirectory pGetSystemWindowsDirectory; 73extern pfnSHGetFolderPathA pSHGetFolderPathA; 74# define FC_SEARCH_PATH_SEPARATOR ';' 75# define FC_DIR_SEPARATOR '\\' 76# define FC_DIR_SEPARATOR_S "\\" 77#else 78# define FC_SEARCH_PATH_SEPARATOR ':' 79# define FC_DIR_SEPARATOR '/' 80# define FC_DIR_SEPARATOR_S "/" 81#endif 82 83#ifdef PATH_MAX 84#define FC_PATH_MAX PATH_MAX 85#else 86#define FC_PATH_MAX 128 87#endif 88 89/* 90 * SCO OpenServer 5.0.7/3.2 has no MAXPATHLEN, but it has PATH_MAX (256). 91 * in limits.h. PATH_MAX is defined alternatively under non-OpenServer OS, 92 * and it is used in dirname.c of bmake. 93 */ 94#if !defined(PATH_MAX) 95#if defined(_SCO_DS) 96#define PATH_MAX 1024 97#endif 98#endif 99 100#if __GNUC__ >= 4 101#define FC_UNUSED __attribute__((unused)) 102#else 103#define FC_UNUSED 104#endif 105 106#ifndef FC_UINT64_FORMAT 107#define FC_UINT64_FORMAT "llu" 108#endif 109 110#define FC_DBG_MATCH 1 111#define FC_DBG_MATCHV 2 112#define FC_DBG_EDIT 4 113#define FC_DBG_FONTSET 8 114#define FC_DBG_CACHE 16 115#define FC_DBG_CACHEV 32 116#define FC_DBG_PARSE 64 117#define FC_DBG_SCAN 128 118#define FC_DBG_SCANV 256 119#define FC_DBG_CONFIG 1024 120#define FC_DBG_LANGSET 2048 121#define FC_DBG_MATCH2 4096 122 123#define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1] FC_UNUSED 124#define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond)) 125#define FC_ASSERT_STATIC(_cond) _FC_ASSERT_STATIC0 (__LINE__, (_cond)) 126 127#define FC_MIN(a,b) ((a) < (b) ? (a) : (b)) 128#define FC_MAX(a,b) ((a) > (b) ? (a) : (b)) 129 130/* slim_internal.h */ 131/* Bug of GCC 4.2 (visibility and -fPIC) 132 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46861 */ 133#if (__GNUC__ == 4 && __GNUC_MINOR__ == 2) && defined(__ELF__) && !defined(__sun) 134#define FcPrivate 135#define HAVE_GNUC_ATTRIBUTE 1 136#include "fcalias.h" 137#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2) 138#define FcPrivate __attribute__((__visibility__("hidden"))) 139#define HAVE_GNUC_ATTRIBUTE 1 140#include "fcalias.h" 141#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) 142#define FcPrivate __hidden 143#else /* not gcc >= 3.3 and not Sun Studio >= 8 */ 144#define FcPrivate 145#endif 146 147/* NLS */ 148#ifdef ENABLE_NLS 149#include <libintl.h> 150#define _(x) (dgettext(GETTEXT_PACKAGE, x)) 151#else 152#define dgettext(d, s) (s) 153#define _(x) (x) 154#endif 155 156#define N_(x) x 157 158FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int)); 159 160#define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s))) 161#define FcFree(s) (free ((FcChar8 *) (s))) 162 163/* 164 * Serialized data structures use only offsets instead of pointers 165 * A low bit of 1 indicates an offset. 166 */ 167 168/* Is the provided pointer actually an offset? */ 169#define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0) 170 171/* Encode offset in a pointer of type t */ 172#define FcOffsetEncode(o,t) ((t *) (intptr_t) ((o) | 1)) 173 174/* Decode a pointer into an offset */ 175#define FcOffsetDecode(p) (((intptr_t) (p)) & ~1) 176 177/* Compute pointer offset */ 178#define FcPtrToOffset(b,p) ((ptrdiff_t) ((intptr_t) (p) - (intptr_t) (b))) 179 180/* Given base address, offset and type, return a pointer */ 181#define FcOffsetToPtr(b,o,t) ((t *) ((intptr_t) (b) + (ptrdiff_t) (o))) 182 183/* Given base address, encoded offset and type, return a pointer */ 184#define FcEncodedOffsetToPtr(b,p,t) FcOffsetToPtr(b,FcOffsetDecode(p),t) 185 186/* Given base address, pointer and type, return an encoded offset */ 187#define FcPtrToEncodedOffset(b,p,t) FcOffsetEncode(FcPtrToOffset(b,p),t) 188 189/* Given a structure, offset member and type, return pointer */ 190#define FcOffsetMember(s,m,t) FcOffsetToPtr(s,(s)->m,t) 191 192/* Given a structure, encoded offset member and type, return pointer to member */ 193#define FcEncodedOffsetMember(s,m,t) FcOffsetToPtr(s,FcOffsetDecode((s)->m), t) 194 195/* Given a structure, member and type, convert the member to a pointer */ 196#define FcPointerMember(s,m,t) (FcIsEncodedOffset((s)->m) ? \ 197 FcEncodedOffsetMember (s,m,t) : \ 198 (s)->m) 199 200/* 201 * Serialized values may hold strings, charsets and langsets as pointers, 202 * unfortunately FcValue is an exposed type so we can't just always use 203 * offsets 204 */ 205#define FcValueString(v) FcPointerMember(v,u.s,FcChar8) 206#define FcValueCharSet(v) FcPointerMember(v,u.c,const FcCharSet) 207#define FcValueLangSet(v) FcPointerMember(v,u.l,const FcLangSet) 208#define FcValueRange(v) FcPointerMember(v,u.r,const FcRange) 209 210typedef struct _FcValueList *FcValueListPtr; 211 212typedef struct _FcValueList { 213 struct _FcValueList *next; 214 FcValue value; 215 FcValueBinding binding; 216} FcValueList; 217 218#define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList) 219 220typedef int FcObject; 221 222/* The 1024 is to leave some room for future added internal objects, such 223 * that caches from newer fontconfig can still be used with older fontconfig 224 * without getting confused. */ 225#define FC_EXT_OBJ_INDEX 1024 226#define FC_OBJ_ID(_n_) ((_n_) & (~FC_EXT_OBJ_INDEX)) 227 228typedef struct _FcPatternElt *FcPatternEltPtr; 229 230/* 231 * Pattern elts are stuck in a structure connected to the pattern, 232 * so they get moved around when the pattern is resized. Hence, the 233 * values field must be a pointer/offset instead of just an offset 234 */ 235typedef struct _FcPatternElt { 236 FcObject object; 237 FcValueList *values; 238} FcPatternElt; 239 240#define FcPatternEltValues(pe) FcPointerMember(pe,values,FcValueList) 241 242struct _FcPattern { 243 int num; 244 int size; 245 intptr_t elts_offset; 246 FcRef ref; 247}; 248 249#define FcPatternElts(p) FcOffsetMember(p,elts_offset,FcPatternElt) 250 251#define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *) 252 253#define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \ 254 FcEncodedOffsetToPtr(fs, \ 255 FcFontSetFonts(fs)[i], \ 256 FcPattern) : \ 257 fs->fonts[i]) 258 259typedef enum _FcOp { 260 FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpRange, FcOpBool, FcOpCharSet, FcOpLangSet, 261 FcOpNil, 262 FcOpField, FcOpConst, 263 FcOpAssign, FcOpAssignReplace, 264 FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast, 265 FcOpDelete, FcOpDeleteAll, 266 FcOpQuest, 267 FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, 268 FcOpContains, FcOpListing, FcOpNotContains, 269 FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual, 270 FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide, 271 FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc, 272 FcOpInvalid 273} FcOp; 274 275typedef enum _FcOpFlags { 276 FcOpFlagIgnoreBlanks = 1U << 0 277} FcOpFlags; 278 279#define FC_OP_GET_OP(_x_) ((_x_) & 0xffff) 280#define FC_OP_GET_FLAGS(_x_) (((_x_) & 0xffff0000) >> 16) 281#define FC_OP(_x_,_f_) (FC_OP_GET_OP (_x_) | ((_f_) << 16)) 282 283typedef struct _FcExprMatrix { 284 struct _FcExpr *xx, *xy, *yx, *yy; 285} FcExprMatrix; 286 287typedef struct _FcExprName { 288 FcObject object; 289 FcMatchKind kind; 290} FcExprName; 291 292struct _FcRange { 293 double begin; 294 double end; 295}; 296 297 298typedef struct _FcExpr { 299 FcOp op; 300 union { 301 int ival; 302 double dval; 303 const FcChar8 *sval; 304 FcExprMatrix *mexpr; 305 FcBool bval; 306 FcCharSet *cval; 307 FcLangSet *lval; 308 FcRange *rval; 309 310 FcExprName name; 311 const FcChar8 *constant; 312 struct { 313 struct _FcExpr *left, *right; 314 } tree; 315 } u; 316} FcExpr; 317 318typedef struct _FcExprPage FcExprPage; 319 320struct _FcExprPage { 321 FcExprPage *next_page; 322 FcExpr *next; 323 FcExpr exprs[(1024 - 2/* two pointers */ - 2/* malloc overhead */) * sizeof (void *) / sizeof (FcExpr)]; 324 FcExpr end[FLEXIBLE_ARRAY_MEMBER]; 325}; 326 327typedef enum _FcQual { 328 FcQualAny, FcQualAll, FcQualFirst, FcQualNotFirst 329} FcQual; 330 331#define FcMatchDefault ((FcMatchKind) -1) 332 333typedef struct _FcTest { 334 FcMatchKind kind; 335 FcQual qual; 336 FcObject object; 337 FcOp op; 338 FcExpr *expr; 339} FcTest; 340 341typedef struct _FcEdit { 342 FcObject object; 343 FcOp op; 344 FcExpr *expr; 345 FcValueBinding binding; 346} FcEdit; 347 348typedef void (* FcDestroyFunc) (void *data); 349 350typedef struct _FcPtrList FcPtrList; 351/* need to sync with FcConfigFileInfoIter at fontconfig.h */ 352typedef struct _FcPtrListIter { 353 void *dummy1; 354 void *dummy2; 355 void *dummy3; 356} FcPtrListIter; 357 358typedef enum _FcRuleType { 359 FcRuleUnknown, FcRuleTest, FcRuleEdit 360} FcRuleType; 361 362typedef struct _FcRule { 363 struct _FcRule *next; 364 FcRuleType type; 365 union { 366 FcTest *test; 367 FcEdit *edit; 368 } u; 369} FcRule; 370 371typedef struct _FcRuleSet { 372 FcRef ref; 373 FcChar8 *name; 374 FcChar8 *description; 375 FcChar8 *domain; 376 FcBool enabled; 377 FcPtrList *subst[FcMatchKindEnd]; 378} FcRuleSet; 379 380typedef struct _FcCharLeaf { 381 FcChar32 map[256/32]; 382} FcCharLeaf; 383 384struct _FcCharSet { 385 FcRef ref; /* reference count */ 386 int num; /* size of leaves and numbers arrays */ 387 intptr_t leaves_offset; 388 intptr_t numbers_offset; 389}; 390 391#define FcCharSetLeaves(c) FcOffsetMember(c,leaves_offset,intptr_t) 392#define FcCharSetLeaf(c,i) (FcOffsetToPtr(FcCharSetLeaves(c), \ 393 FcCharSetLeaves(c)[i], \ 394 FcCharLeaf)) 395#define FcCharSetNumbers(c) FcOffsetMember(c,numbers_offset,FcChar16) 396 397#define FCSS_DEFAULT 0 /* default behavior */ 398#define FCSS_ALLOW_DUPLICATES 1 /* allows for duplicate strings in the set */ 399#define FCSS_GROW_BY_64 2 /* grows buffer by 64 elements instead of 1 */ 400 401#define FcStrSetHasControlBit(s,c) (s->control & c) 402#define FcStrSetHasControlBits(s,c) ( (c) == (s->control & (c)) ) 403 404struct _FcStrSet { 405 FcRef ref; /* reference count */ 406 int num; 407 int size; 408 FcChar8 **strs; 409 unsigned int control; /* control bits for set behavior */ 410}; 411 412struct _FcStrList { 413 FcStrSet *set; 414 int n; 415}; 416 417typedef struct _FcStrBuf { 418 FcChar8 *buf; 419 FcBool allocated; 420 FcBool failed; 421 int len; 422 int size; 423 FcChar8 buf_static[16 * sizeof (void *)]; 424} FcStrBuf; 425 426typedef struct _FcHashTable FcHashTable; 427 428typedef FcChar32 (* FcHashFunc) (const FcChar8 *data); 429typedef int (* FcCompareFunc) (const FcChar8 *v1, const FcChar8 *v2); 430typedef FcBool (* FcCopyFunc) (const void *src, void **dest); 431 432 433struct _FcCache { 434 unsigned int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */ 435 int version; /* FC_CACHE_VERSION_NUMBER */ 436 intptr_t size; /* size of file */ 437 intptr_t dir; /* offset to dir name */ 438 intptr_t dirs; /* offset to subdirs */ 439 int dirs_count; /* number of subdir strings */ 440 intptr_t set; /* offset to font set */ 441 int checksum; /* checksum of directory state */ 442 int64_t checksum_nano; /* checksum of directory state */ 443}; 444 445#undef FcCacheDir 446#undef FcCacheSubdir 447#define FcCacheDir(c) FcOffsetMember(c,dir,FcChar8) 448#define FcCacheDirs(c) FcOffsetMember(c,dirs,intptr_t) 449#define FcCacheSet(c) FcOffsetMember(c,set,FcFontSet) 450#define FcCacheSubdir(c,i) FcOffsetToPtr (FcCacheDirs(c),\ 451 FcCacheDirs(c)[i], \ 452 FcChar8) 453 454/* 455 * Used while constructing a directory cache object 456 */ 457 458typedef union _FcAlign { 459 double d; 460 int i; 461 intptr_t ip; 462 FcBool b; 463 void *p; 464} FcAlign; 465 466typedef struct _FcSerializeBucket { 467 const void *object; /* key */ 468 uintptr_t hash; /* hash of key */ 469 intptr_t offset; /* value */ 470} FcSerializeBucket; 471 472typedef struct _FcCharSetFreezer FcCharSetFreezer; 473 474typedef struct _FcSerialize { 475 intptr_t size; 476 FcCharSetFreezer *cs_freezer; 477 void *linear; 478 FcSerializeBucket *buckets; 479 size_t buckets_count; 480 size_t buckets_used; 481 size_t buckets_used_max; 482} FcSerialize; 483 484/* 485 * To map adobe glyph names to unicode values, a precomputed hash 486 * table is used 487 */ 488 489typedef struct _FcGlyphName { 490 FcChar32 ucs; /* unicode value */ 491 FcChar8 name[1]; /* name extends beyond struct */ 492} FcGlyphName; 493 494/* 495 * To perform case-insensitive string comparisons, a table 496 * is used which holds three different kinds of folding data. 497 * 498 * The first is a range of upper case values mapping to a range 499 * of their lower case equivalents. Within each range, the offset 500 * between upper and lower case is constant. 501 * 502 * The second is a range of upper case values which are interleaved 503 * with their lower case equivalents. 504 * 505 * The third is a set of raw unicode values mapping to a list 506 * of unicode values for comparison purposes. This allows conversion 507 * of ß to "ss" so that SS, ss and ß all match. A separate array 508 * holds the list of unicode values for each entry. 509 * 510 * These are packed into a single table. Using a binary search, 511 * the appropriate entry can be located. 512 */ 513 514#define FC_CASE_FOLD_RANGE 0 515#define FC_CASE_FOLD_EVEN_ODD 1 516#define FC_CASE_FOLD_FULL 2 517 518typedef struct _FcCaseFold { 519 FcChar32 upper; 520 FcChar16 method : 2; 521 FcChar16 count : 14; 522 short offset; /* lower - upper for RANGE, table id for FULL */ 523} FcCaseFold; 524 525#define FC_MAX_FILE_LEN 4096 526 527#define FC_CACHE_MAGIC_MMAP 0xFC02FC04 528#define FC_CACHE_MAGIC_ALLOC 0xFC02FC05 529 530struct _FcAtomic { 531 FcChar8 *file; /* original file name */ 532 FcChar8 *new; /* temp file name -- write data here */ 533 FcChar8 *lck; /* lockfile name (used for locking) */ 534 FcChar8 *tmp; /* tmpfile name (used for locking) */ 535}; 536 537struct _FcConfig { 538 /* 539 * File names loaded from the configuration -- saved here as the 540 * cache file must be consulted before the directories are scanned, 541 * and those directives may occur in any order 542 */ 543 FcStrSet *configDirs; /* directories to scan for fonts */ 544 /* 545 * List of directories containing fonts, 546 * built by recursively scanning the set 547 * of configured directories 548 */ 549 FcStrSet *fontDirs; 550 /* 551 * List of directories containing cache files. 552 */ 553 FcStrSet *cacheDirs; 554 /* 555 * Names of all of the configuration files used 556 * to create this configuration 557 */ 558 FcStrSet *configFiles; /* config files loaded */ 559 /* 560 * Substitution instructions for patterns and fonts; 561 * maxObjects is used to allocate appropriate intermediate storage 562 * while performing a whole set of substitutions 563 * 564 * 0.. substitutions for patterns 565 * 1.. substitutions for fonts 566 * 2.. substitutions for scanned fonts 567 */ 568 FcPtrList *subst[FcMatchKindEnd]; 569 int maxObjects; /* maximum number of tests in all substs */ 570 /* 571 * List of patterns used to control font file selection 572 */ 573 FcStrSet *acceptGlobs; 574 FcStrSet *rejectGlobs; 575 FcFontSet *acceptPatterns; 576 FcFontSet *rejectPatterns; 577 /* 578 * The set of fonts loaded from the listed directories; the 579 * order within the set does not determine the font selection, 580 * except in the case of identical matches in which case earlier fonts 581 * match preferrentially 582 */ 583 FcFontSet *fonts[FcSetApplication + 1]; 584 /* 585 * Fontconfig can periodically rescan the system configuration 586 * and font directories. This rescanning occurs when font 587 * listing requests are made, but no more often than rescanInterval 588 * seconds apart. 589 */ 590 time_t rescanTime; /* last time information was scanned */ 591 int rescanInterval; /* interval between scans */ 592 593 FcRef ref; /* reference count */ 594 595 FcExprPage *expr_pool; /* pool of FcExpr's */ 596 597 FcChar8 *sysRoot; /* override the system root directory */ 598 FcStrSet *availConfigFiles; /* config files available */ 599 FcPtrList *rulesetList; /* List of rulesets being installed */ 600}; 601 602typedef struct _FcFileTime { 603 time_t time; 604 FcBool set; 605} FcFileTime; 606 607typedef struct _FcCharMap FcCharMap; 608 609typedef struct _FcStatFS FcStatFS; 610 611struct _FcStatFS { 612 FcBool is_remote_fs; 613 FcBool is_mtime_broken; 614}; 615 616typedef struct _FcValuePromotionBuffer FcValuePromotionBuffer; 617 618struct _FcValuePromotionBuffer { 619 union { 620 double d; 621 int i; 622 long l; 623 char c[256]; /* Enlarge as needed */ 624 } u; 625}; 626 627/* fccache.c */ 628 629FcPrivate FcCache * 630FcDirCacheScan (const FcChar8 *dir, FcConfig *config); 631 632FcPrivate FcCache * 633FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs); 634 635FcPrivate FcCache * 636FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs); 637 638FcPrivate FcBool 639FcDirCacheWrite (FcCache *cache, FcConfig *config); 640 641FcPrivate FcBool 642FcDirCacheCreateTagFile (const FcChar8 *cache_dir); 643 644FcPrivate void 645FcCacheObjectReference (void *object); 646 647FcPrivate void 648FcCacheObjectDereference (void *object); 649 650FcPrivate void * 651FcCacheAllocate (FcCache *cache, size_t len); 652 653FcPrivate void 654FcCacheFini (void); 655 656 657FcPrivate void 658FcDirCacheReference (FcCache *cache, int nref); 659 660FcPrivate int 661FcDirCacheLock (const FcChar8 *dir, 662 FcConfig *config); 663 664FcPrivate void 665FcDirCacheUnlock (int fd); 666 667/* fccfg.c */ 668 669FcPrivate FcBool 670FcConfigInit (void); 671 672FcPrivate void 673FcConfigFini (void); 674 675FcPrivate FcChar8 * 676FcConfigXdgCacheHome (void); 677 678FcPrivate FcChar8 * 679FcConfigXdgConfigHome (void); 680 681FcPrivate FcChar8 * 682FcConfigXdgDataHome (void); 683 684FcPrivate FcStrSet * 685FcConfigXdgDataDirs (void); 686 687FcPrivate FcExpr * 688FcConfigAllocExpr (FcConfig *config); 689 690FcPrivate FcBool 691FcConfigAddConfigDir (FcConfig *config, 692 const FcChar8 *d); 693 694FcPrivate FcBool 695FcConfigAddFontDir (FcConfig *config, 696 const FcChar8 *d, 697 const FcChar8 *m, 698 const FcChar8 *salt); 699 700FcPrivate FcBool 701FcConfigResetFontDirs (FcConfig *config); 702 703FcPrivate FcChar8 * 704FcConfigMapFontPath(FcConfig *config, 705 const FcChar8 *path); 706 707FcPrivate const FcChar8 * 708FcConfigMapSalt (FcConfig *config, 709 const FcChar8 *path); 710 711FcPrivate FcBool 712FcConfigAddCacheDir (FcConfig *config, 713 const FcChar8 *d); 714 715FcPrivate FcBool 716FcConfigAddConfigFile (FcConfig *config, 717 const FcChar8 *f); 718 719FcPrivate FcBool 720FcConfigAddBlank (FcConfig *config, 721 FcChar32 blank); 722 723FcBool 724FcConfigAddRule (FcConfig *config, 725 FcRule *rule, 726 FcMatchKind kind); 727 728FcPrivate void 729FcConfigSetFonts (FcConfig *config, 730 FcFontSet *fonts, 731 FcSetName set); 732 733FcPrivate FcBool 734FcConfigCompareValue (const FcValue *m, 735 unsigned int op_, 736 const FcValue *v); 737 738FcPrivate FcBool 739FcConfigGlobAdd (FcConfig *config, 740 const FcChar8 *glob, 741 FcBool accept); 742 743FcPrivate FcBool 744FcConfigAcceptFilename (FcConfig *config, 745 const FcChar8 *filename); 746 747FcPrivate FcBool 748FcConfigPatternsAdd (FcConfig *config, 749 FcPattern *pattern, 750 FcBool accept); 751 752FcPrivate FcBool 753FcConfigAcceptFont (FcConfig *config, 754 const FcPattern *font); 755 756FcPrivate FcFileTime 757FcConfigModifiedTime (FcConfig *config); 758 759FcPrivate FcBool 760FcConfigAddCache (FcConfig *config, FcCache *cache, 761 FcSetName set, FcStrSet *dirSet, FcChar8 *forDir); 762 763FcPrivate FcRuleSet * 764FcRuleSetCreate (const FcChar8 *name); 765 766FcPrivate void 767FcRuleSetDestroy (FcRuleSet *rs); 768 769FcPrivate void 770FcRuleSetReference (FcRuleSet *rs); 771 772FcPrivate void 773FcRuleSetEnable (FcRuleSet *rs, 774 FcBool flag); 775 776FcPrivate void 777FcRuleSetAddDescription (FcRuleSet *rs, 778 const FcChar8 *domain, 779 const FcChar8 *description); 780 781FcPrivate int 782FcRuleSetAdd (FcRuleSet *rs, 783 FcRule *rule, 784 FcMatchKind kind); 785 786/* fcserialize.c */ 787FcPrivate intptr_t 788FcAlignSize (intptr_t size); 789 790FcPrivate FcSerialize * 791FcSerializeCreate (void); 792 793FcPrivate void 794FcSerializeDestroy (FcSerialize *serialize); 795 796FcPrivate FcBool 797FcSerializeAlloc (FcSerialize *serialize, const void *object, int size); 798 799FcPrivate intptr_t 800FcSerializeReserve (FcSerialize *serialize, int size); 801 802FcPrivate intptr_t 803FcSerializeOffset (FcSerialize *serialize, const void *object); 804 805FcPrivate void * 806FcSerializePtr (FcSerialize *serialize, const void *object); 807 808FcPrivate FcBool 809FcLangSetSerializeAlloc (FcSerialize *serialize, const FcLangSet *l); 810 811FcPrivate FcLangSet * 812FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l); 813 814/* fccharset.c */ 815FcPrivate FcCharSet * 816FcCharSetPromote (FcValuePromotionBuffer *vbuf); 817 818FcPrivate void 819FcLangCharSetPopulate (void); 820 821FcPrivate FcCharSetFreezer * 822FcCharSetFreezerCreate (void); 823 824FcPrivate const FcCharSet * 825FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs); 826 827FcPrivate void 828FcCharSetFreezerDestroy (FcCharSetFreezer *freezer); 829 830FcPrivate FcBool 831FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c); 832 833FcPrivate FcCharSet * 834FcNameParseCharSet (FcChar8 *string); 835 836FcPrivate FcBool 837FcNameUnparseValue (FcStrBuf *buf, 838 FcValue *v0, 839 FcChar8 *escape); 840 841FcPrivate FcBool 842FcNameUnparseValueList (FcStrBuf *buf, 843 FcValueListPtr v, 844 FcChar8 *escape); 845 846FcPrivate FcCharLeaf * 847FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4); 848 849FcPrivate FcBool 850FcCharSetSerializeAlloc(FcSerialize *serialize, const FcCharSet *cs); 851 852FcPrivate FcCharSet * 853FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs); 854 855FcPrivate FcChar16 * 856FcCharSetGetNumbers(const FcCharSet *c); 857 858/* fccompat.c */ 859FcPrivate int 860FcOpen(const char *pathname, int flags, ...); 861 862FcPrivate int 863FcMakeTempfile (char *template); 864 865FcPrivate int32_t 866FcRandom (void); 867 868FcPrivate FcBool 869FcMakeDirectory (const FcChar8 *dir); 870 871FcPrivate ssize_t 872FcReadLink (const FcChar8 *pathname, 873 FcChar8 *buf, 874 size_t bufsiz); 875 876/* fcdbg.c */ 877 878FcPrivate void 879FcValuePrintFile (FILE *f, const FcValue v); 880 881FcPrivate void 882FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark); 883 884FcPrivate void 885FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos); 886 887FcPrivate void 888FcValueListPrint (FcValueListPtr l); 889 890FcPrivate void 891FcLangSetPrint (const FcLangSet *ls); 892 893FcPrivate void 894FcOpPrint (FcOp op); 895 896FcPrivate void 897FcTestPrint (const FcTest *test); 898 899FcPrivate void 900FcExprPrint (const FcExpr *expr); 901 902FcPrivate void 903FcEditPrint (const FcEdit *edit); 904 905FcPrivate void 906FcRulePrint (const FcRule *rule); 907 908FcPrivate void 909FcCharSetPrint (const FcCharSet *c); 910 911FcPrivate void 912FcPatternPrint2 (FcPattern *p1, FcPattern *p2, const FcObjectSet *os); 913 914extern FcPrivate int FcDebugVal; 915 916#define FcDebug() (FcDebugVal) 917 918FcPrivate void 919FcInitDebug (void); 920 921/* fcdefault.c */ 922FcPrivate FcChar8 * 923FcGetDefaultLang (void); 924 925FcPrivate FcChar8 * 926FcGetPrgname (void); 927 928FcPrivate FcChar8 * 929FcGetDesktopName (void); 930 931FcPrivate void 932FcDefaultFini (void); 933 934/* fcdir.c */ 935 936FcPrivate FcBool 937FcFileIsLink (const FcChar8 *file); 938 939FcPrivate FcBool 940FcFileIsFile (const FcChar8 *file); 941 942FcPrivate FcBool 943FcFileScanConfig (FcFontSet *set, 944 FcStrSet *dirs, 945 const FcChar8 *file, 946 FcConfig *config); 947 948FcPrivate FcBool 949FcDirScanConfig (FcFontSet *set, 950 FcStrSet *dirs, 951 const FcChar8 *dir, 952 FcBool force, 953 FcConfig *config); 954 955/* fcfont.c */ 956FcPrivate int 957FcFontDebug (void); 958 959/* fcfs.c */ 960 961FcPrivate FcBool 962FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s); 963 964FcPrivate FcFontSet * 965FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s); 966 967FcPrivate FcFontSet * 968FcFontSetDeserialize (const FcFontSet *set); 969 970/* fcplist.c */ 971FcPrivate FcPtrList * 972FcPtrListCreate (FcDestroyFunc func); 973 974FcPrivate void 975FcPtrListDestroy (FcPtrList *list); 976 977FcPrivate void 978FcPtrListIterInit (const FcPtrList *list, 979 FcPtrListIter *iter); 980 981FcPrivate void 982FcPtrListIterInitAtLast (FcPtrList *list, 983 FcPtrListIter *iter); 984 985FcPrivate FcBool 986FcPtrListIterNext (const FcPtrList *list, 987 FcPtrListIter *iter); 988 989FcPrivate FcBool 990FcPtrListIterIsValid (const FcPtrList *list, 991 const FcPtrListIter *iter); 992 993FcPrivate void * 994FcPtrListIterGetValue (const FcPtrList *list, 995 const FcPtrListIter *iter); 996 997FcPrivate FcBool 998FcPtrListIterAdd (FcPtrList *list, 999 FcPtrListIter *iter, 1000 void *data); 1001 1002FcPrivate FcBool 1003FcPtrListIterRemove (FcPtrList *list, 1004 FcPtrListIter *iter); 1005 1006/* fcinit.c */ 1007FcPrivate FcConfig * 1008FcInitLoadOwnConfig (FcConfig *config); 1009 1010FcPrivate FcConfig * 1011FcInitLoadOwnConfigAndFonts (FcConfig *config); 1012 1013/* fcxml.c */ 1014FcPrivate void 1015FcConfigPathFini (void); 1016 1017FcPrivate void 1018FcTestDestroy (FcTest *test); 1019 1020FcPrivate void 1021FcEditDestroy (FcEdit *e); 1022 1023void 1024FcRuleDestroy (FcRule *rule); 1025 1026/* fclang.c */ 1027FcPrivate FcLangSet * 1028FcFreeTypeLangSet (const FcCharSet *charset, 1029 const FcChar8 *exclusiveLang); 1030 1031FcPrivate FcLangResult 1032FcLangCompare (const FcChar8 *s1, const FcChar8 *s2); 1033 1034FcPrivate FcLangSet * 1035FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *buf); 1036 1037FcPrivate FcLangSet * 1038FcNameParseLangSet (const FcChar8 *string); 1039 1040FcPrivate FcBool 1041FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls); 1042 1043FcPrivate FcChar8 * 1044FcNameUnparseEscaped (FcPattern *pat, FcBool escape); 1045 1046FcPrivate FcBool 1047FcConfigParseOnly (FcConfig *config, 1048 const FcChar8 *name, 1049 FcBool complain); 1050 1051FcPrivate FcChar8 * 1052FcConfigRealFilename (FcConfig *config, 1053 const FcChar8 *url); 1054 1055/* fclist.c */ 1056 1057FcPrivate FcBool 1058FcListPatternMatchAny (const FcPattern *p, 1059 const FcPattern *font); 1060 1061/* fcmatch.c */ 1062 1063/* fcname.c */ 1064 1065enum { 1066 FC_INVALID_OBJECT = 0, 1067#define FC_OBJECT(NAME, Type, Cmp) FC_##NAME##_OBJECT, 1068#include "fcobjs.h" 1069#undef FC_OBJECT 1070 FC_ONE_AFTER_MAX_BASE_OBJECT 1071#define FC_MAX_BASE_OBJECT (FC_ONE_AFTER_MAX_BASE_OBJECT - 1) 1072}; 1073 1074FcPrivate FcBool 1075FcNameConstantWithObjectCheck (const FcChar8 *string, const char *object, int *result); 1076 1077FcPrivate FcBool 1078FcNameBool (const FcChar8 *v, FcBool *result); 1079 1080FcPrivate FcBool 1081FcObjectValidType (FcObject object, FcType type); 1082 1083FcPrivate FcObject 1084FcObjectFromName (const char * name); 1085 1086FcPrivate const char * 1087FcObjectName (FcObject object); 1088 1089FcPrivate FcObjectSet * 1090FcObjectGetSet (void); 1091 1092#define FcObjectCompare(a, b) ((int) a - (int) b) 1093 1094/* fcpat.c */ 1095 1096FcPrivate FcValue 1097FcValueCanonicalize (const FcValue *v); 1098 1099FcPrivate FcValueListPtr 1100FcValueListCreate (void); 1101 1102FcPrivate void 1103FcValueListDestroy (FcValueListPtr l); 1104 1105FcPrivate FcValueListPtr 1106FcValueListPrepend (FcValueListPtr vallist, 1107 FcValue value, 1108 FcValueBinding binding); 1109 1110FcPrivate FcValueListPtr 1111FcValueListAppend (FcValueListPtr vallist, 1112 FcValue value, 1113 FcValueBinding binding); 1114 1115FcPrivate FcValueListPtr 1116FcValueListDuplicate(FcValueListPtr orig); 1117 1118FcPrivate FcPatternElt * 1119FcPatternObjectFindElt (const FcPattern *p, FcObject object); 1120 1121FcPrivate FcPatternElt * 1122FcPatternObjectInsertElt (FcPattern *p, FcObject object); 1123 1124FcPrivate FcBool 1125FcPatternObjectListAdd (FcPattern *p, 1126 FcObject object, 1127 FcValueListPtr list, 1128 FcBool append); 1129 1130FcPrivate FcBool 1131FcPatternObjectAddWithBinding (FcPattern *p, 1132 FcObject object, 1133 FcValue value, 1134 FcValueBinding binding, 1135 FcBool append); 1136 1137FcPrivate FcBool 1138FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append); 1139 1140FcPrivate FcBool 1141FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append); 1142 1143FcPrivate FcResult 1144FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b); 1145 1146FcPrivate FcResult 1147FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v); 1148 1149FcPrivate FcBool 1150FcPatternObjectDel (FcPattern *p, FcObject object); 1151 1152FcPrivate FcBool 1153FcPatternObjectRemove (FcPattern *p, FcObject object, int id); 1154 1155FcPrivate FcBool 1156FcPatternObjectAddInteger (FcPattern *p, FcObject object, int i); 1157 1158FcPrivate FcBool 1159FcPatternObjectAddDouble (FcPattern *p, FcObject object, double d); 1160 1161FcPrivate FcBool 1162FcPatternObjectAddString (FcPattern *p, FcObject object, const FcChar8 *s); 1163 1164FcPrivate FcBool 1165FcPatternObjectAddMatrix (FcPattern *p, FcObject object, const FcMatrix *s); 1166 1167FcPrivate FcBool 1168FcPatternObjectAddCharSet (FcPattern *p, FcObject object, const FcCharSet *c); 1169 1170FcPrivate FcBool 1171FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b); 1172 1173FcPrivate FcBool 1174FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls); 1175 1176FcPrivate FcBool 1177FcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r); 1178 1179FcPrivate FcResult 1180FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i); 1181 1182FcPrivate FcResult 1183FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int n, double *d); 1184 1185FcPrivate FcResult 1186FcPatternObjectGetString (const FcPattern *p, FcObject object, int n, FcChar8 ** s); 1187 1188FcPrivate FcResult 1189FcPatternObjectGetMatrix (const FcPattern *p, FcObject object, int n, FcMatrix **s); 1190 1191FcPrivate FcResult 1192FcPatternObjectGetCharSet (const FcPattern *p, FcObject object, int n, FcCharSet **c); 1193 1194FcPrivate FcResult 1195FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b); 1196 1197FcPrivate FcResult 1198FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls); 1199 1200FcPrivate FcResult 1201FcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r); 1202 1203FcPrivate FcBool 1204FcPatternAppend (FcPattern *p, FcPattern *s); 1205 1206FcPrivate int 1207FcPatternPosition (const FcPattern *p, const char *object); 1208 1209FcPrivate FcBool 1210FcPatternFindObjectIter (const FcPattern *pat, FcPatternIter *iter, FcObject object); 1211 1212FcPrivate FcObject 1213FcPatternIterGetObjectId (const FcPattern *pat, FcPatternIter *iter); 1214 1215FcPrivate FcValueListPtr 1216FcPatternIterGetValues (const FcPattern *pat, FcPatternIter *iter); 1217 1218FcPrivate FcPattern * 1219FcPatternCacheRewriteFile (const FcPattern *pat, FcCache *cache, const FcChar8 *relocated_font_file); 1220 1221FcPrivate FcChar32 1222FcStringHash (const FcChar8 *s); 1223 1224FcPrivate FcBool 1225FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat); 1226 1227FcPrivate FcPattern * 1228FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat); 1229 1230FcPrivate FcBool 1231FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *pat); 1232 1233FcPrivate FcValueList * 1234FcValueListSerialize (FcSerialize *serialize, const FcValueList *pat); 1235 1236/* fcrender.c */ 1237 1238/* fcmatrix.c */ 1239 1240extern FcPrivate const FcMatrix FcIdentityMatrix; 1241 1242FcPrivate void 1243FcMatrixFree (FcMatrix *mat); 1244 1245/* fcrange.c */ 1246 1247FcPrivate FcRange * 1248FcRangePromote (double v, FcValuePromotionBuffer *vbuf); 1249 1250FcPrivate FcBool 1251FcRangeIsInRange (const FcRange *a, const FcRange *b); 1252 1253FcPrivate FcBool 1254FcRangeCompare (FcOp op, const FcRange *a, const FcRange *b); 1255 1256FcPrivate FcChar32 1257FcRangeHash (const FcRange *r); 1258 1259FcPrivate FcBool 1260FcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r); 1261 1262FcPrivate FcRange * 1263FcRangeSerialize (FcSerialize *serialize, const FcRange *r); 1264 1265/* fcstat.c */ 1266 1267FcPrivate int 1268FcStat (const FcChar8 *file, struct stat *statb); 1269 1270FcPrivate int 1271FcStatChecksum (const FcChar8 *file, struct stat *statb); 1272 1273FcPrivate FcBool 1274FcIsFsMmapSafe (int fd); 1275 1276FcPrivate FcBool 1277FcIsFsMtimeBroken (const FcChar8 *dir); 1278 1279/* fcstr.c */ 1280FcPrivate FcStrSet * 1281FcStrSetCreateEx (unsigned int control); 1282 1283FcPrivate FcBool 1284FcStrSetInsert (FcStrSet *set, const FcChar8 *s, int pos); 1285 1286FcPrivate FcBool 1287FcStrSetAddLangs (FcStrSet *strs, const char *languages); 1288 1289FcPrivate void 1290FcStrSetSort (FcStrSet * set); 1291 1292FcPrivate FcBool 1293FcStrSetMemberAB (FcStrSet *set, const FcChar8 *a, FcChar8 *b, FcChar8 **ret); 1294 1295FcPrivate FcBool 1296FcStrSetAddTriple (FcStrSet *set, const FcChar8 *a, const FcChar8 *b, const FcChar8 *c); 1297 1298FcPrivate const FcChar8 * 1299FcStrTripleSecond (FcChar8 *s); 1300 1301FcPrivate const FcChar8 * 1302FcStrTripleThird (FcChar8 *str); 1303 1304FcPrivate FcBool 1305FcStrSetAddFilenamePairWithSalt (FcStrSet *strs, const FcChar8 *d, const FcChar8 *m, const FcChar8 *salt); 1306 1307FcPrivate FcBool 1308FcStrSetDeleteAll (FcStrSet *set); 1309 1310FcPrivate void 1311FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size); 1312 1313FcPrivate void 1314FcStrBufDestroy (FcStrBuf *buf); 1315 1316FcPrivate FcChar8 * 1317FcStrBufDone (FcStrBuf *buf); 1318 1319FcPrivate FcChar8 * 1320FcStrBufDoneStatic (FcStrBuf *buf); 1321 1322FcPrivate FcBool 1323FcStrBufChar (FcStrBuf *buf, FcChar8 c); 1324 1325FcPrivate FcBool 1326FcStrBufString (FcStrBuf *buf, const FcChar8 *s); 1327 1328FcPrivate FcBool 1329FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len); 1330 1331FcPrivate int 1332FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); 1333 1334FcPrivate int 1335FcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims); 1336 1337FcPrivate const FcChar8 * 1338FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2); 1339 1340FcPrivate const FcChar8 * 1341FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2); 1342 1343FcPrivate const FcChar8 * 1344FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2); 1345 1346FcPrivate int 1347FcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims); 1348 1349FcPrivate FcBool 1350FcStrGlobMatch (const FcChar8 *glob, 1351 const FcChar8 *string); 1352 1353FcPrivate FcBool 1354FcStrUsesHome (const FcChar8 *s); 1355 1356FcPrivate FcBool 1357FcStrIsAbsoluteFilename (const FcChar8 *s); 1358 1359FcPrivate FcChar8 * 1360FcStrLastSlash (const FcChar8 *path); 1361 1362FcPrivate FcChar32 1363FcStrHashIgnoreCase (const FcChar8 *s); 1364 1365FcPrivate FcChar32 1366FcStrHashIgnoreBlanksAndCase (const FcChar8 *s); 1367 1368FcPrivate FcChar8 * 1369FcStrRealPath (const FcChar8 *path); 1370 1371FcPrivate FcChar8 * 1372FcStrCanonFilename (const FcChar8 *s); 1373 1374FcPrivate FcBool 1375FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str); 1376 1377FcPrivate FcChar8 * 1378FcStrSerialize (FcSerialize *serialize, const FcChar8 *str); 1379 1380/* fcobjs.c */ 1381 1382FcPrivate void 1383FcObjectFini (void); 1384 1385FcPrivate FcObject 1386FcObjectLookupIdByName (const char *str); 1387 1388FcPrivate FcObject 1389FcObjectLookupBuiltinIdByName (const char *str); 1390 1391FcPrivate const char * 1392FcObjectLookupOtherNameById (FcObject id); 1393 1394FcPrivate const FcObjectType * 1395FcObjectLookupOtherTypeById (FcObject id); 1396 1397FcPrivate const FcObjectType * 1398FcObjectLookupOtherTypeByName (const char *str); 1399 1400/* fchash.c */ 1401FcPrivate FcBool 1402FcHashStrCopy (const void *src, 1403 void **dest); 1404 1405FcPrivate FcBool 1406FcHashUuidCopy (const void *src, 1407 void **dest); 1408 1409FcPrivate void 1410FcHashUuidFree (void *data); 1411 1412FcPrivate FcHashTable * 1413FcHashTableCreate (FcHashFunc hash_func, 1414 FcCompareFunc compare_func, 1415 FcCopyFunc key_copy_func, 1416 FcCopyFunc value_copy_func, 1417 FcDestroyFunc key_destroy_func, 1418 FcDestroyFunc value_destroy_func); 1419 1420FcPrivate void 1421FcHashTableDestroy (FcHashTable *table); 1422 1423FcPrivate FcBool 1424FcHashTableFind (FcHashTable *table, 1425 const void *key, 1426 void **value); 1427 1428FcPrivate FcBool 1429FcHashTableAdd (FcHashTable *table, 1430 void *key, 1431 void *value); 1432 1433FcPrivate FcBool 1434FcHashTableReplace (FcHashTable *table, 1435 void *key, 1436 void *value); 1437 1438FcPrivate FcBool 1439FcHashTableRemove (FcHashTable *table, 1440 void *key); 1441 1442#endif /* _FC_INT_H_ */ 1443