chromium/third_party/fontconfig/src/src/fccfg.c

/*
 * fontconfig/src/fccfg.c
 *
 * Copyright © 2000 Keith Packard
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of the author(s) not be used in
 * advertising or publicity pertaining to distribution of the software without
 * specific, written prior permission.  The authors make no
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.
 *
 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/* Objects MT-safe for readonly access. */

#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; /* MT-safe */
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)
{}

/*
 * Add cache to configuration, adding fonts and directories
 */

FcBool
FcConfigAddCache (FcConfig *config, FcCache *cache,
		  FcSetName set, FcStrSet *dirSet, FcChar8 *forDir)
{}

static FcBool
FcConfigAddDirList (FcConfig *config, FcSetName set, FcStrSet *dirSet)
{}

/*
 * Scan the current list of directories in the configuration
 * and build the set of available fonts.
 */

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)
{}

/*
 * A couple of typos escaped into the library
 */
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)
{}

/* The bulk of the time in FcConfigSubstitute is spent walking
 * lists of family names. We speed this up with a hash table.
 * Since we need to take the ignore-blanks option into account,
 * we use two separate hash tables.
 */
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)
{}

/*
 * Delete all values associated with a field
 */
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] = ""; /* MT-dontcare */
FcChar8 fontconfig_instprefix[1000] = ""; /* MT-dontcare */

#  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;

      /* If the fontconfig DLL is in a "bin" or "lib" subfolder,
       * assume it's a Unix-style installation tree, and use
       * "etc/fonts" in there as FONTCONFIG_PATH. Otherwise use the
       * folder where the DLL is as FONTCONFIG_PATH.
       */
      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 /* !PIC */

#undef FONTCONFIG_PATH
#define FONTCONFIG_PATH

#endif /* !_WIN32 */

#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 =; /* MT-goodenough */

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)
{}

/*
 * Manage the application-specific fonts
 */

FcBool
FcConfigAppFontAddFile (FcConfig    *config,
			const FcChar8  *file)
{}

FcBool
FcConfigAppFontAddDir (FcConfig	    *config,
		       const FcChar8   *dir)
{}

void
FcConfigAppFontClear (FcConfig	    *config)
{}

/*
 * Manage filename-based font source selectors
 */

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)
{}

/*
 * Manage font-pattern based font source selectors
 */

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__