diff options
author | marha <marha@users.sourceforge.net> | 2013-03-06 08:37:36 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-03-06 08:37:36 +0100 |
commit | 84798668341b15890d625e3bffbbc2d19f434568 (patch) | |
tree | 50cb332dfbdac780fb24daa6cb0ca03cc8b297fc /fontconfig/src/fccfg.c | |
parent | d4d629b77742e60caac3d120ff40e9f386380af2 (diff) | |
download | vcxsrv-84798668341b15890d625e3bffbbc2d19f434568.tar.gz vcxsrv-84798668341b15890d625e3bffbbc2d19f434568.tar.bz2 vcxsrv-84798668341b15890d625e3bffbbc2d19f434568.zip |
fontconfig libfontenc mesa xserver git update 6 Mar 2013
xserver commit 103b77c59e3638a45179bf6d7908f5c738d2d872
libfontenc commit 624508365ec3279bc74ce523d024533e062629e1
fontconfig commit e96d7760886a3781a46b3271c76af99e15cb0146
mesa commit 88b20d58344ed336b146799c0bf1149a932dc2d7
Diffstat (limited to 'fontconfig/src/fccfg.c')
-rw-r--r-- | fontconfig/src/fccfg.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index db878d5f4..b762376ae 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -123,6 +123,8 @@ FcConfigCreate (void) config->expr_pool = NULL; + config->sysRoot = NULL; + FcRefInit (&config->ref, 1); return config; @@ -292,6 +294,8 @@ FcConfigDestroy (FcConfig *config) free (page); page = next; } + if (config->sysRoot) + FcStrFree (config->sysRoot); free (config); } @@ -2309,6 +2313,59 @@ FcConfigAcceptFont (FcConfig *config, return FcFalse; return FcTrue; } + +const FcChar8 * +FcConfigGetSysRoot (const FcConfig *config) +{ + if (!config) + { + config = FcConfigGetCurrent (); + if (!config) + return NULL; + } + + return config->sysRoot; +} + +void +FcConfigSetSysRoot (FcConfig *config, + const FcChar8 *sysroot) +{ + FcChar8 *s; + FcBool init = FcFalse; + + if (!config) + { + /* We can't use FcConfigGetCurrent() here to ensure + * the sysroot is set prior to initialize FcConfig, + * to avoid loading caches from non-sysroot dirs. + * So postpone the initialization later. + */ + config = fc_atomic_ptr_get (&_fcConfig); + if (!config) + { + config = FcConfigCreate (); + if (!config) + return; + init = FcTrue; + } + } + + s = FcStrCopyFilename (sysroot); + if (!s) + return; + + if (config->sysRoot) + FcStrFree (config->sysRoot); + + config->sysRoot = s; + if (init) + { + config = FcInitLoadOwnConfigAndFonts (config); + FcConfigSetCurrent (config); + } +} + #define __fccfg__ #include "fcaliastail.h" #undef __fccfg__ |