diff --git a/packages/x11-fonts/fontconfig/patches/10_remove-expat.diff b/packages/x11-fonts/fontconfig/patches/10_remove-expat.diff deleted file mode 100644 index 53f99a677f..0000000000 --- a/packages/x11-fonts/fontconfig/patches/10_remove-expat.diff +++ /dev/null @@ -1,3116 +0,0 @@ -diff -Naur fontconfig-2.6.0/configure fontconfig-2.6.0a/configure ---- fontconfig-2.6.0/configure 2008-06-01 04:31:02.000000000 +0200 -+++ fontconfig-2.6.0a/configure 2008-06-25 18:14:41.000000000 +0200 -@@ -1529,7 +1529,6 @@ - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) -- --enable-libxml2 Use libxml2 instead of Expat - --disable-docs Don't build and install documentation - - Optional Packages: -@@ -1541,9 +1540,6 @@ - --with-tags[=TAGS] include additional configurations [automatic] - --with-arch=ARCH Force architecture to ARCH - --with-freetype-config=PROG Use FreeType configuration program PROG -- --with-expat=DIR Use Expat in DIR -- --with-expat-includes=DIR Use Expat includes in DIR -- --with-expat-lib=DIR Use Expat library in DIR - --with-default-fonts=DIR Use fonts from DIR when config is busted - --with-add-fonts=DIR1,DIR2,...Find additional fonts in DIR1,DIR2,... - --with-cache-dir=DIR Use DIR to store cache files (default /var/cache/fontconfig) -@@ -22540,743 +22536,6 @@ - LIBS="$fontconfig_save_libs" - - # --# Check expat configuration --# -- -- --# Check whether --with-expat was given. --if test "${with_expat+set}" = set; then -- withval=$with_expat; expat=$withval --else -- expat=yes --fi -- -- --# Check whether --with-expat-includes was given. --if test "${with_expat_includes+set}" = set; then -- withval=$with_expat_includes; expat_includes=$withval --else -- expat_includes=yes --fi -- -- --# Check whether --with-expat-lib was given. --if test "${with_expat_lib+set}" = set; then -- withval=$with_expat_lib; expat_lib=$withval --else -- expat_lib=yes --fi -- -- --if test "$enable_libxml2" != "yes"; then -- case "$expat" in -- no) -- ;; -- *) -- case "$expat_includes" in -- yes) -- case "$expat" in -- yes) -- ;; -- *) -- EXPAT_CFLAGS="-I$expat/include" -- ;; -- esac -- ;; -- no) -- EXPAT_CFLAGS="" -- ;; -- *) -- EXPAT_CFLAGS="-I$expat_includes" -- ;; -- esac -- case "$expat_lib" in -- yes) -- case "$expat" in -- yes) -- EXPAT_LIBS="-lexpat" -- ;; -- *) -- EXPAT_LIBS="-L$expat/lib -lexpat" -- ;; -- esac -- ;; -- no) -- ;; -- *) -- EXPAT_LIBS="-L$expat_lib -lexpat" -- ;; -- esac -- -- expatsaved_CPPFLAGS="$CPPFLAGS" -- CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" -- expatsaved_LIBS="$LIBS" -- LIBS="$LIBS $EXPAT_LIBS" -- -- if test "${ac_cv_header_expat_h+set}" = set; then -- { echo "$as_me:$LINENO: checking for expat.h" >&5 --echo $ECHO_N "checking for expat.h... $ECHO_C" >&6; } --if test "${ac_cv_header_expat_h+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --fi --{ echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 --echo "${ECHO_T}$ac_cv_header_expat_h" >&6; } --else -- # Is the header compilable? --{ echo "$as_me:$LINENO: checking expat.h usability" >&5 --echo $ECHO_N "checking expat.h usability... $ECHO_C" >&6; } --cat >conftest.$ac_ext <<_ACEOF --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ --$ac_includes_default --#include --_ACEOF --rm -f conftest.$ac_objext --if { (ac_try="$ac_compile" --case "(($ac_try" in -- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -- *) ac_try_echo=$ac_try;; --esac --eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 -- (eval "$ac_compile") 2>conftest.er1 -- ac_status=$? -- grep -v '^ *+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { -- test -z "$ac_c_werror_flag" || -- test ! -s conftest.err -- } && test -s conftest.$ac_objext; then -- ac_header_compiler=yes --else -- echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- ac_header_compiler=no --fi -- --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext --{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 --echo "${ECHO_T}$ac_header_compiler" >&6; } -- --# Is the header present? --{ echo "$as_me:$LINENO: checking expat.h presence" >&5 --echo $ECHO_N "checking expat.h presence... $ECHO_C" >&6; } --cat >conftest.$ac_ext <<_ACEOF --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ --#include --_ACEOF --if { (ac_try="$ac_cpp conftest.$ac_ext" --case "(($ac_try" in -- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -- *) ac_try_echo=$ac_try;; --esac --eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 -- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 -- ac_status=$? -- grep -v '^ *+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null && { -- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || -- test ! -s conftest.err -- }; then -- ac_header_preproc=yes --else -- echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- ac_header_preproc=no --fi -- --rm -f conftest.err conftest.$ac_ext --{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 --echo "${ECHO_T}$ac_header_preproc" >&6; } -- --# So? What about this header? --case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -- yes:no: ) -- { echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 --echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5 --echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;} -- ac_header_preproc=yes -- ;; -- no:yes:* ) -- { echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 --echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} -- { echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5 --echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;} -- { echo "$as_me:$LINENO: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&5 --echo "$as_me: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&2;} -- { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} -- { echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5 --echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;} -- -- ;; --esac --{ echo "$as_me:$LINENO: checking for expat.h" >&5 --echo $ECHO_N "checking for expat.h... $ECHO_C" >&6; } --if test "${ac_cv_header_expat_h+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- ac_cv_header_expat_h=$ac_header_preproc --fi --{ echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 --echo "${ECHO_T}$ac_cv_header_expat_h" >&6; } -- --fi -- -- -- case "$ac_cv_header_expat_h" in -- no) -- if test "${ac_cv_header_xmlparse_h+set}" = set; then -- { echo "$as_me:$LINENO: checking for xmlparse.h" >&5 --echo $ECHO_N "checking for xmlparse.h... $ECHO_C" >&6; } --if test "${ac_cv_header_xmlparse_h+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --fi --{ echo "$as_me:$LINENO: result: $ac_cv_header_xmlparse_h" >&5 --echo "${ECHO_T}$ac_cv_header_xmlparse_h" >&6; } --else -- # Is the header compilable? --{ echo "$as_me:$LINENO: checking xmlparse.h usability" >&5 --echo $ECHO_N "checking xmlparse.h usability... $ECHO_C" >&6; } --cat >conftest.$ac_ext <<_ACEOF --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ --$ac_includes_default --#include --_ACEOF --rm -f conftest.$ac_objext --if { (ac_try="$ac_compile" --case "(($ac_try" in -- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -- *) ac_try_echo=$ac_try;; --esac --eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 -- (eval "$ac_compile") 2>conftest.er1 -- ac_status=$? -- grep -v '^ *+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { -- test -z "$ac_c_werror_flag" || -- test ! -s conftest.err -- } && test -s conftest.$ac_objext; then -- ac_header_compiler=yes --else -- echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- ac_header_compiler=no --fi -- --rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext --{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 --echo "${ECHO_T}$ac_header_compiler" >&6; } -- --# Is the header present? --{ echo "$as_me:$LINENO: checking xmlparse.h presence" >&5 --echo $ECHO_N "checking xmlparse.h presence... $ECHO_C" >&6; } --cat >conftest.$ac_ext <<_ACEOF --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ --#include --_ACEOF --if { (ac_try="$ac_cpp conftest.$ac_ext" --case "(($ac_try" in -- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -- *) ac_try_echo=$ac_try;; --esac --eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 -- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 -- ac_status=$? -- grep -v '^ *+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } >/dev/null && { -- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || -- test ! -s conftest.err -- }; then -- ac_header_preproc=yes --else -- echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- ac_header_preproc=no --fi -- --rm -f conftest.err conftest.$ac_ext --{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 --echo "${ECHO_T}$ac_header_preproc" >&6; } -- --# So? What about this header? --case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -- yes:no: ) -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: accepted by the compiler, rejected by the preprocessor!" >&5 --echo "$as_me: WARNING: xmlparse.h: accepted by the compiler, rejected by the preprocessor!" >&2;} -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: proceeding with the compiler's result" >&5 --echo "$as_me: WARNING: xmlparse.h: proceeding with the compiler's result" >&2;} -- ac_header_preproc=yes -- ;; -- no:yes:* ) -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: present but cannot be compiled" >&5 --echo "$as_me: WARNING: xmlparse.h: present but cannot be compiled" >&2;} -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: check for missing prerequisite headers?" >&5 --echo "$as_me: WARNING: xmlparse.h: check for missing prerequisite headers?" >&2;} -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: see the Autoconf documentation" >&5 --echo "$as_me: WARNING: xmlparse.h: see the Autoconf documentation" >&2;} -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: section \"Present But Cannot Be Compiled\"" >&5 --echo "$as_me: WARNING: xmlparse.h: section \"Present But Cannot Be Compiled\"" >&2;} -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: proceeding with the preprocessor's result" >&5 --echo "$as_me: WARNING: xmlparse.h: proceeding with the preprocessor's result" >&2;} -- { echo "$as_me:$LINENO: WARNING: xmlparse.h: in the future, the compiler will take precedence" >&5 --echo "$as_me: WARNING: xmlparse.h: in the future, the compiler will take precedence" >&2;} -- -- ;; --esac --{ echo "$as_me:$LINENO: checking for xmlparse.h" >&5 --echo $ECHO_N "checking for xmlparse.h... $ECHO_C" >&6; } --if test "${ac_cv_header_xmlparse_h+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- ac_cv_header_xmlparse_h=$ac_header_preproc --fi --{ echo "$as_me:$LINENO: result: $ac_cv_header_xmlparse_h" >&5 --echo "${ECHO_T}$ac_cv_header_xmlparse_h" >&6; } -- --fi -- -- -- case "$ac_cv_header_xmlparse_h" in -- no) -- have_expat_header=no; -- ;; -- yes) -- HAVE_XMLPARSE_H=1 -- -- --cat >>confdefs.h <<_ACEOF --#define HAVE_XMLPARSE_H $HAVE_XMLPARSE_H --_ACEOF -- -- have_expat_header=yes -- ;; -- esac -- ;; -- yes) -- have_expat_header=yes -- ;; -- esac -- case "$have_expat_header" in -- no) -- expat=no -- ;; -- yes) -- --for ac_func in XML_SetDoctypeDeclHandler --do --as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` --{ echo "$as_me:$LINENO: checking for $ac_func" >&5 --echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } --if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- cat >conftest.$ac_ext <<_ACEOF --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ --/* Define $ac_func to an innocuous variant, in case declares $ac_func. -- For example, HP-UX 11i declares gettimeofday. */ --#define $ac_func innocuous_$ac_func -- --/* System header to define __stub macros and hopefully few prototypes, -- which can conflict with char $ac_func (); below. -- Prefer to if __STDC__ is defined, since -- exists even on freestanding compilers. */ -- --#ifdef __STDC__ --# include --#else --# include --#endif -- --#undef $ac_func -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char $ac_func (); --/* The GNU C library defines this for functions which it implements -- to always fail with ENOSYS. Some functions are actually named -- something starting with __ and the normal name is an alias. */ --#if defined __stub_$ac_func || defined __stub___$ac_func --choke me --#endif -- --int --main () --{ --return $ac_func (); -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (ac_try="$ac_link" --case "(($ac_try" in -- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -- *) ac_try_echo=$ac_try;; --esac --eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 -- (eval "$ac_link") 2>conftest.er1 -- ac_status=$? -- grep -v '^ *+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && { -- test -z "$ac_c_werror_flag" || -- test ! -s conftest.err -- } && test -s conftest$ac_exeext && -- $as_test_x conftest$ac_exeext; then -- eval "$as_ac_var=yes" --else -- echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- eval "$as_ac_var=no" --fi -- --rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ -- conftest$ac_exeext conftest.$ac_ext --fi --ac_res=`eval echo '${'$as_ac_var'}'` -- { echo "$as_me:$LINENO: result: $ac_res" >&5 --echo "${ECHO_T}$ac_res" >&6; } --if test `eval echo '${'$as_ac_var'}'` = yes; then -- cat >>confdefs.h <<_ACEOF --#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 --_ACEOF -- --fi --done -- -- case "$ac_cv_func_XML_SetDoctypeDeclHandler" in -- yes) -- HAVE_EXPAT=1 -- -- --cat >>confdefs.h <<_ACEOF --#define HAVE_EXPAT $HAVE_EXPAT --_ACEOF -- -- ;; -- *) -- expat=no -- ;; -- esac -- ;; -- esac -- CPPFLAGS="$expatsaved_CPPFLAGS" -- LIBS="$expatsaved_LIBS" -- ;; -- esac -- -- -- -- -- case "$expat" in -- no) -- EXPAT_CFLAGS="" -- EXPAT_LIBS="" -- -- { echo "$as_me:$LINENO: WARNING: Cannot find usable expat library. Trying to use libxml2 as fallback." >&5 --echo "$as_me: WARNING: Cannot find usable expat library. Trying to use libxml2 as fallback." >&2;} -- ;; -- esac --fi -- --# --# Check libxml2 configuration --# -- --# Check whether --enable-libxml2 was given. --if test "${enable_libxml2+set}" = set; then -- enableval=$enable_libxml2; --fi -- -- -- -- --if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then -- if test -n "$ac_tool_prefix"; then -- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. --set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 --{ echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } --if test "${ac_cv_path_PKG_CONFIG+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- case $PKG_CONFIG in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done --IFS=$as_save_IFS -- -- ;; --esac --fi --PKG_CONFIG=$ac_cv_path_PKG_CONFIG --if test -n "$PKG_CONFIG"; then -- { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 --echo "${ECHO_T}$PKG_CONFIG" >&6; } --else -- { echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6; } --fi -- -- --fi --if test -z "$ac_cv_path_PKG_CONFIG"; then -- ac_pt_PKG_CONFIG=$PKG_CONFIG -- # Extract the first word of "pkg-config", so it can be a program name with args. --set dummy pkg-config; ac_word=$2 --{ echo "$as_me:$LINENO: checking for $ac_word" >&5 --echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } --if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then -- echo $ECHO_N "(cached) $ECHO_C" >&6 --else -- case $ac_pt_PKG_CONFIG in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done --done --IFS=$as_save_IFS -- -- ;; --esac --fi --ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG --if test -n "$ac_pt_PKG_CONFIG"; then -- { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 --echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } --else -- { echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6; } --fi -- -- if test "x$ac_pt_PKG_CONFIG" = x; then -- PKG_CONFIG="" -- else -- case $cross_compiling:$ac_tool_warned in --yes:) --{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools --whose name does not start with the host triplet. If you think this --configuration is useful to you, please write to autoconf@gnu.org." >&5 --echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools --whose name does not start with the host triplet. If you think this --configuration is useful to you, please write to autoconf@gnu.org." >&2;} --ac_tool_warned=yes ;; --esac -- PKG_CONFIG=$ac_pt_PKG_CONFIG -- fi --else -- PKG_CONFIG="$ac_cv_path_PKG_CONFIG" --fi -- --fi --if test -n "$PKG_CONFIG"; then -- _pkg_min_version=0.9.0 -- { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 --echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } -- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then -- { echo "$as_me:$LINENO: result: yes" >&5 --echo "${ECHO_T}yes" >&6; } -- else -- { echo "$as_me:$LINENO: result: no" >&5 --echo "${ECHO_T}no" >&6; } -- PKG_CONFIG="" -- fi -- --fi -- --if test "$enable_libxml2" = "yes" -o "$expat" = "no"; then -- --pkg_failed=no --{ echo "$as_me:$LINENO: checking for LIBXML2" >&5 --echo $ECHO_N "checking for LIBXML2... $ECHO_C" >&6; } -- --if test -n "$PKG_CONFIG"; then -- if test -n "$LIBXML2_CFLAGS"; then -- pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS" -- else -- if test -n "$PKG_CONFIG" && \ -- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\"") >&5 -- ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; then -- pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6" 2>/dev/null` --else -- pkg_failed=yes --fi -- fi --else -- pkg_failed=untried --fi --if test -n "$PKG_CONFIG"; then -- if test -n "$LIBXML2_LIBS"; then -- pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS" -- else -- if test -n "$PKG_CONFIG" && \ -- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\"") >&5 -- ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; then -- pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6" 2>/dev/null` --else -- pkg_failed=yes --fi -- fi --else -- pkg_failed=untried --fi -- -- -- --if test $pkg_failed = yes; then -- --if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -- _pkg_short_errors_supported=yes --else -- _pkg_short_errors_supported=no --fi -- if test $_pkg_short_errors_supported = yes; then -- LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libxml-2.0 >= 2.6"` -- else -- LIBXML2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml-2.0 >= 2.6"` -- fi -- # Put the nasty error message in config.log where it belongs -- echo "$LIBXML2_PKG_ERRORS" >&5 -- -- { { echo "$as_me:$LINENO: error: Package requirements (libxml-2.0 >= 2.6) were not met: -- --$LIBXML2_PKG_ERRORS -- --Consider adjusting the PKG_CONFIG_PATH environment variable if you --installed software in a non-standard prefix. -- --Alternatively, you may set the environment variables LIBXML2_CFLAGS --and LIBXML2_LIBS to avoid the need to call pkg-config. --See the pkg-config man page for more details. --" >&5 --echo "$as_me: error: Package requirements (libxml-2.0 >= 2.6) were not met: -- --$LIBXML2_PKG_ERRORS -- --Consider adjusting the PKG_CONFIG_PATH environment variable if you --installed software in a non-standard prefix. -- --Alternatively, you may set the environment variables LIBXML2_CFLAGS --and LIBXML2_LIBS to avoid the need to call pkg-config. --See the pkg-config man page for more details. --" >&2;} -- { (exit 1); exit 1; }; } --elif test $pkg_failed = untried; then -- { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it --is in your PATH or set the PKG_CONFIG environment variable to the full --path to pkg-config. -- --Alternatively, you may set the environment variables LIBXML2_CFLAGS --and LIBXML2_LIBS to avoid the need to call pkg-config. --See the pkg-config man page for more details. -- --To get pkg-config, see . --See \`config.log' for more details." >&5 --echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it --is in your PATH or set the PKG_CONFIG environment variable to the full --path to pkg-config. -- --Alternatively, you may set the environment variables LIBXML2_CFLAGS --and LIBXML2_LIBS to avoid the need to call pkg-config. --See the pkg-config man page for more details. -- --To get pkg-config, see . --See \`config.log' for more details." >&2;} -- { (exit 1); exit 1; }; } --else -- LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS -- LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS -- { echo "$as_me:$LINENO: result: yes" >&5 --echo "${ECHO_T}yes" >&6; } -- : --fi -- --cat >>confdefs.h <<_ACEOF --#define ENABLE_LIBXML2 1 --_ACEOF -- -- -- -- --fi -- --# - # Set default font directory - # - -diff -Naur fontconfig-2.6.0/src/fcxml.c fontconfig-2.6.0a/src/fcxml.c ---- fontconfig-2.6.0/src/fcxml.c 2008-05-25 02:12:34.000000000 +0200 -+++ fontconfig-2.6.0a/src/fcxml.c 2008-06-25 18:18:34.000000000 +0200 -@@ -27,38 +27,6 @@ - #include - #include - --#ifdef ENABLE_LIBXML2 -- --#include -- --#define XML_Char xmlChar --#define XML_Parser xmlParserCtxtPtr --#define XML_ParserFree xmlFreeParserCtxt --#define XML_GetCurrentLineNumber xmlSAX2GetLineNumber --#define XML_GetErrorCode xmlCtxtGetLastError --#define XML_ErrorString(Error) (Error)->message -- --#else /* ENABLE_LIBXML2 */ -- --#ifndef HAVE_XMLPARSE_H --#define HAVE_XMLPARSE_H 0 --#endif -- --#if HAVE_XMLPARSE_H --#include --#else --#include --#endif -- --#endif /* ENABLE_LIBXML2 */ -- --#ifdef _WIN32 --#define STRICT --#include --#undef STRICT --#endif -- -- - void - FcTestDestroy (FcTest *test) - { -@@ -278,2303 +246,12 @@ - return (char *) FcStrCopy ((FcChar8 *) field); - } - --typedef enum _FcElement { -- FcElementNone, -- FcElementFontconfig, -- FcElementDir, -- FcElementCacheDir, -- FcElementCache, -- FcElementInclude, -- FcElementConfig, -- FcElementMatch, -- FcElementAlias, -- -- FcElementBlank, -- FcElementRescan, -- -- FcElementPrefer, -- FcElementAccept, -- FcElementDefault, -- FcElementFamily, -- -- FcElementSelectfont, -- FcElementAcceptfont, -- FcElementRejectfont, -- FcElementGlob, -- FcElementPattern, -- FcElementPatelt, -- -- FcElementTest, -- FcElementEdit, -- FcElementInt, -- FcElementDouble, -- FcElementString, -- FcElementMatrix, -- FcElementBool, -- FcElementCharset, -- FcElementName, -- FcElementConst, -- FcElementOr, -- FcElementAnd, -- FcElementEq, -- FcElementNotEq, -- FcElementLess, -- FcElementLessEq, -- FcElementMore, -- FcElementMoreEq, -- FcElementContains, -- FcElementNotContains, -- FcElementPlus, -- FcElementMinus, -- FcElementTimes, -- FcElementDivide, -- FcElementNot, -- FcElementIf, -- FcElementFloor, -- FcElementCeil, -- FcElementRound, -- FcElementTrunc, -- FcElementUnknown --} FcElement; -- --static const struct { -- const char name[16]; -- FcElement element; --} fcElementMap[] = { -- { "fontconfig", FcElementFontconfig }, -- { "dir", FcElementDir }, -- { "cachedir", FcElementCacheDir }, -- { "cache", FcElementCache }, -- { "include", FcElementInclude }, -- { "config", FcElementConfig }, -- { "match", FcElementMatch }, -- { "alias", FcElementAlias }, -- -- { "blank", FcElementBlank }, -- { "rescan", FcElementRescan }, -- -- { "prefer", FcElementPrefer }, -- { "accept", FcElementAccept }, -- { "default", FcElementDefault }, -- { "family", FcElementFamily }, -- -- { "selectfont", FcElementSelectfont }, -- { "acceptfont", FcElementAcceptfont }, -- { "rejectfont", FcElementRejectfont }, -- { "glob", FcElementGlob }, -- { "pattern", FcElementPattern }, -- { "patelt", FcElementPatelt }, -- -- { "test", FcElementTest }, -- { "edit", FcElementEdit }, -- { "int", FcElementInt }, -- { "double", FcElementDouble }, -- { "string", FcElementString }, -- { "matrix", FcElementMatrix }, -- { "bool", FcElementBool }, -- { "charset", FcElementCharset }, -- { "name", FcElementName }, -- { "const", FcElementConst }, -- { "or", FcElementOr }, -- { "and", FcElementAnd }, -- { "eq", FcElementEq }, -- { "not_eq", FcElementNotEq }, -- { "less", FcElementLess }, -- { "less_eq", FcElementLessEq }, -- { "more", FcElementMore }, -- { "more_eq", FcElementMoreEq }, -- { "contains", FcElementContains }, -- { "not_contains", FcElementNotContains }, -- { "plus", FcElementPlus }, -- { "minus", FcElementMinus }, -- { "times", FcElementTimes }, -- { "divide", FcElementDivide }, -- { "not", FcElementNot }, -- { "if", FcElementIf }, -- { "floor", FcElementFloor }, -- { "ceil", FcElementCeil }, -- { "round", FcElementRound }, -- { "trunc", FcElementTrunc }, --}; --#define NUM_ELEMENT_MAPS (int) (sizeof fcElementMap / sizeof fcElementMap[0]) -- --static FcElement --FcElementMap (const XML_Char *name) --{ -- -- int i; -- for (i = 0; i < NUM_ELEMENT_MAPS; i++) -- if (!strcmp ((char *) name, fcElementMap[i].name)) -- return fcElementMap[i].element; -- return FcElementUnknown; --} -- --typedef struct _FcPStack { -- struct _FcPStack *prev; -- FcElement element; -- FcChar8 **attr; -- FcStrBuf str; --} FcPStack; -- --typedef enum _FcVStackTag { -- FcVStackNone, -- -- FcVStackString, -- FcVStackFamily, -- FcVStackField, -- FcVStackConstant, -- FcVStackGlob, -- FcVStackPattern, -- -- FcVStackPrefer, -- FcVStackAccept, -- FcVStackDefault, -- -- FcVStackInteger, -- FcVStackDouble, -- FcVStackMatrix, -- FcVStackBool, -- -- FcVStackTest, -- FcVStackExpr, -- FcVStackEdit --} FcVStackTag; -- --typedef struct _FcVStack { -- struct _FcVStack *prev; -- FcPStack *pstack; /* related parse element */ -- FcVStackTag tag; -- union { -- FcChar8 *string; -- -- int integer; -- double _double; -- FcMatrix *matrix; -- FcBool bool; -- -- FcTest *test; -- FcQual qual; -- FcOp op; -- FcExpr *expr; -- FcEdit *edit; -- -- FcPattern *pattern; -- } u; --} FcVStack; -- --typedef struct _FcConfigParse { -- FcPStack *pstack; -- FcVStack *vstack; -- FcBool error; -- const FcChar8 *name; -- FcConfig *config; -- XML_Parser parser; --} FcConfigParse; -- --typedef enum _FcConfigSeverity { -- FcSevereInfo, FcSevereWarning, FcSevereError --} FcConfigSeverity; -- --static void --FcConfigMessage (FcConfigParse *parse, FcConfigSeverity severe, const char *fmt, ...) --{ -- const char *s = "unknown"; -- va_list args; -- -- va_start (args, fmt); -- -- switch (severe) { -- case FcSevereInfo: s = "info"; break; -- case FcSevereWarning: s = "warning"; break; -- case FcSevereError: s = "error"; break; -- } -- if (parse) -- { -- if (parse->name) -- fprintf (stderr, "Fontconfig %s: \"%s\", line %d: ", s, -- parse->name, (int)XML_GetCurrentLineNumber (parse->parser)); -- else -- fprintf (stderr, "Fontconfig %s: line %d: ", s, -- (int)XML_GetCurrentLineNumber (parse->parser)); -- if (severe >= FcSevereError) -- parse->error = FcTrue; -- } -- else -- fprintf (stderr, "Fontconfig %s: ", s); -- vfprintf (stderr, fmt, args); -- fprintf (stderr, "\n"); -- va_end (args); --} -- -- --static const char * --FcTypeName (FcType type) --{ -- switch (type) { -- case FcTypeVoid: -- return "void"; -- case FcTypeInteger: -- case FcTypeDouble: -- return "number"; -- case FcTypeString: -- return "string"; -- case FcTypeBool: -- return "bool"; -- case FcTypeMatrix: -- return "matrix"; -- case FcTypeCharSet: -- return "charset"; -- case FcTypeFTFace: -- return "FT_Face"; -- case FcTypeLangSet: -- return "langset"; -- default: -- return "unknown"; -- } --} -- --static void --FcTypecheckValue (FcConfigParse *parse, FcType value, FcType type) --{ -- if (value == FcTypeInteger) -- value = FcTypeDouble; -- if (type == FcTypeInteger) -- type = FcTypeDouble; -- if (value != type) -- { -- if ((value == FcTypeLangSet && type == FcTypeString) || -- (value == FcTypeString && type == FcTypeLangSet)) -- return; -- if (type == (FcType) -1) -- return; -- FcConfigMessage (parse, FcSevereWarning, "saw %s, expected %s", -- FcTypeName (value), FcTypeName (type)); -- } --} -- --static void --FcTypecheckExpr (FcConfigParse *parse, FcExpr *expr, FcType type) --{ -- const FcObjectType *o; -- const FcConstant *c; -- -- /* If parsing the expression failed, some nodes may be NULL */ -- if (!expr) -- return; -- -- switch (expr->op) { -- case FcOpInteger: -- case FcOpDouble: -- FcTypecheckValue (parse, FcTypeDouble, type); -- break; -- case FcOpString: -- FcTypecheckValue (parse, FcTypeString, type); -- break; -- case FcOpMatrix: -- FcTypecheckValue (parse, FcTypeMatrix, type); -- break; -- case FcOpBool: -- FcTypecheckValue (parse, FcTypeBool, type); -- break; -- case FcOpCharSet: -- FcTypecheckValue (parse, FcTypeCharSet, type); -- break; -- case FcOpNil: -- break; -- case FcOpField: -- o = FcNameGetObjectType (FcObjectName (expr->u.object)); -- if (o) -- FcTypecheckValue (parse, o->type, type); -- break; -- case FcOpConst: -- c = FcNameGetConstant (expr->u.constant); -- if (c) -- { -- o = FcNameGetObjectType (c->object); -- if (o) -- FcTypecheckValue (parse, o->type, type); -- } -- else -- FcConfigMessage (parse, FcSevereWarning, -- "invalid constant used : %s", -- expr->u.constant); -- break; -- case FcOpQuest: -- FcTypecheckExpr (parse, expr->u.tree.left, FcTypeBool); -- FcTypecheckExpr (parse, expr->u.tree.right->u.tree.left, type); -- FcTypecheckExpr (parse, expr->u.tree.right->u.tree.right, type); -- break; -- case FcOpAssign: -- case FcOpAssignReplace: -- break; -- case FcOpEqual: -- case FcOpNotEqual: -- case FcOpLess: -- case FcOpLessEqual: -- case FcOpMore: -- case FcOpMoreEqual: -- case FcOpContains: -- case FcOpNotContains: -- case FcOpListing: -- FcTypecheckValue (parse, FcTypeBool, type); -- break; -- case FcOpComma: -- case FcOpOr: -- case FcOpAnd: -- case FcOpPlus: -- case FcOpMinus: -- case FcOpTimes: -- case FcOpDivide: -- FcTypecheckExpr (parse, expr->u.tree.left, type); -- FcTypecheckExpr (parse, expr->u.tree.right, type); -- break; -- case FcOpNot: -- FcTypecheckValue (parse, FcTypeBool, type); -- FcTypecheckExpr (parse, expr->u.tree.left, FcTypeBool); -- break; -- case FcOpFloor: -- case FcOpCeil: -- case FcOpRound: -- case FcOpTrunc: -- FcTypecheckValue (parse, FcTypeDouble, type); -- FcTypecheckExpr (parse, expr->u.tree.left, FcTypeDouble); -- break; -- default: -- break; -- } --} -- --static FcTest * --FcTestCreate (FcConfigParse *parse, -- FcMatchKind kind, -- FcQual qual, -- const FcChar8 *field, -- FcOp compare, -- FcExpr *expr) --{ -- FcTest *test = (FcTest *) malloc (sizeof (FcTest)); -- -- if (test) -- { -- const FcObjectType *o; -- -- FcMemAlloc (FC_MEM_TEST, sizeof (FcTest)); -- test->next = 0; -- test->kind = kind; -- test->qual = qual; -- test->object = FcObjectFromName ((const char *) field); -- test->op = compare; -- test->expr = expr; -- o = FcNameGetObjectType (FcObjectName (test->object)); -- if (o) -- FcTypecheckExpr (parse, expr, o->type); -- } -- return test; --} -- --static FcEdit * --FcEditCreate (FcConfigParse *parse, -- FcObject object, -- FcOp op, -- FcExpr *expr, -- FcValueBinding binding) --{ -- FcEdit *e = (FcEdit *) malloc (sizeof (FcEdit)); -- -- if (e) -- { -- const FcObjectType *o; -- -- e->next = 0; -- e->object = object; -- e->op = op; -- e->expr = expr; -- e->binding = binding; -- o = FcNameGetObjectType (FcObjectName (e->object)); -- if (o) -- FcTypecheckExpr (parse, expr, o->type); -- } -- return e; --} -- --static void --FcVStackPush (FcConfigParse *parse, FcVStack *vstack) --{ -- vstack->prev = parse->vstack; -- vstack->pstack = parse->pstack ? parse->pstack->prev : 0; -- parse->vstack = vstack; --} -- --static FcVStack * --FcVStackCreate (void) --{ -- FcVStack *new; -- -- new = malloc (sizeof (FcVStack)); -- if (!new) -- return 0; -- FcMemAlloc (FC_MEM_VSTACK, sizeof (FcVStack)); -- new->tag = FcVStackNone; -- new->prev = 0; -- return new; --} -- --static void --FcVStackDestroy (FcVStack *vstack) --{ -- FcVStack *prev; -- -- for (; vstack; vstack = prev) -- { -- prev = vstack->prev; -- switch (vstack->tag) { -- case FcVStackNone: -- break; -- case FcVStackString: -- case FcVStackFamily: -- case FcVStackField: -- case FcVStackConstant: -- case FcVStackGlob: -- FcStrFree (vstack->u.string); -- break; -- case FcVStackPattern: -- FcPatternDestroy (vstack->u.pattern); -- break; -- case FcVStackInteger: -- case FcVStackDouble: -- break; -- case FcVStackMatrix: -- FcMatrixFree (vstack->u.matrix); -- break; -- case FcVStackBool: -- break; -- case FcVStackTest: -- FcTestDestroy (vstack->u.test); -- break; -- case FcVStackExpr: -- case FcVStackPrefer: -- case FcVStackAccept: -- case FcVStackDefault: -- FcExprDestroy (vstack->u.expr); -- break; -- case FcVStackEdit: -- FcEditDestroy (vstack->u.edit); -- break; -- } -- FcMemFree (FC_MEM_VSTACK, sizeof (FcVStack)); -- free (vstack); -- } --} -- --static FcBool --FcVStackPushString (FcConfigParse *parse, FcVStackTag tag, FcChar8 *string) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u.string = string; -- vstack->tag = tag; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushInteger (FcConfigParse *parse, int integer) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u.integer = integer; -- vstack->tag = FcVStackInteger; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushDouble (FcConfigParse *parse, double _double) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u._double = _double; -- vstack->tag = FcVStackDouble; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushMatrix (FcConfigParse *parse, FcMatrix *matrix) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- matrix = FcMatrixCopy (matrix); -- if (!matrix) -- { -- FcVStackDestroy (vstack); -- return FcFalse; -- } -- vstack->u.matrix = matrix; -- vstack->tag = FcVStackMatrix; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushBool (FcConfigParse *parse, FcBool bool) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u.bool = bool; -- vstack->tag = FcVStackBool; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushTest (FcConfigParse *parse, FcTest *test) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u.test = test; -- vstack->tag = FcVStackTest; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushExpr (FcConfigParse *parse, FcVStackTag tag, FcExpr *expr) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u.expr = expr; -- vstack->tag = tag; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushEdit (FcConfigParse *parse, FcEdit *edit) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u.edit = edit; -- vstack->tag = FcVStackEdit; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcBool --FcVStackPushPattern (FcConfigParse *parse, FcPattern *pattern) --{ -- FcVStack *vstack = FcVStackCreate (); -- if (!vstack) -- return FcFalse; -- vstack->u.pattern = pattern; -- vstack->tag = FcVStackPattern; -- FcVStackPush (parse, vstack); -- return FcTrue; --} -- --static FcVStack * --FcVStackFetch (FcConfigParse *parse, int off) --{ -- FcVStack *vstack; -- -- for (vstack = parse->vstack; vstack && off-- > 0; vstack = vstack->prev); -- return vstack; --} -- --static void --FcVStackClear (FcConfigParse *parse) --{ -- while (parse->vstack && parse->vstack->pstack == parse->pstack) -- { -- FcVStack *vstack = parse->vstack; -- parse->vstack = vstack->prev; -- vstack->prev = 0; -- FcVStackDestroy (vstack); -- } --} -- --static FcVStack * --FcVStackPop (FcConfigParse *parse) --{ -- FcVStack *vstack = parse->vstack; -- -- if (!vstack || vstack->pstack != parse->pstack) -- return 0; -- parse->vstack = vstack->prev; -- vstack->prev = 0; -- return vstack; --} -- --static int --FcVStackElements (FcConfigParse *parse) --{ -- int h = 0; -- FcVStack *vstack = parse->vstack; -- while (vstack && vstack->pstack == parse->pstack) -- { -- h++; -- vstack = vstack->prev; -- } -- return h; --} -- --static FcChar8 ** --FcConfigSaveAttr (const XML_Char **attr) --{ -- int slen; -- int i; -- FcChar8 **new; -- FcChar8 *s; -- -- if (!attr) -- return 0; -- slen = 0; -- for (i = 0; attr[i]; i++) -- slen += strlen ((char *) attr[i]) + 1; -- new = malloc ((i + 1) * sizeof (FcChar8 *) + slen); -- if (!new) -- return 0; -- FcMemAlloc (FC_MEM_ATTR, 1); /* size is too expensive */ -- s = (FcChar8 *) (new + (i + 1)); -- for (i = 0; attr[i]; i++) -- { -- new[i] = s; -- strcpy ((char *) s, (char *) attr[i]); -- s += strlen ((char *) s) + 1; -- } -- new[i] = 0; -- return new; --} -- --static FcBool --FcPStackPush (FcConfigParse *parse, FcElement element, const XML_Char **attr) --{ -- FcPStack *new = malloc (sizeof (FcPStack)); -- -- if (!new) -- return FcFalse; -- FcMemAlloc (FC_MEM_PSTACK, sizeof (FcPStack)); -- new->prev = parse->pstack; -- new->element = element; -- if (attr) -- { -- new->attr = FcConfigSaveAttr (attr); -- if (!new->attr) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- FcMemFree (FC_MEM_PSTACK, sizeof (FcPStack)); -- free (new); -- return FcFalse; -- } -- } -- else -- new->attr = 0; -- FcStrBufInit (&new->str, 0, 0); -- parse->pstack = new; -- return FcTrue; --} -- --static FcBool --FcPStackPop (FcConfigParse *parse) --{ -- FcPStack *old; -- -- if (!parse->pstack) -- { -- FcConfigMessage (parse, FcSevereError, "mismatching element"); -- return FcFalse; -- } -- FcVStackClear (parse); -- old = parse->pstack; -- parse->pstack = old->prev; -- FcStrBufDestroy (&old->str); -- if (old->attr) -- { -- FcMemFree (FC_MEM_ATTR, 1); /* size is to expensive */ -- free (old->attr); -- } -- FcMemFree (FC_MEM_PSTACK, sizeof (FcPStack)); -- free (old); -- return FcTrue; --} -- --static FcBool --FcConfigInit (FcConfigParse *parse, const FcChar8 *name, FcConfig *config, XML_Parser parser) --{ -- parse->pstack = 0; -- parse->vstack = 0; -- parse->error = FcFalse; -- parse->name = name; -- parse->config = config; -- parse->parser = parser; -- return FcTrue; --} -- --static void --FcConfigCleanup (FcConfigParse *parse) --{ -- while (parse->pstack) -- FcPStackPop (parse); --} -- --static const FcChar8 * --FcConfigGetAttribute (FcConfigParse *parse, const char *attr) --{ -- FcChar8 **attrs; -- if (!parse->pstack) -- return 0; -- -- attrs = parse->pstack->attr; -- if (!attrs) -- return 0; -- -- while (*attrs) -- { -- if (!strcmp ((char *) *attrs, attr)) -- return attrs[1]; -- attrs += 2; -- } -- return 0; --} -- --static void --FcStartElement(void *userData, const XML_Char *name, const XML_Char **attr) --{ -- FcConfigParse *parse = userData; -- FcElement element; -- -- element = FcElementMap (name); -- if (element == FcElementUnknown) -- FcConfigMessage (parse, FcSevereWarning, "unknown element \"%s\"", name); -- -- if (!FcPStackPush (parse, element, attr)) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- return; --} -- --static void --FcParseBlank (FcConfigParse *parse) --{ -- int n = FcVStackElements (parse); -- while (n-- > 0) -- { -- FcVStack *v = FcVStackFetch (parse, n); -- if (v->tag != FcVStackInteger) -- FcConfigMessage (parse, FcSevereError, "non-integer blank"); -- else -- { -- if (!parse->config->blanks) -- { -- parse->config->blanks = FcBlanksCreate (); -- if (!parse->config->blanks) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } -- } -- if (!FcBlanksAdd (parse->config->blanks, v->u.integer)) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } -- } -- } --} -- --static void --FcParseRescan (FcConfigParse *parse) --{ -- int n = FcVStackElements (parse); -- while (n-- > 0) -- { -- FcVStack *v = FcVStackFetch (parse, n); -- if (v->tag != FcVStackInteger) -- FcConfigMessage (parse, FcSevereWarning, "non-integer rescan"); -- else -- parse->config->rescanInterval = v->u.integer; -- } --} -- --static void --FcParseInt (FcConfigParse *parse) --{ -- FcChar8 *s, *end; -- int l; -- -- if (!parse->pstack) -- return; -- s = FcStrBufDone (&parse->pstack->str); -- if (!s) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- end = 0; -- l = (int) strtol ((char *) s, (char **)&end, 0); -- if (end != s + strlen ((char *) s)) -- FcConfigMessage (parse, FcSevereError, "\"%s\": not a valid integer", s); -- else -- FcVStackPushInteger (parse, l); -- FcStrFree (s); --} -- --/* -- * idea copied from glib g_ascii_strtod with -- * permission of the author (Alexander Larsson) -- */ -- --#include -- --static double --FcStrtod (char *s, char **end) --{ -- struct lconv *locale_data; -- char *dot; -- double v; -- -- /* -- * Have to swap the decimal point to match the current locale -- * if that locale doesn't use 0x2e -- */ -- if ((dot = strchr (s, 0x2e)) && -- (locale_data = localeconv ()) && -- (locale_data->decimal_point[0] != 0x2e || -- locale_data->decimal_point[1] != 0)) -- { -- char buf[128]; -- int slen = strlen (s); -- int dlen = strlen (locale_data->decimal_point); -- -- if (slen + dlen > (int) sizeof (buf)) -- { -- if (end) -- *end = s; -- v = 0; -- } -- else -- { -- char *buf_end; -- /* mantissa */ -- strncpy (buf, s, dot - s); -- /* decimal point */ -- strcpy (buf + (dot - s), locale_data->decimal_point); -- /* rest of number */ -- strcpy (buf + (dot - s) + dlen, dot + 1); -- buf_end = 0; -- v = strtod (buf, &buf_end); -- if (buf_end) { -- buf_end = s + (buf_end - buf); -- if (buf_end > dot) -- buf_end -= dlen - 1; -- } -- if (end) -- *end = buf_end; -- } -- } -- else -- v = strtod (s, end); -- return v; --} -- --static void --FcParseDouble (FcConfigParse *parse) --{ -- FcChar8 *s, *end; -- double d; -- -- if (!parse->pstack) -- return; -- s = FcStrBufDone (&parse->pstack->str); -- if (!s) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- end = 0; -- d = FcStrtod ((char *) s, (char **)&end); -- if (end != s + strlen ((char *) s)) -- FcConfigMessage (parse, FcSevereError, "\"%s\": not a valid double", s); -- else -- FcVStackPushDouble (parse, d); -- FcStrFree (s); --} -- --static void --FcParseString (FcConfigParse *parse, FcVStackTag tag) --{ -- FcChar8 *s; -- -- if (!parse->pstack) -- return; -- s = FcStrBufDone (&parse->pstack->str); -- if (!s) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- if (!FcVStackPushString (parse, tag, s)) -- FcStrFree (s); --} -- --static void --FcParseMatrix (FcConfigParse *parse) --{ -- FcVStack *vstack; -- enum { m_done, m_xx, m_xy, m_yx, m_yy } matrix_state = m_yy; -- FcMatrix m; -- -- while ((vstack = FcVStackPop (parse))) -- { -- double v; -- switch (vstack->tag) { -- case FcVStackInteger: -- v = vstack->u.integer; -- break; -- case FcVStackDouble: -- v = vstack->u._double; -- break; -- default: -- FcConfigMessage (parse, FcSevereError, "non-double matrix element"); -- v = 1.0; -- break; -- } -- switch (matrix_state) { -- case m_xx: m.xx = v; break; -- case m_xy: m.xy = v; break; -- case m_yx: m.yx = v; break; -- case m_yy: m.yy = v; break; -- default: break; -- } -- FcVStackDestroy (vstack); -- matrix_state--; -- } -- if (matrix_state != m_done) -- FcConfigMessage (parse, FcSevereError, "wrong number of matrix elements"); -- else -- FcVStackPushMatrix (parse, &m); --} -- --static FcBool --FcConfigLexBool (FcConfigParse *parse, const FcChar8 *bool) --{ -- FcBool result = FcFalse; -- -- if (!FcNameBool (bool, &result)) -- FcConfigMessage (parse, FcSevereWarning, "\"%s\" is not known boolean", -- bool); -- return result; --} -- --static void --FcParseBool (FcConfigParse *parse) --{ -- FcChar8 *s; -- -- if (!parse->pstack) -- return; -- s = FcStrBufDone (&parse->pstack->str); -- if (!s) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- FcVStackPushBool (parse, FcConfigLexBool (parse, s)); -- FcStrFree (s); --} -- --static FcBool --FcConfigLexBinding (FcConfigParse *parse, -- const FcChar8 *binding_string, -- FcValueBinding *binding_ret) -+FcBool -+FcConfigParseAndLoad (FcConfig *config, -+ const FcChar8 *name, -+ FcBool complain) - { -- FcValueBinding binding; -- -- if (!binding_string) -- binding = FcValueBindingWeak; -- else -- { -- if (!strcmp ((char *) binding_string, "weak")) -- binding = FcValueBindingWeak; -- else if (!strcmp ((char *) binding_string, "strong")) -- binding = FcValueBindingStrong; -- else if (!strcmp ((char *) binding_string, "same")) -- binding = FcValueBindingSame; -- else -- { -- FcConfigMessage (parse, FcSevereWarning, "invalid binding \"%s\"", binding_string); -- return FcFalse; -- } -- } -- *binding_ret = binding; -- return FcTrue; --} -- --static void --FcParseFamilies (FcConfigParse *parse, FcVStackTag tag) --{ -- FcVStack *vstack; -- FcExpr *left, *expr = 0, *new; -- -- while ((vstack = FcVStackPop (parse))) -- { -- if (vstack->tag != FcVStackFamily) -- { -- FcConfigMessage (parse, FcSevereWarning, "non-family"); -- FcVStackDestroy (vstack); -- continue; -- } -- left = vstack->u.expr; -- vstack->tag = FcVStackNone; -- FcVStackDestroy (vstack); -- if (expr) -- { -- new = FcExprCreateOp (left, FcOpComma, expr); -- if (!new) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- FcExprDestroy (left); -- FcExprDestroy (expr); -- break; -- } -- expr = new; -- } -- else -- expr = left; -- } -- if (expr) -- { -- if (!FcVStackPushExpr (parse, tag, expr)) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- FcExprDestroy (expr); -- } -- } --} -- --static void --FcParseFamily (FcConfigParse *parse) --{ -- FcChar8 *s; -- FcExpr *expr; -- -- if (!parse->pstack) -- return; -- s = FcStrBufDone (&parse->pstack->str); -- if (!s) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- expr = FcExprCreateString (s); -- FcStrFree (s); -- if (expr) -- FcVStackPushExpr (parse, FcVStackFamily, expr); --} -- --static void --FcParseAlias (FcConfigParse *parse) --{ -- FcExpr *family = 0, *accept = 0, *prefer = 0, *def = 0, *new = 0; -- FcEdit *edit = 0, *next; -- FcVStack *vstack; -- FcTest *test; -- FcValueBinding binding; -- -- if (!FcConfigLexBinding (parse, FcConfigGetAttribute (parse, "binding"), &binding)) -- return; -- while ((vstack = FcVStackPop (parse))) -- { -- switch (vstack->tag) { -- case FcVStackFamily: -- if (family) -- { -- new = FcExprCreateOp (vstack->u.expr, FcOpComma, family); -- if (!new) -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- else -- family = new; -- } -- else -- new = vstack->u.expr; -- if (new) -- { -- family = new; -- vstack->tag = FcVStackNone; -- } -- break; -- case FcVStackPrefer: -- if (prefer) -- FcExprDestroy (prefer); -- prefer = vstack->u.expr; -- vstack->tag = FcVStackNone; -- break; -- case FcVStackAccept: -- if (accept) -- FcExprDestroy (accept); -- accept = vstack->u.expr; -- vstack->tag = FcVStackNone; -- break; -- case FcVStackDefault: -- if (def) -- FcExprDestroy (def); -- def = vstack->u.expr; -- vstack->tag = FcVStackNone; -- break; -- default: -- FcConfigMessage (parse, FcSevereWarning, "bad alias"); -- break; -- } -- FcVStackDestroy (vstack); -- } -- if (!family) -- { -- FcConfigMessage (parse, FcSevereError, "missing family in alias"); -- if (prefer) -- FcExprDestroy (prefer); -- if (accept) -- FcExprDestroy (accept); -- if (def) -- FcExprDestroy (def); -- return; -- } -- if (prefer) -- { -- edit = FcEditCreate (parse, -- FC_FAMILY_OBJECT, -- FcOpPrepend, -- prefer, -- binding); -- if (edit) -- edit->next = 0; -- else -- FcExprDestroy (prefer); -- } -- if (accept) -- { -- next = edit; -- edit = FcEditCreate (parse, -- FC_FAMILY_OBJECT, -- FcOpAppend, -- accept, -- binding); -- if (edit) -- edit->next = next; -- else -- FcExprDestroy (accept); -- } -- if (def) -- { -- next = edit; -- edit = FcEditCreate (parse, -- FC_FAMILY_OBJECT, -- FcOpAppendLast, -- def, -- binding); -- if (edit) -- edit->next = next; -- else -- FcExprDestroy (def); -- } -- if (edit) -- { -- test = FcTestCreate (parse, FcMatchPattern, -- FcQualAny, -- (FcChar8 *) FC_FAMILY, -- FcOpEqual, -- family); -- if (test) -- if (!FcConfigAddEdit (parse->config, test, edit, FcMatchPattern)) -- FcTestDestroy (test); -- } -- else -- FcExprDestroy (family); --} -- --static FcExpr * --FcPopExpr (FcConfigParse *parse) --{ -- FcVStack *vstack = FcVStackPop (parse); -- FcExpr *expr = 0; -- if (!vstack) -- return 0; -- switch (vstack->tag) { -- case FcVStackNone: -- break; -- case FcVStackString: -- case FcVStackFamily: -- expr = FcExprCreateString (vstack->u.string); -- break; -- case FcVStackField: -- expr = FcExprCreateField ((char *) vstack->u.string); -- break; -- case FcVStackConstant: -- expr = FcExprCreateConst (vstack->u.string); -- break; -- case FcVStackGlob: -- /* XXX: What's the correct action here? (CDW) */ -- break; -- case FcVStackPrefer: -- case FcVStackAccept: -- case FcVStackDefault: -- expr = vstack->u.expr; -- vstack->tag = FcVStackNone; -- break; -- case FcVStackInteger: -- expr = FcExprCreateInteger (vstack->u.integer); -- break; -- case FcVStackDouble: -- expr = FcExprCreateDouble (vstack->u._double); -- break; -- case FcVStackMatrix: -- expr = FcExprCreateMatrix (vstack->u.matrix); -- break; -- case FcVStackBool: -- expr = FcExprCreateBool (vstack->u.bool); -- break; -- case FcVStackTest: -- break; -- case FcVStackExpr: -- expr = vstack->u.expr; -- vstack->tag = FcVStackNone; -- break; -- case FcVStackEdit: -- break; -- default: -- break; -- } -- FcVStackDestroy (vstack); -- return expr; --} -- --/* -- * This builds a tree of binary operations. Note -- * that every operator is defined so that if only -- * a single operand is contained, the value of the -- * whole expression is the value of the operand. -- * -- * This code reduces in that case to returning that -- * operand. -- */ --static FcExpr * --FcPopBinary (FcConfigParse *parse, FcOp op) --{ -- FcExpr *left, *expr = 0, *new; -- -- while ((left = FcPopExpr (parse))) -- { -- if (expr) -- { -- new = FcExprCreateOp (left, op, expr); -- if (!new) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- FcExprDestroy (left); -- FcExprDestroy (expr); -- return 0; -- } -- expr = new; -- } -- else -- expr = left; -- } -- return expr; --} -- --static void --FcParseBinary (FcConfigParse *parse, FcOp op) --{ -- FcExpr *expr = FcPopBinary (parse, op); -- if (expr) -- FcVStackPushExpr (parse, FcVStackExpr, expr); --} -- --/* -- * This builds a a unary operator, it consumes only -- * a single operand -- */ -- --static FcExpr * --FcPopUnary (FcConfigParse *parse, FcOp op) --{ -- FcExpr *operand, *new = 0; -- -- if ((operand = FcPopExpr (parse))) -- { -- new = FcExprCreateOp (operand, op, 0); -- if (!new) -- { -- FcExprDestroy (operand); -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- } -- } -- return new; --} -- --static void --FcParseUnary (FcConfigParse *parse, FcOp op) --{ -- FcExpr *expr = FcPopUnary (parse, op); -- if (expr) -- FcVStackPushExpr (parse, FcVStackExpr, expr); --} -- --static void --FcParseInclude (FcConfigParse *parse) --{ -- FcChar8 *s; -- const FcChar8 *i; -- FcBool ignore_missing = FcFalse; -- -- s = FcStrBufDone (&parse->pstack->str); -- if (!s) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- i = FcConfigGetAttribute (parse, "ignore_missing"); -- if (i && FcConfigLexBool (parse, (FcChar8 *) i) == FcTrue) -- ignore_missing = FcTrue; -- if (!FcConfigParseAndLoad (parse->config, s, !ignore_missing)) -- parse->error = FcTrue; -- FcStrFree (s); --} -- --typedef struct _FcOpMap { -- char name[16]; -- FcOp op; --} FcOpMap; -- --static FcOp --FcConfigLexOp (const FcChar8 *op, const FcOpMap *map, int nmap) --{ -- int i; -- -- for (i = 0; i < nmap; i++) -- if (!strcmp ((char *) op, map[i].name)) -- return map[i].op; -- return FcOpInvalid; --} -- --static const FcOpMap fcCompareOps[] = { -- { "eq", FcOpEqual }, -- { "not_eq", FcOpNotEqual }, -- { "less", FcOpLess }, -- { "less_eq", FcOpLessEqual }, -- { "more", FcOpMore }, -- { "more_eq", FcOpMoreEqual }, -- { "contains", FcOpContains }, -- { "not_contains", FcOpNotContains } --}; -- --#define NUM_COMPARE_OPS (int) (sizeof fcCompareOps / sizeof fcCompareOps[0]) -- --static FcOp --FcConfigLexCompare (const FcChar8 *compare) --{ -- return FcConfigLexOp (compare, fcCompareOps, NUM_COMPARE_OPS); --} -- --static void --FcParseTest (FcConfigParse *parse) --{ -- const FcChar8 *kind_string; -- FcMatchKind kind; -- const FcChar8 *qual_string; -- FcQual qual; -- const FcChar8 *name; -- const FcChar8 *compare_string; -- FcOp compare; -- FcExpr *expr; -- FcTest *test; -- -- kind_string = FcConfigGetAttribute (parse, "target"); -- if (!kind_string) -- kind = FcMatchDefault; -- else -- { -- if (!strcmp ((char *) kind_string, "pattern")) -- kind = FcMatchPattern; -- else if (!strcmp ((char *) kind_string, "font")) -- kind = FcMatchFont; -- else if (!strcmp ((char *) kind_string, "scan")) -- kind = FcMatchScan; -- else if (!strcmp ((char *) kind_string, "default")) -- kind = FcMatchDefault; -- else -- { -- FcConfigMessage (parse, FcSevereWarning, "invalid test target \"%s\"", kind_string); -- return; -- } -- } -- qual_string = FcConfigGetAttribute (parse, "qual"); -- if (!qual_string) -- qual = FcQualAny; -- else -- { -- if (!strcmp ((char *) qual_string, "any")) -- qual = FcQualAny; -- else if (!strcmp ((char *) qual_string, "all")) -- qual = FcQualAll; -- else if (!strcmp ((char *) qual_string, "first")) -- qual = FcQualFirst; -- else if (!strcmp ((char *) qual_string, "not_first")) -- qual = FcQualNotFirst; -- else -- { -- FcConfigMessage (parse, FcSevereWarning, "invalid test qual \"%s\"", qual_string); -- return; -- } -- } -- name = FcConfigGetAttribute (parse, "name"); -- if (!name) -- { -- FcConfigMessage (parse, FcSevereWarning, "missing test name"); -- return; -- } -- compare_string = FcConfigGetAttribute (parse, "compare"); -- if (!compare_string) -- compare = FcOpEqual; -- else -- { -- compare = FcConfigLexCompare (compare_string); -- if (compare == FcOpInvalid) -- { -- FcConfigMessage (parse, FcSevereWarning, "invalid test compare \"%s\"", compare_string); -- return; -- } -- } -- expr = FcPopBinary (parse, FcOpComma); -- if (!expr) -- { -- FcConfigMessage (parse, FcSevereWarning, "missing test expression"); -- return; -- } -- test = FcTestCreate (parse, kind, qual, name, compare, expr); -- if (!test) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- FcVStackPushTest (parse, test); --} -- --static const FcOpMap fcModeOps[] = { -- { "assign", FcOpAssign }, -- { "assign_replace", FcOpAssignReplace }, -- { "prepend", FcOpPrepend }, -- { "prepend_first", FcOpPrependFirst }, -- { "append", FcOpAppend }, -- { "append_last", FcOpAppendLast }, --}; -- --#define NUM_MODE_OPS (int) (sizeof fcModeOps / sizeof fcModeOps[0]) -- --static FcOp --FcConfigLexMode (const FcChar8 *mode) --{ -- return FcConfigLexOp (mode, fcModeOps, NUM_MODE_OPS); --} -- --static void --FcParseEdit (FcConfigParse *parse) --{ -- const FcChar8 *name; -- const FcChar8 *mode_string; -- FcOp mode; -- FcValueBinding binding; -- FcExpr *expr; -- FcEdit *edit; -- -- name = FcConfigGetAttribute (parse, "name"); -- if (!name) -- { -- FcConfigMessage (parse, FcSevereWarning, "missing edit name"); -- return; -- } -- mode_string = FcConfigGetAttribute (parse, "mode"); -- if (!mode_string) -- mode = FcOpAssign; -- else -- { -- mode = FcConfigLexMode (mode_string); -- if (mode == FcOpInvalid) -- { -- FcConfigMessage (parse, FcSevereWarning, "invalid edit mode \"%s\"", mode_string); -- return; -- } -- } -- if (!FcConfigLexBinding (parse, FcConfigGetAttribute (parse, "binding"), &binding)) -- return; -- -- expr = FcPopBinary (parse, FcOpComma); -- edit = FcEditCreate (parse, FcObjectFromName ((char *) name), -- mode, expr, binding); -- if (!edit) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- FcExprDestroy (expr); -- return; -- } -- if (!FcVStackPushEdit (parse, edit)) -- FcEditDestroy (edit); --} -- --static void --FcParseMatch (FcConfigParse *parse) --{ -- const FcChar8 *kind_name; -- FcMatchKind kind; -- FcTest *test = 0; -- FcEdit *edit = 0; -- FcVStack *vstack; -- -- kind_name = FcConfigGetAttribute (parse, "target"); -- if (!kind_name) -- kind = FcMatchPattern; -- else -- { -- if (!strcmp ((char *) kind_name, "pattern")) -- kind = FcMatchPattern; -- else if (!strcmp ((char *) kind_name, "font")) -- kind = FcMatchFont; -- else if (!strcmp ((char *) kind_name, "scan")) -- kind = FcMatchScan; -- else -- { -- FcConfigMessage (parse, FcSevereWarning, "invalid match target \"%s\"", kind_name); -- return; -- } -- } -- while ((vstack = FcVStackPop (parse))) -- { -- switch (vstack->tag) { -- case FcVStackTest: -- vstack->u.test->next = test; -- test = vstack->u.test; -- vstack->tag = FcVStackNone; -- break; -- case FcVStackEdit: -- vstack->u.edit->next = edit; -- edit = vstack->u.edit; -- vstack->tag = FcVStackNone; -- if (kind == FcMatchScan && edit->object > FC_MAX_BASE_OBJECT) -- { -- FcConfigMessage (parse, FcSevereError, -- " cannot edit user-defined object \"%s\"", -- FcObjectName(edit->object)); -- } -- break; -- default: -- FcConfigMessage (parse, FcSevereWarning, "invalid match element"); -- break; -- } -- FcVStackDestroy (vstack); -- } -- if (!FcConfigAddEdit (parse->config, test, edit, kind)) -- FcConfigMessage (parse, FcSevereError, "out of memory"); --} -- --static void --FcParseAcceptRejectFont (FcConfigParse *parse, FcElement element) --{ -- FcVStack *vstack; -- -- while ((vstack = FcVStackPop (parse))) -- { -- switch (vstack->tag) { -- case FcVStackGlob: -- if (!FcConfigGlobAdd (parse->config, -- vstack->u.string, -- element == FcElementAcceptfont)) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- } -- break; -- case FcVStackPattern: -- if (!FcConfigPatternsAdd (parse->config, -- vstack->u.pattern, -- element == FcElementAcceptfont)) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- } -- else -- vstack->tag = FcVStackNone; -- break; -- default: -- FcConfigMessage (parse, FcSevereWarning, "bad font selector"); -- break; -- } -- FcVStackDestroy (vstack); -- } --} -- -- --static FcValue --FcPopValue (FcConfigParse *parse) --{ -- FcVStack *vstack = FcVStackPop (parse); -- FcValue value; -- -- value.type = FcTypeVoid; -- -- if (!vstack) -- return value; -- -- switch (vstack->tag) { -- case FcVStackString: -- value.u.s = FcStrCopy (vstack->u.string); -- if (value.u.s) -- value.type = FcTypeString; -- break; -- case FcVStackConstant: -- if (FcNameConstant (vstack->u.string, &value.u.i)) -- value.type = FcTypeInteger; -- break; -- case FcVStackInteger: -- value.u.i = vstack->u.integer; -- value.type = FcTypeInteger; -- break; -- case FcVStackDouble: -- value.u.d = vstack->u._double; -- value.type = FcTypeInteger; -- break; -- case FcVStackMatrix: -- value.u.m = FcMatrixCopy (vstack->u.matrix); -- if (value.u.m) -- value.type = FcTypeMatrix; -- break; -- case FcVStackBool: -- value.u.b = vstack->u.bool; -- value.type = FcTypeBool; -- break; -- default: -- FcConfigMessage (parse, FcSevereWarning, "unknown pattern element %d", -- vstack->tag); -- break; -- } -- FcVStackDestroy (vstack); -- -- return value; --} -- --static void --FcParsePatelt (FcConfigParse *parse) --{ -- FcValue value; -- FcPattern *pattern = FcPatternCreate (); -- const char *name; -- -- if (!pattern) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- -- name = (char *) FcConfigGetAttribute (parse, "name"); -- if (!name) -- { -- FcConfigMessage (parse, FcSevereWarning, "missing pattern element name"); -- FcPatternDestroy (pattern); -- return; -- } -- -- for (;;) -- { -- value = FcPopValue (parse); -- if (value.type == FcTypeVoid) -- break; -- if (!FcPatternAdd (pattern, name, value, FcTrue)) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } -- } -- -- FcVStackPushPattern (parse, pattern); --} -- --static void --FcParsePattern (FcConfigParse *parse) --{ -- FcVStack *vstack; -- FcPattern *pattern = FcPatternCreate (); -- -- if (!pattern) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- return; -- } -- -- while ((vstack = FcVStackPop (parse))) -- { -- switch (vstack->tag) { -- case FcVStackPattern: -- if (!FcPatternAppend (pattern, vstack->u.pattern)) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- FcPatternDestroy (pattern); -- return; -- } -- break; -- default: -- FcConfigMessage (parse, FcSevereWarning, "unknown pattern element"); -- break; -- } -- FcVStackDestroy (vstack); -- } -- -- FcVStackPushPattern (parse, pattern); --} -- --static void --FcEndElement(void *userData, const XML_Char *name) --{ -- FcConfigParse *parse = userData; -- FcChar8 *data; -- -- if (!parse->pstack) -- return; -- switch (parse->pstack->element) { -- case FcElementNone: -- break; -- case FcElementFontconfig: -- break; -- case FcElementDir: -- data = FcStrBufDone (&parse->pstack->str); -- if (!data) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } --#ifdef _WIN32 -- if (strcmp (data, "CUSTOMFONTDIR") == 0) -- { -- FcStrFree (data); -- data = malloc (1000); -- if (!data) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } -- FcMemAlloc (FC_MEM_STRING, 1000); -- if(!GetModuleFileName(NULL, data, 1000)) -- { -- FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed"); -- FcStrFree (data); -- break; -- } -- char *p = strrchr (data, '\\'); -- if (p) *p = '\0'; -- strcat (data, "\\fonts"); -- } -- else if (strcmp (data, "WINDOWSFONTDIR") == 0) -- { -- int rc; -- FcStrFree (data); -- data = malloc (1000); -- if (!data) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } -- FcMemAlloc (FC_MEM_STRING, 1000); -- rc = GetWindowsDirectory (data, 800); -- if (rc == 0 || rc > 800) -- { -- FcConfigMessage (parse, FcSevereError, "GetWindowsDirectory failed"); -- FcStrFree (data); -- break; -- } -- if (data [strlen (data) - 1] != '\\') -- strcat (data, "\\"); -- strcat (data, "fonts"); -- } --#endif -- if (strlen ((char *) data) == 0) -- FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored"); -- else if (!FcStrUsesHome (data) || FcConfigHome ()) -- { -- if (!FcConfigAddDir (parse->config, data)) -- FcConfigMessage (parse, FcSevereError, "out of memory; cannot add directory %s", data); -- } -- FcStrFree (data); -- break; -- case FcElementCacheDir: -- data = FcStrBufDone (&parse->pstack->str); -- if (!data) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } --#ifdef _WIN32 -- if (strcmp (data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0) -- { -- int rc; -- FcStrFree (data); -- data = malloc (1000); -- if (!data) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } -- FcMemAlloc (FC_MEM_STRING, 1000); -- rc = GetTempPath (800, data); -- if (rc == 0 || rc > 800) -- { -- FcConfigMessage (parse, FcSevereError, "GetWindowsDirectory failed"); -- FcStrFree (data); -- break; -- } -- if (data [strlen (data) - 1] != '\\') -- strcat (data, "\\"); -- strcat (data, "fontconfig\\cache"); -- } --#endif -- if (!FcStrUsesHome (data) || FcConfigHome ()) -- { -- if (!FcConfigAddCacheDir (parse->config, data)) -- FcConfigMessage (parse, FcSevereError, "out of memory; cannot add cache directory %s", data); -- } -- FcStrFree (data); -- break; -- -- case FcElementCache: -- data = FcStrBufDone (&parse->pstack->str); -- if (!data) -- { -- FcConfigMessage (parse, FcSevereError, "out of memory"); -- break; -- } -- /* discard this data; no longer used */ -- FcStrFree (data); -- break; -- case FcElementInclude: -- FcParseInclude (parse); -- break; -- case FcElementConfig: -- break; -- case FcElementMatch: -- FcParseMatch (parse); -- break; -- case FcElementAlias: -- FcParseAlias (parse); -- break; -- -- case FcElementBlank: -- FcParseBlank (parse); -- break; -- case FcElementRescan: -- FcParseRescan (parse); -- break; -- -- case FcElementPrefer: -- FcParseFamilies (parse, FcVStackPrefer); -- break; -- case FcElementAccept: -- FcParseFamilies (parse, FcVStackAccept); -- break; -- case FcElementDefault: -- FcParseFamilies (parse, FcVStackDefault); -- break; -- case FcElementFamily: -- FcParseFamily (parse); -- break; -- -- case FcElementTest: -- FcParseTest (parse); -- break; -- case FcElementEdit: -- FcParseEdit (parse); -- break; -- -- case FcElementInt: -- FcParseInt (parse); -- break; -- case FcElementDouble: -- FcParseDouble (parse); -- break; -- case FcElementString: -- FcParseString (parse, FcVStackString); -- break; -- case FcElementMatrix: -- FcParseMatrix (parse); -- break; -- case FcElementBool: -- FcParseBool (parse); -- break; -- case FcElementCharset: --/* FcParseCharset (parse); */ -- break; -- case FcElementSelectfont: -- break; -- case FcElementAcceptfont: -- case FcElementRejectfont: -- FcParseAcceptRejectFont (parse, parse->pstack->element); -- break; -- case FcElementGlob: -- FcParseString (parse, FcVStackGlob); -- break; -- case FcElementPattern: -- FcParsePattern (parse); -- break; -- case FcElementPatelt: -- FcParsePatelt (parse); -- break; -- case FcElementName: -- FcParseString (parse, FcVStackField); -- break; -- case FcElementConst: -- FcParseString (parse, FcVStackConstant); -- break; -- case FcElementOr: -- FcParseBinary (parse, FcOpOr); -- break; -- case FcElementAnd: -- FcParseBinary (parse, FcOpAnd); -- break; -- case FcElementEq: -- FcParseBinary (parse, FcOpEqual); -- break; -- case FcElementNotEq: -- FcParseBinary (parse, FcOpNotEqual); -- break; -- case FcElementLess: -- FcParseBinary (parse, FcOpLess); -- break; -- case FcElementLessEq: -- FcParseBinary (parse, FcOpLessEqual); -- break; -- case FcElementMore: -- FcParseBinary (parse, FcOpMore); -- break; -- case FcElementMoreEq: -- FcParseBinary (parse, FcOpMoreEqual); -- break; -- case FcElementContains: -- FcParseBinary (parse, FcOpContains); -- break; -- case FcElementNotContains: -- FcParseBinary (parse, FcOpNotContains); -- break; -- case FcElementPlus: -- FcParseBinary (parse, FcOpPlus); -- break; -- case FcElementMinus: -- FcParseBinary (parse, FcOpMinus); -- break; -- case FcElementTimes: -- FcParseBinary (parse, FcOpTimes); -- break; -- case FcElementDivide: -- FcParseBinary (parse, FcOpDivide); -- break; -- case FcElementNot: -- FcParseUnary (parse, FcOpNot); -- break; -- case FcElementIf: -- FcParseBinary (parse, FcOpQuest); -- break; -- case FcElementFloor: -- FcParseUnary (parse, FcOpFloor); -- break; -- case FcElementCeil: -- FcParseUnary (parse, FcOpCeil); -- break; -- case FcElementRound: -- FcParseUnary (parse, FcOpRound); -- break; -- case FcElementTrunc: -- FcParseUnary (parse, FcOpTrunc); -- break; -- case FcElementUnknown: -- break; -- } -- (void) FcPStackPop (parse); --} -- --static void --FcCharacterData (void *userData, const XML_Char *s, int len) --{ -- FcConfigParse *parse = userData; -- -- if (!parse->pstack) -- return; -- if (!FcStrBufData (&parse->pstack->str, (FcChar8 *) s, len)) -- FcConfigMessage (parse, FcSevereError, "out of memory"); --} -- --static void --FcStartDoctypeDecl (void *userData, -- const XML_Char *doctypeName, -- const XML_Char *sysid, -- const XML_Char *pubid, -- int has_internal_subset) --{ -- FcConfigParse *parse = userData; -- -- if (strcmp ((char *) doctypeName, "fontconfig") != 0) -- FcConfigMessage (parse, FcSevereError, "invalid doctype \"%s\"", doctypeName); --} -- --#ifdef ENABLE_LIBXML2 -- --static void --FcInternalSubsetDecl (void *userData, -- const XML_Char *doctypeName, -- const XML_Char *sysid, -- const XML_Char *pubid) --{ -- FcStartDoctypeDecl (userData, doctypeName, sysid, pubid, 1); --} -- --static void --FcExternalSubsetDecl (void *userData, -- const XML_Char *doctypeName, -- const XML_Char *sysid, -- const XML_Char *pubid) --{ -- FcStartDoctypeDecl (userData, doctypeName, sysid, pubid, 0); --} -- --#else /* ENABLE_LIBXML2 */ -- --static void --FcEndDoctypeDecl (void *userData) --{ --} -- --#endif /* ENABLE_LIBXML2 */ -- --static int --FcSortCmpStr (const void *a, const void *b) --{ -- const FcChar8 *as = *((FcChar8 **) a); -- const FcChar8 *bs = *((FcChar8 **) b); -- return FcStrCmp (as, bs); --} -- --static FcBool --FcConfigParseAndLoadDir (FcConfig *config, -- const FcChar8 *name, -- const FcChar8 *dir, -- FcBool complain) --{ -- DIR *d; -- struct dirent *e; -- FcBool ret = FcTrue; -- FcChar8 *file; -- FcChar8 *base; -- FcStrSet *files; -- -- d = opendir ((char *) dir); -- if (!d) -- { -- if (complain) -- FcConfigMessage (0, FcSevereError, "Cannot open config dir \"%s\"", -- name); -- ret = FcFalse; -- goto bail0; -- } -- /* freed below */ -- file = (FcChar8 *) malloc (strlen ((char *) dir) + 1 + FC_MAX_FILE_LEN + 1); -- if (!file) -- { -- ret = FcFalse; -- goto bail1; -- } -- -- strcpy ((char *) file, (char *) dir); -- strcat ((char *) file, "/"); -- base = file + strlen ((char *) file); -- -- files = FcStrSetCreate (); -- if (!files) -- { -- ret = FcFalse; -- goto bail2; -- } -- -- if (FcDebug () & FC_DBG_CONFIG) -- printf ("\tScanning config dir %s\n", dir); -- -- while (ret && (e = readdir (d))) -- { -- int d_len; --#define TAIL ".conf" --#define TAIL_LEN 5 -- /* -- * Add all files of the form [0-9]*.conf -- */ -- if ('0' <= e->d_name[0] && e->d_name[0] <= '9' && -- (d_len = strlen (e->d_name)) < FC_MAX_FILE_LEN && -- d_len > TAIL_LEN && -- strcmp (e->d_name + d_len - TAIL_LEN, TAIL) == 0) -- { -- strcpy ((char *) base, (char *) e->d_name); -- if (!FcStrSetAdd (files, file)) -- { -- ret = FcFalse; -- goto bail3; -- } -- } -- } -- if (ret) -- { -- int i; -- qsort (files->strs, files->num, sizeof (FcChar8 *), -- (int (*)(const void *, const void *)) FcSortCmpStr); -- for (i = 0; ret && i < files->num; i++) -- ret = FcConfigParseAndLoad (config, files->strs[i], complain); -- } --bail3: -- FcStrSetDestroy (files); --bail2: -- free (file); --bail1: -- closedir (d); --bail0: -- return ret || !complain; --} -- --FcBool --FcConfigParseAndLoad (FcConfig *config, -- const FcChar8 *name, -- FcBool complain) --{ -- -- XML_Parser p; -- FcChar8 *filename; -- int fd; -- int len; -- FcConfigParse parse; -- FcBool error = FcTrue; -- --#ifdef ENABLE_LIBXML2 -- xmlSAXHandler sax; -- char buf[BUFSIZ]; --#else -- void *buf; --#endif -- -- filename = FcConfigFilename (name); -- if (!filename) -- goto bail0; -- -- if (FcStrSetMember (config->configFiles, filename)) -- { -- FcStrFree (filename); -- return FcTrue; -- } -- -- if (!FcStrSetAdd (config->configFiles, filename)) -- { -- FcStrFree (filename); -- goto bail0; -- } -- -- if (FcFileIsDir (filename)) -- { -- FcBool ret = FcConfigParseAndLoadDir (config, name, filename, complain); -- FcStrFree (filename); -- return ret; -- } -- -- if (FcDebug () & FC_DBG_CONFIG) -- printf ("\tLoading config file %s\n", filename); -- -- fd = open ((char *) filename, O_RDONLY); -- if (fd == -1) { -- FcStrFree (filename); -- goto bail0; -- } -- --#ifdef ENABLE_LIBXML2 -- memset(&sax, 0, sizeof(sax)); -- -- sax.internalSubset = FcInternalSubsetDecl; -- sax.externalSubset = FcExternalSubsetDecl; -- sax.startElement = FcStartElement; -- sax.endElement = FcEndElement; -- sax.characters = FcCharacterData; -- -- p = xmlCreatePushParserCtxt (&sax, &parse, NULL, 0, (const char *) filename); --#else -- p = XML_ParserCreate ("UTF-8"); --#endif -- FcStrFree (filename); -- -- if (!p) -- goto bail1; -- -- if (!FcConfigInit (&parse, name, config, p)) -- goto bail2; -- --#ifndef ENABLE_LIBXML2 -- -- XML_SetUserData (p, &parse); -- -- XML_SetDoctypeDeclHandler (p, FcStartDoctypeDecl, FcEndDoctypeDecl); -- XML_SetElementHandler (p, FcStartElement, FcEndElement); -- XML_SetCharacterDataHandler (p, FcCharacterData); -- --#endif /* ENABLE_LIBXML2 */ -- -- do { --#ifndef ENABLE_LIBXML2 -- buf = XML_GetBuffer (p, BUFSIZ); -- if (!buf) -- { -- FcConfigMessage (&parse, FcSevereError, "cannot get parse buffer"); -- goto bail3; -- } --#endif -- len = read (fd, buf, BUFSIZ); -- if (len < 0) -- { -- FcConfigMessage (&parse, FcSevereError, "failed reading config file"); -- goto bail3; -- } -- --#ifdef ENABLE_LIBXML2 -- if (xmlParseChunk (p, buf, len, len == 0)) --#else -- if (!XML_ParseBuffer (p, len, len == 0)) --#endif -- { -- FcConfigMessage (&parse, FcSevereError, "%s", -- XML_ErrorString (XML_GetErrorCode (p))); -- goto bail3; -- } -- } while (len != 0); -- error = parse.error; --bail3: -- FcConfigCleanup (&parse); --bail2: -- XML_ParserFree (p); --bail1: -- close (fd); -- fd = -1; --bail0: -- if (error && complain) -- { -- if (name) -- FcConfigMessage (0, FcSevereError, "Cannot load config file \"%s\"", name); -- else -- FcConfigMessage (0, FcSevereError, "Cannot load default config file"); -- return FcFalse; -- } -- return FcTrue; -+ return FcFalse; - } - #define __fcxml__ - #include "fcaliastail.h" diff --git a/packages/x11-fonts/fontconfig/url b/packages/x11-fonts/fontconfig/url index 848eed3a61..d50822fea0 100644 --- a/packages/x11-fonts/fontconfig/url +++ b/packages/x11-fonts/fontconfig/url @@ -1 +1 @@ -http://fontconfig.org/release/fontconfig-2.6.0.tar.gz +http://fontconfig.org/release/fontconfig-2.7.0.tar.gz