#include "fcint.h"
#include "fcarch.h"
#include "fcmd5.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <string.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef _WIN32
#include <sys/time.h>
#else
#include <winsock2.h>
#endif
#include <assert.h>
#if defined(HAVE_MMAP) || defined(__CYGWIN__)
# include <unistd.h>
# include <sys/mman.h>
#endif
#if defined(_WIN32)
#include <sys/locking.h>
#endif
#ifndef O_BINARY
#define O_BINARY …
#endif
FcBool
FcDirCacheCreateUUID (FcChar8 *dir,
FcBool force,
FcConfig *config)
{ … }
FcBool
FcDirCacheDeleteUUID (const FcChar8 *dir,
FcConfig *config)
{ … }
#define CACHEBASE_LEN …
static FcBool
FcCacheIsMmapSafe (int fd)
{ … }
static const char bin2hex[] = …;
static FcChar8 *
FcDirCacheBasenameMD5 (FcConfig *config, const FcChar8 *dir, FcChar8 cache_base[CACHEBASE_LEN])
{ … }
#ifndef _WIN32
static FcChar8 *
FcDirCacheBasenameUUID (FcConfig *config, const FcChar8 *dir, FcChar8 cache_base[CACHEBASE_LEN])
{ … }
#endif
FcBool
FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config)
{ … }
static int
FcDirCacheOpenFile (const FcChar8 *cache_file, struct stat *file_stat)
{ … }
static FcBool
FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
FcBool (*callback) (FcConfig *config, int fd, struct stat *fd_stat,
struct stat *dir_stat, struct timeval *cache_mtime, void *closure),
void *closure, FcChar8 **cache_file_ret)
{ … }
#define FC_CACHE_MIN_MMAP …
FcCacheSkip;
struct _FcCacheSkip { … };
#define FC_CACHE_MAX_LEVEL …
static FcCacheSkip *fcCacheChains[FC_CACHE_MAX_LEVEL];
static int fcCacheMaxLevel;
static FcMutex *cache_lock;
static void
lock_cache (void)
{ … }
static void
unlock_cache (void)
{ … }
static void
free_lock (void)
{ … }
static int
random_level (void)
{ … }
static FcBool
FcCacheInsert (FcCache *cache, struct stat *cache_stat)
{ … }
static FcCacheSkip *
FcCacheFindByAddrUnlocked (void *object)
{ … }
static FcCacheSkip *
FcCacheFindByAddr (void *object)
{ … }
static void
FcCacheRemoveUnlocked (FcCache *cache)
{ … }
static FcCache *
FcCacheFindByStat (struct stat *cache_stat)
{ … }
static void
FcDirCacheDisposeUnlocked (FcCache *cache)
{ … }
void
FcCacheObjectReference (void *object)
{ … }
void
FcCacheObjectDereference (void *object)
{ … }
void *
FcCacheAllocate (FcCache *cache, size_t len)
{ … }
void
FcCacheFini (void)
{ … }
static FcBool
FcCacheTimeValid (FcConfig *config, FcCache *cache, struct stat *dir_stat)
{ … }
static FcBool
FcCacheOffsetsValid (FcCache *cache)
{ … }
static FcCache *
FcDirCacheMapFd (FcConfig *config, int fd, struct stat *fd_stat, struct stat *dir_stat)
{ … }
void
FcDirCacheReference (FcCache *cache, int nref)
{ … }
void
FcDirCacheUnload (FcCache *cache)
{ … }
static FcBool
FcDirCacheMapHelper (FcConfig *config, int fd, struct stat *fd_stat, struct stat *dir_stat, struct timeval *latest_cache_mtime, void *closure)
{ … }
FcCache *
FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file)
{ … }
FcCache *
FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
{ … }
static int
FcDirChecksum (struct stat *statb)
{ … }
static int64_t
FcDirChecksumNano (struct stat *statb)
{ … }
static FcBool
FcDirCacheValidateHelper (FcConfig *config, int fd, struct stat *fd_stat, struct stat *dir_stat, struct timeval *latest_cache_mtime, void *closure FC_UNUSED)
{ … }
static FcBool
FcDirCacheValidConfig (const FcChar8 *dir, FcConfig *config)
{ … }
FcBool
FcDirCacheValid (const FcChar8 *dir)
{ … }
FcCache *
FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs)
{ … }
FcCache *
FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs)
{ … }
FcBool
FcDirCacheWrite (FcCache *cache, FcConfig *config)
{ … }
FcBool
FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose)
{ … }
int
FcDirCacheLock (const FcChar8 *dir,
FcConfig *config)
{ … }
void
FcDirCacheUnlock (int fd)
{ … }
#define args1(x) …
#define args2(x,y) …
const FcChar8 *
FcCacheDir args1(const FcCache *c)
{ … }
FcFontSet *
FcCacheCopySet args1(const FcCache *c)
{ … }
const FcChar8 *
FcCacheSubdir args2(const FcCache *c, int i)
{ … }
int
FcCacheNumSubdir args1(const FcCache *c)
{ … }
int
FcCacheNumFont args1(const FcCache *c)
{ … }
FcBool
FcDirCacheCreateTagFile (const FcChar8 *cache_dir)
{ … }
void
FcCacheCreateTagFile (FcConfig *config)
{ … }
#define __fccache__
#include "fcaliastail.h"
#undef __fccache__