#include "fcint.h"
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <sys/types.h>
#if defined (_WIN32) && !defined (R_OK)
#define R_OK …
#endif
#if defined(_WIN32) && !defined(S_ISFIFO)
#define S_ISFIFO …
#endif
static FcConfig *_fcConfig;
static FcMutex *_lock;
static void
lock_config (void)
{ … }
static void
unlock_config (void)
{ … }
static void
free_lock (void)
{ … }
static FcConfig *
FcConfigEnsure (void)
{ … }
static void
FcDestroyAsRule (void *data)
{ … }
static void
FcDestroyAsRuleSet (void *data)
{ … }
FcBool
FcConfigInit (void)
{ … }
void
FcConfigFini (void)
{ … }
FcConfig *
FcConfigCreate (void)
{ … }
static FcFileTime
FcConfigNewestFile (FcStrSet *files)
{ … }
FcBool
FcConfigUptoDate (FcConfig *config)
{ … }
FcExpr *
FcConfigAllocExpr (FcConfig *config)
{ … }
FcConfig *
FcConfigReference (FcConfig *config)
{ … }
void
FcConfigDestroy (FcConfig *config)
{ … }
FcBool
FcConfigAddCache (FcConfig *config, FcCache *cache,
FcSetName set, FcStrSet *dirSet, FcChar8 *forDir)
{ … }
static FcBool
FcConfigAddDirList (FcConfig *config, FcSetName set, FcStrSet *dirSet)
{ … }
FcBool
FcConfigBuildFonts (FcConfig *config)
{ … }
FcBool
FcConfigSetCurrent (FcConfig *config)
{ … }
FcConfig *
FcConfigGetCurrent (void)
{ … }
FcBool
FcConfigAddConfigDir (FcConfig *config,
const FcChar8 *d)
{ … }
FcStrList *
FcConfigGetConfigDirs (FcConfig *config)
{ … }
FcBool
FcConfigAddFontDir (FcConfig *config,
const FcChar8 *d,
const FcChar8 *m,
const FcChar8 *salt)
{ … }
FcBool
FcConfigResetFontDirs (FcConfig *config)
{ … }
FcStrList *
FcConfigGetFontDirs (FcConfig *config)
{ … }
static FcBool
FcConfigPathStartsWith(const FcChar8 *path,
const FcChar8 *start)
{ … }
FcChar8 *
FcConfigMapFontPath(FcConfig *config,
const FcChar8 *path)
{ … }
const FcChar8 *
FcConfigMapSalt (FcConfig *config,
const FcChar8 *path)
{ … }
FcBool
FcConfigAddCacheDir (FcConfig *config,
const FcChar8 *d)
{ … }
FcStrList *
FcConfigGetCacheDirs (FcConfig *config)
{ … }
FcBool
FcConfigAddConfigFile (FcConfig *config,
const FcChar8 *f)
{ … }
FcStrList *
FcConfigGetConfigFiles (FcConfig *config)
{ … }
FcChar8 *
FcConfigGetCache (FcConfig *config FC_UNUSED)
{ … }
FcFontSet *
FcConfigGetFonts (FcConfig *config,
FcSetName set)
{ … }
void
FcConfigSetFonts (FcConfig *config,
FcFontSet *fonts,
FcSetName set)
{ … }
FcBlanks *
FcBlanksCreate (void)
{ … }
void
FcBlanksDestroy (FcBlanks *b FC_UNUSED)
{ … }
FcBool
FcBlanksAdd (FcBlanks *b FC_UNUSED, FcChar32 ucs4 FC_UNUSED)
{ … }
FcBool
FcBlanksIsMember (FcBlanks *b FC_UNUSED, FcChar32 ucs4 FC_UNUSED)
{ … }
FcBlanks *
FcConfigGetBlanks (FcConfig *config FC_UNUSED)
{ … }
FcBool
FcConfigAddBlank (FcConfig *config FC_UNUSED,
FcChar32 blank FC_UNUSED)
{ … }
int
FcConfigGetRescanInterval (FcConfig *config)
{ … }
FcBool
FcConfigSetRescanInterval (FcConfig *config, int rescanInterval)
{ … }
int
FcConfigGetRescanInverval (FcConfig *config)
{ … }
FcBool
FcConfigSetRescanInverval (FcConfig *config, int rescanInterval)
{ … }
FcBool
FcConfigAddRule (FcConfig *config,
FcRule *rule,
FcMatchKind kind)
{ … }
static FcValue
FcConfigPromote (FcValue v, FcValue u, FcValuePromotionBuffer *buf)
{ … }
FcBool
FcConfigCompareValue (const FcValue *left_o,
unsigned int op_,
const FcValue *right_o)
{ … }
#define _FcDoubleFloor(d) …
#define _FcDoubleCeil(d) …
#define FcDoubleFloor(d) …
#define FcDoubleCeil(d) …
#define FcDoubleRound(d) …
#define FcDoubleTrunc(d) …
static FcValue
FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
{ … }
FamilyTableEntry;
FamilyTable;
static FcBool
FamilyTableLookup (FamilyTable *table,
FcOp _op,
const FcChar8 *s)
{ … }
static void
FamilyTableAdd (FamilyTable *table,
FcValueListPtr values)
{ … }
static void
FamilyTableDel (FamilyTable *table,
const FcChar8 *s)
{ … }
static FcBool
copy_string (const void *src, void **dest)
{ … }
static void
FamilyTableInit (FamilyTable *table,
FcPattern *p)
{ … }
static void
FamilyTableClear (FamilyTable *table)
{ … }
static FcValueList *
FcConfigMatchValueList (FcPattern *p,
FcPattern *p_pat,
FcMatchKind kind,
FcTest *t,
FcValueList *values,
FamilyTable *table)
{ … }
static FcValueList *
FcConfigValues (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e, FcValueBinding binding)
{ … }
static FcBool
FcConfigAdd (FcValueListPtr *head,
FcValueList *position,
FcBool append,
FcValueList *new,
FcObject object,
FamilyTable *table)
{ … }
static void
FcConfigDel (FcValueListPtr *head,
FcValueList *position,
FcObject object,
FamilyTable *table)
{ … }
static void
FcConfigPatternAdd (FcPattern *p,
FcObject object,
FcValueList *list,
FcBool append,
FamilyTable *table)
{ … }
static void
FcConfigPatternDel (FcPattern *p,
FcObject object,
FamilyTable *table)
{ … }
static void
FcConfigPatternCanon (FcPattern *p,
FcObject object)
{ … }
FcBool
FcConfigSubstituteWithPat (FcConfig *config,
FcPattern *p,
FcPattern *p_pat,
FcMatchKind kind)
{ … }
FcBool
FcConfigSubstitute (FcConfig *config,
FcPattern *p,
FcMatchKind kind)
{ … }
#if defined (_WIN32)
static FcChar8 fontconfig_path[1000] = "";
FcChar8 fontconfig_instprefix[1000] = "";
# if (defined (PIC) || defined (DLL_EXPORT))
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpvReserved);
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpvReserved)
{
FcChar8 *p;
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
if (!GetModuleFileName ((HMODULE) hinstDLL, (LPCH) fontconfig_path,
sizeof (fontconfig_path)))
break;
p = (FcChar8 *) strrchr ((const char *) fontconfig_path, '\\');
if (p)
{
*p = '\0';
p = (FcChar8 *) strrchr ((const char *) fontconfig_path, '\\');
if (p && (FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "bin") == 0 ||
FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "lib") == 0))
*p = '\0';
strcat ((char *) fontconfig_instprefix, (char *) fontconfig_path);
strcat ((char *) fontconfig_path, "\\etc\\fonts");
}
else
fontconfig_path[0] = '\0';
break;
}
return TRUE;
}
# endif
#undef FONTCONFIG_PATH
#define FONTCONFIG_PATH …
#endif
#ifndef FONTCONFIG_FILE
#define FONTCONFIG_FILE …
#endif
static FcChar8 *
FcConfigFileExists (const FcChar8 *dir, const FcChar8 *file)
{ … }
static FcChar8 **
FcConfigGetPath (void)
{ … }
static void
FcConfigFreePath (FcChar8 **path)
{ … }
static FcBool _FcConfigHomeEnabled = …;
FcChar8 *
FcConfigHome (void)
{ … }
FcChar8 *
FcConfigXdgCacheHome (void)
{ … }
FcChar8 *
FcConfigXdgConfigHome (void)
{ … }
FcChar8 *
FcConfigXdgDataHome (void)
{ … }
FcStrSet *
FcConfigXdgDataDirs (void)
{ … }
FcBool
FcConfigEnableHome (FcBool enable)
{ … }
FcChar8 *
FcConfigGetFilename (FcConfig *config,
const FcChar8 *url)
{ … }
FcChar8 *
FcConfigFilename (const FcChar8 *url)
{ … }
FcChar8 *
FcConfigRealFilename (FcConfig *config,
const FcChar8 *url)
{ … }
FcBool
FcConfigAppFontAddFile (FcConfig *config,
const FcChar8 *file)
{ … }
FcBool
FcConfigAppFontAddDir (FcConfig *config,
const FcChar8 *dir)
{ … }
void
FcConfigAppFontClear (FcConfig *config)
{ … }
FcBool
FcConfigGlobAdd (FcConfig *config,
const FcChar8 *glob,
FcBool accept)
{ … }
static FcBool
FcConfigGlobsMatch (const FcStrSet *globs,
const FcChar8 *string)
{ … }
FcBool
FcConfigAcceptFilename (FcConfig *config,
const FcChar8 *filename)
{ … }
FcBool
FcConfigPatternsAdd (FcConfig *config,
FcPattern *pattern,
FcBool accept)
{ … }
static FcBool
FcConfigPatternsMatch (const FcFontSet *patterns,
const FcPattern *font)
{ … }
FcBool
FcConfigAcceptFont (FcConfig *config,
const FcPattern *font)
{ … }
const FcChar8 *
FcConfigGetSysRoot (const FcConfig *config)
{ … }
void
FcConfigSetSysRoot (FcConfig *config,
const FcChar8 *sysroot)
{ … }
FcRuleSet *
FcRuleSetCreate (const FcChar8 *name)
{ … }
void
FcRuleSetDestroy (FcRuleSet *rs)
{ … }
void
FcRuleSetReference (FcRuleSet *rs)
{ … }
void
FcRuleSetEnable (FcRuleSet *rs,
FcBool flag)
{ … }
void
FcRuleSetAddDescription (FcRuleSet *rs,
const FcChar8 *domain,
const FcChar8 *description)
{ … }
int
FcRuleSetAdd (FcRuleSet *rs,
FcRule *rule,
FcMatchKind kind)
{ … }
void
FcConfigFileInfoIterInit (FcConfig *config,
FcConfigFileInfoIter *iter)
{ … }
FcBool
FcConfigFileInfoIterNext (FcConfig *config,
FcConfigFileInfoIter *iter)
{ … }
FcBool
FcConfigFileInfoIterGet (FcConfig *config,
FcConfigFileInfoIter *iter,
FcChar8 **name,
FcChar8 **description,
FcBool *enabled)
{ … }
#define __fccfg__
#include "fcaliastail.h"
#undef __fccfg__