xscorch-0.2.1/0000755000175000001440000000000011615372006010161 500000000000000xscorch-0.2.1/libj/0000755000175000001440000000000011615372007011102 500000000000000xscorch-0.2.1/libj/libj.m40000644000175000001440000003160711551735454012223 00000000000000# $Header: /fridge/cvs/xscorch/libj/libj.m4,v 1.11 2010-09-03 07:49:28 justins Exp $ # Hacked from configure for GLIB # Owen Taylor 97-11-3 # Hacked by Justin David Smith, 2001.12.10 # Includes some libj-specific functions as well dnl AM_PATH_LIBJ([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for LIBJ, and define LIBJ_CFLAGS and LIBJ_LIBS. dnl This should be used by applications which wish to link dnl to an external copy of libj. Applications which want dnl to embed libj directly need to import the libjconf.m4 dnl internal configuration macros instead. dnl AC_DEFUN([AM_PATH_LIBJ], [dnl dnl Get the cflags and libraries from the libj-config script dnl AC_ARG_WITH(libj-prefix,[ --with-libj-prefix=PFX Prefix where LIBJ is installed (optional)], libj_config_prefix="$withval", libj_config_prefix="") AC_ARG_WITH(libj-exec-prefix,[ --with-libj-exec-prefix=PFX Exec prefix where LIBJ is installed (optional)], libj_config_exec_prefix="$withval", libj_config_exec_prefix="") AC_ARG_ENABLE(libjtest, [ --disable-libjtest Do not try to compile and run a test LIBJ program], , enable_libjtest=yes) if test x$libj_config_exec_prefix != x ; then libj_config_args="$libj_config_args --exec-prefix=$libj_config_exec_prefix" if test x${LIBJ_CONFIG+set} != xset ; then LIBJ_CONFIG=$libj_config_exec_prefix/bin/libj-config fi fi if test x$libj_config_prefix != x ; then libj_config_args="$libj_config_args --prefix=$libj_config_prefix" if test x${LIBJ_CONFIG+set} != xset ; then LIBJ_CONFIG=$libj_config_prefix/bin/libj-config fi fi for module in . $4 do case "$module" in jmtx | libjmtx) libj_config_args="$libj_config_args libjmtx" ;; jconio | libjconio) libj_config_args="$libj_config_args libjconio" ;; esac done AC_PATH_PROG(LIBJ_CONFIG, libj-config, no) min_libj_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for LIBJ - version >= $min_libj_version) no_libj="" if test "$LIBJ_CONFIG" = "no" ; then no_libj=yes else LIBJ_CFLAGS=`$LIBJ_CONFIG $libj_config_args --cflags` LIBJ_LIBS=`$LIBJ_CONFIG $libj_config_args --libs` LIBJ_VERSION=`$LIBJ_CONFIG $libj_config_args --version` libj_config_major_version=`$LIBJ_CONFIG $libj_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` libj_config_minor_version=`$LIBJ_CONFIG $libj_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` libj_config_micro_version=`$LIBJ_CONFIG $libj_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_libjtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $LIBJ_CFLAGS" LIBS="$LIBJ_LIBS $LIBS" dnl dnl Now check if the installed LIBJ is sufficiently new. (Also sanity dnl checks the results of libj-config to some extent dnl rm -f conf.libjtest AC_TRY_RUN([ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include #include #include int main () { int major, minor, micro; unsigned int libj_v; unsigned int libj_major_version; unsigned int libj_minor_version; unsigned int libj_micro_version; unsigned int LIBJ_MAJOR_VERSION; unsigned int LIBJ_MINOR_VERSION; unsigned int LIBJ_MICRO_VERSION; char *tmp_version; system ("touch conf.libjtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = strdup("$min_libj_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libj_version"); exit(1); } libj_v = libj_version(); libj_major_version = (libj_v >> 24) & 0xff; libj_minor_version = (libj_v >> 16) & 0xff; libj_micro_version = (libj_v >> 8) & 0xff; LIBJ_MAJOR_VERSION = (__libj_version >> 24) & 0xff; LIBJ_MINOR_VERSION = (__libj_version >> 16) & 0xff; LIBJ_MICRO_VERSION = (__libj_version >> 8) & 0xff; if ((libj_major_version != $libj_config_major_version) || (libj_minor_version != $libj_config_minor_version) || (libj_micro_version != $libj_config_micro_version)) { printf("\n*** 'libj-config --version' returned %d.%d.%d, but LIBJ (%d.%d.%d)\n", $libj_config_major_version, $libj_config_minor_version, $libj_config_micro_version, libj_major_version, libj_minor_version, libj_micro_version); printf ("*** was found! If libj-config was correct, then it is best\n"); printf ("*** to remove the old version of LIBJ. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libj-config was wrong, set the environment variable LIBJ_CONFIG\n"); printf("*** to point to the correct copy of libj-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libj_major_version != LIBJ_MAJOR_VERSION) || (libj_minor_version != LIBJ_MINOR_VERSION) || (libj_micro_version != LIBJ_MICRO_VERSION)) { printf("*** LIBJ header files (version %d.%d.%d) do not match\n", LIBJ_MAJOR_VERSION, LIBJ_MINOR_VERSION, LIBJ_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", libj_major_version, libj_minor_version, libj_micro_version); } else { if ((libj_major_version > major) || ((libj_major_version == major) && (libj_minor_version > minor)) || ((libj_major_version == major) && (libj_minor_version == minor) && (libj_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of LIBJ (%d.%d.%d) was found.\n", libj_major_version, libj_minor_version, libj_micro_version); printf("*** You need a version of LIBJ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** LIBJ is always available from http://chaos2.org./.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libj-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of LIBJ, but you can also set the LIBJ_CONFIG environment to point to the\n"); printf("*** correct copy of libj-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_libj=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_libj" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$LIBJ_CONFIG" = "no" ; then echo "*** The libj-config script installed by LIBJ could not be found" echo "*** If LIBJ was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBJ_CONFIG environment variable to the" echo "*** full path to libj-config." else if test -f conf.libjtest ; then : else echo "*** Could not run LIBJ test program, checking why..." CFLAGS="$CFLAGS $LIBJ_CFLAGS" LIBS="$LIBS $LIBJ_LIBS" AC_TRY_LINK([ #include #include ], [ return (__libj_version == 0); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBJ or finding the wrong" echo "*** version of LIBJ. If it is not finding LIBJ, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means LIBJ was incorrectly installed" echo "*** or that you have moved LIBJ since it was installed. In the latter case, you" echo "*** may want to edit the libj-config script: $LIBJ_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi LIBJ_CFLAGS="" LIBJ_LIBS="" LIBJ_VERSION="" ifelse([$3], , :, [$3]) fi AC_SUBST([LIBJ_CFLAGS]) AC_SUBST([LIBJ_LIBS]) AC_SUBST([LIBJ_VERSION]) rm -f conf.libjtest ]) dnl LIBJ_PROG_CC dnl Search for GCC or a related compiler and utilities. dnl AC_DEFUN([LIBJ_PROG_CC], [ dnl Make sure we have a C compiler and preprocessor lying around. AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CPP]) dnl Make sure the desired constructs exist in the language. AC_REQUIRE([AC_C_CONST]) AC_REQUIRE([AC_C_INLINE]) ]) dnl LIBJ_PROG_CC_CFLAGS dnl Setup the CFLAGS as appropriate. dnl dnl This provides --enable-opt, --enable-warn, and --enable-debug. dnl Currently, this will try to enforce the C99 standard language dnl if --enable-debug is set, assuming the compiler supports the dnl standard. dnl dnl This now provides handling for --enable-warn-error as well. dnl dnl This defines LIBJ_C99_STANDARD, and sets it to 1 if the compiler dnl is GCC supporting the C99 standard. dnl AC_DEFUN([LIBJ_PROG_CC_CFLAGS], [ dnl Make sure we have a C compiler and preprocessor lying around. AC_REQUIRE([LIBJ_PROG_CC]) dnl Check for GCC-specific extensions. if test "x$ac_cv_prog_gcc" = "xyes"; then echo "GCC compiler found, trying GCC-specific optimizations and warnings." AC_MSG_CHECKING([if compiler supports C99 standard]) LIBJ_OLD_CFLAGS="$CFLAGS" CFLAGS= AC_TRY_COMPILE(, , [AC_MSG_RESULT([yes]) LIBJ_C99_STANDARD=1], [AC_MSG_RESULT([no]) LIBJ_C99_STANDARD=0]) CFLAGS="$LIBJ_OLD_CFLAGS" AC_MSG_CHECKING([for --enable-opt flag]) AC_ARG_ENABLE(opt, [[ --enable-opt Enable optimizations [yes if CFLAGS not set]]], , enable_opt=maybe) if test "x$enable_opt" = "xyes" -o \( "x$enable_opt" = "xmaybe" -a "x$CFLAGS" = "x" \); then AC_MSG_RESULT([enabled]) LIBJ_CFLAGS_OPT="-O3 -fomit-frame-pointer -finline-functions -funroll-loops -fthread-jumps -DNDEBUG" else AC_MSG_RESULT([not enabled]) LIBJ_CFLAGS_OPT= fi AC_MSG_CHECKING([for --enable-warn flag]) AC_ARG_ENABLE(warn, [[ --enable-warn Enable warnings [yes if CFLAGS not set]]], , enable_warn=maybe) if test "x$enable_warn" = "xyes" -o \( "x$enable_warn" = "xmaybe" -a "x$CFLAGS" = "x" \); then AC_MSG_RESULT([enabled]) LIBJ_CFLAGS_WARN="-Wall -Wpointer-arith" else AC_MSG_RESULT([not enabled]) LIBJ_CFLAGS_WARN= fi AC_MSG_CHECKING([for --enable-warn-error flag]) AC_ARG_ENABLE(warn, [[ --enable-warn-error Enable warnings as errors [yes if CFLAGS not set]]], , enable_warn_error=maybe) if test "x$enable_warn_error" = "xyes" -o \( "x$enable_warn_error" = "xmaybe" -a "x$CFLAGS" = "x" \); then AC_MSG_RESULT([enabled]) dnl Warning: on recent gcc we need no-strict-aliasing with Werror LIBJ_CFLAGS_WARN_ERROR="-Werror -fno-strict-aliasing" else AC_MSG_RESULT([not enabled]) LIBJ_CFLAGS_WARN_ERROR= fi AC_MSG_CHECKING([for --enable-debug flag]) AC_ARG_ENABLE(debug, [[ --enable-debug Enable debug flags [no]]], , enable_debug=no) if test "x$enable_debug" = "xyes"; then AC_MSG_RESULT([enabled]) LIBJ_CFLAGS_DEBUG="-g" if test "x$LIBJ_C99_STANDARD" = "x1"; then LIBJ_CFLAGS_DEBUG="$LIBJ_CFLAGS_DEBUG -W -Wunused" fi else AC_MSG_RESULT([not enabled]) LIBJ_CFLAGS_DEBUG= fi CFLAGS="$CFLAGS $LIBJ_CFLAGS_OPT $LIBJ_CFLAGS_WARN $LIBJ_CFLAGS_WARN_ERROR $LIBJ_CFLAGS_DEBUG" echo "CFLAGS = $CFLAGS" else echo "No GCC compiler, will not enable optimizations or warnings." LIBJ_C99_STANDARD=0 fi AC_SUBST([LIBJ_C99_STANDARD]) ]) dnl LIBJ_PRINT_YES_NO(value) dnl Prints "yes" or "no", depending on if value is 1 or 0. dnl AC_DEFUN([LIBJ_PRINT_YES_NO], [ if test "x$1" = "x1"; then echo "Yes" else echo "NO" fi ]) xscorch-0.2.1/libj/libjconf.m40000644000175000001440000001253411551735454013067 00000000000000dnl $Header: /fridge/cvs/xscorch/libj/libjconf.m4,v 1.22 2010-09-03 07:49:30 justins Exp $ dnl Utilities for the libj configure script. This file is only of interest dnl to projects which embed libj; projects linking against the shared lib dnl version of libj only need libj.m4. dnl LIBJ_VERSION_CHECK dnl Setup all version values based on the current libj version. dnl AC_DEFUN([LIBJ_VERSION_CHECK], [ dnl dnl *** Current libj version is defined here *** dnl LIBJ_VERSION_MAJOR=4 LIBJ_VERSION_MINOR=1 LIBJ_VERSION_PATCH=3 dnl Build the library version number based on the numbers above. AC_MSG_CHECKING([for libj version number]) LIBJ_VERSION="${LIBJ_VERSION_MAJOR}.${LIBJ_VERSION_MINOR}.${LIBJ_VERSION_PATCH}" LIBJ_VERSION_EXPR="((((long)${LIBJ_VERSION_MAJOR} & 0xff) << 24) | (((long)${LIBJ_VERSION_MINOR} & 0xff) << 16) | (((long)${LIBJ_VERSION_PATCH} & 0xff) << 8)) /* Version ${LIBJ_VERSION} */" AC_SUBST([LIBJ_VERSION]) AC_SUBST([LIBJ_VERSION_MAJOR]) AC_SUBST([LIBJ_VERSION_MINOR]) AC_SUBST([LIBJ_VERSION_PATCH]) AC_SUBST([LIBJ_VERSION_EXPR]) LIBJ_LT_CURRENT=`expr $LIBJ_VERSION_MAJOR + $LIBJ_VERSION_MINOR` LIBJ_LT_REVISION=$LIBJ_VERSION_PATCH LIBJ_LT_AGE=$LIBJ_VERSION_MINOR AC_SUBST([LIBJ_LT_CURRENT]) AC_SUBST([LIBJ_LT_REVISION]) AC_SUBST([LIBJ_LT_AGE]) AC_MSG_RESULT([$LIBJ_VERSION]) ]) dnl LIBJ_CONF_SIZES dnl Check the sizes of various data types. Used to setup the dnl fixed-size type definitions in libj.h. dnl AC_DEFUN([LIBJ_CONF_SIZES], [ dnl Requirements AC_REQUIRE([LIBJ_PROG_CC]) dnl Checks for object sizes AC_CHECK_SIZEOF([short], 2) AC_CHECK_SIZEOF([int], 4) AC_CHECK_SIZEOF([long], 4) AC_CHECK_SIZEOF([long long], 8) AC_CHECK_SIZEOF([int16_t], 0) AC_CHECK_SIZEOF([int32_t], 0) AC_CHECK_SIZEOF([int64_t], 0) LIBJ_BYTE_TYPE=char case 2 in $ac_cv_sizeof_short) LIBJ_WORD_TYPE=short ;; $ac_cv_sizeof_int) LIBJ_WORD_TYPE=int ;; $ac_cv_sizeof_int16_t) LIBJ_WORD_TYPE=int16_t ;; *) AC_MSG_ERROR([Cannot find a suitable 16-bit data type]) esac case 4 in $ac_cv_sizeof_short) LIBJ_DWORD_TYPE=short ;; $ac_cv_sizeof_int) LIBJ_DWORD_TYPE=int ;; $ac_cv_sizeof_long) LIBJ_DWORD_TYPE=long ;; $ac_cv_sizeof_int32_t) LIBJ_DWORD_TYPE=int32_t ;; *) AC_MSG_ERROR([Cannot find a suitable 32-bit data type]) esac case 8 in $ac_cv_sizeof_int) LIBJ_QWORD_TYPE=int ;; $ac_cv_sizeof_long_long) LIBJ_QWORD_TYPE="long long";; $ac_cv_sizeof_int64_t) LIBJ_QWORD_TYPE=int64_t ;; *) AC_MSG_ERROR([Cannot find a suitable 64-bit data type]) esac AC_SUBST([LIBJ_BYTE_TYPE]) AC_SUBST([LIBJ_WORD_TYPE]) AC_SUBST([LIBJ_DWORD_TYPE]) AC_SUBST([LIBJ_QWORD_TYPE]) ]) dnl LIBJ_CONF_HEADERS dnl Check several headers that libj requires, and make dnl the appropriate definitions. dnl AC_DEFUN([LIBJ_CONF_HEADERS], [ dnl Check for standard C headers (may have already run) AC_REQUIRE([LIBJ_PROG_CC]) AC_REQUIRE([AC_HEADER_STDC]) dnl Check C headers AC_CHECK_HEADERS([sys/time.h]) if test "$ac_cv_header_sys_time_h" = "yes"; then LIBJ_HAVE_SYS_TIME_H=1 else LIBJ_HAVE_SYS_TIME_H=0 fi AC_SUBST([LIBJ_HAVE_SYS_TIME_H]) AC_HEADER_TIME if test "$ac_cv_header_time" = "yes"; then LIBJ_TIME_WITH_SYS_TIME=1 else LIBJ_TIME_WITH_SYS_TIME=0 fi AC_SUBST([LIBJ_TIME_WITH_SYS_TIME]) ]) dnl LIBJ_CONF_FUNCTIONS dnl Check several functions that libj requires, and make dnl the appropriate definitions. dnl AC_DEFUN([LIBJ_CONF_FUNCTIONS], [ dnl Make sure we checked for the compiler. AC_REQUIRE([LIBJ_PROG_CC]) dnl Checks for library functions. AC_CHECK_FUNCS([gettimeofday]) if test "$ac_cv_func_gettimeofday" = "yes"; then LIBJ_HAVE_GETTIMEOFDAY=1 else LIBJ_HAVE_GETTIMEOFDAY=0 fi AC_SUBST([LIBJ_HAVE_GETTIMEOFDAY]) AC_CHECK_FUNCS([snprintf], , [AC_MSG_ERROR([snprintf not found, aborting])]) ]) dnl LIBJ_CONF_STANDALONE dnl LIBJ_CONF_EMBEDDED dnl Setup STANDALONE or EMBEDDED mode build. dnl LIBJ_STANDALONE is always 1 for a libj build. dnl Programs that embed libj should set this 0 in dnl their configure scripts. These macros are dnl convenient shorthands for setting the build. dnl dnl The embedded macro conveniently does all the dnl standard libj checks, and also defines defaults dnl for the libj compilation options. dnl AC_DEFUN([LIBJ_CONF_STANDALONE], [ LIBJ_STANDALONE=1 AC_SUBST([LIBJ_STANDALONE]) AM_CONDITIONAL(LIBJ_STANDALONE, [true]) ]) AC_DEFUN([LIBJ_CONF_EMBEDDED], [ dnl Requirements for the embedded build dnl Note that requirements are *always* expanded first. AC_REQUIRE([LIBJ_VERSION_CHECK]) AC_REQUIRE([LIBJ_PROG_CC]) AC_REQUIRE([LIBJ_CONF_HEADERS]) AC_REQUIRE([LIBJ_CONF_FUNCTIONS]) AC_REQUIRE([LIBJ_CONF_SIZES]) dnl Setup for embedded (not standalone) build. LIBJ_STANDALONE=0 AC_SUBST([LIBJ_STANDALONE]) AM_CONDITIONAL(LIBJ_STANDALONE, [false]) dnl Set default compile options for libj LIBJ_USE_LIBC_STRING=1 LIBJ_C99_STANDARD=0 AC_SUBST([LIBJ_USE_LIBC_STRING]) AC_SUBST([LIBJ_C99_STANDARD]) AM_CONDITIONAL(LIBJ_USE_LIBC_STRING, [true]) ]) xscorch-0.2.1/libj/README0000644000175000001440000000155510017410167011703 00000000000000$Header: /fridge/cvs/xscorch/libj/README,v 1.5 2004/02/26 05:56:50 justins Exp $ This is the README for LIBJ. Not much is documented here right now, unfortunately. But to install the system, you should be able to simply run ./configure make make install # as root NOTE: I would recommend installing this library to an alternate location, ./configure --prefix=/usr/local/libj, for easier package maintenance. NOTE: This library is under heavy development, version 4 may not strictly adhere to standard library versioning. If in doubt, link against the specific library versions you want, or link statically. Please note that this code is licensed under version 2 of the GNU General Public License ONLY, the version that is included with this source distri- bution. NO later version of the General Public License is valid for this code. xscorch-0.2.1/libj/Makefile.am0000644000175000001440000000050407624040765013065 00000000000000## $Header: /fridge/cvs/xscorch/libj/Makefile.am,v 1.2 2003/02/17 01:59:56 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # SUBDIRS = jreg jstr EXTRA_DIST = README libjconf.m4 CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig xscorch-0.2.1/libj/Makefile.in0000644000175000001440000004412711615371714013103 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libj DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/libj.h.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = libj.h CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # SUBDIRS = jreg jstr EXTRA_DIST = README libjconf.m4 CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libj/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libj/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libj.h: $(top_builddir)/config.status $(srcdir)/libj.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/libj/libj.h.in0000644000175000001440000001026111174775151012527 00000000000000/* $Header: /fridge/cvs/xscorch/libj/libj.h.in,v 1.12 2009-02-24 05:14:21 jacob Exp $ */ /* libj - libj.h Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Definitions for libj This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program, in the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA This file is part of LIBJ. */ /* For @PACKAGE@, libj version @LIBJ_VERSION@ */ #ifndef __libj_included #define __libj_included /* Include files */ #include /* Setup libj embedded/standalone and other configuration */ #define LIBJ_STANDALONE @LIBJ_STANDALONE@ #define LIBJ_C99_STANDARD @LIBJ_C99_STANDARD@ /* Version information */ #if LIBJ_STANDALONE #define __libj_version @LIBJ_VERSION_EXPR@ #endif /* LIBJ_STANDALONE */ /* Compilation definitions */ #define LIBJ_LIBC_STRING @LIBJ_USE_LIBC_STRING@ #ifndef TIME_WITH_SYS_TIME #define TIME_WITH_SYS_TIME @LIBJ_TIME_WITH_SYS_TIME@ #endif /* TIME_WITH_SYS_TIME */ #ifndef HAVE_SYS_TIME_H #define HAVE_SYS_TIME_H @LIBJ_HAVE_SYS_TIME_H@ #endif /* HAVE_SYS_TIME_H */ #ifndef HAVE_GETTIMEOFDAY #define HAVE_GETTIMEOFDAY @LIBJ_HAVE_GETTIMEOFDAY@ #endif /* HAVE_GETTIMEOFDAY */ /* Miscellaneous constants */ #define LIBJ_RK_PRIME 32749 /* Rabin-karp prime number (should be 15-bits max) */ #define LIBJ_READBUF 0x4000/* Default read buffer size */ /* Data types */ #ifndef LIBJ_TYPES #define LIBJ_TYPES 1 typedef unsigned @LIBJ_BYTE_TYPE@ ubyte; typedef unsigned @LIBJ_WORD_TYPE@ uword; typedef unsigned @LIBJ_DWORD_TYPE@ udword; typedef unsigned @LIBJ_QWORD_TYPE@ uqword; typedef signed @LIBJ_BYTE_TYPE@ sbyte; typedef signed @LIBJ_WORD_TYPE@ sword; typedef signed @LIBJ_DWORD_TYPE@ sdword; typedef signed @LIBJ_QWORD_TYPE@ sqword; typedef unsigned @LIBJ_BYTE_TYPE@ byte; typedef unsigned @LIBJ_WORD_TYPE@ word; typedef unsigned @LIBJ_DWORD_TYPE@ dword; typedef unsigned @LIBJ_QWORD_TYPE@ qword; typedef unsigned @LIBJ_DWORD_TYPE@ sizea; typedef signed @LIBJ_DWORD_TYPE@ indexa; typedef unsigned @LIBJ_WORD_TYPE@ wchar; typedef signed @LIBJ_DWORD_TYPE@ dimensiona; #define DWORD_MAX 0xffffffff #define WORD_MAX 0xffff #define BYTE_MAX 0xff #endif /* LIBJ_TYPES */ /* Other useful definitions */ #ifndef LIBJ_BOOL #define LIBJ_BOOL 1 #define false 0 #define true (!false) #ifndef __cplusplus typedef ubyte bool; #endif /* not C++ */ #endif /* LIBJ_BOOL */ /* Useful in manipulating ranges of numbers */ #define clamp(x, a, b) ((x) < (a) ? (a) : (x) > (b) ? (b) : (x)) #define min(x, a) ((x) < (a) ? (x) : (a)) #define max(x, a) ((x) > (a) ? (x) : (a)) /* Typical function defines */ typedef void (*destructorfn)(void *data); typedef bool (*comparefn)(const void *a, const void *b); typedef bool (*iteratorfn)(void *a, void *params); /* Version method */ #if LIBJ_STANDALONE unsigned int libj_version(void); #endif /* LIBJ_STANDALONE */ /* __libj_unused is a special attribute indicating a function argument is ignored within the function; this is useful for functions which MUST accept an argument because they escape, but do not actually access the argument. */ #ifndef __libj_unused #if __GNUC__ && LIBJ_C99_STANDARD #define __libj_unused __attribute__((unused)) #else /* Not C99 code */ #define __libj_unused #endif /* LIBJ_C99_STANDARD? */ #endif /* __libj_unused undefined? */ #endif /* Header included? */ xscorch-0.2.1/libj/ChangeLog0000644000175000001440000000636611174775151012616 00000000000000$Header: /fridge/cvs/xscorch/libj/ChangeLog,v 1.32 2009-02-24 05:14:21 jacob Exp $ 4.1.1: Avoid defining "unused" as a keyword. It conflicts with other packages (like the cairo font lib) who use it in their headers. Where the "unused" keyword was used, now use "__libj_unused". 4.1.0: Fix gcc non-null warnings on stra(); stra() is now a function entry point and has a stra_const() sibling. Update libtool scripts (necessary because otherwise the .so extension goes missing on current debian). 4.0.16: Fixes to m4 scripts. 4.0.15: New configure option: --enable-warn-error. 4.0.14: License restricted to version 2 ONLY. Fix libtool issues. 4.0.13: Reworking -Winline flag. 4.0.12: Migration to autoconf 2.50. 4.0.11: configure structural changes. 4.0.10: Setup libj to support embedded builds. Added strblenn. Added strsimilar. Added sbprintf_concat. Cleaned up code for build with GCC 3.2 Removed inline assembly. Minor optimization of string comparisons and copy. Corrected an error in strconcat. Significant extensions of jreg interface: Added mechanism to set values in bulk on a class. Added prelude to "default values" mechanism. Added macros to simplify data structure initialization. Build jreg and jstr with -pedantic -std=c99 -W to clean up some bogus code (signed/unsigned mixups and varadic macros). 4.0.9: Added support for debian packaging. 4.0.8: Made jconio optional. 4.0.7: Minor revision to escapeCGI 4.0.6: Added escapeCGI, escapeCGIa functions. Corrected a bug in strclonea which permits a segfault condition when input string is null. 4.0.5: Unclear where the 4.0.4 boundary ended, so I'm upping release 4.0.4: Fixed bug in mutator macros for jstra that did not update the length of the resulting string. Also exported the strsetlena() function since external code which modifies a stringa buffer needs this. 4.0.3: Bugfixes to build system Minor bugfixes to jstr(a) when libc string turned off 4.0.2: Added runtime configure script and macros for other apps Added CVS headers to jmem, jstr, jstra, jlink 4.0.1: Added strdelinsa() functions. Added strcopynb() functions. Fixed comparator error in bintree_string_lessthan() 4.0.0: Structural overhaul of libjstr. This initiates a major API revision, therefore the major number had to increase. The API may change over the next few patchlevels so it is not recommended to port many apps over to 4.x yet. * Revamped all of jstr, and updated other libraries using jstr calls. * Added strreplace() functions. * Added test suite for jstr. * Revamped some of jstra (particularly parts tied to jstr). Added strreplacea() and sprintfa(), also strreplacea_list(). * Added strinserta() and strdeletea() functions to jstra. 3.0.6: Added the bintree pair functions 3.0.5: Added a few helper functions for bintree utilities 3.0.4: Added hardcoded allocation "chunks" in jstra 3.0.3: First revision xscorch-0.2.1/libj/jreg/0000755000175000001440000000000011615372007012031 500000000000000xscorch-0.2.1/libj/jreg/libjreg.h0000644000175000001440000002616211175116117013546 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jreg/libjreg.h,v 1.9 2009-04-26 17:39:27 jacob Exp $ */ /* libj - libjreg.h Copyright (C) 2000-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Main header file for registry library Note that some of the macros defined in here require ISO C99. The old notation for initializing a field, using "name: value", is deprecated in favour of the new ".name = value" notation. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #ifndef __libjreg_h_included #define __libjreg_h_included /* Required includes */ #include #include /* Useful definitions */ #define REG_TOP "__top" /* Name of `top' variable */ #define REG_NULL "__null" /* Name of `null' class */ #define REG_SYMBOL_SIZE 64 /* Max symbol size */ #define REG_BUFFER 0x1000 /* I/O buffer size */ /* Variable types */ typedef enum _reg_type { REG_INTEGER, /* Integer value */ REG_DOUBLEV, /* Floating value */ REG_BOOLEAN, /* Boolean values */ REG_STRING, /* Character string */ REG_BLOCK, /* Subblock */ REG_ANY /* Any type */ } reg_type; /* Format types */ typedef enum _reg_format_bool { REG_FORMAT_BOOL_TF, /* True/False vals */ REG_FORMAT_BOOL_YN, /* Yes/No values */ REG_FORMAT_BOOL_OO, /* On/Off values */ REG_FORMAT_BOOL_TNIL /* T/NIL values */ } reg_format_bool; /* Default formats */ #define REG_FORMAT_BOOL_DEFAULT REG_FORMAT_BOOL_TF /* Values datatype */ typedef struct _reg_bool { bool value; /* Value of this variable */ reg_format_bool format; /* Output format to use */ } reg_bool; typedef union _reg_value { int integer; /* Integer value */ double doublev; /* Double value */ reg_bool boolean; /* Boolean value */ char *string; /* String data (must be allocated) */ struct _reg_block *block; /* A subblock */ } reg_value; /* Variables */ typedef struct _reg_var_info { char name[REG_SYMBOL_SIZE]; /* Variable name */ reg_type type; /* Variable type */ const struct _reg_class *klass; /* Class (if block)? */ struct _reg_var_info *next; /* Next varinfo in list */ } reg_var_info; typedef struct _reg_var { char name[REG_SYMBOL_SIZE]; /* Variable name */ reg_type type; /* Variable type */ reg_value value; /* Value assigned */ struct _reg_var *next; /* Next var in chain */ } reg_var; /* Subblocks */ typedef struct _reg_class { char name[REG_SYMBOL_SIZE]; /* Name for this class */ reg_var_info *vars; /* Variable registry */ struct _reg_class *next; /* Next block class */ } reg_class; typedef struct _reg_block { char name[REG_SYMBOL_SIZE]; /* Block name */ const reg_class *klass; /* Block class info */ reg_var *vars; /* List of variables */ } reg_block; /* File structure */ typedef struct _reg { char *filename; /* Filename to read */ reg_var *top; /* Toplevel parse tree */ reg_class *classes; /* Block classes avail */ FILE *handle; /* File I/O handle */ int line; /* Current line number (file) */ } reg; /* Bulk registry */ typedef struct _reg_class_data { const char *name; /* Variable name */ reg_type type; /* Variable type */ const char *klass; /* Variable class */ } reg_class_data; typedef struct _reg_class_list { const char *name; /* Class name */ const reg_class_data *vars; /* Class variables */ } reg_class_list; /* Macros to simplify construction of reg_class_data */ #define __REG_CLASS__(_name, _type, _klass) \ { .name = (_name), \ .type = (_type), \ .klass = (_klass) \ } #define REG_CLASS_INTEGER(_name) __REG_CLASS__(_name, REG_INTEGER, NULL) #define REG_CLASS_DOUBLEV(_name) __REG_CLASS__(_name, REG_DOUBLEV, NULL) #define REG_CLASS_BOOLEAN(_name) __REG_CLASS__(_name, REG_BOOLEAN, NULL) #define REG_CLASS_STRING(_name) __REG_CLASS__(_name, REG_STRING, NULL) #define REG_CLASS_BLOCK(_name, _klass) __REG_CLASS__(_name, REG_BLOCK, _klass) #define REG_CLASS_END __REG_CLASS__(NULL, 0, NULL) #define REG_CLASS_BITFIELD(_name) REG_CLASS_STRING(_name) #define REG_CLASS_LIST(_name, _vars) \ { .name = (_name), \ .vars = (_vars) \ } #define REG_CLASS_LIST_END REG_CLASS_LIST(NULL, NULL) /* Bulk initialization */ typedef struct _reg_var_data { const char *name; /* Variable name */ reg_type type; /* Variable type */ reg_value value; /* Variable value */ } reg_var_data; /* Macros to simplify construction of reg_var_data */ #define __REG_VAR__(_name, _type, _field, _value) \ { .name = (_name), \ .type = (_type), \ .value = { ._field = _value } \ } #define __REG_VAR_BOOL__(_value) \ { .value = (_value), \ .format = REG_FORMAT_BOOL_DEFAULT \ } #define REG_VAR_INTEGER(_name, _value) __REG_VAR__(_name, REG_INTEGER, integer, (_value)) #define REG_VAR_DOUBLEV(_name, _value) __REG_VAR__(_name, REG_DOUBLEV, doublev, (_value)) #define REG_VAR_STRING(_name, _value) __REG_VAR__(_name, REG_STRING, string, (_value)) #define REG_VAR_BOOLEAN(_name, _value) __REG_VAR__(_name, REG_BOOLEAN, boolean, __REG_VAR_BOOL__(_value)) #define REG_VAR_END __REG_VAR__(NULL, 0, integer, 0) /* Unifying the class init and variable default data blocks */ typedef struct _reg_class_default_data { reg_class_data class_info; /* Class information (variable type) */ reg_var_data default_info; /* Default information (value info) */ } reg_class_default_data; typedef struct _reg_class_default_list { const char *name; /* Class name */ const reg_class_default_data *vars; /* Class variables */ } reg_class_default_list; /* Macros to simplify construction of reg_class_data */ #define __REG_CLASS_DEFAULT__(_class, _default) \ { .class_info = _class, \ .default_info = _default, \ } #define REG_CLASS_DEFAULT_INTEGER(_name, _value) \ __REG_CLASS_DEFAULT__(REG_CLASS_INTEGER(_name), REG_VAR_INTEGER(_name, _value)) #define REG_CLASS_DEFAULT_DOUBLEV(_name, _value) \ __REG_CLASS_DEFAULT__(REG_CLASS_DOUBLEV(_name), REG_VAR_DOUBLEV(_name, _value)) #define REG_CLASS_DEFAULT_BOOLEAN(_name, _value) \ __REG_CLASS_DEFAULT__(REG_CLASS_BOOLEAN(_name), REG_VAR_BOOLEAN(_name, _value)) #define REG_CLASS_DEFAULT_STRING(_name, _value) \ __REG_CLASS_DEFAULT__(REG_CLASS_STRING(_name), REG_VAR_STRING(_name, _value)) #define REG_CLASS_DEFAULT_BITFIELD(_name, _value) \ __REG_CLASS_DEFAULT__(REG_CLASS_BITFIELD(_name), REG_VAR_STRING(_name, _value)) #define REG_CLASS_DEFAULT_END \ __REG_CLASS_DEFAULT__(REG_CLASS_END, REG_VAR_END) #define REG_CLASS_DEFAULT_LIST(_name, _vars) \ REG_CLASS_LIST(_name, _vars) #define REG_CLASS_DEFAULT_LIST_END \ REG_CLASS_LIST_END /* Basic object maintenance */ reg * reg_new(const char *name); void reg_free(reg **r); void reg_set_name(reg *f, const char *name); bool reg_load(reg *r); bool reg_save(reg *r); /* Class add/Variable registry maintenance */ bool reg_class_add(reg *r, const char *classname); bool reg_class_add_list(reg *r, const char **classnames); bool reg_class_register_var(reg *r, const char *classname, const char *name, reg_type type, const char *klass); bool reg_class_register_vars(reg *r, const char *classname, const reg_class_data *list); bool reg_class_register_list(reg *r, const reg_class_list *list); bool reg_class_register_default_list(reg *r, const reg_class_default_list *list); /* General variable information */ #define reg_get_top(r) reg_get_var((r), NULL, NULL) reg_var * reg_get_var(reg *r, reg_var *v, const char *path); reg_type reg_get_var_type( const reg_var *v); const char *reg_get_var_name( const reg_var *v); const char *reg_get_var_class(const reg_var *v); /* Variable reading */ bool reg_get_integer(reg *r, reg_var *v, const char *path, int *value); bool reg_get_doublev(reg *r, reg_var *v, const char *path, double *value); bool reg_get_boolean(reg *r, reg_var *v, const char *path, bool *value); bool reg_get_string( reg *r, reg_var *v, const char *path, char *value, int size); int reg_get_integer_from_values(reg *r, reg_var *v, const char *path, int defvalue, const char **names, const unsigned int *values); int reg_get_bitmask_from_values(reg *r, reg_var *v, const char *path, int defvalue, const char **names, const unsigned int *values); /* Iterative variable retrieval */ reg_var *reg_get_block_head(reg_var *v); reg_var *reg_get_next_var(reg_var *v); /* Variable set */ bool reg_set_integer(reg *r, reg_var *v, const char *path, int value); bool reg_set_doublev(reg *r, reg_var *v, const char *path, double value); bool reg_set_boolean(reg *r, reg_var *v, const char *path, bool value); bool reg_set_boolean_f(reg *r, reg_var *v, const char *path, bool value, reg_format_bool format); bool reg_set_string( reg *r, reg_var *v, const char *path, const char *value); bool reg_set_block( reg *r, reg_var *v, const char *path, const char *klass); bool reg_set_string_from_values(reg *r, reg_var *v, const char *path, int value, const char **names, const unsigned int *values); bool reg_set_bitmask_from_values(reg *r, reg_var *v, const char *path, int value, const char **names, const unsigned int *values); /* Bulk variable set */ bool reg_set_vars(reg *r, reg_var *v, const char *path, const reg_var_data *data); bool reg_set_var_defaults(reg *r, reg_var *v, const char *path, const reg_var_data *data); bool reg_set_var_class_defaults(reg *r, reg_var *v, const char *path, const reg_class_default_data *data); #endif /* __libjreg_h_included */ xscorch-0.2.1/libj/jreg/Makefile.am0000644000175000001440000000143411615317547014017 00000000000000## $Header: /fridge/cvs/xscorch/libj/jreg/Makefile.am,v 1.9 2011-06-12 08:12:16 justins Exp $ ## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = 1.4 EXTRADIST = overview.txt CLEANFILES = *~ *.bak libs/* MAINTAINERCLEANFILES = aclocal.m4 configure JREG_SRCS = \ reg.c \ regblock.c \ regio.c \ regvar.c \ _reg.h JREG_HDRS = \ libjreg.h if LIBJ_STANDALONE noinst_LTLIBRARIES = libjreg.la libjreg_la_SOURCES = $(JREG_SRCS) libjreg_la_CFLAGS = $(AM_CFLAGS) include_HEADERS = $(JREG_HDRS) else noinst_LIBRARIES = libjreg.a libjreg_a_SOURCES = $(JREG_SRCS) $(JREG_HDRS) libjreg_a_CFLAGS = $(AM_CFLAGS) endif ## LIBJ_STANDALONE if LIBJ_USE_LIBC_STRING INCLUDES = -I../jstr -I../ else INCLUDES = -I../jmem -I../jstr -I../ endif ## LIBJ_USE_LIBC_STRING xscorch-0.2.1/libj/jreg/Makefile.in0000644000175000001440000007353411615371715014037 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libj/jreg DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libjreg_a_AR = $(AR) $(ARFLAGS) libjreg_a_LIBADD = am__libjreg_a_SOURCES_DIST = reg.c regblock.c regio.c regvar.c _reg.h \ libjreg.h am__objects_1 = libjreg_a-reg.$(OBJEXT) libjreg_a-regblock.$(OBJEXT) \ libjreg_a-regio.$(OBJEXT) libjreg_a-regvar.$(OBJEXT) am__objects_2 = @LIBJ_STANDALONE_FALSE@am_libjreg_a_OBJECTS = $(am__objects_1) \ @LIBJ_STANDALONE_FALSE@ $(am__objects_2) libjreg_a_OBJECTS = $(am_libjreg_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) libjreg_la_LIBADD = am__libjreg_la_SOURCES_DIST = reg.c regblock.c regio.c regvar.c _reg.h am__objects_3 = libjreg_la-reg.lo libjreg_la-regblock.lo \ libjreg_la-regio.lo libjreg_la-regvar.lo @LIBJ_STANDALONE_TRUE@am_libjreg_la_OBJECTS = $(am__objects_3) libjreg_la_OBJECTS = $(am_libjreg_la_OBJECTS) libjreg_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libjreg_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @LIBJ_STANDALONE_TRUE@am_libjreg_la_rpath = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libjreg_a_SOURCES) $(libjreg_la_SOURCES) DIST_SOURCES = $(am__libjreg_a_SOURCES_DIST) \ $(am__libjreg_la_SOURCES_DIST) am__include_HEADERS_DIST = libjreg.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.4 EXTRADIST = overview.txt CLEANFILES = *~ *.bak libs/* MAINTAINERCLEANFILES = aclocal.m4 configure JREG_SRCS = \ reg.c \ regblock.c \ regio.c \ regvar.c \ _reg.h JREG_HDRS = \ libjreg.h @LIBJ_STANDALONE_TRUE@noinst_LTLIBRARIES = libjreg.la @LIBJ_STANDALONE_TRUE@libjreg_la_SOURCES = $(JREG_SRCS) @LIBJ_STANDALONE_TRUE@libjreg_la_CFLAGS = $(AM_CFLAGS) @LIBJ_STANDALONE_TRUE@include_HEADERS = $(JREG_HDRS) @LIBJ_STANDALONE_FALSE@noinst_LIBRARIES = libjreg.a @LIBJ_STANDALONE_FALSE@libjreg_a_SOURCES = $(JREG_SRCS) $(JREG_HDRS) @LIBJ_STANDALONE_FALSE@libjreg_a_CFLAGS = $(AM_CFLAGS) @LIBJ_USE_LIBC_STRING_FALSE@INCLUDES = -I../jmem -I../jstr -I../ @LIBJ_USE_LIBC_STRING_TRUE@INCLUDES = -I../jstr -I../ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libj/jreg/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libj/jreg/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libjreg.a: $(libjreg_a_OBJECTS) $(libjreg_a_DEPENDENCIES) -rm -f libjreg.a $(libjreg_a_AR) libjreg.a $(libjreg_a_OBJECTS) $(libjreg_a_LIBADD) $(RANLIB) libjreg.a clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libjreg.la: $(libjreg_la_OBJECTS) $(libjreg_la_DEPENDENCIES) $(libjreg_la_LINK) $(am_libjreg_la_rpath) $(libjreg_la_OBJECTS) $(libjreg_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_a-reg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_a-regblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_a-regio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_a-regvar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_la-reg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_la-regblock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_la-regio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjreg_la-regvar.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libjreg_a-reg.o: reg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-reg.o -MD -MP -MF $(DEPDIR)/libjreg_a-reg.Tpo -c -o libjreg_a-reg.o `test -f 'reg.c' || echo '$(srcdir)/'`reg.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-reg.Tpo $(DEPDIR)/libjreg_a-reg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reg.c' object='libjreg_a-reg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-reg.o `test -f 'reg.c' || echo '$(srcdir)/'`reg.c libjreg_a-reg.obj: reg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-reg.obj -MD -MP -MF $(DEPDIR)/libjreg_a-reg.Tpo -c -o libjreg_a-reg.obj `if test -f 'reg.c'; then $(CYGPATH_W) 'reg.c'; else $(CYGPATH_W) '$(srcdir)/reg.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-reg.Tpo $(DEPDIR)/libjreg_a-reg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reg.c' object='libjreg_a-reg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-reg.obj `if test -f 'reg.c'; then $(CYGPATH_W) 'reg.c'; else $(CYGPATH_W) '$(srcdir)/reg.c'; fi` libjreg_a-regblock.o: regblock.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-regblock.o -MD -MP -MF $(DEPDIR)/libjreg_a-regblock.Tpo -c -o libjreg_a-regblock.o `test -f 'regblock.c' || echo '$(srcdir)/'`regblock.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-regblock.Tpo $(DEPDIR)/libjreg_a-regblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regblock.c' object='libjreg_a-regblock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-regblock.o `test -f 'regblock.c' || echo '$(srcdir)/'`regblock.c libjreg_a-regblock.obj: regblock.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-regblock.obj -MD -MP -MF $(DEPDIR)/libjreg_a-regblock.Tpo -c -o libjreg_a-regblock.obj `if test -f 'regblock.c'; then $(CYGPATH_W) 'regblock.c'; else $(CYGPATH_W) '$(srcdir)/regblock.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-regblock.Tpo $(DEPDIR)/libjreg_a-regblock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regblock.c' object='libjreg_a-regblock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-regblock.obj `if test -f 'regblock.c'; then $(CYGPATH_W) 'regblock.c'; else $(CYGPATH_W) '$(srcdir)/regblock.c'; fi` libjreg_a-regio.o: regio.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-regio.o -MD -MP -MF $(DEPDIR)/libjreg_a-regio.Tpo -c -o libjreg_a-regio.o `test -f 'regio.c' || echo '$(srcdir)/'`regio.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-regio.Tpo $(DEPDIR)/libjreg_a-regio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regio.c' object='libjreg_a-regio.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-regio.o `test -f 'regio.c' || echo '$(srcdir)/'`regio.c libjreg_a-regio.obj: regio.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-regio.obj -MD -MP -MF $(DEPDIR)/libjreg_a-regio.Tpo -c -o libjreg_a-regio.obj `if test -f 'regio.c'; then $(CYGPATH_W) 'regio.c'; else $(CYGPATH_W) '$(srcdir)/regio.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-regio.Tpo $(DEPDIR)/libjreg_a-regio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regio.c' object='libjreg_a-regio.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-regio.obj `if test -f 'regio.c'; then $(CYGPATH_W) 'regio.c'; else $(CYGPATH_W) '$(srcdir)/regio.c'; fi` libjreg_a-regvar.o: regvar.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-regvar.o -MD -MP -MF $(DEPDIR)/libjreg_a-regvar.Tpo -c -o libjreg_a-regvar.o `test -f 'regvar.c' || echo '$(srcdir)/'`regvar.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-regvar.Tpo $(DEPDIR)/libjreg_a-regvar.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regvar.c' object='libjreg_a-regvar.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-regvar.o `test -f 'regvar.c' || echo '$(srcdir)/'`regvar.c libjreg_a-regvar.obj: regvar.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -MT libjreg_a-regvar.obj -MD -MP -MF $(DEPDIR)/libjreg_a-regvar.Tpo -c -o libjreg_a-regvar.obj `if test -f 'regvar.c'; then $(CYGPATH_W) 'regvar.c'; else $(CYGPATH_W) '$(srcdir)/regvar.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_a-regvar.Tpo $(DEPDIR)/libjreg_a-regvar.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regvar.c' object='libjreg_a-regvar.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_a_CFLAGS) $(CFLAGS) -c -o libjreg_a-regvar.obj `if test -f 'regvar.c'; then $(CYGPATH_W) 'regvar.c'; else $(CYGPATH_W) '$(srcdir)/regvar.c'; fi` libjreg_la-reg.lo: reg.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -MT libjreg_la-reg.lo -MD -MP -MF $(DEPDIR)/libjreg_la-reg.Tpo -c -o libjreg_la-reg.lo `test -f 'reg.c' || echo '$(srcdir)/'`reg.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_la-reg.Tpo $(DEPDIR)/libjreg_la-reg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reg.c' object='libjreg_la-reg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -c -o libjreg_la-reg.lo `test -f 'reg.c' || echo '$(srcdir)/'`reg.c libjreg_la-regblock.lo: regblock.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -MT libjreg_la-regblock.lo -MD -MP -MF $(DEPDIR)/libjreg_la-regblock.Tpo -c -o libjreg_la-regblock.lo `test -f 'regblock.c' || echo '$(srcdir)/'`regblock.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_la-regblock.Tpo $(DEPDIR)/libjreg_la-regblock.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regblock.c' object='libjreg_la-regblock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -c -o libjreg_la-regblock.lo `test -f 'regblock.c' || echo '$(srcdir)/'`regblock.c libjreg_la-regio.lo: regio.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -MT libjreg_la-regio.lo -MD -MP -MF $(DEPDIR)/libjreg_la-regio.Tpo -c -o libjreg_la-regio.lo `test -f 'regio.c' || echo '$(srcdir)/'`regio.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_la-regio.Tpo $(DEPDIR)/libjreg_la-regio.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regio.c' object='libjreg_la-regio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -c -o libjreg_la-regio.lo `test -f 'regio.c' || echo '$(srcdir)/'`regio.c libjreg_la-regvar.lo: regvar.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -MT libjreg_la-regvar.lo -MD -MP -MF $(DEPDIR)/libjreg_la-regvar.Tpo -c -o libjreg_la-regvar.lo `test -f 'regvar.c' || echo '$(srcdir)/'`regvar.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjreg_la-regvar.Tpo $(DEPDIR)/libjreg_la-regvar.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regvar.c' object='libjreg_la-regvar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjreg_la_CFLAGS) $(CFLAGS) -c -o libjreg_la-regvar.lo `test -f 'regvar.c' || echo '$(srcdir)/'`regvar.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/libj/jreg/reg.c0000644000175000001440000005070111175116117012674 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jreg/reg.c,v 1.10 2009-04-26 17:39:27 jacob Exp $ */ /* libj - reg.c Copyright(c) 2000-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Config file processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #include <_reg.h> /* Waiting for robotnik */ reg *reg_new(const char *filename) { /* reg_new Create a new registry structure, with the associated filename. The filename is used by reg_load() and reg_save() functions, and may be modified later. */ reg *r; /* Newly constructed reg variable */ reg_class *tc; /* Class registry for top class. */ /* Create the new object */ r = (reg *)malloc(sizeof(reg)); if(r == NULL) return(NULL); /* Initialise class registry */ r->classes = NULL; reg_class_add(r, REG_TOP); tc = reg_class_lookup(r->classes, REG_TOP); /* Initialise toplevel block */ r->top = reg_var_new_block(r, REG_TOP, tc); if(r->top == NULL) { /* Failed to allocate toplevel */ free(r); return(false); } /* Do we have toplevel block? */ /* Initialise associated filename */ r->filename = NULL; reg_set_name(r, filename); /* Return the register structure */ return(r); } void reg_free(reg **r) { /* reg_free Releases a registry, and all associated data. */ /* release the registry structure */ if(r == NULL || *r == NULL) return; reg_var_free(&(*r)->top); reg_class_release(&(*r)->classes); free((*r)->filename); free(*r); *r = NULL; } static inline int _reg_text_to_index(const char *text, const char **list) { /* reg_text_to_index Determine which index the specified text string occurs at. is a NULL-terminated list of strings. */ int index = 0; while(list[index] != NULL) { if(strequal(text, list[index])) return(index); ++index; } return(-1); } static inline int _reg_value_to_index(unsigned int value, const char **list, const unsigned int *values) { /* reg_value_to_index Determine which index the specified value lives at. is required since it has the NULL terminator; although it is the list we compare to. */ int index = 0; while(list[index] != NULL) { if(value == values[index]) return(index); ++index; } return(-1); } int reg_get_integer_from_values(reg *r, reg_var *v, const char *path, int defvalue, const char **names, const unsigned int *values) { /* reg_get_integer_from_values Read the variable , relative to , and attempt to translate its string content to an enumerated type value. If the value cannot be obtained (variable undefined, not a string, etc) then will be returned. The enumerated types and corresponding names are given as arguments to this function. If == NULL, then is read. */ char buf[REG_BUFFER]; /* Temporary read-buffer */ int index; /* Index to matching name-value pair */ /* Attempt to retrieve the string */ if(reg_get_string(r, v, path, buf, REG_BUFFER)) { /* We have a string to work with, yay. Does it have a corresponding entry in the values list? */ trim(buf); index = _reg_text_to_index(buf, names); if(index >= 0) { /* Assign the new default value */ defvalue = values[index]; } /* Text matches? */ } /* Is variable a valid string? */ /* Return the enumerated value */ return(defvalue); } int reg_get_bitmask_from_values(reg *r, reg_var *v, const char *path, int defvalue, const char **names, const unsigned int *values) { /* reg_get_bitmask_from_values Read the variable , relative to , and attempt to translate its string content to a bitmask value. If the value cannot be obtained (variable undefined, not a string, etc) then will be returned. The enumerated types and corresponding names are given as arguments to this function. If == NULL, then is read. */ char buf[REG_BUFFER]; /* Temporary read-buffer */ char *ps; /* Start of `current' bit */ char *p; /* Start of `next' bit */ bool negate; /* True if this bit negated */ int index; /* Matching name-value pair */ /* Attempt to retrieve the string */ if(reg_get_string(r, v, path, buf, REG_BUFFER)) { /* Trim-o-rama, and loop while the string isn't empty */ trim(buf); p = buf; while(*p != '\0') { /* Look for a comma or end-of-string */ ps = p; while(*p != '\0' && *p != ',') ++p; /* If we hit a comma, there is another bit to parse */ if(*p == ',') *(p++) = '\0'; /* Look for a negation flag (if present) */ trim(ps); negate = (*buf == '!'); if(negate) trim(++ps); /* Attempt to find bitvalue corresponding to text */ index = _reg_text_to_index(ps, names); if(index >= 0) { /* We have a matching bitvalue; mix it into default */ index = values[index]; if(negate) defvalue = defvalue & (~index); else defvalue = defvalue | index; } /* Found a matching bitvalue? */ } /* Looping through named bits */ } /* Was variable a valid string? */ /* Return the newly constructed bitfield */ return(defvalue); } bool reg_set_string_from_values(reg *r, reg_var *v, const char *path, int value, const char **names, const unsigned int *values) { /* reg_set_string_from_values Write the enumerated value , as its corresponding string to the variable (relative to ). The enumerated types and corresponding names are also given. If == NULL, then modifications occur directly on . */ int index; /* Index to matching name-value pair */ /* Attempt to get index matching up with value */ index = _reg_value_to_index(value, names, values); if(index >= 0) { /* We have it; try to set this as a string value. */ return(reg_set_string(r, v, path, names[index])); } /* Match found? */ /* No matches; cannot handle this case */ return(false); } bool reg_set_bitmask_from_values(reg *r, reg_var *v, const char *path, int value, const char **names, const unsigned int *values) { /* reg_set_bitmask_from_values Write the bitmask , as its corresponding list of strings to the variable (relative to ). Enumerated types and corresponding names are also given. If == NULL, then modifications occur directly on . */ char buf[REG_BUFFER]; /* Temp variable to construct value in */ bool needcomma; /* True if need preceding comma */ int i; /* Index of matching element */ *buf = '\0'; needcomma = false; i = 0; while(names[i] != NULL) { if((values[i] & value) == values[i]) { value = value & (~values[i]); if(needcomma) strconcatb(buf, ", ", sizeof(buf)); strconcatb(buf, names[i], sizeof(buf)); needcomma = true; } ++i; } if(value != 0) return(false); return(reg_set_string(r, v, path, buf)); } bool reg_get_integer(reg *r, reg_var *v, const char *path, int *value) { /* reg_get_integer Reads the integer value , relative to . True is returned on success. If == NULL, then is read. */ reg_var *var; var = reg_block_resolve(r, v, path); if(var == NULL || var->type != REG_INTEGER) return(false); if(value != NULL) *value = var->value.integer; return(true); } bool reg_get_doublev(reg *r, reg_var *v, const char *path, double *value) { /* reg_get_doublev Reads the double value , relative to . True is returned on success. If == NULL, then is read. */ reg_var *var; var = reg_block_resolve(r, v, path); if(var == NULL || var->type != REG_DOUBLEV) return(false); if(value != NULL) *value = var->value.doublev; return(true); } bool reg_get_boolean(reg *r, reg_var *v, const char *path, bool *value) { /* reg_get_boolean Reads the boolean value , relative to . True is returned on success. If == NULL, then is read. */ reg_var *var; var = reg_block_resolve(r, v, path); if(var == NULL || var->type != REG_BOOLEAN) return(false); if(value != NULL) *value = var->value.boolean.value; return(true); } bool reg_get_string(reg *r, reg_var *v, const char *path, char *value, int size) { /* reg_get_string Reads the string value , relative to . The value is copied to the buffer indicated in , of size . True is returned on success. If == NULL, then is read. */ reg_var *var; var = reg_block_resolve(r, v, path); if(var == NULL || var->type != REG_STRING) { return(false); } if(value != NULL && size > 0) { strcopyb(value, var->value.string, size); } return(true); } bool reg_set_integer(reg *r, reg_var *v, const char *path, int value) { /* reg_set_integer Writes the integer into the variable , relative to . True is returned on success. If == NULL, then modifications occur directly on . */ char varname[REG_SYMBOL_SIZE]; reg_var *block; block = reg_block_resolve_container(r, v, path, varname); if(block == NULL) return(false); return(reg_var_set_integer(r, block, varname, value)); } bool reg_set_doublev(reg *r, reg_var *v, const char *path, double value) { /* reg_set_doublev Writes the double into the variable , relative to . True is returned on success. If == NULL, then modifications occur directly on . */ char varname[REG_SYMBOL_SIZE]; reg_var *block; block = reg_block_resolve_container(r, v, path, varname); if(block == NULL) return(false); return(reg_var_set_doublev(r, block, varname, value)); } bool reg_set_boolean_f(reg *r, reg_var *v, const char *path, bool value, reg_format_bool format) { /* reg_set_boolean_f Writes the boolean into the variable , relative to . True is returned on success. If == NULL, then modifications occur directly on . */ char varname[REG_SYMBOL_SIZE]; reg_var *block; block = reg_block_resolve_container(r, v, path, varname); if(block == NULL) return(false); return(reg_var_set_boolean(r, block, varname, value, format)); } bool reg_set_boolean(reg *r, reg_var *v, const char *path, bool value) { /* reg_set_boolean */ return(reg_set_boolean_f(r, v, path, value, REG_FORMAT_BOOL_DEFAULT)); } bool reg_set_string(reg *r, reg_var *v, const char *path, const char *value) { /* reg_set_string Writes the NULL-terminated string buffer into the variable , relative to . True is returned on success. In case == NULL, the modifications will occur directly on . */ char varname[REG_SYMBOL_SIZE]; reg_var *block; block = reg_block_resolve_container(r, v, path, varname); if(block == NULL) return(false); return(reg_var_set_string(r, block, varname, value)); } bool reg_set_block(reg *r, reg_var *v, const char *path, const char *klass) { /* reg_set_block Constructs a new block with the class named in . If is NULL, then becomes a new block. If is null, then an NULL-classed object will be created. */ char varname[REG_SYMBOL_SIZE]; reg_var *block; reg_var *tmp; block = reg_block_resolve_container(r, v, path, varname); if(block == NULL) return(false); tmp = reg_var_new_block(r, varname, reg_class_lookup(r->classes, klass)); return(reg_var_set_block(r, block, varname, &tmp)); } static bool _reg_set_var(reg *r, reg_var *v, const char *path, const reg_var_data *data, bool overwrite) { /* reg_set_var Sets the variable to the value based on the description in data. If overwrite is not true, then this function will not attempt to replace any existing value binding. This function returns true if the assignment is successful, OR if overwrite = false and the value was already defined. It returns false in other cases. The data contains a reg_value which is used to initialize the variable. As such, it is able to handle multiple types of data. This function can only define integers, floats, booleans and strings at this time. It cannot bulk-define variables that represent subclasses yet, or variant variables. */ char thispath[REG_SYMBOL_SIZE]; /* Construct the final name of the variable to define. */ if(path == NULL) { strcopyb(thispath, data->name, sizeof(thispath)); } else { sbprintf(thispath, sizeof(thispath), "%s/%s", path, data->name); } /* Figure out if we would be overwriting an existing var */ if(!overwrite && reg_get_var(r, v, thispath) != NULL) { /* This is not considered an error case */ return(true); } /* Assign the variable, depending on the type of data */ switch(data->type) { case REG_INTEGER: return(reg_set_integer(r, v, thispath, data->value.integer)); case REG_DOUBLEV: return(reg_set_doublev(r, v, thispath, data->value.doublev)); case REG_BOOLEAN: return(reg_set_boolean_f(r, v, thispath, data->value.boolean.value, data->value.boolean.format)); case REG_STRING: return(reg_set_string(r, v, thispath, data->value.string)); case REG_BLOCK: case REG_ANY: break; } /* If we're here, then something went wrong */ return(false); } static bool _reg_set_vars(reg *r, reg_var *v, const char *path, const reg_var_data *data, bool overwrite) { /* reg_set_vars This function takes a list of reg_var_data's in data, which is terminated by a record whose name field is NULL. It assigns each of the names given, relative to the reg_var v. If path is not NULL, then it is prepended to each name in turn to construct the final variable name (which itself is relative to v). If v is NULL, then the topmost variable in the registry is used. For each entry in the data list, this sets the variable to the value based on the description in data. If overwrite is not true, then this function will not attempt to replace any existing value binding. This function returns true if ALL assignments are successful (an assignment is successful if the variable is either reassigned, or the variable was already bound and overwrite was false). If any single assignemnt fails, then this function will attempt to assign the remainder of the variables in the data list, but will ultimately return false. Each entry in the data list contains a reg_value which is used to initialize the variable. As such, it is able to handle multiple types of data. This function can only define integers, floats, booleans and strings at this time. It cannot bulk-define variables that represent subclasses yet, or variant variables. */ bool success = true; if(data == NULL) return(false); while(data->name != NULL) { success = _reg_set_var(r, v, path, data, overwrite) || success; ++data; } return(success); } bool reg_set_vars(reg *r, reg_var *v, const char *path, const reg_var_data *data) { /* reg_set_vars This function takes a list of reg_var_data's in data, which is terminated by a record whose name field is NULL. It assigns each of the names given, relative to the reg_var v. If path is not NULL, then it is prepended to each name in turn to construct the final variable name (which itself is relative to v). If v is NULL, then the topmost variable in the registry is used. For each entry in the data list, this sets the variable to the value based on the description in data. This function will overwrite existing bindings in the registry. This function returns true if ALL assignments are successful (an assignment is successful if the variable is actually reassigned). If any single assignemnt fails, then this function will attempt to assign the remainder of the variables in the data list, but will ultimately return false. Each entry in the data list contains a reg_value which is used to initialize the variable. As such, it is able to handle multiple types of data. This function can only define integers, floats, booleans and strings at this time. It cannot bulk-define variables that represent subclasses yet, or variant variables. */ return(_reg_set_vars(r, v, path, data, true)); } bool reg_set_var_defaults(reg *r, reg_var *v, const char *path, const reg_var_data *data) { /* reg_set_var_defaults This function takes a list of reg_var_data's in data, which is terminated by a record whose name field is NULL. It assigns each of the names given, relative to the reg_var v. If path is not NULL, then it is prepended to each name in turn to construct the final variable name (which itself is relative to v). If v is NULL, then the topmost variable in the registry is used. For each entry in the data list, this sets the variable to the value based on the description in data. This function will ONLY assign variables which are not already bound in the registry; as such, it is suitable for assigning "default" values to a class and its subclasses, once the class has already been loaded from disk. This function returns true if ALL assignments are successful (an assignment is successful if the variable is either reassigned, or was already bound). If any single assignemnt fails, then this function will attempt to assign the remainder of the variables in the data list, but will ultimately return false. Each entry in the data list contains a reg_value which is used to initialize the variable. As such, it is able to handle multiple types of data. This function can only define integers, floats, booleans and strings at this time. It cannot bulk-define variables that represent subclasses yet, or variant variables. */ return(_reg_set_vars(r, v, path, data, false)); } bool reg_set_var_class_defaults(reg *r, reg_var *v, const char *path, const reg_class_default_data *data) { /* reg_set_var_defaults This function takes a list of reg_class_default_data's, which is terminated by a record whose name field is NULL. It assigns each of the names given, relative to the reg_var v. If path is not NULL, then it is prepended to each name in turn to construct the final variable name (which itself is relative to v). If v is NULL, then the topmost variable in the registry is used. For each entry in the data list, this sets the variable to the value based on the description in data. This function will ONLY assign variables which are not already bound in the registry; as such, it is suitable for assigning "default" values to a class and its subclasses, once the class has already been loaded from disk. This function returns true if ALL assignments are successful (an assignment is successful if the variable is either reassigned, or was already bound). If any single assignemnt fails, then this function will attempt to assign the remainder of the variables in the data list, but will ultimately return false. Each entry in the data list contains a reg_value which is used to initialize the variable. As such, it is able to handle multiple types of data. This function can only define integers, floats, booleans and strings at this time. It cannot bulk-define variables that represent subclasses yet, or variant variables. */ bool success = true; if(data == NULL) return(false); while(data->default_info.name != NULL) { success = _reg_set_var(r, v, path, &data->default_info, false) || success; ++data; } return(success); } xscorch-0.2.1/libj/jreg/regblock.c0000644000175000001440000001752411175116117013715 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jreg/regblock.c,v 1.11 2009-04-26 17:39:27 jacob Exp $ */ /* libj - regblock.c Copyright(c) 2000-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Config file processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #include <_reg.h> /* Waiting for robotnik */ reg_class *reg_class_new(reg_class **classes, const char *name) { /* reg_class_new Creates a new block class object. Each block class holds the list of variables and their data types, for the given class. The new class is prepended to the linked list. */ reg_class *bc; if(classes == NULL || name == NULL) return(NULL); bc = (reg_class *)malloc(sizeof(reg_class)); if(bc == NULL) return(NULL); strcopyb(bc->name, name, REG_SYMBOL_SIZE); bc->vars = NULL; bc->next = *classes; *classes = bc; return(bc); } reg_class *reg_class_lookup(reg_class *classes, const char *name) { /* reg_class_lookup Look for the block class with given name. */ while(classes != NULL) { if(strequal(classes->name, name)) return(classes); classes = classes->next; } return(NULL); } void reg_class_release(reg_class **classes) { /* reg_class_release Release the list of block classes. */ reg_class *cur; if(classes == NULL) return; while(*classes != NULL) { cur = *classes; *classes = cur->next; reg_var_info_release(&cur->vars); free(cur); } } reg_block *reg_block_new(const char *name, const reg_class *klass) { /* reg_block_new Creates a new subblock, of the specified name and class. */ reg_block *b; b = (reg_block *)malloc(sizeof(reg_block)); if(b == NULL) return(NULL); strcopyb(b->name, name, REG_SYMBOL_SIZE); b->klass = klass; b->vars = NULL; return(b); } void reg_block_free(reg_block **b) { /* reg_block_free Releases an entire block. */ if(b == NULL || *b == NULL) return; while((*b)->vars != NULL) { reg_var_free(&(*b)->vars); } free(*b); *b = NULL; } reg_var *reg_block_resolve(reg *r, reg_var *v, const char *path) { /* reg_block_resolve Resolve the specified pathname, relative to . If == NULL, then itself is returned. Otherwise, the is resolved, relative to ; if an error occurs along the way, then NULL will be returned. Note, if is not a block, and is not NULL, then an error occurs. */ char firstelem[REG_SYMBOL_SIZE]; reg_var *match; const char *p; if(v == NULL) v = r->top; if(v == NULL) return(NULL); if(path == NULL) return(v); if(v->type != REG_BLOCK) return(NULL); p = path; while(*p != '\0' && *p != '/') ++p; strcopynb(firstelem, path, p - path, REG_SYMBOL_SIZE); match = reg_var_lookup(v->value.block->vars, firstelem); if(match == NULL) return(NULL); if(*p == '\0') return(match); return(reg_block_resolve(r, match, p + 1)); } reg_var *reg_block_resolve_container(reg *r, reg_var *v, const char *path, char *varname) { /* reg_block_resolve_container Resolve the container which holds the specified variable. Lookup rules are the same as for reg_block_resolve(). The final variable name may be copied into (which must be of size REG_SYMBOL_SIZE) if successful. Caution: If is NULL, then a container _cannot_ be returned for this variable. This is a bug; I should be keeping a backpointer around, but I don't. Oops. */ char firstelem[REG_SYMBOL_SIZE]; reg_var *match; const char *p; if(v == NULL) v = r->top; if(v == NULL || path == NULL) return(NULL); if(v->type != REG_BLOCK) return(NULL); p = path; while(*p != '\0' && *p != '/') ++p; if(*p == '\0') { /* Found the container */ if(varname != NULL) { strcopynb(varname, path, p - path, REG_SYMBOL_SIZE); } return(v); } strcopynb(firstelem, path, p - path, REG_SYMBOL_SIZE); match = reg_var_lookup(v->value.block->vars, firstelem); if(match == NULL) return(NULL); return(reg_block_resolve_container(r, match, p + 1, varname)); } bool reg_class_add(reg *r, const char *classname) { /* sc_file_class_add Add a new (empty) class to the registry. */ if(r == NULL || classname == NULL) return(false); return(reg_class_new(&r->classes, classname) != NULL); } bool reg_class_register_var(reg *r, const char *classname, const char *name, reg_type type, const char *klass) { /* reg_class_register_var Register a variable with name , and specified (and if a block), to the class entry in . NULL pointers are not tolerated by this function, except for . If usedef is true, then the variable is registered with the indicated default value; other- wise, defvalue is ignored. */ reg_class *bc; if(r == NULL || classname == NULL || name == NULL) { return(false); } bc = reg_class_lookup(r->classes, classname); if(bc == NULL) { return(false); } if(reg_var_info_new(&bc->vars, name, type, reg_class_lookup(r->classes, klass)) == NULL) { return(false); } return(true); } bool reg_class_add_list(reg *r, const char **classnames) { /* reg_class_add_list Register a list of empty classes. is a NULL- terminated list of names to register. */ if(classnames == NULL) return(false); while(*classnames != NULL) { if(!reg_class_add(r, *classnames)) return(false); ++classnames; } return(true); } bool reg_class_register_vars(reg *r, const char *classname, const reg_class_data *list) { /* reg_class_register_vars */ if(list == NULL) return(false); while(list->name != NULL) { if(!reg_class_register_var(r, classname, list->name, list->type, list->klass)) { return(false); } ++list; } return(true); } bool reg_class_register_default_vars(reg *r, const char *classname, const reg_class_default_data *list) { /* reg_class_register_default_vars */ if(list == NULL) return(false); while(list->class_info.name != NULL) { if(!reg_class_register_var(r, classname, list->class_info.name, list->class_info.type, list->class_info.klass)) { return(false); } ++list; } return(true); } bool reg_class_register_list(reg *r, const reg_class_list *list) { /* reg_class_register_list */ if(list == NULL) return(false); while(list->name != NULL) { if(!reg_class_add(r, list->name)) return(false); if(!reg_class_register_vars(r, list->name, list->vars)) return(false); ++list; } return(true); } bool reg_class_register_default_list(reg *r, const reg_class_default_list *list) { /* reg_class_register_default_list */ if(list == NULL) return(false); while(list->name != NULL) { if(!reg_class_add(r, list->name)) return(false); if(!reg_class_register_default_vars(r, list->name, list->vars)) return(false); ++list; } return(true); } reg_var *reg_get_block_head(reg_var *v) { if(v == NULL) return(NULL); if(v->type != REG_BLOCK) return(NULL); return(v->value.block->vars); } reg_var *reg_get_next_var(reg_var *v) { if(v == NULL) return(NULL); return(v->next); } xscorch-0.2.1/libj/jreg/regio.c0000644000175000001440000002243511175116117013227 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jreg/regio.c,v 1.9 2009-04-26 17:39:27 jacob Exp $ */ /* libj - regio.c Copyright(c) 2000-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Config file processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #include <_reg.h> /* Waiting for robotnik */ static void _reg_save_block(reg *r, const reg_var *b, int indent); /*** Line processing ***/ static bool _sc_line_is_assignment(char *buf, char *var, char *val) { /* sc_line_is_assignment */ char *p; p = escaped_scan(buf, '='); if(p == NULL) return(false); strcopyb(var, buf, p - buf + 1); strcopyb(val, p + 1, REG_BUFFER); trim(var); trim(val); return(true); } static bool _sc_line_is_block_begin(const reg *r, char *buf, char *name, char *klass) { /* sc_line_is_block_begin */ char *p; p = escaped_scan(buf, '{'); if(p == NULL) return(false); *p++ = '\0'; trim(p); if(*p != '\0') { reg_error_line(r, "Garbage after '{' (warning only)"); } if(!_sc_line_is_assignment(buf, name, klass)) { reg_error_line(r, "Block needs a name and a class"); return(false); } return(true); } static bool _sc_line_is_block_end(const reg *r, char *buf) { /* sc_line_is_block_end */ char *p; p = escaped_scan(buf, '}'); if(p == NULL) return(false); *p++ = '\0'; trim(p); if(*p != '\0') { reg_error_line(r, "Garbage after '}' (warning only)"); } trim(buf); if(*buf != '\0') { reg_error_line(r, "Garbage before '}' (warning only)"); } return(true); } /*** File block readers ***/ static reg_var *_reg_load_block(reg *r, const char *name, const char *klass) { bool exit; int startline; reg_var *block; reg_var *subblock; char buf[REG_BUFFER]; char var[REG_BUFFER]; char val[REG_BUFFER]; startline = r->line; block = reg_var_new_block(r, name, reg_class_lookup(r->classes, klass)); if(block == NULL) return(NULL); exit = false; while(!exit && fgets(buf, REG_BUFFER, r->handle) != NULL) { ++r->line; escaped_chop(buf, ';'); trim(buf); if(_sc_line_is_block_begin(r, buf, var, val)) { subblock = _reg_load_block(r, var, val); if(subblock == NULL) { reg_error_line2(r, " in block \"%s\"(%d)", name, startline); reg_var_free(&block); return(false); } if(!reg_var_merge_block(r, block, var, &subblock)) { reg_error_line3(r, "Failed to add subblock \"%s\" to block \"%s\"(%d) (continuable error)", var, name, startline); } } else if(_sc_line_is_block_end(r, buf)) { exit = true; } else if(_sc_line_is_assignment(buf, var, val)) { if(!reg_var_set_by_value(r, block, var, val)) { reg_error_line3(r, "Failed to add variable \"%s\" to block \"%s\"(%d) (continuable error)", var, name, startline); } } else if(*buf == '\0') { /* Do nothing */ } else { /* Invalid line */ reg_error_line2(r, "Parse error in block \"%s\"(%d)", name, startline); reg_var_free(&block); return(false); } /* What type of line is this? */ } /* Reading lines from the file ... */ if(!exit) { reg_error_line2(r, "Premature end-of-block \"%s\"(%d)", name, startline); reg_var_free(&block); return(false); } /* Return this block */ return(block); } static bool _reg_load_top(reg *r) { reg_var *top; reg_var *subblock; char buf[REG_BUFFER]; char var[REG_BUFFER]; char val[REG_BUFFER]; top = r->top; while(fgets(buf, REG_BUFFER, r->handle) != NULL) { ++r->line; escaped_chop(buf, ';'); trim(buf); if(_sc_line_is_block_begin(r, buf, var, val)) { subblock = _reg_load_block(r, var, val); if(subblock == NULL) { reg_error_line1(r, " in block \"%s\"", top->name); return(false); } if(!reg_var_merge_block(r, top, var, &subblock)) { reg_error_line2(r, "Failed to add subblock \"%s\" to top block \"%s\" (continuable error)", var, top->name); } } else if(_sc_line_is_block_end(r, buf)) { reg_error_line1(r, "Cannot exit top block, \"%s\" (continuable error)", top->name); } else if(_sc_line_is_assignment(buf, var, val)) { if(!reg_var_set_by_value(r, top, var, val)) { reg_error_line2(r, "Failed to add variable \"%s\" to block \"%s\" (continuable error)", var, top->name); } } else if(*buf == '\0') { /* Do nothing */ } else { /* Invalid line */ reg_error_line1(r, "Parse error in block \"%s\"", top->name); return(false); } /* What type of line is this? */ } /* Reading lines from the file ... */ return(true); } /*** Block saving functions ***/ static inline void _reg_indent(FILE *f, int indent) { while(indent-- > 0) fputc(' ', f); } static void _reg_save_variable(reg *r, const reg_var *var, int indent) { char buf[REG_BUFFER]; switch(var->type) { case REG_INTEGER: _reg_indent(r->handle, indent); fprintf(r->handle, "%-16s = %d;\n", var->name, var->value.integer); break; case REG_DOUBLEV: _reg_indent(r->handle, indent); fprintf(r->handle, "%-16s = %e;\n", var->name, var->value.doublev); break; case REG_BOOLEAN: _reg_indent(r->handle, indent); switch(var->value.boolean.format) { case REG_FORMAT_BOOL_TF: fprintf(r->handle, "%-16s = %s;\n", var->name, (var->value.boolean.value ? "True" : "False")); break; case REG_FORMAT_BOOL_YN: fprintf(r->handle, "%-16s = %s;\n", var->name, (var->value.boolean.value ? "Yes" : "No")); break; case REG_FORMAT_BOOL_OO: fprintf(r->handle, "%-16s = %s;\n", var->name, (var->value.boolean.value ? "On" : "Off")); break; case REG_FORMAT_BOOL_TNIL: fprintf(r->handle, "%-16s = %s;\n", var->name, (var->value.boolean.value ? "T" : "NIL")); break; } break; case REG_STRING: strcopyb(buf, var->value.string, REG_BUFFER); escapeb(buf, REG_BUFFER); _reg_indent(r->handle, indent); fprintf(r->handle, "%-16s = \"%s\";\n", var->name, buf); break; case REG_BLOCK: _reg_indent(r->handle, indent); fprintf(r->handle, "%s = %s {\n", var->name, var->value.block->klass == NULL ? "null" : var->value.block->klass->name); _reg_save_block(r, var, indent + 3); _reg_indent(r->handle, indent); fprintf(r->handle, "}; End of block %s\n", var->name); if(indent == 0) fprintf(r->handle, "\n\n"); break; case REG_ANY: break; } } static void _reg_save_block(reg *r, const reg_var *b, int indent) { reg_var *var; var = b->value.block->vars; while(var != NULL) { _reg_save_variable(r, var, indent); var = var->next; } } /*** General interface ***/ void reg_set_name(reg *r, const char *filename) { char *oldfilename; if(r == NULL || filename == NULL) return; oldfilename = r->filename; r->filename = (char *)malloc(strlenn(filename) + 1); if(r->filename == NULL) { r->filename = oldfilename; return; } /* We just allocated the buffer, so the size is always ok */ strcopy(r->filename, filename); free(oldfilename); } bool reg_load(reg *r) { if(r == NULL) return(false); r->line = 0; r->handle = fopen(r->filename, "r"); if(r->handle == NULL) { reg_error(r, "Cannot open file to load"); return(false); } if(!_reg_load_top(r)) { reg_error(r, "Nonrecoverable error occurred"); fclose(r->handle); return(false); } fclose(r->handle); return(true); } bool reg_save(reg *r) { if(r == NULL) return(false); r->handle = fopen(r->filename, "w"); if(r->handle == NULL) { reg_error(r, "Cannot open file to save"); return(false); } fprintf(r->handle, "; This is an automatically generated file\n\n\n"); fprintf(r->handle, "; Warning: there is _no_ error checking on values in this file.\n"); fprintf(r->handle, "; This would make for a rather convenient way to set invalid values.\n"); fprintf(r->handle, "; Maybe it could even be exploited to enable hidden `features'.\n\n\n"); _reg_save_block(r, r->top, 0); fprintf(r->handle, "; End of file\n"); fclose(r->handle); return(true); } xscorch-0.2.1/libj/jreg/regvar.c0000644000175000001440000003544411175116120013406 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jreg/regvar.c,v 1.10 2009-04-26 17:39:28 jacob Exp $ */ /* libj - regvar.c Copyright(c) 2000-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Config file processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #include <_reg.h> /* Waiting for robotnik */ /*** Variables ***/ reg_var_info *reg_var_info_new(reg_var_info **reg, const char *name, reg_type type, const reg_class *klass) { /* reg_var_info_new */ reg_var_info *new; if(reg == NULL) return(NULL); new = (reg_var_info *)malloc(sizeof(reg_var_info)); if(new == NULL) return(NULL); strcopyb(new->name, name, REG_SYMBOL_SIZE); new->klass = klass; new->type = type; new->next = *reg; /* Prepend the new variable definition */ *reg = new; return(new); } reg_type reg_var_info_lookup(const reg_class *bc, const char *name) { /* reg_var_info_lookup */ const reg_var_info *reg; if(bc == NULL || name == NULL) return(REG_ANY); reg = bc->vars; while(reg != NULL) { if(strequal(reg->name, name)) return(reg->type); reg = reg->next; } return(REG_ANY); } const reg_class *reg_var_info_lookup_class(const reg_class *bc, const char *name) { /* reg_var_info_lookup_class */ const reg_var_info *reg; if(bc == NULL || name == NULL) return(NULL); reg = bc->vars; while(reg != NULL) { if(strequal(reg->name, name)) return(reg->klass); reg = reg->next; } return(NULL); } static void _reg_value_free(reg_type type, reg_value *value) { /* reg_value_free */ switch(type) { case REG_STRING: free(value->string); value->string = NULL; break; case REG_BLOCK: reg_block_free(&value->block); break; case REG_INTEGER: case REG_BOOLEAN: case REG_DOUBLEV: case REG_ANY: break; } } void reg_var_info_release(reg_var_info **reg) { /* reg_var_info_release */ reg_var_info *cur; if(reg == NULL || *reg == NULL) return; while(*reg != NULL) { cur = *reg; *reg = cur->next; free(cur); } } static void _reg_var_clear(reg_var *var) { /* reg_var_clear */ if(var == NULL) return; _reg_value_free(var->type, &var->value); } reg_var *reg_var_lookup(reg_var *vars, const char *name) { /* reg_var_lookup Checks to see if the specified variable is already defined. If it is, then we will return it here. */ /* Make sure all pointers given are valid */ if(name == NULL) return(NULL); /* Search for the appropriate variable */ while(vars != NULL) { if(strequal(vars->name, name)) { /* Found a matching variable */ return(vars); } /* Try the next variable... */ vars = vars->next; } /* Searching... */ /* No match found */ return(NULL); } static reg_var *_reg_var_add(const reg *r, reg_var **vars, const char *name, reg_type type) { /* reg_var_add Adds a new variable definition to the end of the linked list given. The variable will be uninitialised, but its type field will be set. This function may fail on an allocation error, or if name/type is invalid, etc... */ reg_var *var; /* Newly constructed variable */ reg_var *cur; /* Pointer into linked list... */ /* Make sure all pointers given are valid */ if(name == NULL) return(NULL); if(vars == NULL) return(NULL); /* Make sure the name is valid, and not duplicated */ if(*name == '\0') { reg_error(r, "Variable name is empty"); return(NULL); } /* Name empty? */ /* Create the new variable */ var = (reg_var *)malloc(sizeof(reg_var)); if(var == NULL) return(NULL); /* Initialise the data members */ strcopyb(var->name, name, REG_SYMBOL_SIZE); var->type = type; var->value.string = NULL; var->next = NULL; /* Insert this variable to the list */ if(*vars == NULL) { /* First variable in the list */ *vars = var; } else { /* Search for end of list */ cur = *vars; while(cur->next != NULL) cur = cur->next; cur->next = var; } /* Return the constructed variable */ return(var); } static reg_var *_reg_var_set(const reg *r, reg_var *b, const char *name, reg_type type) { /* reg_var_set */ reg_var *var; /* Variable created or to set */ reg_type regtype; /* Variable type required by vars */ reg_block *blk; /* Block data */ /* Make sure type agrees with vars (if applicable) */ blk = b->value.block; regtype = reg_var_info_lookup(blk->klass, name); if(regtype != REG_ANY && regtype != type) { /* Sorry, types don't match */ reg_error1(r, "Type must match vars for \"%s\"", name); return(NULL); } /* Does type agree with vars? */ /* Check if the variable has already been defined */ var = reg_var_lookup(blk->vars, name); if(var != NULL) { /* Variable already exists */ _reg_var_clear(var); var->type = type; } else { /* Variable did not exist; create it */ var = _reg_var_add(r, &blk->vars, name, type); } /* Return the variable */ return(var); } bool reg_var_set_integer(const reg *r, reg_var *b, const char *name, int value) { /* reg_var_set_integer Adds a new integer variable. */ reg_var *var; /* Newly constructed variable */ /* Create the variable and initialise its value */ var = _reg_var_set(r, b, name, REG_INTEGER); if(var == NULL) return(false); var->value.integer = value; return(true); } bool reg_var_set_doublev(const reg *r, reg_var *b, const char *name, double value) { /* reg_var_set_doublev Adds a new floating-point variable. */ reg_var *var; /* Newly constructed variable */ /* Create the variable and initialise its value */ var = _reg_var_set(r, b, name, REG_DOUBLEV); if(var == NULL) return(false); var->value.doublev = value; return(true); } bool reg_var_set_boolean(const reg *r, reg_var *b, const char *name, bool value, reg_format_bool format) { /* reg_var_set_boolean Adds a new boolean variable (with associated format). */ reg_var *var; /* Newly constructed variable */ /* Create the variable and initialise its value */ var = _reg_var_set(r, b, name, REG_BOOLEAN); if(var == NULL) return(false); var->value.boolean.value = value; var->value.boolean.format = format; return(true); } bool reg_var_set_string(const reg *r, reg_var *b, const char *name, const char *value) { /* reg_var_set_string Adds a new string variable. */ reg_var *var; /* Newly constructed variable */ /* Construct the variable */ var = _reg_var_set(r, b, name, REG_STRING); if(var == NULL) return(false); /* Copy the new string into the variable */ if(value == NULL) { var->value.string = NULL; } else { /* Source string was not NULL */ var->value.string = (char *)malloc(strlenn(value) + 1); if(var->value.string != NULL) { strcopy(var->value.string, value); } /* Did malloc() succeed? */ } /* Was source value nonnull? */ return(true); } bool reg_var_set_block(const reg *r, reg_var *b, const char *name, reg_var **block) { /* reg_var_set_block Adds a new block variable. */ reg_var *var; /* Newly constructed variable */ const reg_class *klass; /* Block class in vars */ reg_block *blk; /* Original block object */ reg_block *newblk; /* New block object to assign */ /* Assert that b, is a block. */ if(b == NULL || b->type != REG_BLOCK) return(false); if(block == NULL || *block == NULL || (*block)->type != REG_BLOCK) return(false); blk = b->value.block; newblk = (*block)->value.block; /* Make sure class agrees with vars (if applicable) */ klass = reg_var_info_lookup_class(blk->klass, name); if(klass != NULL && newblk->klass != klass) { /* Sorry, types don't match */ reg_error1(r, "Object class must match vars for \"%s\"", name); return(false); } /* Does type agree with vars? */ /* Create the variable and assign the block to it */ var = _reg_var_set(r, b, name, REG_BLOCK); if(var == NULL) return(false); var->value.block = newblk; /* Delete the original */ (*block)->value.block = NULL; reg_var_free(block); return(true); } bool reg_var_merge_block(const reg *r, reg_var *b, const char *name, reg_var **block) { /* reg_var_merge_block Merges the given block into an existing block (if available). If necessary, a new block will be created. Variables in will override the old vars in that were set. WARNING: This function may destroy the block pointer given, after it is finished. */ reg_var *var; /* Newly constructed variable */ reg_var **newlist; /* New variable list to merge */ reg_block *blk; /* Original block object */ reg_block *newblk; /* New block object to merge */ bool advance; /* Advance pointer? */ /* Make sure pointers are valid */ if(b == NULL || block == NULL || *block == NULL) return(false); /* Make sure b, block are valid blocks */ if(b->type != REG_BLOCK || (*block)->type != REG_BLOCK) return(false); blk = b->value.block; newblk = (*block)->value.block; /* Search for an existing block */ var = reg_var_lookup(blk->vars, name); if(var == NULL || var->type != REG_BLOCK || var->value.block->klass != newblk->klass) { /* No variable by that name found, or it wasn't a block */ return(reg_var_set_block(r, b, name, block)); } /* Does variable exist? Is it a block? */ /* Variable is a block; we must merge given block into it */ newlist = &newblk->vars; while(*newlist != NULL) { advance = true; switch((*newlist)->type) { case REG_INTEGER: if(!reg_var_set_integer(r, var, (*newlist)->name, (*newlist)->value.integer)) return(false); break; case REG_DOUBLEV: if(!reg_var_set_doublev(r, var, (*newlist)->name, (*newlist)->value.doublev)) return(false); break; case REG_BOOLEAN: if(!reg_var_set_boolean(r, var, (*newlist)->name, (*newlist)->value.boolean.value, (*newlist)->value.boolean.format)) return(false); break; case REG_STRING: if(!reg_var_set_string(r, var, (*newlist)->name, (*newlist)->value.string)) return(false); break; case REG_BLOCK: if(!reg_var_merge_block(r, var, (*newlist)->name, newlist)) return(false); advance = false; break; case REG_ANY: break; } if(advance) newlist = &((*newlist)->next); } /* Merging ... */ /* Destroy the block */ reg_var_free(block); /* Return success */ return(true); } bool reg_var_set_by_value(const reg *r, reg_var *b, const char *name, char *value) { /* reg_var_set_by_value Adds a new variable, based on the contents of the string value. First, this function attempts to set an integer variable; failing that, it will try seting a double variable, and as a last resort it uses a string variable. */ char *p; /* Pointer to store result of strto? */ int valint; /* Attempted conversion to integer */ double valdbl; /* Attempted conversion to double */ /* Make sure value isn't NULL */ if(value == NULL || *value == '\0') return(false); /* Check for True/False and other boolean keywords */ if(strequal(value, "True") || strequal(value, "true")) return(reg_var_set_boolean(r, b, name, true, REG_FORMAT_BOOL_TF)); if(strequal(value, "Yes") || strequal(value, "yes")) return(reg_var_set_boolean(r, b, name, true, REG_FORMAT_BOOL_YN)); if(strequal(value, "On") || strequal(value, "on")) return(reg_var_set_boolean(r, b, name, true, REG_FORMAT_BOOL_OO)); if(strequal(value, "T") || strequal(value, "t")) return(reg_var_set_boolean(r, b, name, true, REG_FORMAT_BOOL_TNIL)); if(strequal(value, "False") || strequal(value, "false")) return(reg_var_set_boolean(r, b, name, false, REG_FORMAT_BOOL_TF)); if(strequal(value, "No") || strequal(value, "no")) return(reg_var_set_boolean(r, b, name, false, REG_FORMAT_BOOL_YN)); if(strequal(value, "Off") || strequal(value, "off")) return(reg_var_set_boolean(r, b, name, false, REG_FORMAT_BOOL_OO)); if(strequal(value, "NIL") || strequal(value, "nil")) return(reg_var_set_boolean(r, b, name, false, REG_FORMAT_BOOL_TNIL)); /* Attempt to convert to an integer first (most restrictive) */ valint = strtol(value, &p, 0); if(*p == '\0') return(reg_var_set_integer(r, b, name, valint)); /* Attempt to convert to a double */ valdbl = strtod(value, &p); if(*p == '\0') return(reg_var_set_doublev(r, b, name, valdbl)); /* Assume the value is a string if it has a quote. */ if(*value == '\"') { unescape_quoted(value); return(reg_var_set_string(r, b, name, value)); } /* Failure mode */ reg_error2(r, "Malformed value for \"%s\": %s\n", name, value); return(false); } void reg_var_free(reg_var **vars) { /* reg_var_free Removes the variable at the top of the list. */ reg_var *var; /* Variable being deleted */ /* Make sure there is something to delete */ if(vars == NULL || *vars == NULL) return; /* Splice, and update pointers in the list */ var = *vars; *vars = var->next; /* Release any memory associated with the variable */ _reg_var_clear(var); free(var); } reg_var *reg_var_new_block(const reg *r, const char *name, const reg_class *klass) { reg_var *var; var = NULL; _reg_var_add(r, &var, name, REG_BLOCK); if(var != NULL) { var->value.block = reg_block_new(name, klass); } return(var); } reg_type reg_get_var_type(const reg_var *v) { if(v == NULL) return(REG_ANY); return(v->type); } const char *reg_get_var_name(const reg_var *v) { if(v == NULL) return(NULL); return(v->name); } const char *reg_get_var_class(const reg_var *v) { if(v == NULL) return(NULL); if(v->type != REG_BLOCK) return(NULL); if(v->value.block->klass == NULL) return(REG_NULL); return(v->value.block->klass->name); } reg_var *reg_get_var(reg *r, reg_var *v, const char *path) { return(reg_block_resolve(r, v, path)); } xscorch-0.2.1/libj/jreg/_reg.h0000644000175000001440000000713211175116116013037 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jreg/_reg.h,v 1.10 2009-04-26 17:39:26 jacob Exp $ */ /* libj - _reg.h Copyright(c) 2000-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ File reader/writer/parser, variable registry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #ifndef __reg_int_h_included #define __reg_int_h_included /* Includes */ #include #include /* Error reporting assistance */ #define reg_error_line(f, fmt) \ if((f) != NULL) fprintf(stderr, "%s:%d: error: " fmt "\n", (f)->filename, (f)->line) #define reg_error_line1(f, fmt, arg1) \ if((f) != NULL) fprintf(stderr, "%s:%d: error: " fmt "\n", (f)->filename, (f)->line, (arg1)) #define reg_error_line2(f, fmt, arg1, arg2) \ if((f) != NULL) fprintf(stderr, "%s:%d: error: " fmt "\n", (f)->filename, (f)->line, (arg1), (arg2)) #define reg_error_line3(f, fmt, arg1, arg2, arg3) \ if((f) != NULL) fprintf(stderr, "%s:%d: error: " fmt "\n", (f)->filename, (f)->line, (arg1), (arg2), (arg3)) #define reg_error(f, fmt) \ if((f) != NULL) fprintf(stderr, "%s: error: " fmt "\n", (f)->filename) #define reg_error1(f, fmt, arg1) \ if((f) != NULL) fprintf(stderr, "%s: error: " fmt "\n", (f)->filename, (arg1)) #define reg_error2(f, fmt, arg1, arg2) \ if((f) != NULL) fprintf(stderr, "%s: error: " fmt "\n", (f)->filename, (arg1), (arg2)) /* Variable registry */ reg_var_info *reg_var_info_new(reg_var_info **varlist, const char *name, reg_type type, const reg_class *klass); reg_type reg_var_info_lookup(const reg_class *bc, const char *name); void reg_var_info_release(reg_var_info **reg); /* Variables */ void reg_var_free(reg_var **v); bool reg_var_set_integer(const reg *r, reg_var *v, const char *name, int value); bool reg_var_set_doublev(const reg *r, reg_var *v, const char *name, double value); bool reg_var_set_boolean(const reg *r, reg_var *v, const char *name, bool value, reg_format_bool format); bool reg_var_set_string(const reg *r, reg_var *v, const char *name, const char *value); bool reg_var_set_block(const reg *r, reg_var *v, const char *name, reg_var **block); bool reg_var_set_by_value(const reg *r, reg_var *v, const char *name, char *value); bool reg_var_merge_block(const reg *r, reg_var *v, const char *name, reg_var **block); reg_var *reg_var_new_block(const reg *r, const char *name, const reg_class *klass); reg_var *reg_var_lookup(reg_var *v, const char *name); /* Block classes */ reg_class *reg_class_lookup(reg_class *classes, const char *name); void reg_class_release(reg_class **classes); /* Blocks */ reg_block *reg_block_new(const char *name, const reg_class *klass); void reg_block_free(reg_block **block); /* Variable resolution */ reg_var * reg_block_resolve(reg *r, reg_var *v, const char *path); reg_var * reg_block_resolve_container(reg *r, reg_var *v, const char *path, char *varname); #endif /* __reg_int_h_included */ xscorch-0.2.1/libj/jstr/0000755000175000001440000000000011615372010012056 500000000000000xscorch-0.2.1/libj/jstr/libjstr.h0000644000175000001440000002405311175116121013624 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/libjstr.h,v 1.18 2009-04-26 17:39:29 jacob Exp $ */ /* libj - jstr.h Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Main header file for jstr library This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #ifndef __libj_str_included #define __libj_str_included /* Definitions and datatypes */ #include #include #include #if !LIBJ_LIBC_STRING #if LIBJ_ALLOW_LIBC_STRING #define LIBJ_ALLOW_LIBC_MEMORY 1 #endif /* String requires Memory */ #include #endif /* Time functions */ #if HAVE_GETTIMEOFDAY # if TIME_WITH_SYS_TIME # include # include # else # if HAVE_SYS_TIME_H # include # else # include # endif # endif #endif /* Rabin-Karp configuration structure */ typedef struct _rkstate { sizea rk_i; /* Rabin-Karp incrementor/decrementor */ sdword rk_t; /* Rabin-Karp "t" accumulator */ sdword rk_p; /* Rabin-Karp "p" accumulator */ sdword rk_h; /* Rabin-Karp "h" multiplier */ char *rk_source; /* Rabin-Karp source buffer */ const char *rk_pattern; /* Rabin-Karp search pattern */ sizea rk_dlen; /* Rabin-Karp destination string len */ } rkstate; /* String pairs */ typedef struct _string_pair { char *first; char *second; } string_pair; #define pair_car(p) ((p)->first) #define pair_cdr(p) ((p)->second) /* Definitions useful for string manipulation */ #define SEP '|' /* Default separator character */ #define COMM '#' /* Default comment character */ /* Boolean characters */ #define BOOLU(c) ((c) ? 'T' : 'F') #define BOOLL(c) ((c) ? 't' : 'f') #define BOOL(c) BOOLU(c) /* Alphabetic and numeric characters; case verification */ #define LOWER(c) (((c) >= 'a' && (c) <= 'z')) #define UPPER(c) (((c) >= 'A' && (c) <= 'Z')) #define DIGIT(c) (((c) >= '0' && (c) <= '9')) #define ALPHA(c) (LOWER(c) || UPPER(c)) #define WHITESPACE(c) (((c) == ' ' || (c) == '\t' || (c) == '\n')) /* Disable LIBC functions if requested */ #if (!LIBJ_ALLOW_LIBC_STRING) #undef strcmp #define strcmp __dont_use_strcmp #undef strncmp #define strncmp __dont_use_strncmp #undef strcasecmp #define strcasecmp __dont_use_strcasecmp #undef strncasecmp #define strncasecmp __dont_use_strncasecmp #undef strcpy #define strcpy __dont_use_strcpy #undef strncpy #define strncpy __dont_use_strncpy #undef strcat #define strcat __dont_use_strcat #undef strncat #define strncat __dont_use_strncat #undef strlen #define strlen __dont_use_strlen #undef strnlen #define strnlen __dont_use_strnlen #undef sprintf #define sprintf __dont_use_sprintf #undef snprintf #define snprintf __dont_use_snprintf #undef strstr #define strstr __dont_use_strstr #endif /* LIBJ_ALLOW_LIBC_STRING */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* A note on convention and suffices. Functions which accept size args may follow one of two conventions (denoted by a suffix): 'n': size specifies the number of characters, EXCLUDE '\0'. Often used in functions which count but not copy. 'b': size specifies actual size of the buffer. The number of chars (if applicable) is usually the size - 1, and the function (if copying) will impose a '\0' byte in the last position. Use the 'b' version of the function if you are giving a BUFFER SIZE. Suffix 'p' is used when we do not copy, but rather pass around direct pointers. */ /*** Argument String Processing ***/ sizea getnumargs(const char *s, char sep); char *getarg(char *d, const char *s, sizea argnum, char sep); char *getargb(char *d, const char *s, sizea argnum, char sep, sizea maxlen); char *getargn(char *d, const char *s, sizea argnum, char sep, sizea n); sizea getargp(char **d, char *s, sizea argnum, char sep); sizea getargp_trim(char **d, char *s, sizea argnum, char sep); /*** Case-adjustment, etc. ***/ char *unescape(char *s); char *unescape_quoted(char *s); char *escapeb(char *s, sizea size); char *escapen(char *s, sizea n); char *escaped_scan(char *src, char ch); char *escaped_chop(char *src, char ch); char *strlower(char *s); char *strupper(char *s); char *strproper(char *s); /*** CGI Functions ***/ bool getassign(char *var, char *val, const char *s); bool getassignbb(char *var, char *val, const char *s, sizea lvar, sizea lval); bool getassignbn(char *var, char *val, const char *s, sizea lvar, sizea nval); bool getassignnb(char *var, char *val, const char *s, sizea nvar, sizea lval); bool getassignnn(char *var, char *val, const char *s, sizea nvar, sizea nval); #define getassignb(var, val, s, lvar, lval) getassignbb((var), (val), (s), (lvar), (lval)) #define getassignn(var, val, s, lvar, lval) getassignnn((var), (val), (s), (lvar), (lval)) char *unescapeCGI(char *s); char *escapeCGI(char *s); sizea getnumargsCGI(const char *s); char *getargCGI(char *d, const char *s, sizea argnum); char *getargCGIb(char *d, const char *s, sizea argnum, sizea bufsize); char *getargCGIn(char *d, const char *s, sizea argnum, sizea nchars); /*** String comparison routines ***/ /* For comparison, n is the maximum number of characters to compare against. If the first n chars agree, it is a total match. */ int strcomp(const char *a, const char *b); int strcompn(const char *a, const char *b, sizea nchars); bool strequal(const char *a, const char *b); bool strequaln(const char *a, const char *b, sizea nchars); #define streql(a, b) strequal((a), (b)) #define streqln(a, b, n) strequaln((a), (b), (n)) char *rkstrpat(rkstate *rk, char *s, const char *pat); char *rkstrnext(rkstate *rk); char *kmpstrpat(char *s, const char *pat); char *strscan(char *s, const char *pat); char *strscan_list(char *s, const char *const*patlist, sizea *index); bool strsimilar(const char *A, const char *B); /* Shorthands */ #define jstrcmp(a, b) strcomp((a), (b)) #define jstrncmp(a, b, n) strcompn((a), (b), (n)) #define jstreql(a, b) strequal((a), (b)) #define jstrneql(a, b, n) strequal((a), (b), (n)) #define jstrscan(s, pat) strscan((s), (pat)) /*** Console (formatting) string functions ***/ char *cpyslenn(char *d, const char *s, sizea size); void putslenn(const char *s, sizea size); char *cpysrlenn(char *d, const char *s, sizea size); void putsrlenn(const char *s, sizea size); /*** Sprintf services ***/ char *sbprintf(char *dest, sizea size, const char *fmt, ...); char *sbprintf_concat(char *dest, sizea size, const char *fmt, ...); /*** String copy routines ***/ char *strcopyb(char *d, const char *s, sizea bufsize); char *strcopyn(char *d, const char *s, sizea nchars); char *strcopynb(char *d, const char *s, sizea nchars, sizea bufsize); /* #chars to append/size of buffer */ #define strcopybn(d, s, bufsize, nchars) strcopynb((d), (s), (nchars), (bufsize)) char *strcopy(char *d, const char *s); char *strconcatb(char *d, const char *s, sizea bufsize); /* Size of dest buffer! */ char *strconcatn(char *d, const char *s, sizea nchars); /* Number of chars to append! */ char *strconcatnb(char *d, const char *s, sizea nchars, sizea bufsize); /* #chars to append/size of buffer */ #define strconcatbn(d, s, bufsize, nchars) strconcatnb((d), (s), (nchars), (bufsize)) char *strconcat(char *d, const char *s); /* Shorthands */ #define jstrcpy(d, s) strcopy((d), (s)) #define jstrbcpy(d, s, n) strcopyb((d), (s), (n)) #define jstrncpy(d, s, n) strcopyn((d), (s), (n)) #define jstrcat(d, s) strconcat((d), (s)) #define jstrbcat(d, s, n) strconcatb((d), (s), (n)) #define jstrncat(d, s, n) strconcatn((d), (s), (n)) #define jstrnbcat(d, s, n, b) strconcatnb((d), (s), (n), (b)) /*** Special string creation routines ***/ char *strdupl(const char *s); /*** String information functions ***/ sizea strlenn(const char *s); sizea strnlenn(const char *s, sizea maxchars); sizea strblenn(const char *s, sizea size); sizea strnumwords(const char *s); sizea strnumlines(const char *s); /*** File I/O ***/ sizea fcount(const char *fname); /*** Numerical functions ***/ sdword strtoint(const char *s, int *succ); double strtofloat(const char *s, int *succ); char * inttostr(char *d, sdword num, sizea digits); char * inttohex(char *d, udword num, sizea digits); bool getbool(bool *result, const char *s); /*** String Replacement Functions ***/ sizea strreplaceb(char *s, const char *src, const char *dst, sizea bufsize); sizea strreplacen(char *s, const char *src, const char *dst, sizea nchars); /*** Time functions ***/ #if HAVE_GETTIMEOFDAY bool decodetime(struct tm *t, const char *s); char *encodetime(char *d); #endif /*** String trimming ***/ char *trimcomment(char *s, char c); char *trimbracecomment(char *s, char c1, char c2); char *trim(char *s); char *rtrim(char *s); char *ltrim(char *s); /*** Unicode functions ***/ char *unitochar(char *d, const wchar *s); wchar *chartouni(wchar *d, const char *s); char *unitocharc(char *d, const wchar *s, sizea maxlen); wchar *chartounic(wchar *d, const char *s, sizea maxlen); #ifdef __cplusplus /* Close the extern */ }; #endif /* __cplusplus */ #endif /* Header included */ xscorch-0.2.1/libj/jstr/Makefile.am0000644000175000001440000000206311206321106014027 00000000000000## $Header: /fridge/cvs/xscorch/libj/jstr/Makefile.am,v 1.10 2009-05-24 19:38:46 jacob Exp $ ## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = 1.3 CLEANFILES = *~ *.bak libs/* MAINTAINERCLEANFILES = aclocal.m4 configure JSTR_SRCS = \ str_arg.c \ str_case.c \ str_cgi.c \ str_comp.c \ str_con.c \ str_copy.c \ str_creat.c \ str_info.c \ str_io.c \ str_num.c \ str_printf.c \ str_replace.c \ str_time.c \ str_trim.c \ str_uni.c \ _str.h JSTR_HDRS = \ libjstr.h if LIBJ_STANDALONE noinst_LTLIBRARIES = libjstr.la libjstr_la_SOURCES = $(JSTR_SRCS) libjstr_la_CFLAGS = $(AM_CFLAGS) include_HEADERS = $(JSTR_HDRS) noinst_PROGRAMS = str_test else noinst_LIBRARIES = libjstr.a libjstr_a_SOURCES = $(JSTR_SRCS) $(JSTR_HDRS) libjstr_a_CFLAGS = $(AM_CFLAGS) endif ## LIBJ_STANDALONE str_test_SOURCES = \ str_test.c if LIBJ_USE_LIBC_STRING str_test_LDADD = libjstr.la INCLUDES = -I../ else ## !LIBJ_USE_LIBC_STRING str_test_LDADD = libjstr.la ../jmem/libjmem.la INCLUDES = -I../jmem -I../ endif ## ?LIBJ_USE_LIBC_STRING xscorch-0.2.1/libj/jstr/Makefile.in0000644000175000001440000017640711615371715014075 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @LIBJ_STANDALONE_TRUE@noinst_PROGRAMS = str_test$(EXEEXT) subdir = libj/jstr DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libjstr_a_AR = $(AR) $(ARFLAGS) libjstr_a_LIBADD = am__libjstr_a_SOURCES_DIST = str_arg.c str_case.c str_cgi.c str_comp.c \ str_con.c str_copy.c str_creat.c str_info.c str_io.c str_num.c \ str_printf.c str_replace.c str_time.c str_trim.c str_uni.c \ _str.h libjstr.h am__objects_1 = libjstr_a-str_arg.$(OBJEXT) \ libjstr_a-str_case.$(OBJEXT) libjstr_a-str_cgi.$(OBJEXT) \ libjstr_a-str_comp.$(OBJEXT) libjstr_a-str_con.$(OBJEXT) \ libjstr_a-str_copy.$(OBJEXT) libjstr_a-str_creat.$(OBJEXT) \ libjstr_a-str_info.$(OBJEXT) libjstr_a-str_io.$(OBJEXT) \ libjstr_a-str_num.$(OBJEXT) libjstr_a-str_printf.$(OBJEXT) \ libjstr_a-str_replace.$(OBJEXT) libjstr_a-str_time.$(OBJEXT) \ libjstr_a-str_trim.$(OBJEXT) libjstr_a-str_uni.$(OBJEXT) am__objects_2 = @LIBJ_STANDALONE_FALSE@am_libjstr_a_OBJECTS = $(am__objects_1) \ @LIBJ_STANDALONE_FALSE@ $(am__objects_2) libjstr_a_OBJECTS = $(am_libjstr_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) libjstr_la_LIBADD = am__libjstr_la_SOURCES_DIST = str_arg.c str_case.c str_cgi.c \ str_comp.c str_con.c str_copy.c str_creat.c str_info.c \ str_io.c str_num.c str_printf.c str_replace.c str_time.c \ str_trim.c str_uni.c _str.h am__objects_3 = libjstr_la-str_arg.lo libjstr_la-str_case.lo \ libjstr_la-str_cgi.lo libjstr_la-str_comp.lo \ libjstr_la-str_con.lo libjstr_la-str_copy.lo \ libjstr_la-str_creat.lo libjstr_la-str_info.lo \ libjstr_la-str_io.lo libjstr_la-str_num.lo \ libjstr_la-str_printf.lo libjstr_la-str_replace.lo \ libjstr_la-str_time.lo libjstr_la-str_trim.lo \ libjstr_la-str_uni.lo @LIBJ_STANDALONE_TRUE@am_libjstr_la_OBJECTS = $(am__objects_3) libjstr_la_OBJECTS = $(am_libjstr_la_OBJECTS) libjstr_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libjstr_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @LIBJ_STANDALONE_TRUE@am_libjstr_la_rpath = PROGRAMS = $(noinst_PROGRAMS) am_str_test_OBJECTS = str_test.$(OBJEXT) str_test_OBJECTS = $(am_str_test_OBJECTS) @LIBJ_USE_LIBC_STRING_FALSE@str_test_DEPENDENCIES = libjstr.la \ @LIBJ_USE_LIBC_STRING_FALSE@ ../jmem/libjmem.la @LIBJ_USE_LIBC_STRING_TRUE@str_test_DEPENDENCIES = libjstr.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libjstr_a_SOURCES) $(libjstr_la_SOURCES) \ $(str_test_SOURCES) DIST_SOURCES = $(am__libjstr_a_SOURCES_DIST) \ $(am__libjstr_la_SOURCES_DIST) $(str_test_SOURCES) am__include_HEADERS_DIST = libjstr.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 CLEANFILES = *~ *.bak libs/* MAINTAINERCLEANFILES = aclocal.m4 configure JSTR_SRCS = \ str_arg.c \ str_case.c \ str_cgi.c \ str_comp.c \ str_con.c \ str_copy.c \ str_creat.c \ str_info.c \ str_io.c \ str_num.c \ str_printf.c \ str_replace.c \ str_time.c \ str_trim.c \ str_uni.c \ _str.h JSTR_HDRS = \ libjstr.h @LIBJ_STANDALONE_TRUE@noinst_LTLIBRARIES = libjstr.la @LIBJ_STANDALONE_TRUE@libjstr_la_SOURCES = $(JSTR_SRCS) @LIBJ_STANDALONE_TRUE@libjstr_la_CFLAGS = $(AM_CFLAGS) @LIBJ_STANDALONE_TRUE@include_HEADERS = $(JSTR_HDRS) @LIBJ_STANDALONE_FALSE@noinst_LIBRARIES = libjstr.a @LIBJ_STANDALONE_FALSE@libjstr_a_SOURCES = $(JSTR_SRCS) $(JSTR_HDRS) @LIBJ_STANDALONE_FALSE@libjstr_a_CFLAGS = $(AM_CFLAGS) str_test_SOURCES = \ str_test.c @LIBJ_USE_LIBC_STRING_FALSE@str_test_LDADD = libjstr.la ../jmem/libjmem.la @LIBJ_USE_LIBC_STRING_TRUE@str_test_LDADD = libjstr.la @LIBJ_USE_LIBC_STRING_FALSE@INCLUDES = -I../jmem -I../ @LIBJ_USE_LIBC_STRING_TRUE@INCLUDES = -I../ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libj/jstr/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libj/jstr/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libjstr.a: $(libjstr_a_OBJECTS) $(libjstr_a_DEPENDENCIES) -rm -f libjstr.a $(libjstr_a_AR) libjstr.a $(libjstr_a_OBJECTS) $(libjstr_a_LIBADD) $(RANLIB) libjstr.a clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libjstr.la: $(libjstr_la_OBJECTS) $(libjstr_la_DEPENDENCIES) $(libjstr_la_LINK) $(am_libjstr_la_rpath) $(libjstr_la_OBJECTS) $(libjstr_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list str_test$(EXEEXT): $(str_test_OBJECTS) $(str_test_DEPENDENCIES) @rm -f str_test$(EXEEXT) $(LINK) $(str_test_OBJECTS) $(str_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_arg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_case.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_cgi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_comp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_con.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_copy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_creat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_num.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_printf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_replace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_time.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_trim.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_a-str_uni.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_arg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_case.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_cgi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_comp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_con.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_copy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_creat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_num.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_printf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_replace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_trim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjstr_la-str_uni.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libjstr_a-str_arg.o: str_arg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_arg.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_arg.Tpo -c -o libjstr_a-str_arg.o `test -f 'str_arg.c' || echo '$(srcdir)/'`str_arg.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_arg.Tpo $(DEPDIR)/libjstr_a-str_arg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_arg.c' object='libjstr_a-str_arg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_arg.o `test -f 'str_arg.c' || echo '$(srcdir)/'`str_arg.c libjstr_a-str_arg.obj: str_arg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_arg.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_arg.Tpo -c -o libjstr_a-str_arg.obj `if test -f 'str_arg.c'; then $(CYGPATH_W) 'str_arg.c'; else $(CYGPATH_W) '$(srcdir)/str_arg.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_arg.Tpo $(DEPDIR)/libjstr_a-str_arg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_arg.c' object='libjstr_a-str_arg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_arg.obj `if test -f 'str_arg.c'; then $(CYGPATH_W) 'str_arg.c'; else $(CYGPATH_W) '$(srcdir)/str_arg.c'; fi` libjstr_a-str_case.o: str_case.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_case.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_case.Tpo -c -o libjstr_a-str_case.o `test -f 'str_case.c' || echo '$(srcdir)/'`str_case.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_case.Tpo $(DEPDIR)/libjstr_a-str_case.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_case.c' object='libjstr_a-str_case.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_case.o `test -f 'str_case.c' || echo '$(srcdir)/'`str_case.c libjstr_a-str_case.obj: str_case.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_case.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_case.Tpo -c -o libjstr_a-str_case.obj `if test -f 'str_case.c'; then $(CYGPATH_W) 'str_case.c'; else $(CYGPATH_W) '$(srcdir)/str_case.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_case.Tpo $(DEPDIR)/libjstr_a-str_case.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_case.c' object='libjstr_a-str_case.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_case.obj `if test -f 'str_case.c'; then $(CYGPATH_W) 'str_case.c'; else $(CYGPATH_W) '$(srcdir)/str_case.c'; fi` libjstr_a-str_cgi.o: str_cgi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_cgi.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_cgi.Tpo -c -o libjstr_a-str_cgi.o `test -f 'str_cgi.c' || echo '$(srcdir)/'`str_cgi.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_cgi.Tpo $(DEPDIR)/libjstr_a-str_cgi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_cgi.c' object='libjstr_a-str_cgi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_cgi.o `test -f 'str_cgi.c' || echo '$(srcdir)/'`str_cgi.c libjstr_a-str_cgi.obj: str_cgi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_cgi.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_cgi.Tpo -c -o libjstr_a-str_cgi.obj `if test -f 'str_cgi.c'; then $(CYGPATH_W) 'str_cgi.c'; else $(CYGPATH_W) '$(srcdir)/str_cgi.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_cgi.Tpo $(DEPDIR)/libjstr_a-str_cgi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_cgi.c' object='libjstr_a-str_cgi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_cgi.obj `if test -f 'str_cgi.c'; then $(CYGPATH_W) 'str_cgi.c'; else $(CYGPATH_W) '$(srcdir)/str_cgi.c'; fi` libjstr_a-str_comp.o: str_comp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_comp.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_comp.Tpo -c -o libjstr_a-str_comp.o `test -f 'str_comp.c' || echo '$(srcdir)/'`str_comp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_comp.Tpo $(DEPDIR)/libjstr_a-str_comp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_comp.c' object='libjstr_a-str_comp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_comp.o `test -f 'str_comp.c' || echo '$(srcdir)/'`str_comp.c libjstr_a-str_comp.obj: str_comp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_comp.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_comp.Tpo -c -o libjstr_a-str_comp.obj `if test -f 'str_comp.c'; then $(CYGPATH_W) 'str_comp.c'; else $(CYGPATH_W) '$(srcdir)/str_comp.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_comp.Tpo $(DEPDIR)/libjstr_a-str_comp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_comp.c' object='libjstr_a-str_comp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_comp.obj `if test -f 'str_comp.c'; then $(CYGPATH_W) 'str_comp.c'; else $(CYGPATH_W) '$(srcdir)/str_comp.c'; fi` libjstr_a-str_con.o: str_con.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_con.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_con.Tpo -c -o libjstr_a-str_con.o `test -f 'str_con.c' || echo '$(srcdir)/'`str_con.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_con.Tpo $(DEPDIR)/libjstr_a-str_con.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_con.c' object='libjstr_a-str_con.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_con.o `test -f 'str_con.c' || echo '$(srcdir)/'`str_con.c libjstr_a-str_con.obj: str_con.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_con.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_con.Tpo -c -o libjstr_a-str_con.obj `if test -f 'str_con.c'; then $(CYGPATH_W) 'str_con.c'; else $(CYGPATH_W) '$(srcdir)/str_con.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_con.Tpo $(DEPDIR)/libjstr_a-str_con.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_con.c' object='libjstr_a-str_con.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_con.obj `if test -f 'str_con.c'; then $(CYGPATH_W) 'str_con.c'; else $(CYGPATH_W) '$(srcdir)/str_con.c'; fi` libjstr_a-str_copy.o: str_copy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_copy.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_copy.Tpo -c -o libjstr_a-str_copy.o `test -f 'str_copy.c' || echo '$(srcdir)/'`str_copy.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_copy.Tpo $(DEPDIR)/libjstr_a-str_copy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_copy.c' object='libjstr_a-str_copy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_copy.o `test -f 'str_copy.c' || echo '$(srcdir)/'`str_copy.c libjstr_a-str_copy.obj: str_copy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_copy.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_copy.Tpo -c -o libjstr_a-str_copy.obj `if test -f 'str_copy.c'; then $(CYGPATH_W) 'str_copy.c'; else $(CYGPATH_W) '$(srcdir)/str_copy.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_copy.Tpo $(DEPDIR)/libjstr_a-str_copy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_copy.c' object='libjstr_a-str_copy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_copy.obj `if test -f 'str_copy.c'; then $(CYGPATH_W) 'str_copy.c'; else $(CYGPATH_W) '$(srcdir)/str_copy.c'; fi` libjstr_a-str_creat.o: str_creat.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_creat.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_creat.Tpo -c -o libjstr_a-str_creat.o `test -f 'str_creat.c' || echo '$(srcdir)/'`str_creat.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_creat.Tpo $(DEPDIR)/libjstr_a-str_creat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_creat.c' object='libjstr_a-str_creat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_creat.o `test -f 'str_creat.c' || echo '$(srcdir)/'`str_creat.c libjstr_a-str_creat.obj: str_creat.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_creat.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_creat.Tpo -c -o libjstr_a-str_creat.obj `if test -f 'str_creat.c'; then $(CYGPATH_W) 'str_creat.c'; else $(CYGPATH_W) '$(srcdir)/str_creat.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_creat.Tpo $(DEPDIR)/libjstr_a-str_creat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_creat.c' object='libjstr_a-str_creat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_creat.obj `if test -f 'str_creat.c'; then $(CYGPATH_W) 'str_creat.c'; else $(CYGPATH_W) '$(srcdir)/str_creat.c'; fi` libjstr_a-str_info.o: str_info.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_info.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_info.Tpo -c -o libjstr_a-str_info.o `test -f 'str_info.c' || echo '$(srcdir)/'`str_info.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_info.Tpo $(DEPDIR)/libjstr_a-str_info.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_info.c' object='libjstr_a-str_info.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_info.o `test -f 'str_info.c' || echo '$(srcdir)/'`str_info.c libjstr_a-str_info.obj: str_info.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_info.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_info.Tpo -c -o libjstr_a-str_info.obj `if test -f 'str_info.c'; then $(CYGPATH_W) 'str_info.c'; else $(CYGPATH_W) '$(srcdir)/str_info.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_info.Tpo $(DEPDIR)/libjstr_a-str_info.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_info.c' object='libjstr_a-str_info.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_info.obj `if test -f 'str_info.c'; then $(CYGPATH_W) 'str_info.c'; else $(CYGPATH_W) '$(srcdir)/str_info.c'; fi` libjstr_a-str_io.o: str_io.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_io.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_io.Tpo -c -o libjstr_a-str_io.o `test -f 'str_io.c' || echo '$(srcdir)/'`str_io.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_io.Tpo $(DEPDIR)/libjstr_a-str_io.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_io.c' object='libjstr_a-str_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_io.o `test -f 'str_io.c' || echo '$(srcdir)/'`str_io.c libjstr_a-str_io.obj: str_io.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_io.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_io.Tpo -c -o libjstr_a-str_io.obj `if test -f 'str_io.c'; then $(CYGPATH_W) 'str_io.c'; else $(CYGPATH_W) '$(srcdir)/str_io.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_io.Tpo $(DEPDIR)/libjstr_a-str_io.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_io.c' object='libjstr_a-str_io.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_io.obj `if test -f 'str_io.c'; then $(CYGPATH_W) 'str_io.c'; else $(CYGPATH_W) '$(srcdir)/str_io.c'; fi` libjstr_a-str_num.o: str_num.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_num.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_num.Tpo -c -o libjstr_a-str_num.o `test -f 'str_num.c' || echo '$(srcdir)/'`str_num.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_num.Tpo $(DEPDIR)/libjstr_a-str_num.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_num.c' object='libjstr_a-str_num.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_num.o `test -f 'str_num.c' || echo '$(srcdir)/'`str_num.c libjstr_a-str_num.obj: str_num.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_num.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_num.Tpo -c -o libjstr_a-str_num.obj `if test -f 'str_num.c'; then $(CYGPATH_W) 'str_num.c'; else $(CYGPATH_W) '$(srcdir)/str_num.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_num.Tpo $(DEPDIR)/libjstr_a-str_num.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_num.c' object='libjstr_a-str_num.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_num.obj `if test -f 'str_num.c'; then $(CYGPATH_W) 'str_num.c'; else $(CYGPATH_W) '$(srcdir)/str_num.c'; fi` libjstr_a-str_printf.o: str_printf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_printf.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_printf.Tpo -c -o libjstr_a-str_printf.o `test -f 'str_printf.c' || echo '$(srcdir)/'`str_printf.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_printf.Tpo $(DEPDIR)/libjstr_a-str_printf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_printf.c' object='libjstr_a-str_printf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_printf.o `test -f 'str_printf.c' || echo '$(srcdir)/'`str_printf.c libjstr_a-str_printf.obj: str_printf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_printf.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_printf.Tpo -c -o libjstr_a-str_printf.obj `if test -f 'str_printf.c'; then $(CYGPATH_W) 'str_printf.c'; else $(CYGPATH_W) '$(srcdir)/str_printf.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_printf.Tpo $(DEPDIR)/libjstr_a-str_printf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_printf.c' object='libjstr_a-str_printf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_printf.obj `if test -f 'str_printf.c'; then $(CYGPATH_W) 'str_printf.c'; else $(CYGPATH_W) '$(srcdir)/str_printf.c'; fi` libjstr_a-str_replace.o: str_replace.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_replace.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_replace.Tpo -c -o libjstr_a-str_replace.o `test -f 'str_replace.c' || echo '$(srcdir)/'`str_replace.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_replace.Tpo $(DEPDIR)/libjstr_a-str_replace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_replace.c' object='libjstr_a-str_replace.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_replace.o `test -f 'str_replace.c' || echo '$(srcdir)/'`str_replace.c libjstr_a-str_replace.obj: str_replace.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_replace.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_replace.Tpo -c -o libjstr_a-str_replace.obj `if test -f 'str_replace.c'; then $(CYGPATH_W) 'str_replace.c'; else $(CYGPATH_W) '$(srcdir)/str_replace.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_replace.Tpo $(DEPDIR)/libjstr_a-str_replace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_replace.c' object='libjstr_a-str_replace.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_replace.obj `if test -f 'str_replace.c'; then $(CYGPATH_W) 'str_replace.c'; else $(CYGPATH_W) '$(srcdir)/str_replace.c'; fi` libjstr_a-str_time.o: str_time.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_time.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_time.Tpo -c -o libjstr_a-str_time.o `test -f 'str_time.c' || echo '$(srcdir)/'`str_time.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_time.Tpo $(DEPDIR)/libjstr_a-str_time.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_time.c' object='libjstr_a-str_time.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_time.o `test -f 'str_time.c' || echo '$(srcdir)/'`str_time.c libjstr_a-str_time.obj: str_time.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_time.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_time.Tpo -c -o libjstr_a-str_time.obj `if test -f 'str_time.c'; then $(CYGPATH_W) 'str_time.c'; else $(CYGPATH_W) '$(srcdir)/str_time.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_time.Tpo $(DEPDIR)/libjstr_a-str_time.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_time.c' object='libjstr_a-str_time.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_time.obj `if test -f 'str_time.c'; then $(CYGPATH_W) 'str_time.c'; else $(CYGPATH_W) '$(srcdir)/str_time.c'; fi` libjstr_a-str_trim.o: str_trim.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_trim.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_trim.Tpo -c -o libjstr_a-str_trim.o `test -f 'str_trim.c' || echo '$(srcdir)/'`str_trim.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_trim.Tpo $(DEPDIR)/libjstr_a-str_trim.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_trim.c' object='libjstr_a-str_trim.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_trim.o `test -f 'str_trim.c' || echo '$(srcdir)/'`str_trim.c libjstr_a-str_trim.obj: str_trim.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_trim.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_trim.Tpo -c -o libjstr_a-str_trim.obj `if test -f 'str_trim.c'; then $(CYGPATH_W) 'str_trim.c'; else $(CYGPATH_W) '$(srcdir)/str_trim.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_trim.Tpo $(DEPDIR)/libjstr_a-str_trim.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_trim.c' object='libjstr_a-str_trim.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_trim.obj `if test -f 'str_trim.c'; then $(CYGPATH_W) 'str_trim.c'; else $(CYGPATH_W) '$(srcdir)/str_trim.c'; fi` libjstr_a-str_uni.o: str_uni.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_uni.o -MD -MP -MF $(DEPDIR)/libjstr_a-str_uni.Tpo -c -o libjstr_a-str_uni.o `test -f 'str_uni.c' || echo '$(srcdir)/'`str_uni.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_uni.Tpo $(DEPDIR)/libjstr_a-str_uni.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_uni.c' object='libjstr_a-str_uni.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_uni.o `test -f 'str_uni.c' || echo '$(srcdir)/'`str_uni.c libjstr_a-str_uni.obj: str_uni.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -MT libjstr_a-str_uni.obj -MD -MP -MF $(DEPDIR)/libjstr_a-str_uni.Tpo -c -o libjstr_a-str_uni.obj `if test -f 'str_uni.c'; then $(CYGPATH_W) 'str_uni.c'; else $(CYGPATH_W) '$(srcdir)/str_uni.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_a-str_uni.Tpo $(DEPDIR)/libjstr_a-str_uni.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_uni.c' object='libjstr_a-str_uni.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_a_CFLAGS) $(CFLAGS) -c -o libjstr_a-str_uni.obj `if test -f 'str_uni.c'; then $(CYGPATH_W) 'str_uni.c'; else $(CYGPATH_W) '$(srcdir)/str_uni.c'; fi` libjstr_la-str_arg.lo: str_arg.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_arg.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_arg.Tpo -c -o libjstr_la-str_arg.lo `test -f 'str_arg.c' || echo '$(srcdir)/'`str_arg.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_arg.Tpo $(DEPDIR)/libjstr_la-str_arg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_arg.c' object='libjstr_la-str_arg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_arg.lo `test -f 'str_arg.c' || echo '$(srcdir)/'`str_arg.c libjstr_la-str_case.lo: str_case.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_case.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_case.Tpo -c -o libjstr_la-str_case.lo `test -f 'str_case.c' || echo '$(srcdir)/'`str_case.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_case.Tpo $(DEPDIR)/libjstr_la-str_case.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_case.c' object='libjstr_la-str_case.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_case.lo `test -f 'str_case.c' || echo '$(srcdir)/'`str_case.c libjstr_la-str_cgi.lo: str_cgi.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_cgi.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_cgi.Tpo -c -o libjstr_la-str_cgi.lo `test -f 'str_cgi.c' || echo '$(srcdir)/'`str_cgi.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_cgi.Tpo $(DEPDIR)/libjstr_la-str_cgi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_cgi.c' object='libjstr_la-str_cgi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_cgi.lo `test -f 'str_cgi.c' || echo '$(srcdir)/'`str_cgi.c libjstr_la-str_comp.lo: str_comp.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_comp.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_comp.Tpo -c -o libjstr_la-str_comp.lo `test -f 'str_comp.c' || echo '$(srcdir)/'`str_comp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_comp.Tpo $(DEPDIR)/libjstr_la-str_comp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_comp.c' object='libjstr_la-str_comp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_comp.lo `test -f 'str_comp.c' || echo '$(srcdir)/'`str_comp.c libjstr_la-str_con.lo: str_con.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_con.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_con.Tpo -c -o libjstr_la-str_con.lo `test -f 'str_con.c' || echo '$(srcdir)/'`str_con.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_con.Tpo $(DEPDIR)/libjstr_la-str_con.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_con.c' object='libjstr_la-str_con.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_con.lo `test -f 'str_con.c' || echo '$(srcdir)/'`str_con.c libjstr_la-str_copy.lo: str_copy.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_copy.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_copy.Tpo -c -o libjstr_la-str_copy.lo `test -f 'str_copy.c' || echo '$(srcdir)/'`str_copy.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_copy.Tpo $(DEPDIR)/libjstr_la-str_copy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_copy.c' object='libjstr_la-str_copy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_copy.lo `test -f 'str_copy.c' || echo '$(srcdir)/'`str_copy.c libjstr_la-str_creat.lo: str_creat.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_creat.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_creat.Tpo -c -o libjstr_la-str_creat.lo `test -f 'str_creat.c' || echo '$(srcdir)/'`str_creat.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_creat.Tpo $(DEPDIR)/libjstr_la-str_creat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_creat.c' object='libjstr_la-str_creat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_creat.lo `test -f 'str_creat.c' || echo '$(srcdir)/'`str_creat.c libjstr_la-str_info.lo: str_info.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_info.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_info.Tpo -c -o libjstr_la-str_info.lo `test -f 'str_info.c' || echo '$(srcdir)/'`str_info.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_info.Tpo $(DEPDIR)/libjstr_la-str_info.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_info.c' object='libjstr_la-str_info.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_info.lo `test -f 'str_info.c' || echo '$(srcdir)/'`str_info.c libjstr_la-str_io.lo: str_io.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_io.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_io.Tpo -c -o libjstr_la-str_io.lo `test -f 'str_io.c' || echo '$(srcdir)/'`str_io.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_io.Tpo $(DEPDIR)/libjstr_la-str_io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_io.c' object='libjstr_la-str_io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_io.lo `test -f 'str_io.c' || echo '$(srcdir)/'`str_io.c libjstr_la-str_num.lo: str_num.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_num.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_num.Tpo -c -o libjstr_la-str_num.lo `test -f 'str_num.c' || echo '$(srcdir)/'`str_num.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_num.Tpo $(DEPDIR)/libjstr_la-str_num.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_num.c' object='libjstr_la-str_num.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_num.lo `test -f 'str_num.c' || echo '$(srcdir)/'`str_num.c libjstr_la-str_printf.lo: str_printf.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_printf.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_printf.Tpo -c -o libjstr_la-str_printf.lo `test -f 'str_printf.c' || echo '$(srcdir)/'`str_printf.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_printf.Tpo $(DEPDIR)/libjstr_la-str_printf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_printf.c' object='libjstr_la-str_printf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_printf.lo `test -f 'str_printf.c' || echo '$(srcdir)/'`str_printf.c libjstr_la-str_replace.lo: str_replace.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_replace.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_replace.Tpo -c -o libjstr_la-str_replace.lo `test -f 'str_replace.c' || echo '$(srcdir)/'`str_replace.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_replace.Tpo $(DEPDIR)/libjstr_la-str_replace.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_replace.c' object='libjstr_la-str_replace.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_replace.lo `test -f 'str_replace.c' || echo '$(srcdir)/'`str_replace.c libjstr_la-str_time.lo: str_time.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_time.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_time.Tpo -c -o libjstr_la-str_time.lo `test -f 'str_time.c' || echo '$(srcdir)/'`str_time.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_time.Tpo $(DEPDIR)/libjstr_la-str_time.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_time.c' object='libjstr_la-str_time.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_time.lo `test -f 'str_time.c' || echo '$(srcdir)/'`str_time.c libjstr_la-str_trim.lo: str_trim.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_trim.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_trim.Tpo -c -o libjstr_la-str_trim.lo `test -f 'str_trim.c' || echo '$(srcdir)/'`str_trim.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_trim.Tpo $(DEPDIR)/libjstr_la-str_trim.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_trim.c' object='libjstr_la-str_trim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_trim.lo `test -f 'str_trim.c' || echo '$(srcdir)/'`str_trim.c libjstr_la-str_uni.lo: str_uni.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -MT libjstr_la-str_uni.lo -MD -MP -MF $(DEPDIR)/libjstr_la-str_uni.Tpo -c -o libjstr_la-str_uni.lo `test -f 'str_uni.c' || echo '$(srcdir)/'`str_uni.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libjstr_la-str_uni.Tpo $(DEPDIR)/libjstr_la-str_uni.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='str_uni.c' object='libjstr_la-str_uni.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjstr_la_CFLAGS) $(CFLAGS) -c -o libjstr_la-str_uni.lo `test -f 'str_uni.c' || echo '$(srcdir)/'`str_uni.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/libj/jstr/str_arg.c0000644000175000001440000001433211551735455013625 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_arg.c,v 1.10 2010-09-03 07:49:37 justins Exp $ */ /* libj - str_arg.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Argument processing This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> sizea getnumargs(const char *s, char sep) { /* Get-Number-of-Arguments total number of arguments in a cmd string (assuming '|' separates arguments) You can optionally specify the "sep" character to denote your own character to separate arguments. Note, this command will stop processing when it reaches a null character. This command will return 0 if the string is empty, or 1 if no separator characters are found. */ sizea r = 0; if(s != NULL && *s != '\0') { r = 1; while(*s != '\0') { if(*s == sep) ++r; ++s; } } return(r); } static inline sizea __getargpt(char **d, char *s, sizea argnum, char sep) { /* internal-Get-Argument-Pointer-Trim returns a pointer to the argnum'th argument in '|'-delimited cmd string (or you can optionally specify your own separator to use). This command will stop processing at a null character. If argnum is not valid, a NULL pointer is returned and the return length is zero. Otherwise, the return length is the length of the argument. This command will trim the argument beforehand, which is reflected in the returned pointer and size. */ whitespace ws; /* Check for validity of argnum (ie, give up if it is too small), d, s */ if(d != NULL) { *d = NULL; if(s != NULL) { /* Search for the 'th argument. */ while(argnum > 0 && *s != '\0') { if(*s == sep) --argnum; ++s; } /* If argnum > 0, then argnum supplied was too large. */ if(argnum == 0) { /* Start tracking the argument until the end of argument; we'll also trim this argument for user convenience :) */ SKIM_WHITESPACE_T(s, sep); SET_FIRST_NWS(ws, s); SET_LAST_NWS_T(ws, s, sep); /* Return pointer and size */ *d = ws.fnws; return(NWS_SIZE(ws)); } /* Did we have an arg to fetch? */ } } return(0); } static inline char *__getargb(char *d, const char *s, sizea argnum, char sep, sizea maxlen) { /* internal-Get-Argument-Countbuffer returns the argnum'th argument in '|'-delimited cmd string (or you can optionally specify your own separator to use). This command will stop processing at a null character. If argnum is not valid, an empty string is returned. The target buffer should be at least characters (counting NULL); any trailing characters will be truncated, and a NULL will always be squeezed in as needed. If is <= zero, then the target buffer should be at least as large as buffer. If = , then this function will laugh at you. If is NULL, you're screwed. */ char *p; sizea size; if(d != NULL) { *d = '\0'; /* Search for the 'th argument. */ char *s_ptr = (char *)s; size = __getargpt(&p, s_ptr, argnum, sep); if(p != NULL && size > 0) { /* Copy the argument and exit */ ++size; if(maxlen > 0 && size > maxlen) size = maxlen; STRNCPY(d, p, size); } /* Always return the destination */ return(d); /* Destination was NULL */ } else return(NULL); } static inline char *__getarg(char *d, const char *s, sizea argnum, char sep) { /* Internal-Get-Argument returns the argnum'th argument in '|'-delimited cmd string (or you can optionally specify your own separator to use). This command will stop processing at a null character. If argnum is not valid, an empty string is returned. The target buffer should be at least as large as the source string. */ return(__getargb(d, s, argnum, sep, 0)); } char *getarg(char *d, const char *s, sizea argnum, char sep) { /* Get-Argument */ return(__getarg(d, s, argnum, sep)); } char *getargb(char *d, const char *s, sizea argnum, char sep, sizea maxlen) { /* Get-Argument-Countbuffer */ return(__getargb(d, s, argnum, sep, maxlen)); } char *getargn(char *d, const char *s, sizea argnum, char sep, sizea n) { /* Get-Argument-Countbuffer */ return(__getargb(d, s, argnum, sep, n + 1)); } sizea getargp(char **d, char *s, sizea argnum, char sep) { /* Get-Argument-Pointer returns a pointer to the argnum'th argument in '|'-delimited cmd string (or you can optionally specify your own separator to use). This command will stop processing at a null character. If argnum is not valid, a NUILL pointer is returned and the return length is zero. Otherwise, the return length is the length of the argument. This command makes no effort to trim the argument beforehand. */ if(d != NULL) { *d = NULL; /* Is inside the valid range for this string? */ if(s != NULL) { /* Search for the 'th argument. */ while(argnum > 0 && *s) { if(*s == sep) --argnum; ++s; } if(argnum == 0) { /* Start tracking the argument until the end of argument */ *d = s; while(*s != '\0' && *s != sep) ++s; return(s - *d); } } } return(0); } sizea getargp_trim(char **d, char *s, sizea argnum, char sep) { /* Get-Argument-Pointer-Trim */ return(__getargpt(d, s, argnum, sep)); } xscorch-0.2.1/libj/jstr/str_case.c0000644000175000001440000002131511175116121013747 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_case.c,v 1.8 2009-04-26 17:39:29 jacob Exp $ */ /* libj - str_case.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Case sensitive changes This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #include #include <_str.h> char *unescape(char *s) { /* Unescape This function will take an escaped string and "unescape" it. Standard C escape sequence is read. The escape sequences currently recognized are \a bell \b backspace \f formfeed \n newline \r carriage return \t tab \v vertical tab \' single quote \" double quote \? question mark \\ backslash \0 null \ooo ascii character \xhh ascii character If the escape sequence is not valid then the next character after the escape will be printed (but not the escape itself). */ char *d = s; /* Dest pointer */ char *dstart = s; /* Original pointer */ int num; /* Dummy numerical value */ if(s != NULL) { while(*s != '\0') { if(*s == '\\') { ++s; /* Escape character found */ switch(*s) { /* If null, then copy a null and back up s pointer */ case '\0': *d = '\0'; s--; break; /* If return, then remove the return */ case '\n': d--; break; /* Numbers */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': num = *s - '0'; ++s; if(*s >= '0' && *s <= '7') { num = (num << 3) | (*s - '0'); ++s; if(*s >= '0' && *s <= '3') num = (num << 3) | (*s - '0'); else s--; } else s--; *d = (unsigned char)num; break; /* General escapes */ case 'a': *d = '\a'; break; case 'b': *d = '\b'; break; case 'f': *d = '\f'; break; case 'n': *d = '\n'; break; case 'r': *d = '\r'; break; case 't': *d = '\t'; break; case 'v': *d = '\v'; break; /* Hexadecimal numbers case */ case 'x': ++s; if(*s >= '0' && *s <= '9') { num = *s - '0'; ++s; if(*s >= '0' && *s <= '9') num = (num << 4) | (*s - '0'); if(*s >= 'a' && *s <= 'f') num = (num << 4) | (*s - 'a' + 10); if(*s >= 'A' && *s <= 'F') num = (num << 4) | (*s - 'A' + 10); else s--; *d = (unsigned char)num; } else if(*s >= 'a' && *s <= 'f') { num = *s - 'a' + 10; ++s; if(*s >= '0' && *s <= '9') num = (num << 4) | (*s - '0'); if(*s >= 'a' && *s <= 'f') num = (num << 4) | (*s - 'a' + 10); if(*s >= 'A' && *s <= 'F') num = (num << 4) | (*s - 'A' + 10); else s--; *d = (unsigned char)num; } else if(*s >= 'A' && *s <= 'F') { num = *s - 'A' + 10; ++s; if(*s >= '0' && *s <= '9') num = (num << 4) | (*s - '0'); if(*s >= 'a' && *s <= 'f') num = (num << 4) | (*s - 'a' + 10); if(*s >= 'A' && *s <= 'F') num = (num << 4) | (*s - 'A' + 10); else s--; *d = (unsigned char)num; } else { d--; s--; } break; /* This will catch everything else */ default: *d = *s; break; } ++s; } else { /* Normal character */ *d = *s; ++s; } ++d; } *d = '\0'; return(dstart); } /* source wasn't NULL */ return(NULL); } char *unescape_quoted(char *s) { /* Unescape-Quoted Same as the above function, but unescaped double quotes are also stripped from the input string first. */ char *p = s; char *d = s; if(s != NULL) { while(*p != '\0') { if(*p == '\"') ++p; else *(d++) = *(p++); } *d = '\0'; unescape(s); } /* Source wasn't null */ return(s); } char *escapeb(char *str, sizea size) { /* Escape Escapes potentially troublesome characters in the string. The size indicates the maximum size of the buffer; trailing characters will be truncated if necessary. To guarantee the entire string is left intact, allocate a buffer twice as large as the string. */ char *buf; char *src; char *dest; if(str == NULL || size <= 0) return(NULL); buf = (char *)malloc(size + size + 2); if(buf == NULL) return(NULL); src = str; dest = buf; while(*src != '\0') { if(*src == '\n') { *dest++ = '\\'; *dest++ = 'n'; } else if(*src == '\r') { *dest++ = '\\'; *dest++ = 'r'; } else if(*src == '\t') { *dest++ = '\\'; *dest++ = 't'; } else if(*src == '\\' || *src == '\"') { *dest++ = '\\'; *dest++ = *src; } else { *dest++ = *src; } ++src; } *dest = '\0'; MEMCPY(str, buf, size); str[size - 1] = '\0'; free(buf); return(str); } char *escapen(char *str, sizea n) { /* Escape Same as above function, but n is the maximum number of characters to put in the buffer (not including a terminating NULL). */ return(escapeb(str, n + 1)); } char *escaped_scan(char *src, char ch) { /* Escaped-Scan Scans for occurrence of ch in the string. Returns NULL if the character is not found, otherwise the first occurence is returned. This function will ignore characters inside a quoted block, as well as escaped characters. */ char *p; int instring; if(src == NULL) return(NULL); p = src; instring = 0; while(*p != '\0') { if(*p == '\"') { instring = !instring; } else if(*p == '\\' && *(p + 1) != '\0') { ++p; } else if(!instring && *p == ch) return(p); ++p; } return(NULL); } char *escaped_chop(char *src, char ch) { /* Escaped-Chop Chops off the string after the first occurrence of ch. */ char *p = escaped_scan(src, ch); if(p != NULL) *p = '\0'; return(src); } char *strlower(char *s) { /* String-Lowercase converts string to lowercase characters */ char *dstart = s; if(s != NULL) { while(*s != '\0') { if (UPPER(*s)) *s += 0x20; s++; } return(dstart); } /* Source wasn't null */ return(NULL); } char *strupper(char *s) { /* String-Uppercase converts string to uppercase characters */ char *dstart = s; if(s != NULL) { while(*s != '\0') { if (LOWER(*s)) *s -= 0x20; s++; } return(dstart); } /* Source wasn't null */ return(NULL); } char *strproper(char *s) { /* String-Proper converts string to propercase character */ char *d = s; bool whitespace = true; if(d != NULL) { while(*d != '\0') { if(WHITESPACE(*d)) whitespace = true; else if(whitespace) { if(LOWER(*d)) *d -= 0x20; whitespace = false; } else if(UPPER(*d)) *d += 0x20; d++; } return(s); } /* Destination wasn't null */ return(NULL); } xscorch-0.2.1/libj/jstr/str_cgi.c0000644000175000001440000002067311175116121013604 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_cgi.c,v 1.10 2009-04-26 17:39:29 jacob Exp $ */ /* libj - str_cgi.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Routines to help CGI processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program, in the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> static inline bool __getassignb(char *var, char *val, const char *s, sizea lvar, sizea lval) { /* internal-Get-Assignment-Countbuffer This is a useful function for more than just CGI processing, actually. What this will do is it takes the string , which is typically an argument out of a CGI string (but can be any string, like a line from a config file, f.e.), and it will chop off the variable name and the value assign if the string is of the form "variable = value". It will also trim off whitespace in both the variable name and the value. This function returns false if the string is not an assign string (e.g., it does not contain a '=' character). The size of and can be specified in and , respectively. If these values are zero then the and/or buffers are assumed to be at least as large as the source buffer . Note: if ANY of the buffer pointers are NULL then this function will AUTOMATICALLY return false. */ const char *p = s; const char *scanp; const_whitespace ws; sizea size; if(var != NULL && val != NULL && s != NULL) { *var = '\0'; *val = '\0'; /* Search for the equals sign */ while(*p != '\0' && *p != '=') ++p; if(*p != '\0') { /* Get the value. */ scanp = p + 1; SKIM_WHITESPACE(scanp); if(*scanp) { SET_FIRST_NWS(ws, scanp); SET_LAST_NWS(ws, scanp); size = NWS_SIZE(ws) + 1; if(lval > 0 && size > lval) size = lval; STRNCPY(val, ws.fnws, size); } /* Get the variable name. */ scanp = s; SKIM_WHITESPACE_T(scanp, '='); if(scanp != p) { SET_FIRST_NWS(ws, scanp); SET_LAST_NWS_T(ws, scanp, '='); size = NWS_SIZE(ws) + 1; if(lvar > 0 && size > lvar) size = lvar; STRNCPY(var, ws.fnws, size); } return(true); } } /* Invalid arguments given */ return(false); } bool getassign(char *var, char *val, const char *s) { /* Get-Assignment This is a useful function for more than just CGI processing, actually. What this will do is it takes the string , which is typically an argument out of a CGI string (but can be any string, like a line from a config file, f.e.), and it will chop off the variable name and the value assign if the string is of the form "variable = value". It will also trim off whitespace in both the variable name and the value. This function returns false if the string is not an assign string (e.g., it does not contain a '=' character). Each target buffer should be at least as large as the source. */ return(__getassignb(var, val, s, 0, 0)); } bool getassignbb(char *var, char *val, const char *s, sizea lvar, sizea lval) { /* Get-Assignment-Countbuffer */ return(__getassignb(var, val, s, lvar, lval)); } bool getassignbn(char *var, char *val, const char *s, sizea lvar, sizea lval) { /* Get-Assignment-Countbuffer */ return(__getassignb(var, val, s, lvar, lval + 1)); } bool getassignnb(char *var, char *val, const char *s, sizea lvar, sizea lval) { /* Get-Assignment-Countbuffer */ return(__getassignb(var, val, s, lvar + 1, lval)); } bool getassignnn(char *var, char *val, const char *s, sizea lvar, sizea lval) { /* Get-Assignment-Countbuffer */ return(__getassignb(var, val, s, lvar + 1, lval + 1)); } static inline char *__unescapeCGI(char *s) { /* internal-Unescape-CGIstring This function will unescape characters in a CGI-encoded string. Note that since the target string is always smaller than the source string we don't have to worry about buffer overflows (unless you were stupid enough not to terminate with a null character! :) */ char *d = s; char *dstart = d; unsigned char num; if(s != NULL) { /* This part of the function converts CGI "+" to spaces, expands CGI escapes, etc etc etc... */ while(*s != '\0') { if(*s == '+') { /* Expand the space */ *d = ' '; } else if(*s == '%') { /* Expand that escape! yum yum */ ++s; num = 0; if (*s >= 'a' && *s <= 'f') num = (unsigned)*s - 'a' + 10; else if (*s >= 'A' && *s <= 'F') num = (unsigned)*s - 'A' + 10; else if (*s >= '0' && *s <= '9') num = (unsigned)*s - '0'; ++s; num *= 16; if (*s >= 'a' && *s <= 'f') num += (unsigned)*s - 'a' + 10; else if (*s >= 'A' && *s <= 'F') num += (unsigned)*s - 'A' + 10; else if (*s >= '0' && *s <= '9') num += (unsigned)*s - '0'; *d = num; } else *d = *s; ++s; ++d; } *d = '\0'; return(dstart); } return(NULL); } char *unescapeCGI(char *s) { /* Unescape-CGIstring */ return(__unescapeCGI(s)); } static inline char *__escapeCGI(char *s) { /* internal-Escape-CGIstring This function will escape characters in a string to their safe CGI representation. Note that the target string must be capable of holding 3*strlen(s) characters (also the NULL terminator). */ sizea len = STRLENN(s); char *in = s + 2 * len; char *out = s; char ch; sizea num; if(s == NULL) return(NULL); /* Move the working copy of the string elsewhere, for now */ MEMCPY(in, s, len + 1); /* Iterate */ while(*in != '\0') { ch = *in; if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '.' || ch == '/' || ch == '_') || ch == '-') { /* Safe character */ *out = ch; ++out; } else { /* Unsafe character */ *out = '%'; num = (unsigned)ch / 16; if(num < 10) *(out + 1) = num + '0'; else *(out + 1) = num + 'A' - 10; num = (unsigned)ch % 16; if(num < 10) *(out + 2) = num + '0'; else *(out + 2) = num + 'A' - 10; out += 3; } ++in; } *out = '\0'; return(s); } char *escapeCGI(char *s) { /* Escape-CGIstring */ return(__escapeCGI(s)); } unsigned int getnumargsCGI(const char *s) { /* Get-Num-Args-CGIstring returns the number of arguments in the CGI cmd string. Each argument separated by "&". In fact, this code is so similar to getnumargs() that we'll just use the getnumargs call :) */ return(getnumargs(s, '&')); } char *getargCGI(char *d, const char *s, unsigned int argnum) { /* Get-Arg-CGIstring Returns the argnum'th argument in the CGI cmd string. This code is amazingly similar to getarg so we'll just use the getarg code and do modifications later. */ getarg(d, s, argnum, '&'); return(__unescapeCGI(d)); } char *getargCGIb(char *d, const char *s, sizea argnum, sizea maxlen) { /* Get-Arg-CGIstring-Countbuffer Returns the argnum'th argument in the CGI cmd string. This code is amazingly similar to getarg so we'll just use the getarg code and do modifications later. */ getargb(d, s, argnum, '&', maxlen); return(__unescapeCGI(d)); } char *getargCGIn(char *d, const char *s, sizea argnum, sizea n) { /* Get-Arg-CGIstring-Countbuffer Returns the argnum'th argument in the CGI cmd string. This code is amazingly similar to getarg so we'll just use the getarg code and do modifications later. */ getargn(d, s, argnum, '&', n); return(__unescapeCGI(d)); } xscorch-0.2.1/libj/jstr/str_comp.c0000644000175000001440000002621511615366343014012 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_comp.c,v 1.16 2011-08-01 00:01:39 jacob Exp $ */ /* libj - str_comp.c Copyright (C) 1998-2003 Justin David Smith Copyright (C) 2003 Jacob Luna Lundberg justins (a) chaos2.org http://chaos2.org/ jacob (a) chaos2.org http://www.gnifty.net/ String Comparison functions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program, in the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> int strcomp(const char *s, const char *d) { /* String-Compare-Nullsafe This is a null-pointer-safe version of strcmp. This will return 0 if both pointers are NULL. This function considers a NULL pointer to be "less than" any valid string, including the empty string. */ int result; /* Handle trivial equality and NULL cases */ if(s == d) return(0); if(s == NULL) return(-1); if(d == NULL) return(+1); /* At this point, neither s nor d are NULL */ result = STRCOMP(s, d); if(result == 0) return(0); if(result < 0) return(-1); return(+1); } int strcompn(const char *s, const char *d, sizea n) { /* String-N-Compare-Nullsafe This is a null-pointer-safe version of strncmp. This will return 0 if both pointers are NULL. This function considers a NULL pointer to be "less than" any valid string, including the empty string. */ int result; /* Handle trivial equality and NULL cases */ if(s == d) return(0); if(s == NULL) return(-1); if(d == NULL) return(+1); /* At this point, neither s nor d are NULL */ result = STRNCOMP(s, d, n); if(result == 0) return(0); if(result < 0) return(-1); return(+1); } bool strequal(const char *s, const char *d) { /* String-N-Equal */ if(s == d) return(true); if(s == NULL || d == NULL) return(false); return(STREQL(s, d)); } bool strequaln(const char *s, const char *d, sizea n) { /* String-N-Equal */ if(s == d) return(true); if(s == NULL || d == NULL) return(false); return(STRNEQL(s, d, n)); } char *rkstrpat(rkstate *rk, char *s, const char *d) { /* Rabin-Karp-String-Pattern Searches for substring in source string using the Rabin Karp algorithm. */ unsigned char *sp = (unsigned char *)s; const unsigned char *dp = (const unsigned char *)d; unsigned char *rk_source; const unsigned char *rk_pattern; sizea rk_i; sdword rk_t; sdword rk_p; sdword rk_h; sizea rk_slen; sizea rk_dlen; if(s != NULL) { rk_p = 0; rk_t = 0; rk_h = 1; rk_i = 0; rk_source = (unsigned char *)s; rk_pattern = (const unsigned char *)d; if(d != NULL && *d != '\0') { /* Scan the strings */ while(*sp != '\0' && *dp != '\0') { rk_t = (rk_t << 8) + *sp; if(rk_t >= LIBJ_RK_PRIME) rk_t %= LIBJ_RK_PRIME; rk_p = (rk_p << 8) + *dp; if(rk_p >= LIBJ_RK_PRIME) rk_p %= LIBJ_RK_PRIME; ++sp; ++dp; } if(*sp != '\0' || *dp == '\0') { /* Calculate the lengths of the strings */ while(*sp != '\0') ++sp; rk_slen = (sp - (unsigned char *)s); rk_dlen = (dp - (const unsigned char *)d); /* Precalc the infamous "h" value. */ if(rk_dlen != 0) { rk_i = rk_dlen - 1; while(rk_i != 0) { rk_h = (rk_h << 8); if(rk_h >= LIBJ_RK_PRIME) rk_h %= LIBJ_RK_PRIME; --rk_i; } } /* Pattern matching loop */ rk_i = (rk_slen - rk_dlen) + 1; rk_source = (unsigned char *)s; while(rk_i) { if(rk_p == rk_t) { if(MEMEQL(rk_source, rk_pattern, rk_dlen)) { if(rk != NULL) { rk->rk_i = rk_i; rk->rk_t = rk_t; rk->rk_p = rk_p; rk->rk_h = rk_h; rk->rk_source = (char *)rk_source; rk->rk_pattern = (const char *)rk_pattern; rk->rk_dlen = rk_dlen; } return((char *)rk_source); } } --rk_i; if(rk_i != 0) { rk_t = (((rk_t - (((unsigned char)*rk_source) * rk_h)) << 8) + ((unsigned char)*(rk_source + rk_dlen))) % LIBJ_RK_PRIME; if(rk_t < 0) rk_t += LIBJ_RK_PRIME; } ++rk_source; } } /* Did we reach end of source before end of pattern? */ } else { /* destination buffer started out empty */ if(rk != NULL) { rk->rk_source = (char *)rk_source; rk->rk_pattern = (const char *)rk_pattern; } return((char *)rk_source); } } if(rk != NULL) rk->rk_source = NULL; return(NULL); } char *rkstrnext(rkstate *rk) { /* Rabin-Karp-String-Next Searches for the next substring in source string using the Rabin Karp algorithm. Returns NULL if no more entries were found, or if there was no successful call to rkstrpat() to initiate the search. */ unsigned char *rk_source; sizea rk_i; sdword rk_t; sdword rk_p; sdword rk_h; sizea rk_dlen; bool need_to_skip; if(rk != NULL && rk->rk_source != NULL) { /* We need to update the calculations to reflect the first shift. As a result, we set rk_source equal to the location of the last match; we'll explicitly ignore it further down... */ rk_source = (unsigned char *)rk->rk_source; need_to_skip = true; if(*rk_source != '\0') { if(rk->rk_pattern != NULL && *rk->rk_pattern != '\0') { /* Pattern matching loop */ rk_i = rk->rk_i; rk_t = rk->rk_t; rk_p = rk->rk_p; rk_h = rk->rk_h; rk_dlen = rk->rk_dlen; while(rk_i != 0) { if(rk_p == rk_t) { if(!need_to_skip && MEMEQL(rk_source, rk->rk_pattern, rk_dlen)) { rk->rk_i = rk_i; rk->rk_t = rk_t; rk->rk_source = (char *)rk_source; return((char *)rk_source); } } --rk_i; if(rk_i != 0) { rk_t = (((rk_t - (((unsigned char)*rk_source) * rk_h)) << 8) + ((unsigned char)*(rk_source + rk_dlen))) % LIBJ_RK_PRIME; if(rk_t < 0) rk_t += LIBJ_RK_PRIME; } ++rk_source; need_to_skip = false; } } else return(rk->rk_source); } /* Source is not an empty buffer? */ /* Assign source to NULL (we've reached end of search) */ rk->rk_source = NULL; } /* rk was not null */ return(NULL); } char *kmpstrpat(char *s, const char *d) { /* Kmith-Morris-Pratt-String-Pattern A different algorithm from rabin karp. Best suited for algorithms with longer patterns with a relatively small alphabet. Not a guaranteed one-pass algorithm like rabin-karp. Similar interface as in rabin-karp rkstrpat() function. */ sizea dlen = 0; sizea *pi = NULL; sizea *pip; sizea k = 0; char *sp = s; char *dp = (char *)d; if(d == NULL) return(s); if(s != NULL && d != NULL) { /* Get the pattern string length */ while(*dp != '\0') ++dp; dlen = dp - d; /* Allocate the data buffer for pi - calculate pi values */ if(dlen != 0) { pi = (sizea *)malloc(sizeof(sizea) * dlen); if(pi != NULL) { pip = pi + 1; *pi = 0; dp = (char *)(d + 1); while(*dp != '\0') { while(k && d[k] != *dp) k = pi[k]; if(d[k] == *dp) ++k; *pip = k; ++dp; ++pip; } } else dlen = 0; } /* Now, search! Search, my friend, search! */ k = 0; while(*sp != '\0') { while(k && d[k] != *sp) k = pi[k]; if(d[k] == *sp) ++k; if(k == dlen) { /* Match found! Yay... */ free(pi); return(sp - dlen + 1); } ++sp; } free(pi); } /* Source, dest weren't NULL */ return(NULL); } char *strscan(char *s, const char *pat) { /* strscan Scans the string s for first occurrence of pat. s must be NULL-terminated. */ return(rkstrpat(NULL, s, pat)); } char *strscan_list(char *s, const char *const*patlist, sizea *index) { /* strscan_list Searches the string s for the first occurence of any string in the pattern list given (where pattern-list is terminated by a NULL entry). On success, *index is set to the matching pattern and the location in the string is returned. This is currently using the naive algorithm which applies rabin-karp on every pattern and takes the smallest res. */ sizea best_index = (sizea)-1; char *best_p = NULL; const char *const*patlistp; char *p; if(s == NULL || patlist == NULL) return(NULL); /* Start scanning each pattern */ patlistp = patlist; while(*patlistp != NULL && **patlistp != '\0') { p = strscan(s, *patlistp); if(p != NULL && (best_p == NULL || p < best_p)) { best_p = p; best_index = patlistp - patlist; } ++patlistp; } /* Return best result */ if(index != NULL) *index = best_index; return(best_p); } bool strsimilar(const char *A, const char *B) { /* strsimilar Sloppy string comparison. Basically, make sure the strings are the same, allowing for case and punctuation. The return type is bool. This function is courtesy of Jacob Lundberg. */ if(A == B) return(true); if(A == NULL || B == NULL) return(false); while(*A != '\0' && *B != '\0') { /* next valid A char */ while(!( (*A == '\0') || (*A >= '0' && *A <= '9') || (*A >= 'A' && *A <= 'Z') || (*A >= 'a' && *A <= 'z') )) ++A; /* next valid B char */ while(!( (*B == '\0') || (*B >= '0' && *B <= '9') || (*B >= 'A' && *B <= 'Z') || (*B >= 'a' && *B <= 'z') )) ++B; /* test for disparate strings at this char pair */ if( ((*A >= 'a' && *A <= 'z') ? (*A - ('a' - 'A')) : *A) != ((*B >= 'a' && *B <= 'z') ? (*B - ('a' - 'A')) : *B) ) break; ++A; ++B; } /* If both made it to the end then they're ``equal'' enough for us. */ return(*A == '\0' && *B == '\0'); } xscorch-0.2.1/libj/jstr/str_con.c0000644000175000001440000001050511175116121013612 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_con.c,v 1.8 2009-04-26 17:39:29 jacob Exp $ */ /* libj - str_con.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Console string helper functions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program, in the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> char *cpyslenn(char *d, const char *s, sizea size) { /* Copy-String-Length Copies the first characters of string to string . String must already be allocated to support + 1 characters (this will allow for the terminating null character). Remaining characters are filled in as spaces. and may point to the same string but cannot point inside of . Note: if is bigger than then trailing characters will be cut off. This command is just an overglorified memset() call if = NULL :) */ sizea count = STRLENN(s); char *dstart = d; /* Original return pointer */ if(d != NULL) { if(s != NULL) { /* Copy the most relevant characters in s. */ if(count > size) count = size; MEMCPY(d, s, count); size -= count; d += count; } /* s is smaller than size -- fill in with some spaces. */ MEMSET(d, ' ', size); d += size; *d = '\0'; return(dstart); } return(NULL); } void putslenn(const char *s, sizea size) { /* Put-String-Length Displays the first characters of string on the console. If is smaller than characters, then the remaining characters are filled in as spaces. Useful for table-like output. Note: if is bigger than then trailing characters will be cut off. */ if(s != NULL) { while(size > 0 && *s != '\0') { /* Print out the first relevant characters of s. */ putchar(*s); s++; size--; } } while(size > 0) { /* s is smaller than size -- fill in some spaces. */ putchar(' '); size--; } } char *cpysrlenn(char *d, const char *s, sizea size) { /* Copy-String-Rightaligned-Length Copies the first characters of string to string . String must already be allocated to support + 1 characters (this will allow for the terminating null character). Preceding characters are filled in as spaces. Note: if is bigger than then trailing characters will be cut off. This command is just an overglorified memset() if is NULL. :) */ sizea count = STRLENN(s); char *dstart = d; /* Original dest pointer. */ if(d != NULL) { if(count < size) { /* We will have some preceding spaces. */ count = size - count; MEMSET(d, ' ', count); size -= count; d += count; } if(s != NULL) { /* Copy the most relevant characters in s. */ MEMCPY(d, s, size); d += size; } *d = '\0'; return(dstart); } return(NULL); } void putsrlenn(const char *s, sizea size) { /* Put-String-Rightaligned-Length Displays the first characters of string on the console. If is smaller than characters, then preceding characters are filled in as spaces. Useful for table-like output. Note: if is bigger than then trailing characters will be cut off. */ sizea count = STRLENN(s); while(count < size) { /* We will have some preceding spaces. */ putchar(' '); size--; } if(s != NULL) { while(size > 0 && *s != '\0') { /* Print out the first relevant characters of s. */ putchar(*s); s++; size--; } } } xscorch-0.2.1/libj/jstr/str_copy.c0000644000175000001440000001014111175116122014002 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_copy.c,v 1.10 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_copy.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Copies one string into another This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> char *strcopyb(char *d, const char *s, sizea n) { /* StringN-Copy-Null Copies a string but appends a null character to the string. Be warned, the destination buffer must be at least n bytes long for the null append to work! */ if(d != NULL) { if(n <= 0) { /* Nothing to do... */ } else if(s != NULL) { STRNCPY(d, s, n); } else { *d = '\0'; } } return(d); } char *strcopyn(char *d, const char *s, sizea n) { /* strcopyn Same as above, but we guarantee that n *characters* can be copied, so the buffer needs to be at least n+1 large. */ return(strcopyb(d, s, n + 1)); } char *strcopynb(char *d, const char *s, sizea n, sizea b) { /* strcopynb */ return(strcopyb(d, s, min(n + 1, b))); } char *strcopy(char *d, const char *s) { /* String-Copy-Null Copies a string but appends a null character to the string. Be warned, the destination buffer must be at least the size of the source buffer or else you are seriously fucked */ if(d != NULL) { if(s != NULL) { STRCPY(d, s); } else { *d = '\0'; } } return(d); } char *strconcatb(char *d, const char *s, sizea b) { /* StringN-Concat-Null Concatenates 2 strings but appends a null character to the string. Be warned, the destination buffer must be at least b bytes long for the operation to work. The terminating NULL will always be written, so the concatenated part might be truncated. */ sizea dlen; if(d != NULL) { dlen = STRLEN(d); if(dlen < b) { strcopyb(d + dlen, s, b - dlen); } } return(d); } char *strconcatn(char *d, const char *s, sizea n) { /* StringN-Concat-Null Concatenates 2 strings by copying the first characters from s into d, and appends a null character to the string. The dest buffer must be able to handle n additional characters (the NULL need not be counted since the NULL from d will simply shift). */ if(d != NULL) { strcopyn(d + STRLEN(d), s, n); } return(d); } char *strconcatnb(char *d, const char *s, sizea n, sizea b) { /* StringN-Concat-Null Concatenates 2 strings by copying the first characters from s into d, and appends a null character to the string. The dest buffer is bytes long (counting the NULL that is stored in d), therefore s might be truncated (we might not be able to copy all n characters). */ sizea dlen; if(d != NULL) { dlen = STRLEN(d); if(b < dlen) { /* Cannot do a thing */ } else if(b - dlen >= n + 1) { /* The buffer can hold all of the requested chars */ strcopyn(d + dlen, s, n); } else if(b - dlen > 0) { /* The buffer can only hold some of requested chars */ strcopyb(d + dlen, s, b - dlen); } /* If neither case holds, then we cannot grow */ } return(d); } char *strconcat(char *d, const char *s) { /* String-Concat-Null Concatenates 2 strings but appends a null character to the string. */ if(d != NULL) { strcopy(d + STRLEN(d), s); } return(d); } xscorch-0.2.1/libj/jstr/str_creat.c0000644000175000001440000000254011175116122014132 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_creat.c,v 1.8 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_creat.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ String cloning and creation This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> char *strdupl(const char *s) { /* String-Duplicate This function behaves like strdup() */ char *t = NULL; sizea l; if(s != NULL) { l = STRLEN(s); t = (char *)malloc(l + 1); if(t != NULL) { MEMCPY(t, s, l + 1); } /* Allocate succeeded? */ } /* Source not NULL? */ return(t); } xscorch-0.2.1/libj/jstr/str_info.c0000644000175000001440000000467711175116122014004 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_info.c,v 1.10 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_info.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Miscellaneous information about the string This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> sizea strlenn(const char *s) { /* String-Length-Nullsafe Returns the string length, except if = NULL, in which case 0 is returned. */ return(STRLENN(s)); } sizea strnlenn(const char *src, sizea maxlen) { /* strnlenn Returns the length of the string, never scanning beyond maxlen characters of the string. This function returns a value between 0 and maxlen. */ const char *p = src; if(src == NULL || maxlen <= 0) return(0); while(maxlen > 0 && *p != '\0') { ++p; --maxlen; } return(p - src); } sizea strblenn(const char *src, sizea size) { /* strblenn Returns the length of the string, assuming that the buffer size of src is size (so it never scans more than size-1 characters). This function returns a value between 0 and size-1. */ return(strnlenn(src, size - 1)); } sizea strnumwords(const char *s) { /* String-Number-of-Words */ bool inword = false; sizea numwords = 0; if(s != NULL) { while(*s != '\0') { if(WHITESPACE(*s)) inword = false; else if(!inword) { ++numwords; inword = true; } ++s; } } return(numwords); } sizea strnumlines(const char *s) { /* String-Number-of-Lines */ sizea lines = 0; if(s != NULL && *s != '\0') { ++lines; while(*s != '\0') { if(*s == '\n') ++lines; ++s; } } return(lines); } xscorch-0.2.1/libj/jstr/str_io.c0000644000175000001440000000351411175116122013445 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_io.c,v 1.9 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_io.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ File I/O This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> sizea fcount(const char *fname) { /* File-Count Counts the number of lines in a standard text file. Reads through a local read buffer for parsing. Return value is zero if an error occurs, or if the file isn't found, etc.. */ char *buf; sizea count = 0; FILE *f; /* Give up now if the name wasn't given. */ if(fname != NULL && *fname != '\0') { buf = (char *)malloc(LIBJ_READBUF); if(buf != NULL) { /* Try to open the file. On error return zero. */ if(NULL != (f = fopen(fname, "r"))) { /* Read data until an EOF... */ while(fgets(buf, LIBJ_READBUF, f) != NULL) { if(*(buf + STRLEN(buf) - 1) == '\n') ++count; } fclose(f); } free(buf); } } /* Return the final count */ return(count); } xscorch-0.2.1/libj/jstr/str_num.c0000644000175000001440000003460211175116122013637 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_num.c,v 1.7 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_num.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Number-string conversions This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #include #include sdword strtoint(const char *s, int *succ) { /* String-To-Integer Converts string to a long integer, if possible. If succ is not null, then the return value in <*succ> will be zero on success, and on failure it will be a pointer to the character which failed PLUS ONE. If is NULL, then the returned value will be zero but there will be no indication of the error having occured. */ /* random thoughts, random code, random bugs, random crashes */ sdword result = 0; int state = 0; int possign = -1; /* +1 for plus, 0 for minus, -1 for default (plus) */ if(!s) { if(succ) *succ = 1; return(0); } if(succ) *succ = 0; while(state >= 0) { switch(state) { /* Initial-state processing Accepts '+', '-', '0'..'9', 'x', 'o', 'b' -> state 1 if character is '+', '-' -> state 2 if character is '1'..'9' -> state 3 if character is '0' -> state 4 if character is 'x' -> state 6 if character is 'o' -> state 8 if character is 'b' -> state -1 if error */ case 0: state = 1; if(*s == '+') possign = 1; else if(*s == '-') possign = 0; if(possign >= 0) break; state = 2; if(*s == '0') state = 3; else if(*s >= '1' && *s <= '9') result = *s - '0'; else if(*s == 'x' || *s == 'X') state = 4; else if(*s == 'o' || *s == 'O') state = 6; else if(*s == 'b' || *s == 'B') state = 8; else state = -1; break; /* Require-decimal-number state -> state 2 if character is '0'..'9' -> state -1 if error */ case 1: state = 2; if(*s >= '0' && *s <= '9') result = (result * 10) + (*s - '0'); else state = -1; break; /* Optional-decimal-number state -> state 2 if character is '0'..'9' -> state -1 if error -> state -2 if finished */ case 2: if(*s >= '0' && *s <= '9') result = (result * 10) + (*s - '0'); else if(!*s) state = -2; else state = -1; break; /* Optional-decimal-or-hex-delimiter state -> state 2 if character is '0'..'9' -> state 4 if character is 'x' -> state -1 if error -> state -2 if finished */ case 3: state = 2; if(*s >= '0' && *s <= '9') result = (result * 10) + (*s - '0'); else if(*s == 'x' || *s == 'X') state = 4; else if(!*s) state = -2; else state = -1; break; /* Required-hexadecimal-character state -> state 5 if character is '0'..'F' -> state -1 if error */ case 4: state = 5; if(*s >= '0' && *s <= '9') result = (result << 4) | (*s - '0'); else if(*s >= 'a' && *s <= 'f') result = (result << 4) | (*s - 'a' + 10); else if(*s >= 'A' && *s <= 'F') result = (result << 4) | (*s - 'A' + 10); else state = -1; break; /* Optional-hexadecimal-character-state -> state 5 if character is '0'..'F' -> state -1 if error -> state -2 if finished */ case 5: if(*s >= '0' && *s <= '9') result = (result << 4) | (*s - '0'); else if(*s >= 'a' && *s <= 'f') result = (result << 4) | (*s - 'a' + 10); else if(*s >= 'A' && *s <= 'F') result = (result << 4) | (*s - 'A' + 10); else if(!*s) state = -2; else state = -1; break; /* Required-octal-character state -> state 7 if character is '0'..'7' -> state -1 if error */ case 6: state = 7; if(*s >= '0' && *s <= '7') result = (result << 3) | (*s - '0'); else state = -1; break; /* Optional-octal-character-state -> state 7 if character is '0'..'7' -> state -1 if error -> state -2 if finished */ case 7: if(*s >= '0' && *s <= '7') result = (result << 3) | (*s - '0'); else if(!*s) state = -2; else state = -1; break; /* Required-binary-character state -> state 9 if character is '0'..'1' -> state -1 if error */ case 8: state = 9; if(*s == '0') result = (result << 1); else if(*s == '1') result = (result << 1) | 1; else state = -1; break; /* Optional-binary-character-state -> state 9 if character is '0'..'1' -> state -1 if error -> state -2 if finished */ case 9: if(*s == '0') result = (result << 1); else if(*s == '1') result = (result << 1) | 1; else if(!*s) state = -2; else state = -1; break; } s++; if(succ) (*succ)++; } if(state == -1) return(0); if(!possign) result = -result; if(succ) *succ = 0; return(result); } double strtofloat(const char *s, int *succ) { /* String-To-Float Converts string to a double value, if possible. If succ is not null, then the return value in <*succ> will be zero on success, and on failure it will be a pointer to the character which failed PLUS ONE. If is NULL, then the returned value will be zero but there will be no indication of the error having occured. */ /* random thoughts, random code, random bugs, random crashes */ int state = 0; double result = 0; long mantissa = 0; int posbase = -1; /* +1 for plus, 0 for minus, -1 for default (plus) */ int posmant = -1; /* +1 for plus, 0 for minux, -1 for default (plus) */ double decval = 0.1; /* power to multiply for decimal digit */ if(!s) { if(succ) *succ = 1; return(0); } if(succ) *succ = 0; while(state >= 0) { switch(state) { /* Initial-state processing -> state 1 if character is '+', '-' -> state 2 if character is '0'..'9' -> state 3 if character is '.' -> state -1 on error */ case 0: state = 1; if(*s == '+') posbase = 1; else if(*s == '-') posbase = 0; if(posbase >= 0) break; state = 2; if(*s >= '0' && *s <= '9') result = (*s - '0'); else if(*s == '.') state = 3; else state = -1; break; /* Require-whole-number-or-decimal state -> state 2 if character is '0'..'9' -> state 3 if character is '.' -> state -1 if error */ case 1: state = 2; if(*s >= '0' && *s <= '9') result = (result * 10) + (*s - '0'); else if(*s == '.') state = 3; else state = -1; break; /* Optional-whole-number-or-decimal state -> state 2 if character is '0'..'9' -> state 4 if character is '.' -> state 5 if character is 'e' -> state -1 if error -> state -2 if finished */ case 2: if(*s >= '0' && *s <= '9') result = (result * 10) + (*s - '0'); else if(*s == '.') state = 4; else if(*s == 'e' || *s == 'E') state = 5; else if(!*s) state = -2; else state = -1; break; /* Require-decimal-digit state -> state 4 if character is '0'..'9' -> state -1 if error */ case 3: state = 4; if(*s >= '0' && *s <= '9') { result = result + decval * (*s - '0'); decval /= 10; } else state = -1; break; /* Optional-decimal-digit state -> state 4 if character is '0'..'9' -> state 5 if character is 'e' -> state -1 if error -> state -2 if finished */ case 4: if(*s >= '0' && *s <= '9') { result = result + decval * (*s - '0'); decval /= 10; } else if(*s == 'e' || *s == 'E') state = 5; else if(!*s) state = -2; else state = -1; break; /* Exponential-init state -> state 6 if character is '+', '-' -> state 7 if character is '0'..'9' -> state -1 on error */ case 5: state = 6; if(*s == '+') posmant = 1; else if(*s == '-') posmant = 0; if(posmant >= 0) break; state = 7; if(*s >= '0' && *s <= '9') mantissa = (*s - '0'); else state = -1; break; /* Require-exponential-digit state -> state 7 if character is '0'..'9' -> state -1 on error */ case 6: state = 7; if(*s >= '0' && *s <= '9') mantissa = (mantissa * 10) + (*s - '0'); else state = -1; break; /* Optional-exponential-digit state -> state 7 if character is '0'..'9' -> state -1 if error -> state -2 if finished */ case 7: if(*s >= '0' && *s <= '9') mantissa = (mantissa * 10) + (*s - '0'); else if(!*s) state = -2; else state = -1; break; } s++; if(succ) (*succ)++; } if(state == -1) return(0); if(!posbase) result = -result; if(!posmant) mantissa = -mantissa; result = pow(result, mantissa); if(succ) *succ = 0; return(result); } char *inttostr(char *d, sdword num, udword digits) { /* Integer-To_String Converts integer to a string with digits. If is less than number of digits in , then the _least_ significant digits are copied. If digits is larger, then leading zeroes will be copied. If = 0, then the number will simply be copied without leading zeroes. Note for negative numbers: the "-" sign is considered to take up a digit space, so be warned... The dest buffer should be at least + 1 characters long. */ char *dstart = d; udword mag = 1; /* What magnitude are we on right now? */ if(!d) return(NULL); /* Handling for negative numbers */ if (num < 0) { *d = '-'; d++; num = -num; digits--; if(!digits) { *d = '\0'; return(dstart); } } /* Figure out how many digits to bother with */ if(digits > 0) { /* Print specified number of digits */ while(--digits) mag *= 10; } else { /* Print all digits */ while (num / (mag * 10) > 0) mag *= 10; } /* Start copying off the digits :) */ while (mag) { *d = (num / mag) % 10 + '0'; d++; num %= mag; mag /= 10; } /* Set ending NULL on the destination string (kinda important..) */ *d = '\0'; return(dstart); } char *inttohex(char *d, udword num, udword digits) { /* Integer-To_Hexadecimal Converts integer to a string with digits. If is less than number of digits in , then the _least_ significant digits are copied. If digits is larger, then leading zeroes will be copied. If = 0, then the number will simply be copied without leading zeroes. Note for negative numbers: the "-" sign is considered to take up a digit space, so be warned... The dest buffer should be at least + 1 characters long. */ char *dstart = d; unsigned int mag = 0; /* What magnitude are we on right now? */ if(!d) return(NULL); /* Figure out how many digits to bother with */ if(digits > 0) { /* Print specified number of digits */ while(--digits) mag += 4; } else { /* Print all digits */ while ((num >> mag) > 0) mag += 4; } /* Start copying off the digits :) */ while (mag) { *d = (num >> mag) & 0xf; #ifdef PREFER_UPPER if(*d > 9) *d += 'A'; #else if(*d > 9) *d += 'a'; #endif else *d += '0'; d++; mag -= 4; } /* Set ending NULL on the destination string (kinda important..) */ *d = '\0'; return(dstart); } bool getbool(bool *result, const char *s) { /* Get-Boolean Returns "true" if the value in is a boolean identifier string, in which case, is set to true or false based on . If is NULL, then this function just returns whether or not is a valid boolean identifier. Valid identifiers are... true: "true" "True" "TRUE" "t" "T" "yes" "Yes" "YES" "y" "Y" "+" false: "false" "False" "FALSE" "f" "F" "no" "No" "NO" "n" "N" "-" */ if( streql(s, "true") || streql(s, "True") || streql(s, "TRUE") || streql(s, "t") || streql(s, "T") || streql(s, "yes") || streql(s, "Yes") || streql(s, "YES") || streql(s, "y") || streql(s, "Y") || streql(s, "+")) { if(result) *result = true; } else if(streql(s, "false") || streql(s, "False") || streql(s, "FALSE") || streql(s, "f") || streql(s, "F") || streql(s, "no") || streql(s, "No") || streql(s, "NO") || streql(s, "n") || streql(s, "N") || streql(s, "-")) { if(result) *result = false; } else return(false); return(true); } xscorch-0.2.1/libj/jstr/str_printf.c0000644000175000001440000000341411175116122014337 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_printf.c,v 1.9 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_printf.c Copyright (C) 2001-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ sprintf helper functions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program, in the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> #include char *sbprintf(char *dest, sizea size, const char *fmt, ...) { /* sbprintf */ va_list args; if(size > 0 && dest != NULL && fmt != NULL) { va_start(args, fmt); vsnprintf(dest, size, fmt, args); va_end(args); dest[size - 1] = '\0'; return(dest); } return(NULL); } char *sbprintf_concat(char *dest, sizea size, const char *fmt, ...) { /* sbprintf_concat */ va_list args; sizea destlen; if(size > 0 && dest != NULL && fmt != NULL) { destlen = STRLEN(dest); if(destlen < size) { va_start(args, fmt); vsnprintf(dest + destlen, size - destlen, fmt, args); va_end(args); } dest[size - 1] = '\0'; return(dest); } return(NULL); } xscorch-0.2.1/libj/jstr/str_replace.c0000644000175000001440000000705611175116122014456 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_replace.c,v 1.8 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_replace.c Copyright (C) 2001-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ String Replacement functions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program, in the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> sizea strreplaceb(char *in_s, const char *src, const char *dst, sizea in_ssize) { /* strreplaceb Replaces occurrences of src with dst in the string s. Here, ssize is the size of s's buffer; we guarantee that s will terminate with NULL after this call, so we may truncate part of a replacement in this. If src or s are NULL, nothing happens; if dst is NULL, then occurrences of src are removed. NOTE: we do not scan dst for further replacements in this function. */ char *s; char *p; sizea ssize; sizea srclen; sizea dstlen = 0; sizea count = 0; /* Sanity checks */ if(in_s == NULL || src == NULL || in_ssize <= 0 || *src == '\0') return(0); /* Prepare to search for occurrences of src */ s = in_s; ssize = in_ssize; srclen = STRLEN(src); dstlen = STRLENN(dst); while((p = strscan(s, src)) != NULL) { /* Found an occurrence of src */ if(ssize <= (sizea)(p - s)) { /* We cannot replace this text, it is beyond end of buffer */ return(count); } ++count; ssize -= p - s; if(dst == NULL) { /* Delete the source string */ ssize -= srclen; MEMMOVE(p, p + srclen, ssize); s = p; } else if(dstlen + 1 >= ssize) { /* Destination will have to be truncated; tail of s will be lost in this operation. This must appear before the check below in case repl string crossed the buffer boundary. */ STRNCPY(p, dst, ssize); s += ssize - 1; ssize = 1; } else if(dstlen <= srclen) { /* Tail of s will be moved forward a bit. */ s = p + dstlen; if(dstlen != srclen) MEMMOVE(s, p + srclen, ssize - srclen); MEMCPY(p, dst, dstlen); ssize -= dstlen; } else { /* Destination will NOT have to be truncated, but since dstlen > srclen, we will have to truncate s as we move it. Also, we need to move s out of the way before copying in the dst data. */ s = p + dstlen; ssize -= srclen + (dstlen - srclen); MEMMOVE(s, p + srclen, ssize); MEMCPY(p, dst, dstlen); s[ssize - 1] = '\0'; /* NULL terminator may have been lost */ } /* All possible replacement cases */ } /* Found a string to rewrite */ /* Return the number of replacements that happened */ return(count); } sizea strreplacen(char *s, const char *src, const char *dst, sizea n) { /* strreplacen */ return(strreplaceb(s, src, dst, n + 1)); } xscorch-0.2.1/libj/jstr/str_time.c0000644000175000001440000000622411175116122013775 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_time.c,v 1.8 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_time.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Time manipulation and strings This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> #if HAVE_GETTIMEOFDAY bool decodetime(struct tm *t, const char *s) { /* Decode-Time Decodes the timestring (encoded by encodetime) into the time structure . Returns false if the source string is not a valid encoded time. Note that must already be allocated. */ char buf[20]; udword count = 0; if(!t || !s) return(false); /* Check validity of the string */ if(STRLEN(s) < 19) return(false); if(*(s + 4) != '.') return(false); if(*(s + 7) != '.') return(false); if(*(s + 10) != '@') return(false); if(*(s + 13) != ':') return(false); if(*(s + 16) != ':') return(false); /* Copy to a temp buffer for processing */ MEMCPY(buf, s, 19); *(buf + 4) = 0; *(buf + 7) = 0; *(buf + 10) = 0; *(buf + 13) = 0; *(buf + 16) = 0; *(buf + 19) = 0; /* More checks */ while(count < 19) { if(*(buf + count) && (*(buf + count) < '0' || *(buf + count) > '9')) return(false); count++; } /* Get the actual values and write them to the time structure. */ t->tm_year = strtoint(buf, 0) - 1900; t->tm_mon = strtoint(buf + 5, 0) - 1; t->tm_mday = strtoint(buf + 8, 0); t->tm_hour = strtoint(buf + 11, 0); t->tm_min = strtoint(buf + 14, 0); t->tm_sec = strtoint(buf + 17, 0); return(true); } char *encodetime(char *d) { /* Encodes the _current_ system time into the string . Useful for logging functions and anything else needing a timestamp in it :) Note that the character buffer pointed to by needs to be at least 20 characters long. */ time_t tpacked; struct tm *t; if(!d) return(NULL); /* Grab the current system time */ time(&tpacked); t = localtime(&tpacked); /* Encode the time string */ MEMCPY(d, "yyyy.mm.dd@hh:mm:ss", 20); inttostr(d, t->tm_year + 1900, 4); *(d + 4) = '.'; inttostr(d + 5, t->tm_mon + 1, 2); *(d + 7) = '.'; inttostr(d + 8, t->tm_mday, 2); *(d + 10) = '@'; inttostr(d + 11, t->tm_hour, 2); *(d + 13) = ':'; inttostr(d + 14, t->tm_min, 2); *(d + 16) = ':'; inttostr(d + 17, t->tm_sec, 2); return(d); } #endif /* HAVE_GETTIMEOFDAY */ xscorch-0.2.1/libj/jstr/str_trim.c0000644000175000001440000000701111175116122014005 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_trim.c,v 1.8 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_trim.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ String trimming This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include #include <_str.h> char *trim(char *s) { /* Trim trims off leading and trailing whitespace, \n, \t, etc off of the string passed in . Since this function only removes characters, sizeof(final_) <= sizeof(init_), so we won't have to worry about overflowing memory or anything :) */ /* Pointers into the string (used to parse whitespace out) */ char *d = s; whitespace ws; if(s != NULL) { SKIM_WHITESPACE(s); SET_FIRST_NWS(ws, s); SET_LAST_NWS(ws, s); /* Copy the non-ws characters in . */ if(ws.fnws > d) MEMCPY(d, ws.fnws, NWS_SIZE(ws)); *(d + NWS_SIZE(ws)) = '\0'; return(d); } return(NULL); } char *rtrim(char *s) { /* R-Trim trims off trailing whitespace, \n, \t, etc off of the string passed in . Since this function only removes characters, sizeof(final_) <= sizeof(init_), so we won't have to worry about overflowing memory or anything :) */ /* Pointers into the string (used to parse whitespace out) */ char *d = s; whitespace ws; if(s != NULL) { ws.lnws = s; SET_LAST_NWS(ws, s); *ws.lnws = '\0'; return(d); } return(NULL); } char *ltrim(char *s) { /* L-Trim trims off leading whitespace, \n, \t, etc off of the string passed in . Since this function only removes characters, sizeof(final_) <= sizeof(init_), so we won't have to worry about overflowing memory or anything :) */ /* Pointers into the string (used to parse whitespace out) */ char *d = s; if(s != NULL) { SKIM_WHITESPACE(s); MEMCPY(d, s, STRLEN(s) + 1); return(d); } return(NULL); } char *trimcomment(char *s, char c) { /* Trim-Comment Trims off the comment in string , which is specified as anything following the character specified in . */ char *p = s; if(s != NULL) { while(*p != '\0') { if(*p == c) *p = '\0'; else p++; } } return(s); } char *trimbracecomment(char *s, char c1, char c2) { /* Trim-Brace-Comment Trims off the comment in string , which is specified as anything following the character specified in , up to the occurrence of . */ char *p = s; char *p1; if(s != NULL) { while(*p != '\0') { if(*p == c1) { p1 = p; while(*p != '\0' && *p != c2) p++; if(*p != '\0') { p++; STRCPY(p1, p); p = p1; } else *p1 = '\0'; } else p++; } } return(s); } xscorch-0.2.1/libj/jstr/str_uni.c0000644000175000001440000000577711175116123013647 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_uni.c,v 1.6 2009-04-26 17:39:31 jacob Exp $ */ /* libj - str_uni.c Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Unicode conversions This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #include char *unitocharc(char *d, const wchar *s, unsigned int maxlen) { /* Unicode-to-Character-Countbuffer Converts a source unicode string into a character string by stripping off the high bits of the source string. The target buffer should be at least wide_strlen(source) + 1 bytes long if = 0, otherwise will specify the size of the target buffer. */ const unsigned char *ps = (const unsigned char *)s; unsigned char *pd = (unsigned char *)d; if(!s || !d) return(NULL); /* Convert a unicode string to char, stripping the most significant bytes */ while(*ps && --maxlen) { *pd = *ps; ps += 2; pd++; } *pd = '\0'; return(d); } char *unitochar(char *d, const wchar *s) { /* Unicode-to-Character-Countbuffer Converts a source unicode string into a character string by stripping off the high bits of the source string. The target buffer should be at least wide_strlen(source) + 1 bytes long. */ return(unitocharc(d, s, 0)); } wchar *chartounic(wchar *d, const char *s, unsigned int maxlen) { /* Character-to-Unicode-Countbuffer Converts a source character string into a unicode string by appending a leading 0 byte to each byte in the source string. The target buffer should be at least strlen(source) * 2 + 2 bytes long if = 0, otherwise will specify the size of the target buffer IN 2-BYTE INCREMENTS! */ const unsigned char *ps = (const unsigned char *)s; unsigned char *pd = (unsigned char *)d; if(!s || !d) return(NULL); /* Convert a char string to ASCII characters in unicode */ while(*ps && --maxlen) { *pd = *ps; *(pd + 1) = '\0'; ps++; pd += 2; } *pd = '\0'; *(pd + 1) = '\0'; return(d); } wchar *chartouni(wchar *d, const char *s) { /* Character-to-Unicode Converts a source character string into a unicode string by appending a leading 0 byte to each byte in the source string. The target buffer should be at least strlen(source) * 2 + 2 bytes long. */ return(chartounic(d, s, 0)); } xscorch-0.2.1/libj/jstr/_str.h0000644000175000001440000000725311175116121013125 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/_str.h,v 1.8 2009-04-26 17:39:29 jacob Exp $ */ /* libj - _str.h Copyright (C) 1998-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Main internal header file for jstr library This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #ifndef __libj__str_included #define __libj__str_included /* Include the public header */ #include /* Functions for whitespace manipulation */ typedef struct _const_whitespace { const char *fnws; const char *lnws; } const_whitespace; typedef struct _whitespace { char *fnws; char *lnws; } whitespace; #define SKIM_WHITESPACE(p) do { while(WHITESPACE(*(p))) ++(p); } while(0) #define SKIM_WHITESPACE_T(p,t) do { while(WHITESPACE(*(p)) && *(p) != (t)) ++(p); } while(0) #define SET_FIRST_NWS(ws,p) do { (ws).fnws = (ws).lnws = (p); } while(0) #define SET_LAST_NWS(ws,p) do { \ while(*(p) != '\0') { \ if(!WHITESPACE(*(p))) (ws).lnws = (p) + 1; \ ++(p); \ } \ } while(0) #define SET_LAST_NWS_T(ws,p,t) do { \ while(*(p) != '\0' && *(p) != (t)) { \ if(!WHITESPACE(*(p))) (ws).lnws = (p) + 1; \ ++(p); \ } \ } while(0) #define NWS_SIZE(ws) (unsigned)((ws).lnws - (ws).fnws) /* Short macros for character buffer manipulation */ #if LIBJ_LIBC_STRING #define MEMEQL(s,d,z) (!memcmp((s), (d), (z))) #define MEMCOMP(s,d,z) (memcmp((s), (d), (z))) #define MEMCPY(d,s,z) memcpy((d), (s), (z)) #define MEMMOVE(d,s,z) memmove((d), (s), (z)) #define MEMSET(d,c,z) memset((d), (c), (z)) #define STREQL(s,d) (!strcmp((s), (d))) #define STRCOMP(s,d) (strcmp((s), (d))) #define STRLEN(s) strlen(s) #define STRLENN(s) (s == NULL ? 0 : strlen(s)) #define STRNEQL(s,d,z) (!strncmp((s), (d), (z))) #define STRNCOMP(s,d,z) (strncmp((s), (d), (z))) #define STRNCPY(d,s,z) (strncpy((d), (s), (z)), *((d) + (z) - 1) = '\0') #define STRCPY(d,s) strcpy((d), (s)) #else #define MEMEQL(s,d,z) jmemeql((s), (d), (z)) #define MEMCOMP(s,d,z) jmemcmp((s), (d), (z)) #define MEMCPY(d,s,z) mcopy((d), (s), (z)) #define MEMMOVE(d,s,z) mmove((d), (s), (z)) #define MEMSET(d,c,z) mset((d), (c), (z)) #define STREQL(s,d) MEM_ARE_EQUAL(scmp((s), (d))) #define STRCOMP(s,d) __memcomp((s), (d), scmp((s), (d))) #define STRLEN(s) sscan_null(s) #define STRLENN(s) (s == NULL ? 0 : sscan_null(s)) #define STRNEQL(s,d,z) MEM_ARE_EQUAL(scmp_size((s), (d), (z))) #define STRNCOMP(s,d,z) __memcomp((s), (d), scmp_size((s), (d), (z))) #define STRNCPY(d,s,z) scopy_size((d), (s), (z)) #define STRCPY(d,s) scopy((d), (s)) #endif #endif /* Header included */ xscorch-0.2.1/libj/jstr/str_test.c0000644000175000001440000004624411175116122014024 00000000000000/* $Header: /fridge/cvs/xscorch/libj/jstr/str_test.c,v 1.9 2009-04-26 17:39:30 jacob Exp $ */ /* libj - str_test.c Copyright (C) 2001-2003 Justin David Smith justins (a) chaos2.org http://chaos2.org/ Tests the jstr functions This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file is part of LIBJ. */ #define LIBJ_ALLOW_LIBC_STRING 1 #include int success = 0; int failure = 0; void test_int(const char *msg, int actual, int expected) { if(actual == expected) { printf("%16s: pass\n", msg); ++success; } else { printf("%16s: fail - expected %d, got %d\n", msg, expected, actual); ++failure; } } void test_ptr(const char *msg, const char *actual, const char *expected) { if(actual == expected) { printf("%16s: pass\n", msg); ++success; } else { printf("%16s: fail - expected %p, got %p\n", msg, expected, actual); ++failure; } } void test_str(const char *msg, const char *actual, const char *expected) { if(strcmp(actual, expected) == 0) { printf("%16s: pass\n", msg); ++success; } else { printf("%16s: fail - buffers differ, expected \"%s\", got \"%s\"\n", msg, expected, actual); ++failure; } } int main() { char *q; const char *p; char s1[0x1000]; char s2[0x1000]; char s3[0x1000]; char s4[0x1000]; rkstate rk; /* Test comparison functions */ test_int("compare1", strcomp("abcdefg", "abcdefg"), 0); test_int("compare2", strcomp("abcdefg", "abcdefghij"), -1); test_int("compare3", strcomp("abcdefghij", "abcdefg"), +1); test_int("compare4", strcomp("abcdefg", "abceefg"), -1); test_int("compare5", strcompn("abcdefg", "abceefg", 3), 0); test_int("compare6", strcompn("abcdefg", "abceefg", 4), -1); test_int("compare7", strcompn("foo", "bar", 0), 0); test_int("compare8", strcomp("foo", NULL), +1); test_int("compare9", strcomp(NULL, NULL), 0); test_int("compare10", strcompn(NULL, NULL, 100000), 0); test_int("equal1", strequal("abcdefg", "abcdefg"), true); test_int("equal2", strequal("abcdefg", "abcdefghijklm"), false); test_int("equal3", strequaln("abcdefg", "abcdefghijklm", 7), true); test_int("equal4", strequaln("abcdefg", "abcdefghijklm", 8), false); test_int("equal5", strequaln(NULL, "abcdefghijklm", 0), false); test_int("equal6", strequaln(NULL, "abcdefghijklm", 1), false); test_int("equal6", strequaln(NULL, NULL, 0), true); test_int("equal7", strequaln(NULL, NULL, 100000), true); /* Test scanning functions */ p = "abdefghijklmnopabcababc"; strcpy(s1, p); test_int("prescan1", strequal(s1, p), true); test_ptr("scan1", strscan(s1, NULL), s1); test_ptr("scan2", strscan(s1, "ab"), s1); test_ptr("scan3", strscan(s1, "abc"), s1 + 15); test_ptr("scan4", strscan(s1, "cba"), NULL); test_ptr("rkstrpat1a", rkstrpat(&rk, s1, NULL), s1); test_ptr("rkstrpat1b", rkstrnext(&rk), s1); test_ptr("rkstrpat1c", rkstrnext(&rk), s1); test_ptr("rkstrpat2a", rkstrpat(&rk, s1, "ab"), s1); test_ptr("rkstrpat2b", rkstrnext(&rk), s1 + 15); test_ptr("rkstrpat2c", rkstrnext(&rk), s1 + 18); test_ptr("rkstrpat2d", rkstrnext(&rk), s1 + 20); test_ptr("rkstrpat2e", rkstrnext(&rk), NULL); test_ptr("rkstrpat3a", rkstrpat(&rk, s1, "abc"), s1 + 15); test_ptr("rkstrpat3b", rkstrnext(&rk), s1 + 20); test_ptr("rkstrpat3c", rkstrnext(&rk), NULL); test_ptr("rkstrpat4", rkstrpat(NULL, NULL, s1), NULL); test_ptr("rkstrpat5a", rkstrpat(&rk, s1, NULL), s1); test_ptr("rkstrpat5b", rkstrnext(&rk), s1); test_ptr("rkstrpat5c", rkstrnext(&rk), s1); test_ptr("rkstrpat6", rkstrpat(NULL, NULL, NULL), NULL); test_ptr("kmpstrpat1a", (q = kmpstrpat(s1, "abc")), s1 + 15); test_ptr("kmpstrpat1b", (q = kmpstrpat(q, "abc")), s1 + 15); test_ptr("kmpstrpat1c", (q = kmpstrpat(q + 1, "abc")), s1 + 20); test_ptr("kmpstrpat1d", (q = kmpstrpat(q + 1, "abc")), NULL); test_ptr("kmpstrpat2", kmpstrpat(NULL, s1), NULL); test_ptr("kmpstrpat3", kmpstrpat(s1, NULL), s1); /* Test copy functions */ p = "abcdefgdfmbdlfmvlkmvklmvkl;dfvkl;dfkvl;fdmlkv;dsfkmvsdfvmvmkvmkldsfmvklmvlk;mvkl;dfsmvkl;dfskml;sdfvdvmvkml;dfskvl;"; strcpy(s1, p); p = "xxxxxxx"; strcpy(s2, p); strcpy(s3, s2); strcat(s3, s1); strncpy(s3, s2, strlen(s2)); test_int("strlenn1", strlenn(NULL), 0); test_int("strlenn2", strlenn(s1), 115); test_int("strlenn3", strlenn(s2), 7); test_int("strlenn4", strlenn(s3), 122); test_int("strnlenn1", strnlenn(NULL, 100), 0); test_int("strnlenn2", strnlenn(s1, 100), 100); test_int("strnlenn3", strnlenn(s1, 115), 115); test_int("strnlenn4", strnlenn(s1, 150), 115); memset(s4, 0xff, sizeof(s4)); test_str("strcopy1a", strcopy(s4, s1), s1); test_int("strcopy1b", *(unsigned char *)(s4 + strlen(s1) + 2), (unsigned int)0xff); memset(s4, 0xfe, 8); test_str("strcopyn1a", strcopyn(s4, s1, 7), "abcdefg"); test_str("strcopyn1b", s4, "abcdefg"); test_str("strcopyn1c", s4 + 8, s1 + 8); test_str("strcopyb1a", strcopyb(s4, s2, 7), "xxxxxx"); test_str("strcopyb1b", s4 + 7, ""); test_str("strcopyb1c", s4 + 8, s1 + 8); test_str("strcopy2", strcopy(s4, NULL), ""); test_ptr("strcopy3", strcopy(NULL, s1), NULL); test_str("strcopyb2", strcopyb(s4, NULL, sizeof(s4)), ""); test_ptr("strcopyb3", strcopyb(NULL, s1, sizeof(s1)), NULL); strcpy(s4, s1); test_str("strcopyb4", strcopyb(s4, s2, 0), s1); test_str("strcopyb5", strcopyb(s4, s3, 1), ""); test_str("strcopyn2", strcopyn(s4, s2, 0), ""); test_str("strcopyn3", strcopyn(s4, s2, 1), "x"); test_str("strconcat1a", strcopy(s4, s2), s2); test_str("strconcat1b", strconcat(s4, s1), s3); test_ptr("strconcat2", strconcat(NULL, s1), NULL); test_str("strconcat3a", strcopy(s4, s1), s1); test_str("strconcat3b", strconcat(s4, NULL), s1); test_str("strconcatb1a", strcopyb(s4, s2, sizeof(s4)), s2); test_str("strconcatb1b", strconcatb(s4, s1, sizeof(s4)), s3); test_str("strconcatb2a", strcopyb(s4, s2, sizeof(s4)), s2); test_str("strconcatb2b", strconcatb(s4, s1, strlen(s4) + 1), s2); test_str("strconcatb3a", strcopyb(s4, "abcd", 4), "abc"); test_str("strconcatb3b", strconcatb(s4, "efg", 6), "abcef"); test_str("strconcatb4a", strcopyb(s4, "abcd", 5), "abcd"); test_str("strconcatb4b", strconcatb(s4, "efg", 4), "abcd"); test_ptr("strconcatb5", strconcatb(NULL, s1, 1000), NULL); test_str("strconcatb6a", strcopyb(s4, s1, sizeof(s4)), s1); test_str("strconcatb6b", strconcatb(s4, NULL, sizeof(s4)), s1); test_str("strconcatb7a", strcopyb(s4, "defghij", sizeof(s4)), "defghij"); test_str("strconcatb7b", strconcatb(s4, "yyyyyyyy", 2), "defghij"); test_str("strconcatn1a", strcopy(s4, "abcdefg"), "abcdefg"); test_str("strconcatn1b", strconcatn(s4, "xxxxxxxx", 0), "abcdefg"); test_str("strconcatn2a", strcopy(s4, "defghij"), "defghij"); test_str("strconcatn2b", strconcatn(s4, "yyyyyyyy", 1), "defghijy"); test_str("strconcatn3a", strcopy(s4, "abcdefg"), "abcdefg"); test_str("strconcatn3b", strconcatn(s4, "zzzzzzzz", 1000), "abcdefgzzzzzzzz"); test_str("strconcatn4a", strcopy(s4, "defghij"), "defghij"); test_str("strconcatn4b", strconcatn(s4, NULL, 1000), "defghij"); test_ptr("strconcatn5", strconcatn(NULL, "abcdefg", 5), NULL); test_str("strconcatbn1a", strcopy(s4, "abcdefg"), "abcdefg"); test_str("strconcatbn1b", strconcatbn(s4, "yyyyyyyy", 8, 1000), "abcdefg"); test_str("strconcatbn2a", strcopy(s4, "defghij"), "defghij"); test_str("strconcatbn2b", strconcatbn(s4, "zzzzzzzz", 10, 1000), "defghijzz"); test_str("strconcatbn3a", strcopy(s4, "abcdefg"), "abcdefg"); test_str("strconcatbn3b", strconcatbn(s4, "xxxxxxxx", 16, 1000), "abcdefgxxxxxxxx"); test_str("strconcatbn4a", strcopy(s4, "defghij"), "defghij"); test_str("strconcatbn4b", strconcatbn(s4, "zzzzzzzz", 32, 4), "defghijzzzz"); test_str("strconcatbn5a", strcopy(s4, "abcdefg"), "abcdefg"); test_str("strconcatbn5b", strconcatbn(s4, "xxxxxxxx", 12, 4), "abcdefgxxxx"); test_str("strconcatbn6a", strcopy(s4, "defghij"), "defghij"); test_str("strconcatbn6b", strconcatbn(s4, "yyyyyyyy", 12, 4), "defghijyyyy"); test_ptr("strconcatbn7", strconcatbn(NULL, "abcdefg", 12, 12), NULL); test_str("strconcatbn8a", strcopy(s4, "abcdefg"), "abcdefg"); test_str("strconcatbn8b", strconcatbn(s4, "abcdefg", 1, 12), "abcdefg"); test_str("strconcatbn9a", strcopy(s4, "defghij"), "defghij"); test_str("strconcatbn9b", strconcatbn(s4, NULL, 100, 100), "defghij"); /* Test sbprintf */ memset(s4, 0xff, sizeof(s4)); test_str("sbprintf1a", sbprintf(s4, 12, "abcd%s", "efg"), "abcdefg"); test_int("sbprintf1b", *(unsigned char *)(s4 + 9), 0xff); memset(s4, 0xfe, sizeof(s4)); test_str("sbprintf2a", sbprintf(s4, 8, "abcd%d", 123), "abcd123"); test_int("sbprintf2b", *(unsigned char *)(s4 + 9), 0xfe); memset(s4, 0xfd, sizeof(s4)); test_str("sbprintf3a", sbprintf(s4, 7, "abcd%03x", 0x42), "abcd04"); test_int("sbprintf3b", *(unsigned char *)(s4 + 8), 0xfd); /* Test sbprintf_append */ memset(s4, 0xff, sizeof(s4)); test_str("sbprintf_app1a", sbprintf(s4, 12, "abcd%s", "efg"), "abcdefg"); test_int("sbprintf_app1b", *(unsigned char *)(s4 + 9), 0xff); test_str("sbprintf_app1c", sbprintf_concat(s4, 12, "hi%sl", "jk"), "abcdefghijk"); test_int("sbprintf_app1d", *(unsigned char *)(s4 + 12), 0xff); test_str("sbprintf_app1e", sbprintf_concat(s4, 12, "oops"), "abcdefghijk"); test_int("sbprintf_app1f", *(unsigned char *)(s4 + 12), 0xff); /* Test misc info functions */ strcpy(s1, "now is \n the\t time, for\n all good men!!!"); strcpy(s2, "\n\n\n"); test_int("strnumwords1", strnumwords(s1), 8); test_int("strnumlines1", strnumlines(s1), 3); test_int("strnumlines2", strnumlines(s2), 4); /* String replacement functions */ p = "abcab$replcabcabca$replbc"; strcpy(s1, p); strcpy(s2, s1); test_int("strreplace1", strreplaceb(NULL, "$repl", "XXX", 1000), 0); test_int("strreplace2a", strreplaceb(s2, "$repl", "XXX", 0), 0); test_str("strreplace2b", s2, s1); test_str("strreplace3a", strcopy(s2, s1), p); test_int("strreplace3b", strreplaceb(s2, "$repl", "", sizeof(s2)), 2); test_str("strreplace3c", s2, "abcabcabcabcabc"); test_str("strreplace4a", strcopy(s2, s1), p); test_int("strreplace4b", strreplaceb(s2, "$repl", NULL, sizeof(s2)), 2); test_str("strreplace4c", s2, "abcabcabcabcabc"); test_str("strreplace5a", strcopy(s2, s1), p); test_int("strreplace5b", strreplaceb(s2, "$repl", "X", sizeof(s2)), 2); test_str("strreplace5c", s2, "abcabXcabcabcaXbc"); test_str("strreplace6a", strcopy(s2, s1), p); test_int("strreplace6b", strreplacen(s2, "$repl", "X", strlen(s1)), 2); test_str("strreplace6c", s2, "abcabXcabcabcaXbc"); test_str("strreplace7a", strcopy(s2, s1), p); test_int("strreplace7b", strreplaceb(s2, "$repl", "XXXXX", sizeof(s2)), 2); test_str("strreplace7c", s2, "abcabXXXXXcabcabcaXXXXXbc"); test_str("strreplace8a", strcopy(s2, s1), p); test_int("strreplace8b", strreplacen(s2, "$repl", "XXXXX", strlen(s1)), 2); test_str("strreplace8c", s2, "abcabXXXXXcabcabcaXXXXXbc"); test_str("strreplace9a", strcopy(s2, s1), p); test_str("strreplace9b", s1, p); test_int("strreplace9c", strreplaceb(s2, "$repl", "XXXXXXXX", sizeof(s2)), 2); test_str("strreplace9d", s1, p); test_str("strreplace9e", s2, "abcabXXXXXXXXcabcabcaXXXXXXXXbc"); /* The replacement cases which truncate start here */ memset(s2, 0xff, sizeof(s2)); test_str("strreplace10a", strcopy(s2, s1), p); test_int("strreplace10b", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 1), 2); test_str("strreplace10c", s2, "abcabXXXXXXXXcabcabcaXXXXX"); test_int("strreplace10d", *(unsigned char *)(s2 + strlen(s1) + 2), 0xff); memset(s2, 0xfe, sizeof(s2)); test_str("strreplace10e", strcopyn(s2, s1, strlen(s1)), p); test_int("strreplace10f", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 1), 2); test_str("strreplace10g", s2, "abcabXXXXXXXXcabcabcaXXXXX"); test_int("strreplace10h", *(unsigned char *)(s2 + strlen(s1) + 2), 0xfe); memset(s2, 0xfd, sizeof(s2)); test_str("strreplace10i", strcopy(s2, s1), p); test_int("strreplace10j", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1)), 1); test_str("strreplace10k", s2, "abcabXXXXXXXXcabcabca$rep"); test_int("strreplace10l", *(unsigned char *)(s2 + strlen(s1) + 1), 0xfd); memset(s2, 0xfc, sizeof(s2)); test_str("strreplace10m", strcopyn(s2, s1, strlen(s1)), p); test_int("strreplace10n", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1)), 1); test_str("strreplace10o", s2, "abcabXXXXXXXXcabcabca$rep"); test_int("strreplace10p", *(unsigned char *)(s2 + strlen(s1) + 1), 0xfc); memset(s2, 0xfb, sizeof(s2)); test_str("strreplace11a", strcopy(s2, s1), p); test_int("strreplace11b", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 4), 2); test_str("strreplace11c", s2, "abcabXXXXXXXXcabcabcaXXXXXXXX"); test_int("strreplace11d", *(unsigned char *)(s2 + strlen(s1) + 5), 0xfb); memset(s2, 0xfa, sizeof(s2)); test_str("strreplace11e", strcopyn(s2, s1, strlen(s1) + 4), p); test_int("strreplace11f", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 4), 2); test_str("strreplace11g", s2, "abcabXXXXXXXXcabcabcaXXXXXXXX"); test_int("strreplace11h", *(unsigned char *)(s2 + strlen(s1) + 5), 0xfa); test_str("strreplace12a", strcopy(s2, s1), p); test_int("strreplace12b", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 5), 2); test_str("strreplace12c", s2, "abcabXXXXXXXXcabcabcaXXXXXXXXb"); test_str("strreplace12d", strcopyn(s2, s1, strlen(s1) + 5), p); test_int("strreplace12e", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 5), 2); test_str("strreplace12f", s2, "abcabXXXXXXXXcabcabcaXXXXXXXXb"); test_str("strreplace13a", strcopy(s2, s1), p); test_int("strreplace13b", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 6), 2); test_str("strreplace13c", s2, "abcabXXXXXXXXcabcabcaXXXXXXXXbc"); test_str("strreplace13d", strcopyn(s2, s1, strlen(s1) + 6), p); test_int("strreplace13e", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 6), 2); test_str("strreplace13f", s2, "abcabXXXXXXXXcabcabcaXXXXXXXXbc"); test_str("strreplace14a", strcopy(s2, s1), p); test_int("strreplace14b", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 7), 2); test_str("strreplace14c", s2, "abcabXXXXXXXXcabcabcaXXXXXXXXbc"); test_str("strreplace14d", strcopyn(s2, s1, strlen(s1) + 7), p); test_int("strreplace14e", strreplacen(s2, "$repl", "XXXXXXXX", strlen(s1) + 7), 2); test_str("strreplace14f", s2, "abcabXXXXXXXXcabcabcaXXXXXXXXbc"); test_str("strreplace15a", strcopy(s2, s1), p); test_int("strreplace15b", strreplacen(s2, "$repl", "XXXXXXXX", 16), 1); test_str("strreplace15c", s2, "abcabXXXXXXXXcab"); test_str("strreplace15d", strcopyn(s2, s1, 16), "abcab$replcabcab"); test_int("strreplace15e", strreplacen(s2, "$repl", "XXXXXXXX", 16), 1); test_str("strreplace15f", s2, "abcabXXXXXXXXcab"); test_str("strreplace16a", strcopy(s2, s1), p); test_int("strreplace16b", strreplacen(s2, "$repl", "XXXXXXXX", 8), 1); test_str("strreplace16c", s2, "abcabXXX"); test_str("strreplace16d", strcopyn(s2, s1, 8), "abcab$re"); test_int("strreplace16e", strreplacen(s2, "$repl", "XXXXXXXX", 8), 0); test_str("strreplace16f", s2, "abcab$re"); test_str("strreplace17a", strcopy(s2, s1), p); test_int("strreplace17b", strreplacen(s2, "$repl", "XXXXXXXX", 4), 0); test_str("strreplace17c", s2, p); test_str("strreplace17d", strcopyn(s2, s1, 4), "abca"); test_int("strreplace17e", strreplacen(s2, "$repl", "XXXXXXXX", 4), 0); test_str("strreplace17f", s2, "abca"); test_str("strreplace18a", strcopy(s2, s1), p); test_int("strreplace18b", strreplacen(s2, "$repl", "XXXXXXXX", 5), 1); test_str("strreplace18c", s2, "abcab"); test_str("strreplace19a", strcopy(s2, s1), p); test_int("strreplace19b", strreplacen(s2, "$repl", "XXXXXXXX", 6), 1); test_str("strreplace19c", s2, "abcabX"); /* Briefly test trim ops */ #define WS1 " " #define WS2 "ab cd e fh dflvmd; moogle" #define WS3 "\n \t \t \n \t" #define WS (WS1 WS2 WS3) strcpy(s1, WS); test_str("trim1", trim(s1), WS2); strcpy(s1, WS); test_str("ltrim1", ltrim(s1), WS2 WS3); strcpy(s1, WS); test_str("rtrim1", rtrim(s1), WS1 WS2); strcpy(s1, WS2); test_str("trim2", trim(s1), WS2); strcpy(s1, WS2 WS3); test_str("ltrim2", ltrim(s1), WS2 WS3); strcpy(s1, WS1 WS2); test_str("rtrim2", rtrim(s1), WS1 WS2); test_ptr("trim3", trim(NULL), NULL); test_ptr("ltrim3", ltrim(NULL), NULL); test_ptr("rtrim3", rtrim(NULL), NULL); strcpy(s1, WS1 WS2 WS3 "#" WS1 WS2 WS3); test_str("trimcomment1", trimcomment(s1, '#'), WS); test_ptr("trimcomment2", trimcomment(NULL, '#'), NULL); /* Test assignments */ strcpy(s1, " abc = def "); test_int("getassign1a", getassign(s2, s3, s1), true); test_str("getassign1b", s2, "abc"); test_str("getassign1c", s3, "def"); test_int("getassign2a", getassign(s2, s3, "moogle32"), false); test_str("getassign2b", s2, ""); test_str("getassign2c", s3, ""); test_int("getassign3a", getassign(s2, s3, NULL), false); test_str("getassign3b", s2, ""); test_str("getassign3c", s3, ""); test_int("getassign4", getassign(s3, NULL, s1), false); /* Test getarg interface */ strcpy(s1, "arg0| arg1 |arg2 | arg33333|4|"); test_int("getnumargs1", getnumargs(s1, '|'), 6); test_int("getnumargs2", getnumargs(NULL, '|'), 0); test_int("getnumargs3", getnumargs("", '|'), 0); test_int("getnumargs4", getnumargs("moogle", '|'), 1); test_str("getarg1", getarg(s2, s1, 0, '|'), "arg0"); test_str("getarg2", getarg(s2, s1, 1, '|'), "arg1"); test_str("getarg3", getarg(s2, s1, 7, '|'), ""); test_str("getarg4", getarg(s2, NULL, 7, '|'), ""); test_ptr("getarg5", getarg(NULL, s1, 1, '|'), NULL); test_str("getargb1", getargb(s2, s1, 0, '|', 4), "arg"); test_str("getargb2", getargb(s2, s1, 1, '|', 4), "arg"); test_str("getargb3", getargb(s2, NULL, 1, '|', 4), ""); test_ptr("getargb4", getargb(NULL, s1, 1, '|', 100), NULL); /* Summary */ printf("Total: %d Success: %d Fail: %d\n", success + failure, success, failure); return(failure > 0 ? 1 : 0); } xscorch-0.2.1/README0000644000175000001440000000545211615371762010777 00000000000000$Header: /fridge/cvs/xscorch/README,v 1.13 2011-08-01 00:31:46 jacob Exp $ xscorch - A Scorched Earth clone Code copyright(c) 2000-2004 Justin David Smith Code copyright(c) 2000-2011 Jacob Luna Lundberg This document agrees with version 0.2.21. Please note that most of this code is licensed under version 2 of the GNU General Public License ONLY, the version that is included with this source distribution. NO later version of the General Public License is valid for the full xscorch distribution. Notes on current status ------------------------ PLEASE SEE THE NOTES BEFORE REPORTING A BUG: The doc/NOTES file in the source distribution for the more technical details about what needs to be done. The manual page contains general gameplay information. Note, there are two versions of the manual page installed -- the documents installed to the share/ directory are used by the Help menu in the game. Before sending in a request for feature X, check the TODO file and the doc/NOTES file first to see if we are already planning on implementing it. If you're bored and want to contribute to the project, check out these files to see what needs to be implemented :) Requirements ------------- The following libraries are required: GTK+ 2.20 or better (http://www.gtk.org./) These libraries are optional: MikMod 3.1.9 or better (http://mikmod.darkorb.net./) Quick installation ------------------- ./configure --help to see options ./configure make make install Run xscorch --help for brief instructions. See ChangeLog for list of changes made since the project's initial release. See the file TODO has the long list of stuff yet to exist. See the AUTHORS file for a complete list of contributors. Building without GCC --------------------- If you are building with the native compiler for your operating system, you may need to do some tweaking. In particular, you will probably want to run configure as env CFLAGS=" " ./configure to keep the project from trying to use GNU-specific warnings that may or may not be available on your system. Documentation -------------- Some documentation on implementation, and about things that still need work, is present in the doc/ directory of the source distribution. A manpage is also provided. Please note, that _two_ versions of the man page will be installed. One is a "standard" manpage, while the other is a text document which is used for the on-line game help. You may remove the latter document, but the Help menu will no longer function. Contact Information -------------------- There's a mailing list, at xscorch (a) xscorch.org. You can subscribe to the list by sending a mail message to xscorch-request (a) xscorch.org, with the word ``subscribe'' in the message body. See the AUTHORS file for the complete list of contributors and e-mail addresses. xscorch-0.2.1/acinclude.m40000644000175000001440000000530611615365103012276 00000000000000dnl acinclude.m4 dnl Support functions for configure.in. dnl dnl These programs are free software; you can redistribute them and/or dnl modify them under the terms of the GNU General Public License as dnl published by the Free Software Foundation; either version 2 of the dnl License, or (at your option) any later version. dnl dnl These programs are distributed in the hope that they will be dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with these programs; if not, write to the Free Software Foundation, dnl Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl FC_CHECK_READLINE_RUNTIME(EXTRA-LIBS, ACTION-IF-FOUND) dnl dnl This tests whether readline works at runtime. Here, "works" dnl means "doesn't dump core", as some versions do if linked dnl against wrong ncurses library. Compiles with LIBS modified dnl to include -lreadline and parameter EXTRA-LIBS. dnl Should already have checked that header and library exist. dnl dnl If readline "works", or if cross-compiling, defines dnl READLINE=1 and runs ACTION-IF-FOUND. Otherwise prints dnl a warning (and leaves READLINE untouched). dnl AC_DEFUN([FC_CHECK_READLINE_RUNTIME], [AC_MSG_CHECKING(whether readline works at runtime) templibs="$LIBS" LIBS="-lreadline $1 $LIBS" AC_TRY_RUN([ /* * testrl.c * File revision 0 * Check to make sure that readline works at runtime. * (Specifically, some readline packages link against a wrong * version of ncurses library and dump core at runtime.) * (c) 2000 Jacob Lundberg, jacob(at)gnifty.net */ #include /* We assume that the presence of readline has already been verified. */ #include #include /* Setup for readline. */ #define TMP_FILE "./conftest.readline.runtime" static void handle_readline_input_callback(char *line) { /* Generally taken from freeciv-1.11.4/server/sernet.c. */ if(line) { if(*line) add_history(line); /* printf(line); */ } } int main(void) { /* Try to init readline and see if it barfs. */ using_history(); read_history(TMP_FILE); rl_initialize(); rl_callback_handler_install("_ ", handle_readline_input_callback); rl_callback_handler_remove(); /* needed to re-set terminal */ return(0); } ], [AC_MSG_RESULT(yes) READLINE="1" [$2]], [AC_MSG_RESULT(no) AC_MSG_WARN(Readline fails at runtime and will not be used.) AC_MSG_WARN(You probably need to get a newer readline package.)], [AC_MSG_RESULT(unknown: cross-compiling) READLINE="1" [$2]]) LIBS="$templibs" ]) xscorch-0.2.1/configure.ac0000644000175000001440000002300311615364352012372 00000000000000dnl $Header: /fridge/cvs/xscorch/configure.ac,v 1.18 2011-07-31 23:44:42 jacob Exp $ dnl dnl dnl Process this file with autoconf to produce a configure script. dnl Copyright(c) 2001-2004 Justin David Smith dnl Copyright(c) 2005-2011 Jacob Luna Lundberg dnl AC_PREREQ(2.50) AC_INIT(xscorch.c) AM_INIT_AUTOMAKE(xscorch, 0.2.1) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIR([m4]) dnl Watch out for problems with prefix, datadir dnl test "x$prefix" = "xNONE" && prefix="$ac_default_prefix" test "x$datarootdir" = 'x${prefix}/share' && datarootdir="${prefix}/share" test "x$datarootdir" = 'x${datarootdir}' && datarootdir="${prefix}/share" dnl test "x$datadir" = 'x${prefix}/share' && datadir="${prefix}/share" test "x$datadir" = 'x${datarootdir}' && datadir="${prefix}/share" test "x$mandir" = 'x${prefix}/man' && mandir="${prefix}/man" test "x$mandir" = 'x${datarootdir}/man' && mandir="${prefix}/man" dnl Checks for basic programs. dnl LIBJ_CONF_EMBEDDED AM_PROG_CC_C_O AC_PROG_INSTALL AM_PROG_LIBTOOL AC_PROG_LN_S dnl This is a very ugly hack. So is libtool... ;) LIBTOOL="$LIBTOOL --preserve-dup-deps" AC_SUBST(LIBTOOL) dnl Use/enable network support? dnl AC_MSG_CHECKING([for --enable-network flag]) AC_ARG_ENABLE(network, [ --enable-network Enable network gameplay [yes]], , enable_network=yes) if test "x$enable_network" != "xyes"; then AC_MSG_RESULT([Network play not enabled]) NETWORK=0 else AC_MSG_RESULT([Network enabled]) NETWORK=1 fi AC_SUBST(NETWORK) AM_CONDITIONAL(NETWORK, test "x$NETWORK" != "x0") dnl Check for --with-readline flags dnl READLINE="0" LIBREADLINE_LIBS="" if test "x$NETWORK" = "x1"; then AC_MSG_CHECKING([for --with-readline flag]) AC_ARG_WITH(readline, [ --with-readline support fancy command line editing], WITH_READLINE=$withval, dnl yes/no - required to use / never use WITH_READLINE="maybe" dnl maybe - use if found [default] ) AC_MSG_RESULT([$WITH_READLINE]) if test "$WITH_READLINE" = "yes"; then AC_CHECK_LIB(readline, rl_callback_handler_install, [READLINE="1", LIBREADLINE_LIBS="-lreadline -ltermcap"], AC_MSG_ERROR([Specified --with-readline but did not find library.])) AC_CHECK_HEADER(readline/readline.h, , AC_MSG_ERROR([Specified --with-readline; found library but not header file. You may need to install a readline \"development\" package.])) elif test "$WITH_READLINE" = "maybe"; then AC_CHECK_HEADER(readline/readline.h, have_readline_h=1, have_readline_h=0) if test "$have_readline_h" = "1"; then AC_CHECK_LIB(readline, rl_callback_handler_install, have_readline_lib=1, have_readline_lib=0) if test "$have_readline_lib" = "1"; then FC_CHECK_READLINE_RUNTIME("", [LIBREADLINE_LIBS="-lreadline"]) fi fi fi else echo "No network support, not checking for libreadline." fi AM_CONDITIONAL(READLINE, test "x$READLINE" = "x1") AC_SUBST(READLINE) AC_SUBST(LIBREADLINE_LIBS) dnl Check for --with-gtk flags dnl dnl Disable old GTK and GNOME subsystems GTK12=0 GNOME=0 AM_PATH_GTK_2_0(2.20.0, [GTK20=1; echo "GTK libs: $GTK_LIBS" echo "GTK flags: $GTK_CFLAGS"], [GTK20=0; echo "GTK 2.20 not found, but you can ignore the errors above if you do not want an interface"]) LIBS= dnl Figure out if ANY GTK interface is being used. dnl if test "x$GTK12" = "x1" -o "x$GTK20" = "x1"; then ANYGTK=1 else ANYGTK=0 fi dnl GTK substitutions dnl AM_CONDITIONAL(GTK12, test "x$GTK12" = "x1") AM_CONDITIONAL(GTK20, test "x$GTK20" = "x1") AM_CONDITIONAL(ANYGTK, test "x$ANYGTK" = "x1") AC_SUBST(GTK12) AC_SUBST(GTK20) AC_SUBST(ANYGTK) AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) dnl GNOME substitutions dnl AM_CONDITIONAL(GNOME, test "x$GNOME" = "x1") AC_SUBST(GNOME) AC_SUBST(GNOME_DESKTOP) AC_SUBST(GNOME_PIXMAPS) dnl Check for --enable-sound flag dnl if test "x$ANYGTK" = "x1"; then AC_MSG_CHECKING([for --enable-sound flag]) AC_ARG_ENABLE(sound, [ --enable-sound Enable sound/music [yes]], , enable_sound=yes) if test "x$enable_sound" != "xyes"; then AC_MSG_RESULT([Sound/music not enabled]) MIKMOD=0 else AC_MSG_RESULT([Sound/music enabled]) MIKMOD=1 fi else echo "No client being built, so disabling MikMod support." MIKMOD=0 fi dnl Check for --with-mikmod flags dnl if test "x$MIKMOD" = "x1"; then AM_PATH_LIBMIKMOD(3.1.5, [MIKMOD=1; echo "libmikmod libs: $LIBMIKMOD_LIBS" echo "libmikmod flags: $LIBMIKMOD_CFLAGS"], [MIKMOD=0; echo "libmikmod not found, but you can ignore the errors above if you do not want sound support"]) LIBS= fi AM_CONDITIONAL(MIKMOD, test "x$MIKMOD" = "x1") AC_SUBST(MIKMOD) dnl Make sure we're building something at all... dnl if test "x$ANYGTK" = "x0" -a "x$NETWORK" = "x0"; then AC_MSG_ERROR([GTK and network support disabled. Nothing left to build!]) fi dnl Check C structures that we will rely on later dnl critical_failure=0 AC_CHECK_HEADERS(sys/time.h, , critical_failure=1) AC_CHECK_HEADERS(sys/stat.h, , critical_failure=1) AC_CHECK_HEADERS(unistd.h, , critical_failure=1) if test "x$critical_failure" = "x1"; then AC_MSG_ERROR([Required header missing, aborting.]) fi AC_HEADER_TIME if test "x$NETWORK" = "x1"; then AC_CHECK_HEADERS(sys/types.h, , critical_failure=1) AC_CHECK_HEADERS(sys/socket.h, , critical_failure=1) AC_CHECK_HEADERS(netdb.h, , critical_failure=1) AC_CHECK_HEADERS(netinet/in.h, , critical_failure=1) AC_CHECK_HEADERS(arpa/inet.h, , critical_failure=1) AC_CHECK_HEADERS(errno.h, , critical_failure=1) AC_CHECK_HEADERS(fcntl.h, , critical_failure=1) AC_CHECK_HEADERS(string.h, , critical_failure=1) if test "x$critical_failure" = "x1"; then AC_MSG_ERROR([Required network header missing, aborting.]) fi fi dnl Checks for library functions. dnl AC_CHECK_FUNCS(gettimeofday, , [AC_MSG_ERROR([gettimeofday() not found, aborting.])]) AC_CHECK_FUNCS(usleep, , [AC_MSG_ERROR([usleep() not found, aborting.])]) AC_CHECK_FUNCS(memcpy, , [AC_MSG_ERROR([memcpy() not found, aborting.])]) AC_CHECK_FUNCS(memset, , [AC_MSG_ERROR([memset() not found, aborting.])]) AC_CHECK_FUNCS(vsnprintf, , [AC_MSG_ERROR([vsnprintf() not found, aborting.])]) AC_CHECK_FUNCS(stat, , [AC_MSG_ERROR([stat() not found, aborting.])]) AC_CHECK_FUNCS(strnlen) dnl Check if we should use the built-in getopt dnl AC_CHECK_FUNCS(getopt_long, NEED_GETOPT=0, NEED_GETOPT=1) AM_CONDITIONAL(NEED_GETOPT, test "x$NEED_GETOPT" = "x1") dnl Checks for network library functions dnl NET_LIBS="" AC_SUBST(NET_LIBS) if test "x$NETWORK" = "x1"; then AC_CHECK_FUNCS(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, NET_LIBS="$NET_LIBS -lnsl", [AC_MSG_ERROR([gethostbyname() network function not found, aborting.])])]) AC_CHECK_FUNCS(socket, , [AC_CHECK_LIB(socket, socket, NET_LIBS="$NET_LIBS -lsocket", [AC_MSG_ERROR([socket() network function not found, aborting.])])]) echo "Network libraries we're linking against: "`if test "x$NET_LIBS" = "x"; then echo "(none)"; else echo "$NET_LIBS"; fi` fi dnl Checks whether netdb.h provides host.h_addr_list dnl AC_CHECK_MEMBER([struct hostent.h_addr_list], AC_DEFINE([HOSTENT_H_ADDR], [h_addr_list@<:@0@:>@], [How to access hostent.haddr]), AC_DEFINE([HOSTENT_H_ADDR], [h_addr], [How to access hostent.haddr]), [[#include ]]) dnl A random check dnl AC_CHECK_LIB(reality, convolution, , , ) dnl Checks for X Windows dnl if test "x$ANYGTK" = "x1"; then AC_PATH_XTRA AC_CHECK_LIB(X11, XOpenDisplay, , [AC_MSG_ERROR([libX11 is required for GTK interface, aborting.])], $X_LIBS) LIBS= fi AC_SUBST(X_LIBS) LIBJ_PROG_CC_CFLAGS dnl Output the makefiles and headers dnl AC_OUTPUT([ Makefile xscorch.h libj/libj.h sai/Makefile sconsole/Makefile sgame/Makefile sgtk/Makefile sgtk/swidgets/Makefile snet/Makefile snet/tcpnet/Makefile ssound/Makefile sutil/Makefile libj/Makefile libj/jreg/Makefile libj/jstr/Makefile data/Makefile doc/Makefile img/Makefile snd/Makefile ]) dnl Display final configure status dnl echo "" echo "$PACKAGE $VERSION Configuration:" echo " Prefix: $prefix" echo " Datadir: $datadir" echo " Mandir: $mandir" echo " CFLAGS: $CFLAGS" echo -n " Sound: " LIBJ_PRINT_YES_NO($MIKMOD) echo -n " Network: " LIBJ_PRINT_YES_NO($NETWORK) echo -n " Readline: " LIBJ_PRINT_YES_NO($READLINE) echo -n " GTK 2+: " LIBJ_PRINT_YES_NO($GTK20) echo "" if test "x$NETWORK" = "x1"; then echo "*** WARNING ***" echo "Network games are UNSTABLE. PLEASE read doc/NETWORK before sending in bug" echo "reports. Also, check out the document if you are interested in network" echo "development. We appreciate any feedback/bugfixes on the networking code." echo "" fi if test "x$MIKMOD" = "x1"; then echo "*** NOTE ***" echo "You have enabled sound support, but currently there is no music, nor are" echo "there sound effects in the game. xscorch will be linked to mikmod but the" echo "sound options will currently do nothing. We are currently looking for" echo "volunteers to create music for xscorch. If you'd like to write us some" echo "tracks, please drop us an e-mail!" echo "" fi xscorch-0.2.1/aclocal.m40000644000175000001440000127466011615371712011764 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Configure paths for GTK+ # Owen Taylor 1997-2001 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, dnl pass to pkg-config dnl AC_DEFUN([AM_PATH_GTK_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) pkg_config_args=gtk+-2.0 for module in . $4 do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl dnl Now check if the installed GTK+ is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; fclose (fopen ("conf.gtktest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) # Configure paths for libmikmod # # Derived from glib.m4 (Owen Taylor 97-11-3) # Improved by Chris Butler # dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and dnl LIBMIKMOD_LDADD dnl AC_DEFUN([AM_PATH_LIBMIKMOD], [dnl dnl Get the cflags and libraries from the libmikmod-config script dnl AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)], libmikmod_config_prefix="$withval", libmikmod_config_prefix="") AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)], libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="") AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program], , enable_libmikmodtest=yes) if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no) min_libmikmod_version=ifelse([$1], ,3.1.5,$1) AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version) no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" AC_LANG_SAVE AC_LANG_C CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" dnl dnl Now check if the installed libmikmod is sufficiently new. (Also sanity dnl checks the results of libmikmod-config to some extent dnl rm -f conf.mikmodtest AC_TRY_RUN([ #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main() { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; char *tmp_version; system("touch conf.mikmodtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_libmikmod_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255; libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255; libmikmod_micro_version=(MikMod_GetVersion() ) & 255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_RESTORE fi fi if test "x$no_libmikmod" = x ; then AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`]) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([ #include #include ], [ return (MikMod_GetVersion()!=0); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_RESTORE fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBMIKMOD_CFLAGS) AC_SUBST(LIBMIKMOD_LIBS) AC_SUBST(LIBMIKMOD_LDADD) rm -f conf.mikmodtest ]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3293 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4]) m4_define([LT_PACKAGE_REVISION], [1.3293]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' macro_revision='1.3293' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([libj/libj.m4]) m4_include([libj/libjconf.m4]) m4_include([acinclude.m4]) xscorch-0.2.1/Makefile.am0000644000175000001440000000423611615330556012146 00000000000000## $Header: /fridge/cvs/xscorch/Makefile.am,v 1.23 2011-07-31 19:47:58 jacob Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.11 ACLOCAL_AMFLAGS = -I m4 # Subdirectories to build in # SUBDIRS = doc sai sconsole sgame sgtk snet ssound sutil libj data img snd # Extra distribution files, and cleanfiles # EXTRA_DIST = TODO CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig if ANYGTK GTK_PROGRAM=xscorch else GTK_PROGRAM= endif if NETWORK NETWORK_PROGRAM=xscorch-server NETWORK_LD_ADD=$(NET_LIBS) snet/libscorch_net.a snet/tcpnet/libtcpnet.a else NETWORK_PROGRAM= NETWORK_LD_ADD= endif if MIKMOD MIKMOD_LD_ADD=ssound/libscorch_sound.a else MIKMOD_LD_ADD=ssound/libscorch_sound_null.a endif bin_PROGRAMS=$(GTK_PROGRAM) $(NETWORK_PROGRAM) xscorch_SOURCES = \ xscorch.c xscorch_LDADD = \ sgame/libscorch_game.a \ sgtk/libscorch_gtk.a \ sgtk/swidgets/libscorch_widget_gtk.a \ sai/libscorch_ai.a \ $(MIKMOD_LD_ADD) \ $(NETWORK_LD_ADD) \ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ libj/jstr/libjstr.a \ -lm \ $(GTK_LIBS) \ $(LIBMIKMOD_LIBS) xscorch_server_SOURCES = \ xscorch.c xscorch_server_LDADD = \ sgame/libscorch_game.a \ sconsole/libscorch_console.a \ sai/libscorch_ai.a \ ssound/libscorch_sound_null.a \ $(NETWORK_LD_ADD) \ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ libj/jstr/libjstr.a \ -lm \ $(LIBREADLINE_LIBS) work-list: egrep -n '(TEMP(\W|_)|#warning\W)' `find . \! -path ./old/\* -a -name \*.\[ch\]` | sort > doc/work-list.txt INCLUDES=-Isgame -Isgtk install-data-local: @echo "" @echo "" @echo "*** Installation successful ***" @echo "" @echo "Please note: Until you use the 'Save Options' command in" @echo "xscorch, you will get a message indicating that the user" @echo "configuration could not be loaded. This is normal and will" @echo "not affect gameplay; the program is just letting you know" @echo "that it will use the game defaults instead." @echo "" @echo "Note also: the keybindings for shields have changed. See" @echo "the ChangeLog or the manual page for details." @echo "" @echo "Enjoy the game!" @echo "" @echo "" xscorch-0.2.1/Makefile.in0000644000175000001440000007607511615371716012174 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/xscorch.h.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS TODO compile config.guess config.sub \ depcomp install-sh ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = xscorch.h CONFIG_CLEAN_VPATH_FILES = @ANYGTK_TRUE@am__EXEEXT_1 = xscorch$(EXEEXT) @NETWORK_TRUE@am__EXEEXT_2 = xscorch-server$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_xscorch_OBJECTS = xscorch.$(OBJEXT) xscorch_OBJECTS = $(am_xscorch_OBJECTS) am__DEPENDENCIES_1 = @NETWORK_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @NETWORK_TRUE@ snet/libscorch_net.a snet/tcpnet/libtcpnet.a xscorch_DEPENDENCIES = sgame/libscorch_game.a sgtk/libscorch_gtk.a \ sgtk/swidgets/libscorch_widget_gtk.a sai/libscorch_ai.a \ $(MIKMOD_LD_ADD) $(am__DEPENDENCIES_2) sutil/libscorch_util.a \ sgame/libscorch_game.a libj/jreg/libjreg.a libj/jstr/libjstr.a \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_xscorch_server_OBJECTS = xscorch.$(OBJEXT) xscorch_server_OBJECTS = $(am_xscorch_server_OBJECTS) xscorch_server_DEPENDENCIES = sgame/libscorch_game.a \ sconsole/libscorch_console.a sai/libscorch_ai.a \ ssound/libscorch_sound_null.a $(am__DEPENDENCIES_2) \ sutil/libscorch_util.a sgame/libscorch_game.a \ libj/jreg/libjreg.a libj/jstr/libjstr.a $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(xscorch_SOURCES) $(xscorch_server_SOURCES) DIST_SOURCES = $(xscorch_SOURCES) $(xscorch_server_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.11 ACLOCAL_AMFLAGS = -I m4 # Subdirectories to build in # SUBDIRS = doc sai sconsole sgame sgtk snet ssound sutil libj data img snd # Extra distribution files, and cleanfiles # EXTRA_DIST = TODO CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig @ANYGTK_FALSE@GTK_PROGRAM = @ANYGTK_TRUE@GTK_PROGRAM = xscorch @NETWORK_FALSE@NETWORK_PROGRAM = @NETWORK_TRUE@NETWORK_PROGRAM = xscorch-server @NETWORK_FALSE@NETWORK_LD_ADD = @NETWORK_TRUE@NETWORK_LD_ADD = $(NET_LIBS) snet/libscorch_net.a snet/tcpnet/libtcpnet.a @MIKMOD_FALSE@MIKMOD_LD_ADD = ssound/libscorch_sound_null.a @MIKMOD_TRUE@MIKMOD_LD_ADD = ssound/libscorch_sound.a xscorch_SOURCES = \ xscorch.c xscorch_LDADD = \ sgame/libscorch_game.a \ sgtk/libscorch_gtk.a \ sgtk/swidgets/libscorch_widget_gtk.a \ sai/libscorch_ai.a \ $(MIKMOD_LD_ADD) \ $(NETWORK_LD_ADD) \ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ libj/jstr/libjstr.a \ -lm \ $(GTK_LIBS) \ $(LIBMIKMOD_LIBS) xscorch_server_SOURCES = \ xscorch.c xscorch_server_LDADD = \ sgame/libscorch_game.a \ sconsole/libscorch_console.a \ sai/libscorch_ai.a \ ssound/libscorch_sound_null.a \ $(NETWORK_LD_ADD) \ sutil/libscorch_util.a \ sgame/libscorch_game.a \ libj/jreg/libjreg.a \ libj/jstr/libjstr.a \ -lm \ $(LIBREADLINE_LIBS) INCLUDES = -Isgame -Isgtk all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 xscorch.h: $(top_builddir)/config.status $(srcdir)/xscorch.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xscorch$(EXEEXT): $(xscorch_OBJECTS) $(xscorch_DEPENDENCIES) @rm -f xscorch$(EXEEXT) $(LINK) $(xscorch_OBJECTS) $(xscorch_LDADD) $(LIBS) xscorch-server$(EXEEXT): $(xscorch_server_OBJECTS) $(xscorch_server_DEPENDENCIES) @rm -f xscorch-server$(EXEEXT) $(LINK) $(xscorch_server_OBJECTS) $(xscorch_server_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xscorch.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags ctags-recursive dist \ dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS work-list: egrep -n '(TEMP(\W|_)|#warning\W)' `find . \! -path ./old/\* -a -name \*.\[ch\]` | sort > doc/work-list.txt install-data-local: @echo "" @echo "" @echo "*** Installation successful ***" @echo "" @echo "Please note: Until you use the 'Save Options' command in" @echo "xscorch, you will get a message indicating that the user" @echo "configuration could not be loaded. This is normal and will" @echo "not affect gameplay; the program is just letting you know" @echo "that it will use the game defaults instead." @echo "" @echo "Note also: the keybindings for shields have changed. See" @echo "the ChangeLog or the manual page for details." @echo "" @echo "Enjoy the game!" @echo "" @echo "" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/config.h.in0000644000175000001440000001036411615360057012133 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `reality' library (-lreality). */ #undef HAVE_LIBREALITY /* Define to 1 if you have the `X11' library (-lX11). */ #undef HAVE_LIBX11 /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the `stat' function. */ #undef HAVE_STAT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strnlen' function. */ #undef HAVE_STRNLEN /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* How to access hostent.haddr */ #undef HOSTENT_H_ADDR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `int16_t', as computed by sizeof. */ #undef SIZEOF_INT16_T /* The size of `int32_t', as computed by sizeof. */ #undef SIZEOF_INT32_T /* The size of `int64_t', as computed by sizeof. */ #undef SIZEOF_INT64_T /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif xscorch-0.2.1/xscorch.h.in0000644000175000001440000001476711615366343012356 00000000000000/* $Header: /fridge/cvs/xscorch/xscorch.h.in,v 1.36 2011-08-01 00:01:39 jacob Exp $ */ /* xscorch - xscorch.h Copyright(c) 2000-2004 Justin David Smith Copyright(c) 2000-2004 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Main header file for xscorch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __xscorch_h_included #define __xscorch_h_included /* Include files */ #include #include #include #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ /* Pick up libj definitions */ #include /* Time inclusion */ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif /*** Profile SUBSYSTEM ***/ #define SC_PROFILE_BEGIN(desc) { struct timeval profile_timer1, profile_timer2; \ long profile_sec, profile_usec; \ const char *profile_desc = (desc); \ gettimeofday(&profile_timer1, NULL); #define SC_PROFILE_END gettimeofday(&profile_timer2, NULL); \ profile_usec = profile_timer2.tv_usec - profile_timer1.tv_usec; \ profile_sec = profile_timer2.tv_sec - profile_timer1.tv_sec; \ while(profile_usec < 0) profile_usec += 1000000, profile_sec--; \ printf("%s: %ld.%06ld\n", profile_desc, profile_sec, profile_usec); } /* Debugging constants */ #define __debugging_macros 0 #if __debugging_macros #define SC_DEBUG_PRINTF(args...) { printf(args); fflush(stdout); } #define SC_DEBUG_HEADING() SC_DEBUG_PRINTF("%s(%d): %s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__) #define SC_DEBUG_MSG(fmt, args...) { SC_DEBUG_HEADING(); SC_DEBUG_PRINTF(fmt "\n", args); } #define SC_DEBUG_ENTER(fmt, args...) { SC_DEBUG_HEADING(); SC_DEBUG_PRINTF("enter " fmt "\n", args); } #define SC_DEBUG_ENTER_() SC_DEBUG_ENTER("%s", "") #define SC_DEBUG_EXIT(fmt, args...) { SC_DEBUG_HEADING(); SC_DEBUG_PRINTF("exit " fmt "\n", args); } #define SC_DEBUG_EXIT_() SC_DEBUG_EXIT("%s", "") #endif /* __debugging_macros */ /* Check for definition of M_PI */ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif /* M_PI defined? */ #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 #endif /* M_SQRT2 defined? */ /* Other useful generic macros */ #ifndef SQR #define SQR(a) ((a) * (a)) #endif /* SQR defined? */ #ifndef DIST #define DIST(a,b) (sqrt(SQR(a) + SQR(b))) #endif /* DIST defined? */ #ifndef SGN #define SGN(a) ((a) < 0 ? -1 : 1) #endif /* SGN defined? */ /* This is a function that divides two ints and rounds to the nearest int. */ #ifndef INT_ROUND_DIV #define INT_ROUND_DIV(a,b) ((a)/(b) + (((a)%(b)) << 1) / (b)) #endif /* INT_ROUND_DIV defined? */ /* Configure-defined flags */ #define USE_SOUND @MIKMOD@ /* Enable sound support? */ #define USE_NETWORK @NETWORK@ /* Enable network support? */ #define USE_READLINE @READLINE@ /* Use the readline library? */ #define GTK_ENABLED @ANYGTK@ /* Enable *any* GTK support? */ #define GTK12_ENABLED @GTK12@ /* Enable GTK 1.2 support? */ #define GTK20_ENABLED @GTK20@ /* Enable GTK 2.0 support? */ #define GNOME_ENABLED @GNOME@ /* Enable GNOME support? */ /* Filenames, paths */ #define SC_FILENAME_LENGTH 0x1000 /* Max. length for a filename. */ #define SC_FONT_LENGTH 0x1000 /* Max. length for a font. */ #define SC_GLOBAL_DIR "@datadir@/xscorch/" /* Global information directory */ #define SC_LOCAL_CONFIG_DIR ".xscorch" /* Config in home directory */ #define SC_LOCAL_CONFIGURATION "config" /* Local config file */ #define SC_SOUND_DIR "sounds" /* Sound subdirectory */ #define SC_IMAGE_DIR "images" /* Image subdirectory */ #define SC_ACCESSORY_FILE "accessories.def" /* Data file supplying accessory defs */ #define SC_TANK_PROFILE_FILE "profiles.def" /* Data file supplying tank profiles */ #define SC_SCORING_FILE "scorings.def" /* Data file supplying scoring defs */ #define SC_WEAPON_FILE "weapons.def" /* Data file supplying weapon defs */ /* Player and round limits -- these are universal enough that they really ought to be at the toplevel include file. */ #define SC_MAX_PLAYERS 10 /* Total number of players allowed. */ #define SC_MAX_ROUNDS 1000 /* Total number of rounds allowed. */ /* General field definitions */ #define SC_DEF_FIELD_WIDTH 800 /* Width of field in pixels */ #define SC_DEF_FIELD_HEIGHT 600 /* Height of field in pixels */ #define SC_DEF_MAX_HEIGHT 550 /* Maximum initial height of ground */ #define SC_MIN_FIELD_WIDTH 320 /* Minimum Width of field in pixels */ #define SC_MIN_FIELD_HEIGHT 240 /* Minimum Height of field in pixels */ #define SC_MAX_FIELD_WIDTH 1024 /* Maximum Width of field in pixels */ #define SC_MAX_FIELD_HEIGHT 768 /* Maximum Height of field in pixels */ /* Miscellaneous */ #define SC_SLEEP_TIME 5 /* Timer sleep time (in msec) */ #define SC_TIME_ETERNITY 10 /* Units are subjective */ /* (eh, too much xscorch coding lately) */ /* STFU automake */ #define SC_DATAROOTDIR @datarootdir@ #endif /* __xscorch_h_included */ xscorch-0.2.1/configure0000755000175000001440000172610611615371717012035 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="xscorch.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF NET_LIBS NEED_GETOPT_FALSE NEED_GETOPT_TRUE MIKMOD MIKMOD_FALSE MIKMOD_TRUE LIBMIKMOD_LDADD LIBMIKMOD_LIBS LIBMIKMOD_CFLAGS LIBMIKMOD_CONFIG GNOME_PIXMAPS GNOME_DESKTOP GNOME GNOME_FALSE GNOME_TRUE ANYGTK GTK20 GTK12 ANYGTK_FALSE ANYGTK_TRUE GTK20_FALSE GTK20_TRUE GTK12_FALSE GTK12_TRUE GTK_LIBS GTK_CFLAGS PKG_CONFIG LIBREADLINE_LIBS READLINE READLINE_FALSE READLINE_TRUE NETWORK_FALSE NETWORK_TRUE NETWORK OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL LIBJ_USE_LIBC_STRING_FALSE LIBJ_USE_LIBC_STRING_TRUE LIBJ_C99_STANDARD LIBJ_USE_LIBC_STRING LIBJ_STANDALONE_FALSE LIBJ_STANDALONE_TRUE LIBJ_STANDALONE LIBJ_QWORD_TYPE LIBJ_DWORD_TYPE LIBJ_WORD_TYPE LIBJ_BYTE_TYPE LIBJ_HAVE_GETTIMEOFDAY LIBJ_TIME_WITH_SYS_TIME LIBJ_HAVE_SYS_TIME_H EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBJ_LT_AGE LIBJ_LT_REVISION LIBJ_LT_CURRENT LIBJ_VERSION_EXPR LIBJ_VERSION_PATCH LIBJ_VERSION_MINOR LIBJ_VERSION_MAJOR LIBJ_VERSION MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_network with_readline enable_gtktest enable_sound with_libmikmod_prefix with_libmikmod_exec_prefix enable_libmikmodtest with_x enable_opt enable_warn enable_debug ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-network Enable network gameplay yes --disable-gtktest do not try to compile and run a test GTK+ program --enable-sound Enable sound/music yes --disable-libmikmodtest Do not try to compile and run a test libmikmod program --enable-opt Enable optimizations [yes if CFLAGS not set] --enable-warn Enable warnings [yes if CFLAGS not set] --enable-warn-error Enable warnings as errors [yes if CFLAGS not set] --enable-debug Enable debug flags [no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-readline support fancy command line editing --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional) --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional) --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else 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_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=xscorch VERSION=0.2.1 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE test "x$prefix" = "xNONE" && prefix="$ac_default_prefix" test "x$datarootdir" = 'x${prefix}/share' && datarootdir="${prefix}/share" test "x$datarootdir" = 'x${datarootdir}' && datarootdir="${prefix}/share" test "x$datadir" = 'x${prefix}/share' && datadir="${prefix}/share" test "x$datadir" = 'x${datarootdir}' && datadir="${prefix}/share" test "x$mandir" = 'x${prefix}/man' && mandir="${prefix}/man" test "x$mandir" = 'x${datarootdir}/man' && mandir="${prefix}/man" LIBJ_VERSION_MAJOR=4 LIBJ_VERSION_MINOR=1 LIBJ_VERSION_PATCH=3 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libj version number" >&5 $as_echo_n "checking for libj version number... " >&6; } LIBJ_VERSION="${LIBJ_VERSION_MAJOR}.${LIBJ_VERSION_MINOR}.${LIBJ_VERSION_PATCH}" LIBJ_VERSION_EXPR="((((long)${LIBJ_VERSION_MAJOR} & 0xff) << 24) | (((long)${LIBJ_VERSION_MINOR} & 0xff) << 16) | (((long)${LIBJ_VERSION_PATCH} & 0xff) << 8)) /* Version ${LIBJ_VERSION} */" LIBJ_LT_CURRENT=`expr $LIBJ_VERSION_MAJOR + $LIBJ_VERSION_MINOR` LIBJ_LT_REVISION=$LIBJ_VERSION_PATCH LIBJ_LT_AGE=$LIBJ_VERSION_MINOR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBJ_VERSION" >&5 $as_echo "$LIBJ_VERSION" >&6; } # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi done if test "$ac_cv_header_sys_time_h" = "yes"; then LIBJ_HAVE_SYS_TIME_H=1 else LIBJ_HAVE_SYS_TIME_H=0 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi if test "$ac_cv_header_time" = "yes"; then LIBJ_TIME_WITH_SYS_TIME=1 else LIBJ_TIME_WITH_SYS_TIME=0 fi for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF fi done if test "$ac_cv_func_gettimeofday" = "yes"; then LIBJ_HAVE_GETTIMEOFDAY=1 else LIBJ_HAVE_GETTIMEOFDAY=0 fi for ac_func in snprintf do : ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SNPRINTF 1 _ACEOF else as_fn_error $? "snprintf not found, aborting" "$LINENO" 5 fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 $as_echo "$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int16_t" >&5 $as_echo_n "checking size of int16_t... " >&6; } if ${ac_cv_sizeof_int16_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int16_t))" "ac_cv_sizeof_int16_t" "$ac_includes_default"; then : else if test "$ac_cv_type_int16_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int16_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int16_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int16_t" >&5 $as_echo "$ac_cv_sizeof_int16_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT16_T $ac_cv_sizeof_int16_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int32_t" >&5 $as_echo_n "checking size of int32_t... " >&6; } if ${ac_cv_sizeof_int32_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int32_t))" "ac_cv_sizeof_int32_t" "$ac_includes_default"; then : else if test "$ac_cv_type_int32_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int32_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int32_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int32_t" >&5 $as_echo "$ac_cv_sizeof_int32_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT32_T $ac_cv_sizeof_int32_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int64_t" >&5 $as_echo_n "checking size of int64_t... " >&6; } if ${ac_cv_sizeof_int64_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int64_t))" "ac_cv_sizeof_int64_t" "$ac_includes_default"; then : else if test "$ac_cv_type_int64_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int64_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int64_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int64_t" >&5 $as_echo "$ac_cv_sizeof_int64_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT64_T $ac_cv_sizeof_int64_t _ACEOF LIBJ_BYTE_TYPE=char case 2 in $ac_cv_sizeof_short) LIBJ_WORD_TYPE=short ;; $ac_cv_sizeof_int) LIBJ_WORD_TYPE=int ;; $ac_cv_sizeof_int16_t) LIBJ_WORD_TYPE=int16_t ;; *) as_fn_error $? "Cannot find a suitable 16-bit data type" "$LINENO" 5 esac case 4 in $ac_cv_sizeof_short) LIBJ_DWORD_TYPE=short ;; $ac_cv_sizeof_int) LIBJ_DWORD_TYPE=int ;; $ac_cv_sizeof_long) LIBJ_DWORD_TYPE=long ;; $ac_cv_sizeof_int32_t) LIBJ_DWORD_TYPE=int32_t ;; *) as_fn_error $? "Cannot find a suitable 32-bit data type" "$LINENO" 5 esac case 8 in $ac_cv_sizeof_int) LIBJ_QWORD_TYPE=int ;; $ac_cv_sizeof_long_long) LIBJ_QWORD_TYPE="long long";; $ac_cv_sizeof_int64_t) LIBJ_QWORD_TYPE=int64_t ;; *) as_fn_error $? "Cannot find a suitable 64-bit data type" "$LINENO" 5 esac LIBJ_STANDALONE=0 if false; then LIBJ_STANDALONE_TRUE= LIBJ_STANDALONE_FALSE='#' else LIBJ_STANDALONE_TRUE='#' LIBJ_STANDALONE_FALSE= fi LIBJ_USE_LIBC_STRING=1 LIBJ_C99_STANDARD=0 if true; then LIBJ_USE_LIBC_STRING_TRUE= LIBJ_USE_LIBC_STRING_FALSE='#' else LIBJ_USE_LIBC_STRING_TRUE='#' LIBJ_USE_LIBC_STRING_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4' macro_revision='1.3293' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else 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_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else 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_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else 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_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else 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_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else 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_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else 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_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else 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_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else 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_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else 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_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else 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_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else 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_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else 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_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else 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_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else 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_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else 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_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else 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_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else 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_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else 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_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else 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_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else 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_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else 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_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else 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_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' lt_prog_compiler_pic='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi LIBTOOL="$LIBTOOL --preserve-dup-deps" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-network flag" >&5 $as_echo_n "checking for --enable-network flag... " >&6; } # Check whether --enable-network was given. if test "${enable_network+set}" = set; then : enableval=$enable_network; else enable_network=yes fi if test "x$enable_network" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Network play not enabled" >&5 $as_echo "Network play not enabled" >&6; } NETWORK=0 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Network enabled" >&5 $as_echo "Network enabled" >&6; } NETWORK=1 fi if test "x$NETWORK" != "x0"; then NETWORK_TRUE= NETWORK_FALSE='#' else NETWORK_TRUE='#' NETWORK_FALSE= fi READLINE="0" LIBREADLINE_LIBS="" if test "x$NETWORK" = "x1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-readline flag" >&5 $as_echo_n "checking for --with-readline flag... " >&6; } # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; WITH_READLINE=$withval else WITH_READLINE="maybe" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_READLINE" >&5 $as_echo "$WITH_READLINE" >&6; } if test "$WITH_READLINE" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -lreadline" >&5 $as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 rl_callback_handler_install (); int main () { return rl_callback_handler_install (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_rl_callback_handler_install=yes else ac_cv_lib_readline_rl_callback_handler_install=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 $as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } if test "x$ac_cv_lib_readline_rl_callback_handler_install" = xyes; then : READLINE="1", LIBREADLINE_LIBS="-lreadline -ltermcap" else as_fn_error $? "Specified --with-readline but did not find library." "$LINENO" 5 fi ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" if test "x$ac_cv_header_readline_readline_h" = xyes; then : else as_fn_error $? "Specified --with-readline; found library but not header file. You may need to install a readline \"development\" package." "$LINENO" 5 fi elif test "$WITH_READLINE" = "maybe"; then ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" if test "x$ac_cv_header_readline_readline_h" = xyes; then : have_readline_h=1 else have_readline_h=0 fi if test "$have_readline_h" = "1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install in -lreadline" >&5 $as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 rl_callback_handler_install (); int main () { return rl_callback_handler_install (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_rl_callback_handler_install=yes else ac_cv_lib_readline_rl_callback_handler_install=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 $as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } if test "x$ac_cv_lib_readline_rl_callback_handler_install" = xyes; then : have_readline_lib=1 else have_readline_lib=0 fi if test "$have_readline_lib" = "1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline works at runtime" >&5 $as_echo_n "checking whether readline works at runtime... " >&6; } templibs="$LIBS" LIBS="-lreadline "" $LIBS" if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown: cross-compiling" >&5 $as_echo "unknown: cross-compiling" >&6; } READLINE="1" LIBREADLINE_LIBS="-lreadline" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* * testrl.c * File revision 0 * Check to make sure that readline works at runtime. * (Specifically, some readline packages link against a wrong * version of ncurses library and dump core at runtime.) * (c) 2000 Jacob Lundberg, jacob(at)gnifty.net */ #include /* We assume that the presence of readline has already been verified. */ #include #include /* Setup for readline. */ #define TMP_FILE "./conftest.readline.runtime" static void handle_readline_input_callback(char *line) { /* Generally taken from freeciv-1.11.4/server/sernet.c. */ if(line) { if(*line) add_history(line); /* printf(line); */ } } int main(void) { /* Try to init readline and see if it barfs. */ using_history(); read_history(TMP_FILE); rl_initialize(); rl_callback_handler_install("_ ", handle_readline_input_callback); rl_callback_handler_remove(); /* needed to re-set terminal */ return(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } READLINE="1" LIBREADLINE_LIBS="-lreadline" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Readline fails at runtime and will not be used." >&5 $as_echo "$as_me: WARNING: Readline fails at runtime and will not be used." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You probably need to get a newer readline package." >&5 $as_echo "$as_me: WARNING: You probably need to get a newer readline package." >&2;} fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$templibs" fi fi fi else echo "No network support, not checking for libreadline." fi if test "x$READLINE" = "x1"; then READLINE_TRUE= READLINE_FALSE='#' else READLINE_TRUE='#' READLINE_FALSE= fi GTK12=0 GNOME=0 # Check whether --enable-gtktest was given. if test "${enable_gtktest+set}" = set; then : enableval=$enable_gtktest; else enable_gtktest=yes fi pkg_config_args=gtk+-2.0 for module in . do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=2.20.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK+ - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK+ - version >= $min_gtk_version... " >&6; } if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" rm -f conf.gtktest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { int major, minor, micro; char *tmp_version; fclose (fopen ("conf.gtktest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_gtk=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5 $as_echo "yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6; } GTK20=1; echo "GTK libs: $GTK_LIBS" echo "GTK flags: $GTK_CFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" GTK20=0; echo "GTK 2.20 not found, but you can ignore the errors above if you do not want an interface" fi rm -f conf.gtktest LIBS= if test "x$GTK12" = "x1" -o "x$GTK20" = "x1"; then ANYGTK=1 else ANYGTK=0 fi if test "x$GTK12" = "x1"; then GTK12_TRUE= GTK12_FALSE='#' else GTK12_TRUE='#' GTK12_FALSE= fi if test "x$GTK20" = "x1"; then GTK20_TRUE= GTK20_FALSE='#' else GTK20_TRUE='#' GTK20_FALSE= fi if test "x$ANYGTK" = "x1"; then ANYGTK_TRUE= ANYGTK_FALSE='#' else ANYGTK_TRUE='#' ANYGTK_FALSE= fi if test "x$GNOME" = "x1"; then GNOME_TRUE= GNOME_FALSE='#' else GNOME_TRUE='#' GNOME_FALSE= fi if test "x$ANYGTK" = "x1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-sound flag" >&5 $as_echo_n "checking for --enable-sound flag... " >&6; } # Check whether --enable-sound was given. if test "${enable_sound+set}" = set; then : enableval=$enable_sound; else enable_sound=yes fi if test "x$enable_sound" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sound/music not enabled" >&5 $as_echo "Sound/music not enabled" >&6; } MIKMOD=0 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sound/music enabled" >&5 $as_echo "Sound/music enabled" >&6; } MIKMOD=1 fi else echo "No client being built, so disabling MikMod support." MIKMOD=0 fi if test "x$MIKMOD" = "x1"; then # Check whether --with-libmikmod-prefix was given. if test "${with_libmikmod_prefix+set}" = set; then : withval=$with_libmikmod_prefix; libmikmod_config_prefix="$withval" else libmikmod_config_prefix="" fi # Check whether --with-libmikmod-exec-prefix was given. if test "${with_libmikmod_exec_prefix+set}" = set; then : withval=$with_libmikmod_exec_prefix; libmikmod_config_exec_prefix="$withval" else libmikmod_config_exec_prefix="" fi # Check whether --enable-libmikmodtest was given. if test "${enable_libmikmodtest+set}" = set; then : enableval=$enable_libmikmodtest; else enable_libmikmodtest=yes fi if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi # Extract the first word of "libmikmod-config", so it can be a program name with args. set dummy libmikmod-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBMIKMOD_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBMIKMOD_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBMIKMOD_CONFIG="$LIBMIKMOD_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_LIBMIKMOD_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBMIKMOD_CONFIG" && ac_cv_path_LIBMIKMOD_CONFIG="no" ;; esac fi LIBMIKMOD_CONFIG=$ac_cv_path_LIBMIKMOD_CONFIG if test -n "$LIBMIKMOD_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBMIKMOD_CONFIG" >&5 $as_echo "$LIBMIKMOD_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_libmikmod_version=3.1.5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmikmod - version >= $min_libmikmod_version" >&5 $as_echo_n "checking for libmikmod - version >= $min_libmikmod_version... " >&6; } no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags` LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs` LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd` libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'` if test "x$enable_libmikmodtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD" LIBS="$LIBMIKMOD_LIBS $LIBS" rm -f conf.mikmodtest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main() { int major,minor,micro; int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version; char *tmp_version; system("touch conf.mikmodtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_libmikmod_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_libmikmod_version"); exit(1); } libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255; libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255; libmikmod_micro_version=(MikMod_GetVersion() ) & 255; if ((libmikmod_major_version != $libmikmod_config_major_version) || (libmikmod_minor_version != $libmikmod_config_minor_version) || (libmikmod_micro_version != $libmikmod_config_micro_version)) { printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version, libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf ("*** was found! If libmikmod-config was correct, then it is best\n"); printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n"); printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) || (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) || (libmikmod_micro_version != LIBMIKMOD_REVISION)) { printf("*** libmikmod header files (version %d.%d.%d) do not match\n", LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION); printf("*** library (version %d.%d.%d)\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); } else { if ((libmikmod_major_version > major) || ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) || ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n", libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version); printf("*** You need a version of libmikmod newer than %d.%d.%d.\n", major, minor, micro); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n"); printf("*** correct copy of libmikmod-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_libmikmod=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi if test "x$no_libmikmod" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, \`$LIBMIKMOD_CONFIG --version\`" >&5 $as_echo "yes, \`$LIBMIKMOD_CONFIG --version\`" >&6; } MIKMOD=1; echo "libmikmod libs: $LIBMIKMOD_LIBS" echo "libmikmod flags: $LIBMIKMOD_CFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$LIBMIKMOD_CONFIG" = "no" ; then echo "*** The libmikmod-config script installed by libmikmod could not be found" echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." else if test -f conf.mikmodtest ; then : else echo "*** Could not run libmikmod test program, checking why..." CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS" LIBS="$LIBS $LIBMIKMOD_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return (MikMod_GetVersion()!=0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding libmikmod or finding the wrong" echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location. Also, make sure you have run ldconfig if that" echo "*** is required on your system." echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means libmikmod was incorrectly installed" echo "*** or that you have moved libmikmod since it was installed. In the latter case, you" echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" LIBMIKMOD_LDADD="" MIKMOD=0; echo "libmikmod not found, but you can ignore the errors above if you do not want sound support" fi rm -f conf.mikmodtest LIBS= fi if test "x$MIKMOD" = "x1"; then MIKMOD_TRUE= MIKMOD_FALSE='#' else MIKMOD_TRUE='#' MIKMOD_FALSE= fi if test "x$ANYGTK" = "x0" -a "x$NETWORK" = "x0"; then as_fn_error $? "GTK and network support disabled. Nothing left to build!" "$LINENO" 5 fi critical_failure=0 for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF else critical_failure=1 fi done for ac_header in sys/stat.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" if test "x$ac_cv_header_sys_stat_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_STAT_H 1 _ACEOF else critical_failure=1 fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF else critical_failure=1 fi done if test "x$critical_failure" = "x1"; then as_fn_error $? "Required header missing, aborting." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi if test "x$NETWORK" = "x1"; then for ac_header in sys/types.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" if test "x$ac_cv_header_sys_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TYPES_H 1 _ACEOF else critical_failure=1 fi done for ac_header in sys/socket.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SOCKET_H 1 _ACEOF else critical_failure=1 fi done for ac_header in netdb.h do : ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETDB_H 1 _ACEOF else critical_failure=1 fi done for ac_header in netinet/in.h do : ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETINET_IN_H 1 _ACEOF else critical_failure=1 fi done for ac_header in arpa/inet.h do : ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARPA_INET_H 1 _ACEOF else critical_failure=1 fi done for ac_header in errno.h do : ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERRNO_H 1 _ACEOF else critical_failure=1 fi done for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FCNTL_H 1 _ACEOF else critical_failure=1 fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRING_H 1 _ACEOF else critical_failure=1 fi done if test "x$critical_failure" = "x1"; then as_fn_error $? "Required network header missing, aborting." "$LINENO" 5 fi fi for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF else as_fn_error $? "gettimeofday() not found, aborting." "$LINENO" 5 fi done for ac_func in usleep do : ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_USLEEP 1 _ACEOF else as_fn_error $? "usleep() not found, aborting." "$LINENO" 5 fi done for ac_func in memcpy do : ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy" if test "x$ac_cv_func_memcpy" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMCPY 1 _ACEOF else as_fn_error $? "memcpy() not found, aborting." "$LINENO" 5 fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMSET 1 _ACEOF else as_fn_error $? "memset() not found, aborting." "$LINENO" 5 fi done for ac_func in vsnprintf do : ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" if test "x$ac_cv_func_vsnprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VSNPRINTF 1 _ACEOF else as_fn_error $? "vsnprintf() not found, aborting." "$LINENO" 5 fi done for ac_func in stat do : ac_fn_c_check_func "$LINENO" "stat" "ac_cv_func_stat" if test "x$ac_cv_func_stat" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STAT 1 _ACEOF else as_fn_error $? "stat() not found, aborting." "$LINENO" 5 fi done for ac_func in strnlen do : ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" if test "x$ac_cv_func_strnlen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRNLEN 1 _ACEOF fi done for ac_func in getopt_long do : ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" if test "x$ac_cv_func_getopt_long" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_LONG 1 _ACEOF NEED_GETOPT=0 else NEED_GETOPT=1 fi done if test "x$NEED_GETOPT" = "x1"; then NEED_GETOPT_TRUE= NEED_GETOPT_FALSE='#' else NEED_GETOPT_TRUE='#' NEED_GETOPT_FALSE= fi NET_LIBS="" if test "x$NETWORK" = "x1"; then for ac_func in gethostbyname do : ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYNAME 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : NET_LIBS="$NET_LIBS -lnsl" else as_fn_error $? "gethostbyname() network function not found, aborting." "$LINENO" 5 fi fi done for ac_func in socket do : ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SOCKET 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : NET_LIBS="$NET_LIBS -lsocket" else as_fn_error $? "socket() network function not found, aborting." "$LINENO" 5 fi fi done echo "Network libraries we're linking against: "`if test "x$NET_LIBS" = "x"; then echo "(none)"; else echo "$NET_LIBS"; fi` fi ac_fn_c_check_member "$LINENO" "struct hostent" "h_addr_list" "ac_cv_member_struct_hostent_h_addr_list" "#include " if test "x$ac_cv_member_struct_hostent_h_addr_list" = xyes; then : $as_echo "#define HOSTENT_H_ADDR h_addr_list[0]" >>confdefs.h else $as_echo "#define HOSTENT_H_ADDR h_addr" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for convolution in -lreality" >&5 $as_echo_n "checking for convolution in -lreality... " >&6; } if ${ac_cv_lib_reality_convolution+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreality $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 convolution (); int main () { return convolution (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_reality_convolution=yes else ac_cv_lib_reality_convolution=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_reality_convolution" >&5 $as_echo "$ac_cv_lib_reality_convolution" >&6; } if test "x$ac_cv_lib_reality_convolution" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBREALITY 1 _ACEOF LIBS="-lreality $LIBS" fi if test "x$ANYGTK" = "x1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 $as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $X_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenDisplay=yes else ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 $as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBX11 1 _ACEOF LIBS="-lX11 $LIBS" else as_fn_error $? "libX11 is required for GTK interface, aborting." "$LINENO" 5 fi LIBS= fi if test "x$ac_cv_c_compiler_gnu" = "xyes"; then echo "GCC compiler found, trying GCC-specific optimizations and warnings." { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports C99 standard" >&5 $as_echo_n "checking if compiler supports C99 standard... " >&6; } LIBJ_OLD_CFLAGS="$CFLAGS" CFLAGS= cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } LIBJ_C99_STANDARD=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBJ_C99_STANDARD=0 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$LIBJ_OLD_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-opt flag" >&5 $as_echo_n "checking for --enable-opt flag... " >&6; } # Check whether --enable-opt was given. if test "${enable_opt+set}" = set; then : enableval=$enable_opt; else enable_opt=maybe fi if test "x$enable_opt" = "xyes" -o \( "x$enable_opt" = "xmaybe" -a "x$CFLAGS" = "x" \); then { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 $as_echo "enabled" >&6; } LIBJ_CFLAGS_OPT="-O3 -fomit-frame-pointer -finline-functions -funroll-loops -fthread-jumps -DNDEBUG" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not enabled" >&5 $as_echo "not enabled" >&6; } LIBJ_CFLAGS_OPT= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-warn flag" >&5 $as_echo_n "checking for --enable-warn flag... " >&6; } # Check whether --enable-warn was given. if test "${enable_warn+set}" = set; then : enableval=$enable_warn; else enable_warn=maybe fi if test "x$enable_warn" = "xyes" -o \( "x$enable_warn" = "xmaybe" -a "x$CFLAGS" = "x" \); then { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 $as_echo "enabled" >&6; } LIBJ_CFLAGS_WARN="-Wall -Wpointer-arith" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not enabled" >&5 $as_echo "not enabled" >&6; } LIBJ_CFLAGS_WARN= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-warn-error flag" >&5 $as_echo_n "checking for --enable-warn-error flag... " >&6; } # Check whether --enable-warn was given. if test "${enable_warn+set}" = set; then : enableval=$enable_warn; else enable_warn_error=maybe fi if test "x$enable_warn_error" = "xyes" -o \( "x$enable_warn_error" = "xmaybe" -a "x$CFLAGS" = "x" \); then { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 $as_echo "enabled" >&6; } LIBJ_CFLAGS_WARN_ERROR="-Werror -fno-strict-aliasing" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not enabled" >&5 $as_echo "not enabled" >&6; } LIBJ_CFLAGS_WARN_ERROR= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-debug flag" >&5 $as_echo_n "checking for --enable-debug flag... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; else enable_debug=no fi if test "x$enable_debug" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5 $as_echo "enabled" >&6; } LIBJ_CFLAGS_DEBUG="-g" if test "x$LIBJ_C99_STANDARD" = "x1"; then LIBJ_CFLAGS_DEBUG="$LIBJ_CFLAGS_DEBUG -W -Wunused" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not enabled" >&5 $as_echo "not enabled" >&6; } LIBJ_CFLAGS_DEBUG= fi CFLAGS="$CFLAGS $LIBJ_CFLAGS_OPT $LIBJ_CFLAGS_WARN $LIBJ_CFLAGS_WARN_ERROR $LIBJ_CFLAGS_DEBUG" echo "CFLAGS = $CFLAGS" else echo "No GCC compiler, will not enable optimizations or warnings." LIBJ_C99_STANDARD=0 fi ac_config_files="$ac_config_files Makefile xscorch.h libj/libj.h sai/Makefile sconsole/Makefile sgame/Makefile sgtk/Makefile sgtk/swidgets/Makefile snet/Makefile snet/tcpnet/Makefile ssound/Makefile sutil/Makefile libj/Makefile libj/jreg/Makefile libj/jstr/Makefile data/Makefile doc/Makefile img/Makefile snd/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LIBJ_STANDALONE_TRUE}" && test -z "${LIBJ_STANDALONE_FALSE}"; then as_fn_error $? "conditional \"LIBJ_STANDALONE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LIBJ_USE_LIBC_STRING_TRUE}" && test -z "${LIBJ_USE_LIBC_STRING_FALSE}"; then as_fn_error $? "conditional \"LIBJ_USE_LIBC_STRING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NETWORK_TRUE}" && test -z "${NETWORK_FALSE}"; then as_fn_error $? "conditional \"NETWORK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${READLINE_TRUE}" && test -z "${READLINE_FALSE}"; then as_fn_error $? "conditional \"READLINE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK12_TRUE}" && test -z "${GTK12_FALSE}"; then as_fn_error $? "conditional \"GTK12\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK20_TRUE}" && test -z "${GTK20_FALSE}"; then as_fn_error $? "conditional \"GTK20\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ANYGTK_TRUE}" && test -z "${ANYGTK_FALSE}"; then as_fn_error $? "conditional \"ANYGTK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GNOME_TRUE}" && test -z "${GNOME_FALSE}"; then as_fn_error $? "conditional \"GNOME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MIKMOD_TRUE}" && test -z "${MIKMOD_FALSE}"; then as_fn_error $? "conditional \"MIKMOD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NEED_GETOPT_TRUE}" && test -z "${NEED_GETOPT_FALSE}"; then as_fn_error $? "conditional \"NEED_GETOPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "xscorch.h") CONFIG_FILES="$CONFIG_FILES xscorch.h" ;; "libj/libj.h") CONFIG_FILES="$CONFIG_FILES libj/libj.h" ;; "sai/Makefile") CONFIG_FILES="$CONFIG_FILES sai/Makefile" ;; "sconsole/Makefile") CONFIG_FILES="$CONFIG_FILES sconsole/Makefile" ;; "sgame/Makefile") CONFIG_FILES="$CONFIG_FILES sgame/Makefile" ;; "sgtk/Makefile") CONFIG_FILES="$CONFIG_FILES sgtk/Makefile" ;; "sgtk/swidgets/Makefile") CONFIG_FILES="$CONFIG_FILES sgtk/swidgets/Makefile" ;; "snet/Makefile") CONFIG_FILES="$CONFIG_FILES snet/Makefile" ;; "snet/tcpnet/Makefile") CONFIG_FILES="$CONFIG_FILES snet/tcpnet/Makefile" ;; "ssound/Makefile") CONFIG_FILES="$CONFIG_FILES ssound/Makefile" ;; "sutil/Makefile") CONFIG_FILES="$CONFIG_FILES sutil/Makefile" ;; "libj/Makefile") CONFIG_FILES="$CONFIG_FILES libj/Makefile" ;; "libj/jreg/Makefile") CONFIG_FILES="$CONFIG_FILES libj/jreg/Makefile" ;; "libj/jstr/Makefile") CONFIG_FILES="$CONFIG_FILES libj/jstr/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "img/Makefile") CONFIG_FILES="$CONFIG_FILES img/Makefile" ;; "snd/Makefile") CONFIG_FILES="$CONFIG_FILES snd/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "" echo "$PACKAGE $VERSION Configuration:" echo " Prefix: $prefix" echo " Datadir: $datadir" echo " Mandir: $mandir" echo " CFLAGS: $CFLAGS" echo -n " Sound: " if test "x$MIKMOD" = "x1"; then echo "Yes" else echo "NO" fi echo -n " Network: " if test "x$NETWORK" = "x1"; then echo "Yes" else echo "NO" fi echo -n " Readline: " if test "x$READLINE" = "x1"; then echo "Yes" else echo "NO" fi echo -n " GTK 2+: " if test "x$GTK20" = "x1"; then echo "Yes" else echo "NO" fi echo "" if test "x$NETWORK" = "x1"; then echo "*** WARNING ***" echo "Network games are UNSTABLE. PLEASE read doc/NETWORK before sending in bug" echo "reports. Also, check out the document if you are interested in network" echo "development. We appreciate any feedback/bugfixes on the networking code." echo "" fi if test "x$MIKMOD" = "x1"; then echo "*** NOTE ***" echo "You have enabled sound support, but currently there is no music, nor are" echo "there sound effects in the game. xscorch will be linked to mikmod but the" echo "sound options will currently do nothing. We are currently looking for" echo "volunteers to create music for xscorch. If you'd like to write us some" echo "tracks, please drop us an e-mail!" echo "" fi xscorch-0.2.1/AUTHORS0000644000175000001440000000340611615366343011163 00000000000000$Header: /fridge/cvs/xscorch/AUTHORS,v 1.17 2011-08-01 00:01:39 jacob Exp $ (Please do not list these e-mail addresses on webpages, or list them in other packages, without contacting us first.) Principle code written by: Justin David Smith (c) 2005,2004,2003,2002,2001,2000 http://chaos2.org/ justins(at)chaos2.org Jacob Luna Lundberg (c) 2011,2009,2006,2005,2004,2003,2002,2001,2000 http://www.gnifty.net/ jacob(at)gnifty.net Contributors: Matti Hänninen (c) 2000 matti (a) mvillage.u-net.com Improved land generation Jason House (c) 2003 jhouse (a) mitre.org New shielding algorithms Various bug fixes Jake Post (c) 2000,2001 waif (a) chaos2.org Nifty plasma fractals used in certain explosions Algorithm used to bounce missiles off of Force Shields Nickolai Zeldovich (c) 2000 kolya (a) mit.edu Random player locations Network code contributions Thanks: Mikhail Kruk and Alexander Rasin, http://www.scorch2000.com/ They gave us their insight on network development from when they developed the Java version of the game. Without their advice it probably would have taken forever for us to figure it out :) Thanks! The various people who have ported xscorch to different platforms: * Will Andrews, FreeBSD * H. Wade Minter, RedHat * Marcin Garski, Fedora Project * Brian Bassett, Debian, 2001 * Brian Almeida, Debian, 2000,2001 * Michael D. Ivey, Debian, 2002,2003 * Team OS/2 Russia, OS/2 Please note that most of this code is licensed under version 2 of the GNU General Public License ONLY, the version that is included with this source distribution. NO later version of the General Public License is valid for the full xscorch distribution. xscorch-0.2.1/COPYING0000644000175000001440000004313310236475637011154 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. xscorch-0.2.1/ChangeLog0000644000175000001440000012316311615364351011665 00000000000000$Header: /fridge/cvs/xscorch/ChangeLog,v 1.180 2011-07-31 23:44:41 jacob Exp $ ChangeLog for XScorch. Copyright(c) 2000-2004 Justin David Smith Copyright(c) 2000-2011 Jacob Luna Lundberg. Changes in 0.2.1 ------------------ KNOWN BUGS: * Leap Frogs fail to leap in Interleaved Mode, because the land is not cleared by one explosion before the next missile is animated. * Some moves/items are interpreted locally instead of sent through the network server like they should be. It contributes to desync. * Graphics/Computers are fast - hangs and crashes have been reported. * The wedge code sometimes draws straight ends instead of rounded ones. * The man page is out of date enough to notice. BUG FIXES: * Audited for 64-bit pointers and should now run on 64-bit platforms. * Hans de Goede of the Fedora project fixed a stack smash in saddconf. * Fix from Sayu for roller infinite loop on elastic/rubbery walls bug. MISCELLANEOUS: * Updated the FSF's address in our GPL notices. * Upgraded various autotools cruft so it kinda works with newer versions. * Patch from Ilya Barygin to allow linking with the --as-needed option. * Added autoselection of h_addr_list[0] vs. h_addr. * Updated the libtoolization. GTK 2.0 CONVERSION * GTK >= 2.20 is now required. I got tired of the GTK habit of constantly coming up with a new shiny thing and deprecating every way that used to be the right way to do stuff, so I am not going to even vaguely try to support GTK < 2.20. * Fixed segfault in some menus caused by incorrect use of GtkDialogBox. * Changed yet more random interfaces GTK changed for whatever reason. * We need to finish GTK2 support. We are using allow deprecated some. 1. GdkFont is deprecated, so all the font code still needs rewritten. 2. The chat window used GtkText and still need to be rewritten. 3. sgtk/swidgets/sconsole.c:#define __ALLOW_DEPRECATED_GDK__ sgtk/swidgets/sdialog.c:#define __ALLOW_DEPRECATED_GDK__ sgtk/swindow-gtk.c:#define __ALLOW_DEPRECATED_GDK__ Changes in 0.2.0 ------------------ KNOWN BUGS: * Some moves/items are interpreted locally instead of sent through the network server like they should be. It contributes to desync. * Graphics/Computers are fast - hangs and crashes have been reported. * The wedge code sometimes draws straight ends instead of rounded ones. * Leap Frogs fail to leap in Interleaved Mode, because the land is not cleared by one explosion before the next missile is animated... * The man page is out of date enough to notice. BUG FIXES: * Removed excessive assertion in seconomy-gtk.c (thanks Gunnar). * Fix snet header file inclusion. * Only sa_handler OR sa_sigaction in handler (cross compatibility). * Repaired two bugs in sgame/soptions.c (fixes solaris compiles). MISCELLANEOUS: * License restricted to version 2 of the GPL. * Easter Egg wars :) * Fixed #warnings or changed them to /* TEMP */ for 0.2.0 release. Changes in 0.1.16 ------------------ KNOWN BUGS: * Some moves/items are interpreted locally instead of sent through the network server like they should be. It contributes to desync. * Graphics/Computers are fast - hangs and crashes have been reported. * The wedge code sometimes draws straight ends instead of rounded ones. * Leap Frogs fail to leap in Interleaved Mode, because the land is not cleared by one explosion before the next missile is animated... * The man page is out of date enough to notice. BUG FIXES: * Resolved the force shields bug, thanks to Jason House. * Switched to more accurate (and slower) mag shield computations. * Fixed bug where power was being reduced unfairly at start of turn. * Resolved the mag shields sign bug in 0.1.16-pre1 (Jason House). * Prevent Auto Defense from raising a dead player's shields. * Fix precision and yield calculations on triple weapons. * WTF? Wrong scaling used again/still when life lost... * Fix napalm bugs including tunneling through solid rock and fizzling even with contact triggers. * Fixed argument parsing of -g, -S, and unknown option error reporting. * Replaced !vp->dead with SC_PLAYER_IS_ALIVE(vp) in sai/saiturn.c This should make dead people invisible to AIs. * Weapons no longer pass through shields, with or without triggers. * Cleanup of sphysics and strack code, and adding more safety checks. * Corrected minor memory leaks, and a potentially major NULL pointer dereference, in the console highlights code. * Added support for dynamically updating fonts on consoles. * Added Glib assertions to console code to help track down problems. * Fixed several significant errors in the flight trajectory code, involving improperly initialized values, broken invariants, and other minor errors that, added up, resulted in serious bugs. This fixes issues with tunnelling weapons never detonating or dampening until impact with the ground. * Fixed several logic errors in the roller code. * xscorch binary no longer has a dependence on the installed man page. * xscorch binary no longer has a dependence on license or xscorch.txt files. ACCESSORIES: * Switched accessory info storage over to the data registry. ECONOMICS: * Created scoring.def config file and added readers (Jason House). * Switched economics scoring types over to data registry storage. WEAPONS: * Cleanup of the phoenix system code. * Created a weapon explosion dispatch that simplifies things. * Add phoenix action DETONATE which causes immediate detonation. * Made some weapon explosion types match the def file more closely. * Add a new weapon called the ``Black Market MIRV''. =) * For the truly adventurous, added a debug-only weapon called ``Mr. Napalm''. Think Mr. Fusion, only with... ah... napalm... * Switched weapon info storage over to the data registry. * Implemented the capability to detonate weapons at the tank barrel. * Implemented wedged blasts, allowing Riot Charge and Riot Blast. Thanks to Jason House for the wedged explosions drawing code. MISCELLANEOUS: * Fixed functions all over the codebase. * Fixed compiler warnings caused by empty last case switches. * Resolved some ambiguities in string manipulations. * Added memcmpn to sstr. Analagous to strcmpn. * Added truly hidden options. Insanity, indeed... * Implemented a registry for in-game data. * It is now possible to override the fonts. Save a ~/.xscorch/config file and edit the entries in the fonts section. I (Justin) find that adding this to ~/.xscorch/config helps a lot if you're on XFree86 4.x: fonts = font_class { fixedFont = "-adobe-courier-medium-r-*-*-12-*-*"; italicFixedFont = "-adobe-courier-medium-o-*-*-12-*-*"; boldFixedFont = "-adobe-courier-bold-r-*-*-12-*-*"; }; End of block fonts * Added font selection interface. It's not quite done yet, but you can access it from the main menu, or from the Graphics options window. It sort of works; the status bar gets reset, which can be annoying in the middle of the game, but the other consoles seem to update fine. * Converted over to using embedded libj libraries, instead of manually imported files for registry/string functions. * Added --enable-debug configure option. * Updated the ChangeLog. Numerous times... * Reorganized includes throughout the codebase. From now on they are supposed to be rather alphabetized, so please sort when you add. ;) A note on that: xscorch.h and sgtk.h break the rules, as they *must* be listed first if they are included at all. * Compliance with C99. * Fixed up and commented lots of trajectory code in sphysics.c. * Link problem on binary in OpenBSD - need explicit -lm (Jesse Meyer). * Fixing lags in interface caused by state machine problems. * Updated libtool, dispite what a PITA it is. * Hasn't anyone figured out what --insanity does yet? GTK 2.0 CONVERSION * Initiating conversion of interface code to GTK 2.0. The 2.0-specific code is NOT WELL TESTED yet. To force GTK 1.2, use the new configure option --with-gtk-12 (currently this is the default). To force GTK 2.0, use --without-gtk-12. Once GTK 2.0 support is stable, the default will change to using GTK 2.0 code. * Current issues: 1. GdkFont was deprecated. All font code will need to be rewritten. 2. There is text which assumes latin-1 encoding, GTK 2 wants unicode. To complicate matters, I use EUC-JP encoding, so forget about entering unicode data from my terminals... 3. A couple of spots with GtkText must be rewritten. This has been partially done for ScDialog, but right now the font support is only partially there. 4. Some signalling paths, notably for expose, are not compatible with GTK 1.2. This will take some time to fix everywhere; for now, the code is at least drawing, and that's good enough for me. Changes in 0.1.15 ------------------ KNOWN BUGS: * Force Shields are definitely rebounding at odd angles sometimes. * Graphics/Computers are fast - hangs and crashes have been reported. * Napalm can tunnel upwards through solid rock, erm... * AIs target dead people. ``I see dead people...'' BUG FIXES: * Removed extra slashes being added to SC_GLOBAL_DIR in sgtk/smenu-gtk.c * Added a signal handler for SIGPIPE and removed MSG_NOSIGNAL NETWORK: * Update tcpnet to 0.5, only change is removal of MSG_NOSIGNAL AI: * Added some support to allow AIs to use Shield Sappers, but it is disabled for now because most of them almost always miss... * Made AIs buy just a wee bit more aggressively. If they lose the first several rounds, they're often effectively done for good. What we really need here is a complete overhaul, however. Changes in 0.1.14 ------------------ This release is gearing up toward a possible 0.2 release, now that most of the weapons are implemented... KNOWN BUGS * Force Shields are definitely rebounding at odd angles sometimes. * Graphics/Computers are fast - hangs and crashes have been reported. BUG FIXES: * Fixed a segfault in _sc_spill_fill, when no walls were selected and napalm detonated off-screen. Parts of the spill code were not using proper VCS. * Fixed up a quick hack for the ``useless items'' bug. (Turning display of such items off was causing a lockup.) * Fixed some of the long standing roller bugs. * Fixed another roller bug (lockup on direct tank impact). * argument misordering in memcpy() in snetconnect.c * Fixed order for winners/losers first * Call order breakage in sending auto defense shield orders. * Wrong scaling was used in reducing power when life lost. * Return Leap Frogs to reasonable y values before creating children. * Fixed the funky tank placement where some got platforms and some not. (sc_land_avg_height_around() didn't always get it right) * Fixed potential infinite loop in MORON AI (thanks to Mark Anderson for spotting) * Fixed minor error in console driver; it allowed nonprintable chars * Fixed the buggy allowreturn logic in sactiveconsole.c * Fixed a bug that allowed user to issue commands to AI if the AI spent awhile thinking (this was one heck of a ``feature'' :) ACCESSORIES: * Improved magnetic effect precision in mag shielding. * Added the Tank Defense window (for Auto Defense accessories). It's currently incompletely implemented but I wanted to check it in anyway while I go off looking for a checkbox widget... * Months later -- finished the Tank Defense window. Yay! WEAPONS: * Fixed thia really naaty apelling error in the weapona def file. ECONOMICS: * Winnings now scale by initialcash, so as not to be trivialised by a high interest rate and initial cash setting. * There is now a Lottery option that awards a random weapon to a random player before each round. MISCELLANEOUS: * --insanity does something now :) * Status bar includes information on rounds. * Added PGUP and PGDN to the tank power key bindings. * Cleaning up hacks in inventory dialogue * Made player selweapon and selshield use info ptrs. This also cleans up the former hack used to fix the ``useless items bug''. NETWORK: * The low level of the network has been switched over to a much cleaner packet engine designed for TCP specifically. If all goes well, there won't be any real change to network games, but this will allow for us to start working on the areas of networking that need it... * Update tcpnet to 0.4, no interface or packet changes. Changes in 0.1.13 ------------------ KNOWN BUGS: * There is some evidence that force shields may not be rebounding weapons in quite the right direction, but only occasionally. * Player drop, death and move events do not trigger a landfall on land above the tank (can only happen in certain circumstances but appears to be aggravated in Interleave mode) BUG FIXES: * Fixed buggy calculations for determining shield and tank impacts. * Fixed a nasty bug where double-clicking in inventory screen and other locations was interpreted as _three_ button clicks, not 2. * Fixed funky bombs so they will draw arcs when the center of detonation is at ground level (or more specifically, one pixel below ground level). * Fixed bug in scrollable active consoles, which caused mouse click events to be interpreted at the wrong locations when scrolled. * Fixed error in values displayed in inventory header (round count) INTERFACE: * Keybindings for shields have changed! Press `e' to engage the shields now; the `s' key now toggles between shields which are currently in inventory, as it should always have done... * Status bar has been redesigned: there is a new option, Extended Status in game options window, which will bring up a two-line statusbar; the second line contains less vital information about the current game. * Added wind indicator to top-right of screen * Status bar now accepts mouse input on certain controls, to toggle weapons, activate shields, toggle triggers, use batteries, move. * Information about the currently selected item is now displayed at the bottom of the inventory screen. The currently selected shields are displayed in the status bar next to the strength of the current shield. The display for currently selected shields is a bit cryptic, but it will help to know that shields are classified by their power, with a suffix indicating type: M for magnetic, F for force, and S for standard shields. So, for example, `160M' represents a magnetic shield with 16000 life. When no shields are selected (i.e. you have no shields left in your inventory), the text `None' is displayed next to the shield power in the status bar. ACCESSORIES: * Remove shield probability hack. * Support for Magnetic Shields. * Support for Force Shields. * Disallow shields directly absorbing their owner's missiles. * Each shield type has its own colour. * Solar Panels can recharge some shield damage each turn. The magnetic shielding is a very complex piece to tune correctly so it may be a bit odd until we get it adjusted just right. Feel free to e-mail us (particularly Jacob) with any suggestions as to tuning or functionality of the new shielding. WEAPONS: * Created the Shield Sapper weapon, which really saps shields. AI: * Worked on AI targetting, making them compensate for new shields * Added new option, "Always Offset" to the AI controller menu. * Added new option, "Scan Refinement" to the AI controller menu. * Updates to Annihilator AI, w.r.t. its budget * AI's now know how to buy and use batteries GAME PLAY MODES: Interleave mode is in development. This will probably be renamed once it stabilizes, currently it is anything but stable. When enabled, it basically means weapons and explosions are run in parallel -- the game will NOT stop to draw an explosion, other weapons will merrily continue to fly and detonate. The major problem with it right now is an issue of causality -- when do certain events occur? F.e., land isn't cleared until an explosion clears (not as its exploding), which causes drastically different behaviour for spread weapons than the old state machine gave. Whether this is a good or bad thing? *shrug* If you really want to play with this, check the ``Interleave Tracking'' checkbox in the ``Game Options'' window. And watch out for levitating napalm :) MISCELLANEOUS: * Immobile tanks are identified in player screen with an `(I)' * Auto defense now automatically revives dead shields when the tank sustains damage * Cleaned up GTK dialogue code * Tank info and Tank Fuel screens now focus properly, and also accept the ESC key to close the windows out (in addition to Return) * Fixed most console windows so they FINALLY grab focus like they were supposed to do 10 releases back or so... * Added tooltips, and a configuration option in Game Options to turn tooltips off. * Console scrollbars now accept mouse input * Consoles now accept PageUp/PageDown to scroll * State machine overhaul (partly to support interleaving the various tracking states, making simultaneous explosions and weapon tracking possible) Changes in 0.1.12 ------------------ This release should be considered to resolve most of the stability regression of the last release, except in the networking code, which is already marked with a big fat EXPERIMENTAL anyway. ;-) BUG FIXES: * Fixed a nasty loop bug in the Moron AI weapons purchasing. * Enabled compile-time font selection (see sgtkfont.h). * Fixed a memory leak in an aibuy failure path probably nobody sees. * Fixed can-buy limitations for one-time purchases (like Triple Turret). * Removed const from info structs (no user-visible change I hope). * Fixed a `weapon inventories linger from one game to the next' bug. * Working on getting tunnelling to work properly... Currently the tunnelling is working reasonably well (landfall is postponed until the weapon actually detonates) but there is some strange rebound going on when the weapon first impacts with land... * Implemented proper mechanism for making course corrections to a missile in FLIGHT mode, use sc_traj_revise_velocity(), do NOT attempt to modify the control equations directly. * Above fix also fixes tunnelling rebound bug * Fixed wind bug/quicksand bug in tunnelling by revising acceleration values while a weapon is tunnelling through the ground. This finally makes tunnelling quite usable! TANK PROFILES: * Added two new tank profiles and renamed Default to Fortification. * Added support for more/less fuel-efficient tanks. * Added support for harder/softer tanks. * Added support for immobile tanks. * Added turretRadius option (affects both firing point and drawing). Make sure this value is large enough to be outside shield radius... Yes yes, so hardness isn't really a very good measure of how much damage a tank will take. When I worked for a Titanium manufacturer they were constantly looking for that elusive balance of hardness and strength that would work best on tanks. It's worth a lot of money... Plus real tanks tend to have this brittle filler crap that is supposed to absorb the shock from direct hits. Turns out that otherwise the concussion will often do in the tank's occupants even if the tank itself isn't really breached. Hmm. So anyway, it's a computer game. Let's just call it hardness, ok? =) ACCESSORIES: * Fixed contact triggers so they're only consumed if they're consumable. * The accessories.def version of the weapons.def file is now supported. * Added batteries for repairing tank damage (and therefore allowing you to restore full firing power when damaged, see below). To use a single battery on a damaged tank, press `B' -- it restores 5% of life. WEAPONS: * The yield calculations of spider weapons (funky bomb) are increased by 50% to more accurately model the yields given in the real code. On average, 75% of legs are detonated, not 50% as assumed before. * Remove the phoenix debug output that snuck into the last release. * Restored the functionality of the DEFER state flag. * Resolve remaining Leap Frog issues. * Firing power is limited by tank's life (i.e. damage sustained directly to tank will affect maximum firing ability) * Added precision weapons buying for Choosers and Calculators. * Made AIs that buy from lists of weapons a bit less predictable. * Introduced notion of ground damping to tunneling weapons. * Ground damping constant can be controlled in Physics Options window. MISCELLANEOUS: * Fixed AUTHORS to credit Brian Bassett as the new Debian maintainer. Changes in 0.1.11 ------------------ KNOWN ISSUES: * This release may be a regression in stability. There are changes to internal game structures that the network code definitely has NOT been updated for, in particular. 0.1.10 is more stable, but hey -- this release has rollers :) * For most accessories, you can only purchase one bundle right now. Don't know why, but bug will probably be cleared once accessories are moved to the config files. * Tunnelling leaves a lot to be desired. It produces ah... amusing effects -- probably also why digger/sandhog weapons don't work. WEAPONRY AND ACCESSORIES: * Roller weapons are now supported. * Work is in progress on the digger/sandhog weapons. * Work is in progress on tunnelling/contact triggers. * Auto-defense is now implemented, so sequential mode is now playable :) Auto-defense will just bring up the best shields that you have at the beginning of the round; not too fancy right now. Includes AI support for auto-defense. * Fixed bug in napalm spill code that caused napalm weapons to fizzle unexpectedly in certain terrains. * Really fixed the fuel bug this time... * Check out the new weapons.def file! NETWORK: * Player status is now sent across the network; the network information panel will tell you who else is in the game, their network address, and their current status. * Not much progress here this time. Go play with weapons.def! * Network support is NOT compatible with previous releases, and currently no weapon configurations are sent across; so you will see _very_ interesting results if you mix-n-match the weapon.def files on each client. EXPLOSIONS AND ANIMATION: * Explosions now ``clear'' by erasing from the inside out. * Fixed redraw problem when using riot bombs (bug was introduced in the prerelease from the new explosion clearing code). * Dirt bombs and riot bombs now animate. * Fixed bug where tanks are not redrawn if buried, after land fall. * Further bugfixes in explosion drawing code. MISCELLANEOUS: * Fixed an omission in snet/Makefile.am that prevented compiling when mikmod enabled and installed in a nonstandard location (thanks to Will Andrews for spotting) * Various changes in the game timing. * ``None'' landscape added (mainly for debug: to test rollers). * Added support for loading user-defined weapons and tank profiles -- see the user config file for more. * Can now specify an alternate user config file to load, using the --config option on the command-line. * Build system updated; new configure option, --disable-sound, to disable sound support in the client. The changes required to bring the game's manipulation of weapons structures in line and allow loading of weapons files were not at all small ones. I (Jacob) had to rewrite several functions in random places like saibuy.c and sinventory-gtk.c in order to allow this to work. So in some ways this release may be a bit of a stability regression. Please test it. Go look in the weapons.def file and play in there too. I will try and write some useful documentation on the structure of this file soon. In the meantime there is some documentation inside sphoenix.h for the bold. The next release will hopefully modify accessories to load from file. On the other side of things, the new weapons stuff definitely will have destabilized network games to the extent that you must make sure the client and server have the same weapons.def file. In the future, the server will manage the weapons lists and this will alleviate this particular problem. Networking is still in quite a transitional state anyway, and is likely to be unstable in other ways as well. Look for big changes there in the ``near'' future. Changes in 0.1.10 ------------------ NETWORK SUPPORT: * The network sync types are now checked. * Better documentation on the sync events in the code. * Chat dialogue box is hooked up. * We have packet ordering, but not yet retransmission or reordering so if tcp manages to drop a packet it's game over... * Lots of (now dead) bugs fell out of the new packet reception code. * Server is now allowed to configure most game options, even after other players have connected. Clients may look at the game options but they will not be allowed to change the options. MISCELLANEOUS: * Some sundry speling fixces went in to the source commentary. * Sanity checking is performed before beginning a game. ``Bring out your dead...'' ``But I'm not dead yet!'' We're still here, just incredibly busy these days -- both of us are swamped in the vagaries of academia, work, research, and more work. But there have been changes in the game, mostly to the networking code -- we're trying to get it to be more stable. Please give it a try, and let us know if it's working, etc. See doc/NETWORK for some more information. We want to get the networking stuff stable before continuing work on other aspects of the game. If you'd like to help out on anything in the game, just drop us an e-mail -- we'd love to have the help (and it could speed up the release cycle, too :) We'll try to get prereleases out more often, time permitting. Changes in 0.1.9 ----------------- BUG FIXES: * Deflector shield strength was too low/incorrect. * Fixed problem with shields taking the shot when player fires to right at 64degrees. * Fixed problem with signal handling that prevented GTK from exiting when various dialogues were open. * Fuel counter wasn't decremented when moving (I think this bug was introduced in the prereleases). NETWORK SUPPORT: * Gave up on UDP, ripped out xpuyopuyo's TCP codebase. * Implemented (mostly) variable length packets and a recv queue. * Fixed condition that might cause segfault regarding screen sizes (see #warning's in 0.1.8 for details) * Fixed misalignment caused by PRELUDE_BEGIN state (particularly noticable when given the --client command-line option). * Verification is sort of done on the current player state. * Merged recvfrom() calls into single function (Nickolai Zeldovich) * Fixed misalignments that were caused by a certain packet arriving out of order. * Messages are now displayed when client is waiting for some sort of network activity. * Player movement with fuel is now communicated. * Client code was cleaned up. * Network > Status option enabled in network games. The server can see all client connections, although the client does not (yet) have that information. This is a significant overhaul of the network code base; we decided to go with TCP after all since the amount of data communicated is rather low. The network code is much more stable; we were able to play complete rounds over a rather unstable network link across 1000miles :) Even the bugs in the program (levitating land?!) were consistent on both sides. There is better error recovery. When a client drops off permanently, we will probably have their player permanently destroyed, or perhaps turn it over to an AI player. Currently, nothing is done, so their tank will just sit there until the end of time or someone gets around to blowing it up :) The downside is 0.1.9 server can only talk to 0.1.9 clients; the protocol is not yet stable. But it seems to be working better; if you want to give it a try, just do ./configure --enable-network Changes in 0.1.8 ----------------- NETWORK SUPPORT: * It's there. It sort of works. See below. * Merged network bugfixes by Nickolai Zeldovich * Added --port, --server, --client, --name commandline options * Config data/player information is synchronized, sort of. * Player orders and inventories are synchronized. MISCELLANEOUS: * Random walls implemented * Fixed bug with getopt() that prevented compile on SunOS * The animate flag is now used in land, player dropping This release is a bugfix-only release, unless you're following network development. If you're following the network development, PLEASE read doc/NETWORK for the current status, especially before sending in bug reports. Networking is disabled by default, you need to ./configure --enable-network if you want to try network play. There was a segfault-on-startup report on a libc-5 system, but we've been unable to determine if xscorch was at fault. Anyone out there with Linux libc 5.3.12 who has been able to run xscorch? Changes in 0.1.7 ----------------- NETWORKING MODE: * Client/server communication code written. * Control messages and chat appear to be working. * Chat sort of works (can send, but text box isn't updated for recv) BUG FIXES: * VCS bug: tanks disappear when wrapping around - fixed. * VCS bug: tanks can colocate if in different frames - fixed. * VCS bug: distance calculation for damage could take long path even with wraparound boundaries, causing no damage to be dealt even though it is reasonable to expect damage - fixed. The virtual coordinate system (VCS) was implemented in 0.1.5 to make coordinate specification simpler, by allowing us to specify coordinates without having to worry about the boundary conditions all over the code. Unfortunately, this change broke a lot of things. Hopefully they are fixed now. Networking code is disabled by default; you must configure with the option --enable-network to build the networking code. NETWORK GAMES ARE NOT CURRENTLY PLAYABLE, but if you'd like to check out the code, help debug it or better yet, send in code, we'd appreciate it. Changes in 0.1.6 ----------------- BUG FIXES: * Fixed an off-by-one error that will cause segfaults on game start for most operating systems (even sometimes Linux). * Additional safeties to avoid a potential but unlikely segfault when verifying phoenix class weaponry. * make install now uses DESTDIR. PORTABILITY: * Removed some DEBUG defines that used ellipsi from xscorch.h. * Replaced variable array declarations with malloc/free. GAMEPLAY: * Tank profiles are implemented. As a direct consequence, tanks can no longer occupy the same location on the screen. Nor can they occupy the same position as a blob of land. The physics model should be much better behaved, now. This also means there will be user- selectable tank icons, in the near future. If you get any `levitation' warnings during the game, please contact us promptly. I think I've resolved the levitation bug, but I'm not sure. Changes in 0.1.5 ----------------- BUG FIXES: * Fix minor alloc bug with AI controller (Nickolai Zeldovich). * Problems with attempting to install to `NONE' are hopefully fixed. * Since 0.1.2, funky bombs detonated near the edge of the screen could send legs in the wrong direction. This has hopefully been solved as part of a large simplification in how land locations are specified. GAMEPLAY: * Player starting positions are now randomized (Nickolai Zeldovich). WEAPONS: * Liquid dirt implemented. * Triple Shots have gone away, in favor of the new Triple Turret accessory, which now impacts both baby missiles and missiles... * Weapon verification completed, one step closer to weapon save files. Ah, I forgot to release 0.1.4, in the midst of the system crash. Let's see, Sequential mode has been implemented, but otherwise the changes from 0.1.4 were minor. Tank profiles (-> custom tank icons) are next on Justin's list, and user-defined weapons are coming up on Jacob's list. Changes in 0.1.4 ----------------- BUG FIXES: * Fix realloc bug that shows up in Solaris (Nickolai Zeldovich). GAMEPLAY: * Sequential mode implemented * Explosions are now faster Changes in 0.1.3 ----------------- BUG FIXES: * Bug prevented compiling without sound support, now fixed. GRAPHICS: * Napalm now has flames. In the next version, they'll probably be animated flames. USER INTERFACE: * Pause feature: press ^Z. This is only meaningful during actual firing but it's kind of handy to be able to pause the game while the missiles are flying... Changes in 0.1.2 ----------------- BUG FIXES: * Fix crash on startup: 0.1.1 introduced a realloc thinko because I wasn't really prepared to release yet. The realloc was to remind me how it should get done... This release makes sure to initialise that pointer first. ;) -Jacob * Made Spider weapons (Funky Bombs) avoid potential lockup. * Fixed fatal bug with --geometry, when dimensions given were small. SOUND SUPPORT: * Sound support is present - see below for comments. USER INTERFACE: * Minor enhancements; status bar is now usable in small screens (it will split into two rows so you still have access to all the info) * Inventory lists will attempt to adjust to the current window size. MISCELLANEOUS: * `Unknown' AI added. This will select a random AI type, but you will not be informed which AI you are playing against! * `Random' landscape generator and `Random' sky selection. These will select any of the landscape generators to construct land. * `Mass Kill', in the System Menu, is implemented. * Icon-related code updated. * Ditch Day's Tomorrow! Sound support is present, but as you'll quickly notice, there are no sounds yet. Neither of us is particularly musically gifted, so if someone out there is willing to write modules and sound effects, that would be great! The system is currently looking for XM files, although any format playable by libmikmod is fine. If you're interested in doing music, I've been thinking of splitting it into five parts, prelude, inventory screen, main game, end round, and end game. Changes in 0.1.1 ----------------- USER INTERFACE: * Merged icon, in xscorch-icon.xpm (Matti Hänninen). * New xscorch logo! (thanks to Claire Luna Lundberg) * Now you can find out who killed you (at end of round). Look for the horribly labelled `Xby' field. * Added --geometry command-line option * Inventory lists are scrolling. Unfortunately, the scroll bars are not actually hooked up (yet). Arrow keys will scroll through the list; I'll get the pager keys working someday. Also, the inventory lists will be smarter about dynamically sizing in the next release. WEAPONS and DETONATIONS: * Version 1.0 of Riot Bombs, dirt weapons. * Ripped out constants all over the place to allow dynamic resizing of weapon and accessory lists. This allows changes that will introduce save files for both categories. * Made RAND phoenix location work (mostly). * Killed one of the state flag ints in the sc_weapon struct. * New plasma explosion-drawing code LAND and GRAPHICS: * New landscape: Canyon This release is primarily a bugfix release for folks who were having crashes when running the game on recent Debian and FreeBSD releases. The bug corrected is that of pressing Enter while in Inventory or certain other screens. In the meantime, enjoy the dirt bomb and riot charges :) Changes in 0.1.0 ----------------- LAND and GRAPHICS: * Merged Matti Hänninen's improved land generation code. * Finally fixed the land_level bug on right boundary. * Explosions wrap when wraparound walls are selected * Added support for dynamic screen size / other graphics options are implemented, and the graphics pipe has been optimized yet again. Land draws fast, now! CONFIGURATION: * Configuration files have been written; can save the game options (well, most of them) by clicking the "Save Options" button in the main menu. WEAPONS and DETONATIONS: * Funky Bombs really work now. * Added "Black Rain" under arms level four. * Complete separation of location from function of phoenix weapons. This will make some really twisted weapons possible to create if you tweak sweapon.c right. But the weapons struct is rather poorly documented / commented right now... * Improvements to weapon yield calculations used by AIs. * Adjustments to scaling of Leap Frogs. * Trace Paths is implemented. * Napalm is implemented. * Players can die in several ways. Napalm is implemented. It isn't all that great yet, but it is implemented. Future improvements will bring along burnt land, and animated flames... for the time being, the relevant part -- the destructive power -- is there. :) AI CONTROLLER: The AI controller is implemented. These options are global, they will affect all AI types. These options will generally make the game quite miserable for the human players. - Human Target Practice: AI's will always prefer human targets to AI targets (except for AI's that fire at random). When playing against 9 Calculators, this can make your day pretty lousy. - Allow Offset Targetting: generally, when a weapon hits a shield it does less damage than an explosion detonating right outside the shield (weapons hitting the shield do not have a chance to detonate). This changes the AI targetting behaviour so they will deliberately aim outside the shield, if their intended victim has raised shields. - No budget constraints: AI's will spend as much money as they can, disregarding their budget preferences. MISCELLANEOUS: * Fixed a serious timing problem in the game * Fuel has been implemented; press "F". While in fuel menu, you can use buttons or the Left/Right arrow keys to move. * System menu implemented (Ctrl-Y) * Explosions wrap when wraparound walls are selected * Added --yields command-line option * Options not implemented are marked "N/A" * Actual documentation exists, yay! At this point, the game is functional enough to go to 0.1.0. The 0.1.0 series will see addition of the missing weapons and accessories, and implementation of the remaining "N/A" options. Please note, that _two_ versions of the man page will be installed. One is a "standard" manpage, while the other is a text document which is used for the on-line game help. You may remove the latter document, but the Help menu will no longer function. Changes in 0.0.2 ----------------- * Justin: I broke smoke tracers. Hopefully they are fixed now. * Jacob: Changed accessory lookup to model after weapon lookup. Created a weapon-specific yield calculation function. Increased velocity damping in Leap-Frog weapons. Made shield damage spill over when a shield fails. Made chain weapons get smaller not larger. Cleaned up and moved sc_phoenix_frog to sc_phoenix_chain. * Justin: Major UI changes. Console widgets are now implemented so we can have decent mouse support. As time permits, these consoles will take on a style other than the current "block-character" format they are in. The widgets will probably change in appearance, but the usage will remain the same. * Justin: Overhaul of configuration dialogues * Justin: Added --insanity command-line option. Thanks to everyone who dropped us a note about the first release -- we appreciate the feedback! There's not much new, in terms of gameplay. This release is mainly a restructuring of the code, so most of the advanced weapons/accessories can be implemented. Now that the code structure has more or less stabilized, this is a good opportunity for other interested developers to join the bandwagon. In the next couple of releases, most of the weapons and accessories will be implemented (and maybe a few new items as well) -- for all of those whose favourite weapon is napalm, don't worry -- it is at the top of the list :) Changes in 0.0.1 ----------------- * Justin and Jacob: Coded like crazy. Here's the result... xscorch-0.2.1/INSTALL0000644000175000001440000001723007263212752011142 00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. xscorch-0.2.1/NEWS0000644000175000001440000000013307615446750010612 00000000000000$Header: /fridge/cvs/xscorch/NEWS,v 1.4 2003/01/28 08:33:16 waif Exp $ Not much for now. xscorch-0.2.1/TODO0000644000175000001440000000025707263670641010607 00000000000000$Header: /fridge/cvs/xscorch/TODO,v 1.2 2001/04/07 19:59:29 justins Exp $ TODO for XScorch. Copyright(c) 1999,2000 Justin David Smith See doc/NOTES for the current list. xscorch-0.2.1/compile0000755000175000001440000000717311206316072011464 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: xscorch-0.2.1/config.guess0000755000175000001440000012673011615325637012442 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-05-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-tilera-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xscorch-0.2.1/config.sub0000755000175000001440000010460611615325637012103 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xscorch-0.2.1/depcomp0000755000175000001440000002753307627255051011500 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. We will use -o /dev/null later, # however we can't do the remplacement now because # `-o $object' might simply not be used IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; -*) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 xscorch-0.2.1/install-sh0000755000175000001440000003253711615325637012127 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xscorch-0.2.1/ltmain.sh0000755000175000001440000105051111615325637011737 00000000000000 # libtool (GNU libtool) 2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4 Debian-2.4-3 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4 Debian-2.4-3" TIMESTAMP="" package_revision=1.3293 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_apped perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 xscorch-0.2.1/missing0000755000175000001440000002403211150430077011476 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 xscorch-0.2.1/mkinstalldirs0000755000175000001440000000132507263215521012712 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1 2001/04/06 01:26:41 justins Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here xscorch-0.2.1/xscorch.c0000644000175000001440000000510111615366343011722 00000000000000/* $Header: /fridge/cvs/xscorch/xscorch.c,v 1.13 2011-08-01 00:01:39 jacob Exp $ */ /* xscorch - xscorch.c Copyright(c) 2000-2004 Justin David Smith Copyright(c) 2000-2004 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched Earth, main function This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #define _POSIX_SOURCE /* Needed for signal handling */ #define _GNU_SOURCE /* Needed for signal handling */ #include #include #include #include #include #include #include #include #if !HAVE_GETTIMEOFDAY #error "This program requires gettimeofday()" #endif void sc_signal_handler(int sig) { /* sc_sig_handler Extensible signal handler for xscorch. */ switch(sig) { case SIGPIPE: /* SIGPIPE will most likely be a dead net cnxn. We try to ignore it and sort of hope for the best... */ fprintf(stderr, "xscorch: Got SIGPIPE; there goes the neighborhood...\n"); break; default: ; } } int main(int argc, char **argv) { struct sigaction sa; sigset_t sigset; sc_config *c; sc_window *w; /* Signal handlers */ sigemptyset(&sigset); sigaddset(&sigset, SIGPIPE); sa.sa_handler = sc_signal_handler; sa.sa_mask = sigset; sa.sa_flags = 0; sigaction(SIGPIPE, &sa, NULL); /* Tell them what they've won! */ sc_info(); /* Create game configuration, X window. Parse command line options, and load images. */ if(!(c = sc_config_new(&argc, &argv))) return(1); if(!(w = sc_window_new(c, argc, argv))) return(1); sc_land_generate(c, c->land); sc_window_run(w); /* Release all data */ sc_window_free(&w); sc_config_free(&c); printf("War is the science of destruction. -- John Abbott\n"); return(0); } xscorch-0.2.1/doc/0000755000175000001440000000000011615372006010726 500000000000000xscorch-0.2.1/doc/Makefile.am0000644000175000001440000000176310000406070012673 00000000000000## $Header: /fridge/cvs/xscorch/doc/Makefile.am,v 1.8 2003/10/04 17:54:41 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # man_MANS = xscorch.6 EXTRA_DIST = $(man_MANS) xscorch.txt NOTES NETWORK AI make_text_data.pl CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov shelpdata.c MAINTAINERCLEANFILES = *.orig all-local: xscorch.txt shelpdata.c xscorch.txt: xscorch.6 cat xscorch.6 | groff -Tascii -mandoc > xscorch.txt shelpdata.c: xscorch.txt xscorch.6 echo "#include "> shelpdata.c ./make_text_data.pl data_xscorch_txt > shelpdata.c ./make_text_data.pl data_xscorch_man > shelpdata.c ./make_text_data.pl data_copying_txt <../COPYING>> shelpdata.c install-data-local: xscorch.txt $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch $(INSTALL_DATA) ../COPYING $(DESTDIR)$(datadir)/xscorch/copying.txt $(INSTALL_DATA) xscorch.txt $(DESTDIR)$(datadir)/xscorch/xscorch.txt xscorch-0.2.1/doc/Makefile.in0000644000175000001440000003603011615371714012722 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man6dir = $(mandir)/man6 am__installdirs = "$(DESTDIR)$(man6dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # man_MANS = xscorch.6 EXTRA_DIST = $(man_MANS) xscorch.txt NOTES NETWORK AI make_text_data.pl CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov shelpdata.c MAINTAINERCLEANFILES = *.orig all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man6: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man6dir)" || $(MKDIR_P) "$(DESTDIR)$(man6dir)" @list=''; test -n "$(man6dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.6[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man6dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man6dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man6dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man6dir)" || exit $$?; }; \ done; } uninstall-man6: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man6dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.6[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man6dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man6dir)" && rm -f $$files; } tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) all-local installdirs: for dir in "$(DESTDIR)$(man6dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man6 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man6 .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-local \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man6 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-man uninstall-man6 all-local: xscorch.txt shelpdata.c xscorch.txt: xscorch.6 cat xscorch.6 | groff -Tascii -mandoc > xscorch.txt shelpdata.c: xscorch.txt xscorch.6 echo "#include "> shelpdata.c ./make_text_data.pl data_xscorch_txt > shelpdata.c ./make_text_data.pl data_xscorch_man > shelpdata.c ./make_text_data.pl data_copying_txt <../COPYING>> shelpdata.c install-data-local: xscorch.txt $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch $(INSTALL_DATA) ../COPYING $(DESTDIR)$(datadir)/xscorch/copying.txt $(INSTALL_DATA) xscorch.txt $(DESTDIR)$(datadir)/xscorch/xscorch.txt # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/doc/xscorch.60000644000175000001440000005155111615371762012425 00000000000000.\" $Header: /fridge/cvs/xscorch/doc/xscorch.6,v 1.21 2011-08-01 00:31:46 jacob Exp $ .\" .\" .\" Once upon a time .\" There was a document formatting system .\" It had a nice, complete set of commands .\" That were intuitive .\" And memorable. .\" .\" This is definitely _not_ that system. .\" .\" .\" .TH xscorch 6 "May 2001" "Justin David Smith" \" .SH NAME xscorch \- Annihilate enemy tanks using overpowered guns. .SH SYNOPSIS .B "xscorch" .P .B "xscorch " .I "[options]" .P .B xscorch \-\-help .SH DESCRIPTION Xscorch is a clone of the classic DOS game, "Scorched Earth". The basic goal is to annihilate enemy tanks using overpowered guns :). Basically, you buy weapons, you target the enemy by adjusting the angle of your turret and firing power, and you hope to destroy their tank before they destroy yours. .SH GAMEPLAY First, fiddle with the options in the main menu. There are a number of options which are described below, which may make the game easier or harder. The default options make for a reasonable level of gameplay. Most of the game configuration is controlled from the user interface, although there are a few command\-line options which are mentioned below. Once you are ready to begin a new game, you might want to \fISave Options\fP to save your configuration, then select \fIBegin Game\fP to start a new game. .P Gameplay is divided up into several rounds. Each round consists of two parts: the \fIInventory\fP phase and the \fIBattle\fP phase. In the Inventory phase, you can buy weapons to shoot at your opponents, and accessories to help defend your tank. See the Inventory section below for information on the weapons and accessories you may buy. In the Battle phase, you setup defenses, choose a weapon, aim and fire at your opponents. See the section on Battle below, for more information. .SH INVENTORY The player has the option to buy weapons and accessories to make the game more interesting. Weapons are just that: an assortment of missiles, including ICBM\-like warheads, napalm, lasers, and a number of custom weapons to bring down specific defenses. Accessories are methods to make gameplay easier for the player and increase their chance of survival, with guidance systems, shields, fuel, batteries, and other odds\-and\-ends. .P At the beginning of a round, each player is given an opportunity to buy or sell weapons and accessories. Each player may have up to 99 of any item in their inventory. A few weapons have an infinite supply (for example, Baby Missiles) \- these weapons cannot be purchased. .P Weapons and accessories are sold in bundles; the price for the bundle is displayed in the inventory, and you must buy items as a complete bundle. The exception to this is when a player attempts to buy more of an item than their inventory can hold; in this case, the bundle will be broken and the weapons are sold on an individual basis, with a small markup applied. .P Weapons and accessories may also be sold from a player's inventory. Again, items are generally sold as a bundle. The player will receive a reduced amount of money for the sale \- hey, the middleman has to make money somewhere :) .P In the Inventory screen, two panels are displayed, listing the weapons and accessories that are available. The \fITab\fP key will switch between the various panes. \fIUp Arrow\fP and \fIDown Arrow\fP will allow the player to scroll through the list of items, \fIRight Arrow\fP will buy a bundle, and \fILeft Arrow\fP will sell a bundle of the currently highlighted item. .P For each item, the \fIname\fP, \fIbundle size\fP/\fItotal price\fP, and \fIcurrent inventory\fP are displayed. .P Items which can neither be bought or sold will appear darkened. If the player has maxed their inventory for that item, or they cannot afford to purchase the item, or the item has a higher \fIarms level\fP than the player is allowed, then the item cannot be purchased. Items which can be bought will appear with an arrow pointing to the right, and items which can be sold will appear with an arrow pointing to the left. .P The items that are available are listed in the next two sections. .SH WEAPONS LIST This list will be added once the weapons list is reasonably stable. .SH ACCESSORIES LIST This list will be added once the accessories list is reasonably stable. .SH BATTLE This overview is sadly, incomplete. .SH TANK CONTROLS .\" Welcome to the tank controls section. .\" This code really looks pretty horrendous .\" I hope this is actually the comment char .\" .TP \fILeft\fP, \fIRight\fP Change the turret angle. This will adjust the turret angle in increments of 5 degrees. For finer control, hold \fIShift\fP to adjust the angle in increments of 1 degree. .TP \fIUp\fP, \fIDown\fP Change the firing power, in the range of 0 to 1000. This will adjust the firing power in increments of 20. For finer control, hold \fIShift\fP to adjust the firing power in increments of 1. .TP \fITab\fP Select the next weapon available in your inventory. .TP \fIShift+Tab\fP Select the previous weapon available in your inventory. .TP \fIB\fP, \fIb\fP Activate a battery. A single battery can restore 5% of damage done to your tank, and therefore restore the maximum firing power by 5% when you are damaged. You must have a battery to discharge in your inventory to excercise this option. .TP \fIE\fP, \fIe\fP Activate or energize the currently selected shields. .TP \fIF\fP, \fIf\fP Activate your fuel tanks. A window will be displayed, indicating the amount of fuel you have available. As long as you have fuel, you may use the \fILeft\fP and \fIRight\fP arrows to move one unit to the left or right, respectively. In general, you cannot move your tank up a steep hill. Immobile tanks will not be able to excercise this option. .TP \fIR\fP, \fIr\fP Force a redraw of the screen. .TP \fIS\fP, \fIs\fP Toggle the currently selected shields. The currently selected shields are the shields which will be used when you Energize. Shields are classified by a power number with a type suffix: \fIM\fP for magnetic shielding, \fIF\fP for force shielding, and \fIS\fP for your standard, run-of-the-mill shields. If no shields are available, \fI0S\fP is displayed. .TP \fIT\fP, \fIt\fP Toggle contact triggers on/off. This is only meaningful if you actually \fIhave\fP some contact triggers of course, and when tunneling is enabled. Weapons that are fired after this point will have contact triggers equipped (until you run out). .TP \fI0\fP \- \fI9\fP Display information about a particular player. \fI1\fP gives information about Player 1, and \fI0\fP gives information about Player 10. .TP \fIEnter\fP Accept your orders. .TP \fICtrl+Y\fP Bring up the System Menu (this can also be accessed from the menus). You can control certain graphics options from the system menu, clear the screen of smoke trails, and end a round prematurely. .TP \fICtrl+Z\fP Pauses the game. .TP \fICtrl+R\fP Resign from the game. This will end the game for everyone. You will be asked to confirm the resignation. .SH SYSTEM MENU .P The system menu gives you some control over the game while it is in progress. In this menu, you will have options to change how the game is displayed (e.g. the \fIGraphics Fast\fP option described below). You also have access to a few useful commands, described below. .TP \fBMass Kill\fP Kills everyone still alive in the round. No player gets credit for the kills, and none are considered a suicide. This option is useful if all human players have already been eliminated from the game, but the AI players are making no progress whatsoever in annihilating each other. This option ends the current round only. .TP \fBErase Smoke\fP If you have used smoke tracers or have \fITrace Paths\fP enabled, then this option will clear all smoke trails from the sky. .TP \fBRetreat\fP N/A .TP \fBResign Game\fP Resigns from the current round and all remaining rounds. This option ends the entire game, and will take you back to the intro screen. .TP \fBSound Setup\fP Takes you to the \fISound Options\fP window. .SH AI PLAYERS .TP .B Human The humans believe they are the superior mind. The AI's rather disagree with that sentiment. Keep this in mind when you are wondering why 9 AI's would want to simultaneously target your tank... .TP .B Moron This AI fires at random. Of all the AI's, this one has by far the highest suicide rate. An alternate name is ``Cannon Fodder''. .TP .B Shooter This AI goes for targets it has a line\-of\-sight to. It's not a great player otherwise. This AI buys weapons that have the best economical yield, but during the game it will select weapons which have the highest yield. .TP .B Spreader This AI is similar to the Shooter, except a Spreader buys weapons with the highest yield, without regard for the price. .TP .B Chooser This AI chooses a victim. Once chosen, the victim is attacked until they are dead, or the Chooser loses the ability to reach the victim. This AI does not need line\-of\-sight, but fortunately it cannot compensate for wind. .TP .B Calculater This AI is like Chooser, except a Calculater can compensate for the wind. These guys are fairly deadly in a fight; they also tend to allocate large budgets to defense and offense. .TP .B Annihilater This AI goes for weapons that will cause as much damage as possible, without much regard for individual victims. This AI prefers spread weapons to the more focused, precision weapons. A few Annihilaters can clear the terrain easily. These AI's don't worry about defenses too much. With their destructive tendency, they won't survive long anyway \- but neither will anyone else. .TP .B Insanity No one knows what this AI thinks... .TP .B Unknown This selects one of the above AI's at random, but you will not be informed which AI was selected. .SH CONFIGURATION OPTIONS \fIPlayers/Rounds\fP: .TP \fBNumber of Players\fP (integer, 2\-10) Set the number of players participating in the game. .TP \fBNumber of Rounds\fP (integer, >= 1) Set the number of rounds to play for this game. .TP \fBAI Type\fP (list) Select the AI type. Human players are ``Human''; the remaining AI's are documented above. .TP \fBPlayer Name\fP (string) Give a unique name for each player. .TP \fBTank Style\fP (list) Select the type/shape of the tank, for each player. .P \fIEconomics\fP: .TP \fBInterest Rate\fP (float, 0\-0.30) Interest rate for savings, compounded once per round. .TP \fBDynamic Interest\fP (toggle) If enabled, interest rates will change during the game. .TP \fBInitial Cash\fP (integer, 0\-1000000) Amount of money each player should start with. .TP \fBAIs Can Buy\fP (toggle) If enabled, computers are permitted to buy items. The AI's are very uninteresting if this option is turned off. .TP \fBAIs Buy Aggressively\fP (toggle) If the previous option is enabled, the AI's will buy items conservatively. With this option, the AI's will allocate larger budgets and buy bigger items early in the game. .TP \fBFree Market\fP (toggle) N/A .TP \fBScoring\fP (list) Specify how scoring works, selecting from Basic, Standard, Greedy, or possibly other methods defined in the configuration file: .PD 0 .RS +12 .TP 9 \fIBasic\fP Players only receive money for kills and survival. .TP 9 \fIStandard\fP Players receive less money for kills and survival, but they will also receive money for damaging an opponent. .TP 9 \fIGreedy\fP Players are paid as in Standard scoring, but with bonuses for unused inventory at the end of the round. .RE .PD .TP \fBThe Lottery\fP (toggle) If the lottery is enabled, there will be a random drawing at the start of each round. A random player will receive a bundle of a random weapon for free as the lottery award. This is a great way to inject a little extra life into AIs who are usually conservative buyers. Plus it's always great fun when you get a free Annihilator... .P \fIPhysics\fP: .TP \fBAir Viscosity\fP (float) N/A .TP \fBGravity\fP (float, 0\-10) Specify the gravity, in pixels per cycle squared (one cycle is roughly 50 milliseconds). .TP \fBGround Damping\fP (float, 0\-10) Specify the ground damping, used in tunnelling calculations. .TP \fBMaximum Wind Speed\fP (float, 0\-10) Specify the maximum wind speed, in pixels per cycle squared. The actual wind velocity is initialised once per round, to some value in (-\fImax\fP, \fImax\fP). .TP \fBWind is Dynamic\fP (toggle) Normally the wind remains constant through a round. If this is enabled, the wind will change once per turn. .TP \fBSuspend Dirt\fP (percentage) N/A .TP \fBTanks Fall\fP (percentage) N/A .TP \fBBorders Extend\fP (integer, >= 0) This specifies how far off\-screen weapons should be tracked, when you are playing with no walls. When this value is zero, weapons will disappear as soon as they leave the screen in the horizontal direction, even if wind would have brought them back on\-screen. .TP \fBWalls Are\fP (list) Specify how weapons behave when they hit a boundary. Note, the ground is always ``concrete'' -- this specifies how the sides and ceiling behave: .PD 0 .RS +12 .TP 11 \fINone\fP The sides and ceiling are open. .TP 11 \fIConcrete\fP All sides are solid. Weapons hitting any boundary will explode. .TP 11 \fIPadded\fP Weapons hitting the sides and ceiling will bounce off, although at a reduced velocity. .TP 11 \fIRubber\fP Weapons hitting the boundary will bounce off at exactly the same velocity. .TP 11 \fISpringy\fP Weapons hitting the boundary will bounce off with an additional ``kick'' to the velocity. .TP 11 \fIWraparound\fP The ceiling is open. Weapons going off one side will reappear on the opposite side. Explosions will also wrap around the screen if they detonate near an edge. .TP 11 \fIRandom\fP One of the above types of walls are selected at random. .RE .PD .P \fILandscape\fP: .TP \fBSky\fP (list) Specify the background sky. .TP \fBHostile Environment\fP (toggle) N/A .TP \fBLand Generator\fP (list) Specify the generator to use to create the land. .TP \fBBumpiness\fP (percentage) Specify the noise on the generated landscape. .P \fIWeapons\fP: .TP \fBArms Level\fP (integer, 0\-4) Specify the maximum arms level for the game. Only weapons with this arms level or lower may be purchased by any player, under normal circumstances. .TP \fBBomb Icon Size\fP (integer, 0\-4) Specify the size of the bomb icons, while they are traversing their path in the sky. This does not affect the size of explosions, or the size of the smoke paths (if \fItrace paths\fP is on). .TP \fBTunneling\fP (toggle) If set, weapons are allowed to tunnel through land. If you enable this, you will want to buy contact triggers if you want a particular weapon to always detonate on impact (instead of tunneling through land). .TP \fBScaling\fP (float) Scale the size of explosions by this value. If playing on a very large or very small playing field, you might want to adjust this value. .TP \fBTrace Paths\fP (toggle) If enabled, all weapons leave a smoke trail to reveal their trajectory. If this option is off, you can still use \fISmoke Tracers\fP to determine the path a weapon will take. .TP \fBUseless Items\fP (toggle) Some weapons are not useful given the current configuration (e.g. contact triggers are irrelevant if tunneling is disabled). If this option is enabled, then weapons which will have no effect are not listed in the inventory screens. .P \fIGraphics\fP: .TP \fBScreen Width\fP (integer) Set the width of the playing field, in pixels. .TP \fBScreen Height\fP (integer) Set the height of the playing field, in pixels. .TP \fBDithering\fP (toggle) If enabled, the land and sky gradients will be dithered. This option is particularly useful on 16\-bit displays, where the gradient is very noticeable otherwise. This does slow down land generation somewhat. .TP \fBAnimation\fP (toggle) If enabled, explosions and other effects will be animated. This option can also be controlled from the \fISystem Menu\fP. .TP \fBGraphics Are Fast\fP (toggle) If enabled, all graphics are always as fast as possible. This option can also be controlled from the \fISystem Menu\fP. .TP \fBComputers Are Fast\fP (toggle) If enabled, graphics are fast when there only computer players are alive. This option can also be controlled from the \fISystem Menu\fP. .P \fIGameplay Options\fP: .TP \fBMode\fP (list) Determines if all players will fire at once (\fISynchronous\fP), or whether each player will fire independently (\fISequential\fP). .TP \fBTeams\fP (list) N/A .TP \fBOrder\fP (list) Determines the player order. .TP \fBTalk Mode\fP (list) Determines who is allowed to talk. .TP \fBTalk Probability\fP (percentage) Determines the likelihood that a player will speak at the end of a turn. .TP \fBExtended Status\fP (toggle) If set, the status bar will contain an additional row of extended information during the game (things such as trigger and battery inventories, life, wind). .TP \fBTooltips\fP (toggle) If set, tooltips will be displayed where available. A restart is required to change the value of this option. .P \fIAI Controller\fP: .TP \fBHuman Target Practice\fP (toggle) AI's will always prefer human targets to AI targets (except for AI's that fire at random). When playing against 9 Calculators, this can make your day pretty lousy. .TP \fBAllow Offset Targetting\fP (toggle) Generally, when a weapon hits a shield it does less damage than an explosion detonating right outside the shield (weapons hitting the shield do not have a chance to detonate). This changes the AI targetting behaviour so they will deliberately aim outside the shield, if their intended victim has raised shields. .TP \fBAlways Offset\fP (toggle) If the above option is set, this option will force the AI to always offset its targetting as if the player had raised shields. This allows the AI to compensate for cases where the player may simply not have had their turn yet to raise shields. The downside is the AI will never attempt to score a direct hit with this option enabled. .TP \fBEnable Scan Refinement\fP (toggle) If set, harder AIs are allowed to refine their trajectories by computing trajectories that take into account player shielding effect and various other factors they do not normally consider. This option could slow down gameplay a bit but makes the AIs much more difficult. .TP \fBNo Budget Constraints\fP (toggle) AI's will spend as much money as they can, disregarding their budget preferences. .P \fISound Setup\fP: .TP \fBEnable Sound\fP (toggle) When set, music and sound effects will be played. .TP \fBUse HQ Mixer\fP (toggle) When set, mikmod's high-quality mixer will be used. .SH COMMAND-LINE OPTIONS .TP .B \-\-help Display a brief synopsis of the command-line options available. .TP .B \-\-insanity This is insanity, Max! Or what if it's genius? .TP .B \-\-yields Display weapon yields, and economical yields. .TP .B \-\-geometry=\fIw\fPx\fIh\fP Specify an initial window geometry for xscorch, where \fIw\fP is the width and \fIh\fP is the height of the playing field. Useful for displays less than around 800x600 resolution. Note this option overrides the settings in the config file, but you can save the new options to your config file so you don't have to specify this every time. You may also use \fB\-g\fP. .TP .B \-\-config=\fIfile\fP Load an alternate user config file, in \fIfile\fP. .TP .B \-\-sound Enable music and sound effects. You may also use \fB\-S\fP. .TP .B \-\-nosound Disable music and sound effects. You may also use \fB\-s\fP. .TP .B \-\-hqmixer Enable use of the high-quality mixer, if sound is enabled. This may use a lot of CPU power on older machines. .TP .B \-\-nohqmixer Disable use of the high-quality mixer, if sound is enabled. .TP .B \-\-name Set the name of your player, if you are initiating a network game. By default, your user name is used. .TP .B \-\-port Set the port number to use in a network game. This option is only relevant if you also specify \fB\-\-client\fP or \fB\-\-server\fP. The default is dependent on the protocol number, but is some large port number. .TP .B \-\-client=\fIserver\fP Start xscorch in client mode, and connect to \fIserver\fP (which should already be running). If \fB\-\-name\fP and \fB\-\-port\fP are not specified, reasonable defaults are used. .TP .B \-\-server Start xscorch in server mode, and wait for connections from the clients. \fB\-\-name\fP may be used in conjunction to specify the name of this player. .SH NETWORK MODE This is very unstable right now, and therefore is not documented. .SH FILES .TP .B ~/.xscorch/config User's default configuration for xscorch. .TP .B tankprofiles Profile bitmaps for the tanks, usually stored in the local share directory. .SH SEE ALSO The xscorch home page at . There is also additional documentation in the source distribution. .SH AUTHORS xscorch was written by Justin David Smith and Jacob Luna Lundberg . (Please do not list these e-mail addresses on webpages, or list them in other packages, without contacting us first.) .PP This manual page written by Justin David Smith . Copyright(c) 2001,2000 Justin David Smith. xscorch-0.2.1/doc/xscorch.txt0000644000175000001440000006614711615372001013071 00000000000000xscorch(6) xscorch(6) NNAAMMEE xscorch - Annihilate enemy tanks using overpowered guns. SSYYNNOOPPSSIISS xxssccoorrcchh xxssccoorrcchh _[_o_p_t_i_o_n_s_] xxssccoorrcchh ----hheellpp DDEESSCCRRIIPPTTIIOONN Xscorch is a clone of the classic DOS game, "Scorched Earth". The basic goal is to annihilate enemy tanks using overpowered guns :). Basically, you buy weapons, you target the enemy by adjusting the angle of your turret and firing power, and you hope to destroy their tank before they destroy yours. GGAAMMEEPPLLAAYY First, fiddle with the options in the main menu. There are a number of options which are described below, which may make the game easier or harder. The default options make for a reasonable level of gameplay. Most of the game configuration is controlled from the user interface, although there are a few command-line options which are mentioned below. Once you are ready to begin a new game, you might want to _S_a_v_e _O_p_t_i_o_n_s to save your configuration, then select _B_e_g_i_n _G_a_m_e to start a new game. Gameplay is divided up into several rounds. Each round consists of two parts: the _I_n_v_e_n_t_o_r_y phase and the _B_a_t_t_l_e phase. In the Inventory phase, you can buy weapons to shoot at your opponents, and accessories to help defend your tank. See the Inventory section below for informa- tion on the weapons and accessories you may buy. In the Battle phase, you setup defenses, choose a weapon, aim and fire at your opponents. See the section on Battle below, for more information. IINNVVEENNTTOORRYY The player has the option to buy weapons and accessories to make the game more interesting. Weapons are just that: an assortment of mis- siles, including ICBM-like warheads, napalm, lasers, and a number of custom weapons to bring down specific defenses. Accessories are meth- ods to make gameplay easier for the player and increase their chance of survival, with guidance systems, shields, fuel, batteries, and other odds-and-ends. At the beginning of a round, each player is given an opportunity to buy or sell weapons and accessories. Each player may have up to 99 of any item in their inventory. A few weapons have an infinite supply (for example, Baby Missiles) - these weapons cannot be purchased. Weapons and accessories are sold in bundles; the price for the bundle is displayed in the inventory, and you must buy items as a complete bundle. The exception to this is when a player attempts to buy more of an item than their inventory can hold; in this case, the bundle will be broken and the weapons are sold on an individual basis, with a small markup applied. Weapons and accessories may also be sold from a player's inventory. Again, items are generally sold as a bundle. The player will receive a reduced amount of money for the sale - hey, the middleman has to make money somewhere :) In the Inventory screen, two panels are displayed, listing the weapons and accessories that are available. The _T_a_b key will switch between the various panes. _U_p _A_r_r_o_w and _D_o_w_n _A_r_r_o_w will allow the player to scroll through the list of items, _R_i_g_h_t _A_r_r_o_w will buy a bundle, and _L_e_f_t _A_r_r_o_w will sell a bundle of the currently highlighted item. For each item, the _n_a_m_e, _b_u_n_d_l_e _s_i_z_e/_t_o_t_a_l _p_r_i_c_e, and _c_u_r_r_e_n_t _i_n_v_e_n_t_o_r_y are displayed. Items which can neither be bought or sold will appear darkened. If the player has maxed their inventory for that item, or they cannot afford to purchase the item, or the item has a higher _a_r_m_s _l_e_v_e_l than the player is allowed, then the item cannot be purchased. Items which can be bought will appear with an arrow pointing to the right, and items which can be sold will appear with an arrow pointing to the left. The items that are available are listed in the next two sections. WWEEAAPPOONNSS LLIISSTT This list will be added once the weapons list is reasonably stable. AACCCCEESSSSOORRIIEESS LLIISSTT This list will be added once the accessories list is reasonably stable. BBAATTTTLLEE This overview is sadly, incomplete. TTAANNKK CCOONNTTRROOLLSS _L_e_f_t, _R_i_g_h_t Change the turret angle. This will adjust the turret angle in increments of 5 degrees. For finer control, hold _S_h_i_f_t to adjust the angle in increments of 1 degree. _U_p, _D_o_w_n Change the firing power, in the range of 0 to 1000. This will adjust the firing power in increments of 20. For finer control, hold _S_h_i_f_t to adjust the firing power in increments of 1. _T_a_b Select the next weapon available in your inventory. _S_h_i_f_t_+_T_a_b Select the previous weapon available in your inventory. _B, _b Activate a battery. A single battery can restore 5% of damage done to your tank, and therefore restore the maximum firing power by 5% when you are damaged. You must have a battery to discharge in your inventory to excercise this option. _E, _e Activate or energize the currently selected shields. _F, _f Activate your fuel tanks. A window will be displayed, indicat- ing the amount of fuel you have available. As long as you have fuel, you may use the _L_e_f_t and _R_i_g_h_t arrows to move one unit to the left or right, respectively. In general, you cannot move your tank up a steep hill. Immobile tanks will not be able to excercise this option. _R, _r Force a redraw of the screen. _S, _s Toggle the currently selected shields. The currently selected shields are the shields which will be used when you Energize. Shields are classified by a power number with a type suffix: _M for magnetic shielding, _F for force shielding, and _S for your standard, run-of-the-mill shields. If no shields are available, _0_S is displayed. _T, _t Toggle contact triggers on/off. This is only meaningful if you actually _h_a_v_e some contact triggers of course, and when tunnel- ing is enabled. Weapons that are fired after this point will have contact triggers equipped (until you run out). _0 - _9 Display information about a particular player. _1 gives informa- tion about Player 1, and _0 gives information about Player 10. _E_n_t_e_r Accept your orders. _C_t_r_l_+_Y Bring up the System Menu (this can also be accessed from the menus). You can control certain graphics options from the sys- tem menu, clear the screen of smoke trails, and end a round pre- maturely. _C_t_r_l_+_Z Pauses the game. _C_t_r_l_+_R Resign from the game. This will end the game for everyone. You will be asked to confirm the resignation. SSYYSSTTEEMM MMEENNUU The system menu gives you some control over the game while it is in progress. In this menu, you will have options to change how the game is displayed (e.g. the _G_r_a_p_h_i_c_s _F_a_s_t option described below). You also have access to a few useful commands, described below. MMaassss KKiillll Kills everyone still alive in the round. No player gets credit for the kills, and none are considered a suicide. This option is useful if all human players have already been eliminated from the game, but the AI players are making no progress whatsoever in annihilating each other. This option ends the current round only. EErraassee SSmmookkee If you have used smoke tracers or have _T_r_a_c_e _P_a_t_h_s enabled, then this option will clear all smoke trails from the sky. RReettrreeaatt N/A RReessiiggnn GGaammee Resigns from the current round and all remaining rounds. This option ends the entire game, and will take you back to the intro screen. SSoouunndd SSeettuupp Takes you to the _S_o_u_n_d _O_p_t_i_o_n_s window. AAII PPLLAAYYEERRSS HHuummaann The humans believe they are the superior mind. The AI's rather disagree with that sentiment. Keep this in mind when you are wondering why 9 AI's would want to simultaneously target your tank... MMoorroonn This AI fires at random. Of all the AI's, this one has by far the highest suicide rate. An alternate name is ``Cannon Fod- der''. SShhooootteerr This AI goes for targets it has a line-of-sight to. It's not a great player otherwise. This AI buys weapons that have the best economical yield, but during the game it will select weapons which have the highest yield. SSpprreeaaddeerr This AI is similar to the Shooter, except a Spreader buys weapons with the highest yield, without regard for the price. CChhoooosseerr This AI chooses a victim. Once chosen, the victim is attacked until they are dead, or the Chooser loses the ability to reach the victim. This AI does not need line-of-sight, but fortunately it cannot compensate for wind. CCaallccuullaatteerr This AI is like Chooser, except a Calculater can compensate for the wind. These guys are fairly deadly in a fight; they also tend to allocate large budgets to defense and offense. AAnnnniihhiillaatteerr This AI goes for weapons that will cause as much damage as pos- sible, without much regard for individual victims. This AI prefers spread weapons to the more focused, precision weapons. A few Annihilaters can clear the terrain easily. These AI's don't worry about defenses too much. With their destructive tendency, they won't survive long anyway - but neither will any- one else. IInnssaanniittyy No one knows what this AI thinks... UUnnkknnoowwnn This selects one of the above AI's at random, but you will not be informed which AI was selected. CCOONNFFIIGGUURRAATTIIOONN OOPPTTIIOONNSS _P_l_a_y_e_r_s_/_R_o_u_n_d_s: NNuummbbeerr ooff PPllaayyeerrss (integer, 2-10) Set the number of players participating in the game. NNuummbbeerr ooff RRoouunnddss (integer, >= 1) Set the number of rounds to play for this game. AAII TTyyppee (list) Select the AI type. Human players are ``Human''; the remaining AI's are documented above. PPllaayyeerr NNaammee (string) Give a unique name for each player. TTaannkk SSttyyllee (list) Select the type/shape of the tank, for each player. _E_c_o_n_o_m_i_c_s: IInntteerreesstt RRaattee (float, 0-0.30) Interest rate for savings, compounded once per round. DDyynnaammiicc IInntteerreesstt (toggle) If enabled, interest rates will change during the game. IInniittiiaall CCaasshh (integer, 0-1000000) Amount of money each player should start with. AAIIss CCaann BBuuyy (toggle) If enabled, computers are permitted to buy items. The AI's are very uninteresting if this option is turned off. AAIIss BBuuyy AAggggrreessssiivveellyy (toggle) If the previous option is enabled, the AI's will buy items con- servatively. With this option, the AI's will allocate larger budgets and buy bigger items early in the game. FFrreeee MMaarrkkeett (toggle) N/A SSccoorriinngg (list) Specify how scoring works, selecting from Basic, Standard, Greedy, or possibly other methods defined in the configuration file: _B_a_s_i_c Players only receive money for kills and survival. _S_t_a_n_d_a_r_d Players receive less money for kills and survival, but they will also receive money for damaging an opponent. _G_r_e_e_d_y Players are paid as in Standard scoring, but with bonuses for unused inventory at the end of the round. TThhee LLootttteerryy (toggle) If the lottery is enabled, there will be a random drawing at the start of each round. A random player will receive a bundle of a random weapon for free as the lottery award. This is a great way to inject a little extra life into AIs who are usually con- servative buyers. Plus it's always great fun when you get a free Annihilator... _P_h_y_s_i_c_s: AAiirr VViissccoossiittyy (float) N/A GGrraavviittyy (float, 0-10) Specify the gravity, in pixels per cycle squared (one cycle is roughly 50 milliseconds). GGrroouunndd DDaammppiinngg (float, 0-10) Specify the ground damping, used in tunnelling calculations. MMaaxxiimmuumm WWiinndd SSppeeeedd (float, 0-10) Specify the maximum wind speed, in pixels per cycle squared. The actual wind velocity is initialised once per round, to some value in (-_m_a_x, _m_a_x). WWiinndd iiss DDyynnaammiicc (toggle) Normally the wind remains constant through a round. If this is enabled, the wind will change once per turn. SSuussppeenndd DDiirrtt (percentage) N/A TTaannkkss FFaallll (percentage) N/A BBoorrddeerrss EExxtteenndd (integer, >= 0) This specifies how far off-screen weapons should be tracked, when you are playing with no walls. When this value is zero, weapons will disappear as soon as they leave the screen in the horizontal direction, even if wind would have brought them back on-screen. WWaallllss AArree (list) Specify how weapons behave when they hit a boundary. Note, the ground is always ``concrete'' -- this specifies how the sides and ceiling behave: _N_o_n_e The sides and ceiling are open. _C_o_n_c_r_e_t_e All sides are solid. Weapons hitting any bound- ary will explode. _P_a_d_d_e_d Weapons hitting the sides and ceiling will bounce off, although at a reduced velocity. _R_u_b_b_e_r Weapons hitting the boundary will bounce off at exactly the same velocity. _S_p_r_i_n_g_y Weapons hitting the boundary will bounce off with an additional ``kick'' to the velocity. _W_r_a_p_a_r_o_u_n_d The ceiling is open. Weapons going off one side will reappear on the opposite side. Explosions will also wrap around the screen if they deto- nate near an edge. _R_a_n_d_o_m One of the above types of walls are selected at random. _L_a_n_d_s_c_a_p_e: SSkkyy (list) Specify the background sky. HHoossttiillee EEnnvviirroonnmmeenntt (toggle) N/A LLaanndd GGeenneerraattoorr (list) Specify the generator to use to create the land. BBuummppiinneessss (percentage) Specify the noise on the generated landscape. _W_e_a_p_o_n_s: AArrmmss LLeevveell (integer, 0-4) Specify the maximum arms level for the game. Only weapons with this arms level or lower may be purchased by any player, under normal circumstances. BBoommbb IIccoonn SSiizzee (integer, 0-4) Specify the size of the bomb icons, while they are traversing their path in the sky. This does not affect the size of explo- sions, or the size of the smoke paths (if _t_r_a_c_e _p_a_t_h_s is on). TTuunnnneelliinngg (toggle) If set, weapons are allowed to tunnel through land. If you enable this, you will want to buy contact triggers if you want a particular weapon to always detonate on impact (instead of tun- neling through land). SSccaalliinngg (float) Scale the size of explosions by this value. If playing on a very large or very small playing field, you might want to adjust this value. TTrraaccee PPaatthhss (toggle) If enabled, all weapons leave a smoke trail to reveal their tra- jectory. If this option is off, you can still use _S_m_o_k_e _T_r_a_c_e_r_s to determine the path a weapon will take. UUsseelleessss IItteemmss (toggle) Some weapons are not useful given the current configuration (e.g. contact triggers are irrelevant if tunneling is dis- abled). If this option is enabled, then weapons which will have no effect are not listed in the inventory screens. _G_r_a_p_h_i_c_s: SSccrreeeenn WWiiddtthh (integer) Set the width of the playing field, in pixels. SSccrreeeenn HHeeiigghhtt (integer) Set the height of the playing field, in pixels. DDiitthheerriinngg (toggle) If enabled, the land and sky gradients will be dithered. This option is particularly useful on 16-bit displays, where the gra- dient is very noticeable otherwise. This does slow down land generation somewhat. AAnniimmaattiioonn (toggle) If enabled, explosions and other effects will be animated. This option can also be controlled from the _S_y_s_t_e_m _M_e_n_u. GGrraapphhiiccss AArree FFaasstt (toggle) If enabled, all graphics are always as fast as possible. This option can also be controlled from the _S_y_s_t_e_m _M_e_n_u. CCoommppuutteerrss AArree FFaasstt (toggle) If enabled, graphics are fast when there only computer players are alive. This option can also be controlled from the _S_y_s_t_e_m _M_e_n_u. _G_a_m_e_p_l_a_y _O_p_t_i_o_n_s: MMooddee (list) Determines if all players will fire at once (_S_y_n_c_h_r_o_n_o_u_s), or whether each player will fire independently (_S_e_q_u_e_n_t_i_a_l). TTeeaammss (list) N/A OOrrddeerr (list) Determines the player order. TTaallkk MMooddee (list) Determines who is allowed to talk. TTaallkk PPrroobbaabbiilliittyy (percentage) Determines the likelihood that a player will speak at the end of a turn. EExxtteennddeedd SSttaattuuss (toggle) If set, the status bar will contain an additional row of extended information during the game (things such as trigger and battery inventories, life, wind). TToooollttiippss (toggle) If set, tooltips will be displayed where available. A restart is required to change the value of this option. _A_I _C_o_n_t_r_o_l_l_e_r: HHuummaann TTaarrggeett PPrraaccttiiccee (toggle) AI's will always prefer human targets to AI targets (except for AI's that fire at random). When playing against 9 Calculators, this can make your day pretty lousy. AAllllooww OOffffsseett TTaarrggeettttiinngg (toggle) Generally, when a weapon hits a shield it does less damage than an explosion detonating right outside the shield (weapons hit- ting the shield do not have a chance to detonate). This changes the AI targetting behaviour so they will deliberately aim out- side the shield, if their intended victim has raised shields. AAllwwaayyss OOffffsseett (toggle) If the above option is set, this option will force the AI to always offset its targetting as if the player had raised shields. This allows the AI to compensate for cases where the player may simply not have had their turn yet to raise shields. The downside is the AI will never attempt to score a direct hit with this option enabled. EEnnaabbllee SSccaann RReeffiinneemmeenntt (toggle) If set, harder AIs are allowed to refine their trajectories by computing trajectories that take into account player shielding effect and various other factors they do not normally consider. This option could slow down gameplay a bit but makes the AIs much more difficult. NNoo BBuuddggeett CCoonnssttrraaiinnttss (toggle) AI's will spend as much money as they can, disregarding their budget preferences. _S_o_u_n_d _S_e_t_u_p: EEnnaabbllee SSoouunndd (toggle) When set, music and sound effects will be played. UUssee HHQQ MMiixxeerr (toggle) When set, mikmod's high-quality mixer will be used. CCOOMMMMAANNDD--LLIINNEE OOPPTTIIOONNSS ----hheellpp Display a brief synopsis of the command-line options available. ----iinnssaanniittyy This is insanity, Max! Or what if it's genius? ----yyiieellddss Display weapon yields, and economical yields. ----ggeeoommeettrryy==_wxx_h Specify an initial window geometry for xscorch, where _w is the width and _h is the height of the playing field. Useful for dis- plays less than around 800x600 resolution. Note this option overrides the settings in the config file, but you can save the new options to your config file so you don't have to specify this every time. You may also use --gg. ----ccoonnffiigg==_f_i_l_e Load an alternate user config file, in _f_i_l_e. ----ssoouunndd Enable music and sound effects. You may also use --SS. ----nnoossoouunndd Disable music and sound effects. You may also use --ss. ----hhqqmmiixxeerr Enable use of the high-quality mixer, if sound is enabled. This may use a lot of CPU power on older machines. ----nnoohhqqmmiixxeerr Disable use of the high-quality mixer, if sound is enabled. ----nnaammee Set the name of your player, if you are initiating a network game. By default, your user name is used. ----ppoorrtt Set the port number to use in a network game. This option is only relevant if you also specify ----cclliieenntt or ----sseerrvveerr. The default is dependent on the protocol number, but is some large port number. ----cclliieenntt==_s_e_r_v_e_r Start xscorch in client mode, and connect to _s_e_r_v_e_r (which should already be running). If ----nnaammee and ----ppoorrtt are not speci- fied, reasonable defaults are used. ----sseerrvveerr Start xscorch in server mode, and wait for connections from the clients. ----nnaammee may be used in conjunction to specify the name of this player. NNEETTWWOORRKK MMOODDEE This is very unstable right now, and therefore is not documented. FFIILLEESS ~~//..xxssccoorrcchh//ccoonnffiigg User's default configuration for xscorch. ttaannkkpprrooffiilleess Profile bitmaps for the tanks, usually stored in the local share directory. SSEEEE AALLSSOO The xscorch home page at . There is also additional documentation in the source distribution. AAUUTTHHOORRSS xscorch was written by Justin David Smith and Jacob Luna Lundberg . (Please do not list these e-mail addresses on webpages, or list them in other packages, without contacting us first.) This manual page written by Justin David Smith . Copyright(c) 2001,2000 Justin David Smith. Justin David Smith May 2001 xscorch(6) xscorch-0.2.1/doc/NOTES0000644000175000001440000002143011615366343011470 00000000000000$Header: /fridge/cvs/xscorch/doc/NOTES,v 1.39 2011-08-01 00:01:39 jacob Exp $ NOTES file for XScorch. Copyright(c) 2000-2004 Justin David Smith Copyright(c) 2000-2011 Jacob Luna Lundberg. This document agrees with version 0.2.1. !! Please read this document before reporting a bug. This document contains the current known issues with the game. In particular, if you have ideas on how to fix these bugs or implement some of these features, we'd like to hear from you: send e-mail to xscorch(at)xscorch.org. Also refer to doc/NETWORK for network-related issues, and doc/AI for issues relating to the computer AI's. CONTENTS Immediate Attention Jacob's Notes Weapons Implementation Status Features Not Yet Implemented/Known Problems Waif's Notes on log_accum.pl IMMEDIATE ATTENTION Balance: Economics unfair, shield strength (Mattias Eriksson) Network: Packet retransmission! JACOB'S NOTES ** More Things for Immediate Attention ** These are the features and bugs I plan to work on soon. * Hopefulls for release soon * Radiator system that reduces your damage by (50 * (1 - p->power / 1000)) percent? Make spider phoenix more aware of hills in the way... Rewrite the AI budgeting system -- what a mess! Finish teaching AIs to use Shield Sappers. Document the weapon info struct format. Animate napalm flames (?). * Long term stuff * Weapon creation utility. Check out porting to WinCrud via gtk (painful) ... There are in fact several things that need selectable tracking functions... [Now partially implemented.] o blasts at tank barrel o sandhogs underground o rollers on surface * Weapon selling/trading in game * We both have thoughts on this and I think it will happen. Stay tuned... o To do this we will need `unique' weapons, i.e. eliminate the idea of a `mass market' with a surplus of weaponry. Might be easy, hard to say `tho. o `fair' pricing model for custom weapons. Can't have Bob the Destroyer designing a new weapon with 10000Force destructive, then making it available for 1$ (would be amusing, though). * Napalm doesn't spill on high-speed impact, even with triggers. JDS: I left comments in sspill.c about this; I think I know what's going on. Does it only occur when the weapon tunnels? WEAPONS IMPLEMENTATION STATUS ** The Weapon List ** We still have a ways to go creating weapons. We need some more specialized detonation functions. * separate weapon explosion drawing functions * (marked by conventions used with weapons list below) + (a) circular gradient explosions ("normal" weapons) + (b) spread circular gradient explosions (funky bombs) + (c) dribbling liquid explosions (liquid dirt, napalm) - (d) digging (dirt eating) pseudo-explosions (diggers, sandhogs) + (e) spraying explosions (riot charge/blast, dirt charge) (f) beam weapons (lasers mostly) * weapon list goal * Those that are fully implemented are marked at the left with a '+'. Those that are partially (often twistedly) implemented are marked with a '-'. Note that our explosive radii run about twice those of the original game. [Name] [Cost] [Bundle Size] Radius-[Scorch]-[XScorch] [Arms Level] + No Weapon $0 0 N/I 0 0 + Baby Missile $400 0 10 20 0 + Missile $1,875 5 20 40 0 + Baby Nuke $10,000 3 40 80 0 + Nuke $12,000 1 75 150 1 + Leap Frog $10,000 2 30,25,20 60,50,41 3 + Funky Bomb $7,000 2 80 160 4 + MIRV $10,000 3 20 40 2 + Black Market MIRV $15,000 3 N/I ~100 4 + Death's Head $20,000 1 35 70 4 + Annihilator $24,000 1 N/I 200 4 + The Chaos $5,000,000 1 N/I 200 5 + The Chaos^2 $9,999,999 1 N/I 200 6 + Napalm $10,000 10 N/A N/A 2 + Hot Napalm $20,000 2 N/A N/A 4 + Black Rain $30,000 2 N/I 20 4 + Mr. Napalm $3,000,000 2 N/I N/A 6 + Tracer $10 20 0 0 0 + Smoke Tracer $500 10 0 0 1 + Shield Sapper $2,500 5 N/I 0 3 + Baby Roller $5,000 10 10 20 2 + Roller $6,000 5 20 40 2 + Heavy Roller $6,750 2 45 90 3 + Riot Charge $2,000 10 36 72 2 + Riot Blast $5,000 5 60 120 3 + Riot Bomb $5,000 5 30 60 3 + Heavy Riot Bomb $4,750 2 45 90 3 - Baby Digger $3,000 10 N/A N/A 0 - Digger $2,500 5 N/A N/A 0 - Heavy Digger $6,750 2 N/A N/A 1 - Baby Sandhog $10,000 10 N/A N/A 0 - Sandhog $16,750 5 N/A N/A 0 - Heavy Sandhog $25,000 2 N/A N/A 1 + Dirt Clod $5,000 10 20 40 0 + Dirt Ball $5,000 5 35 70 0 + Ton of Dirt $6,750 2 70 140 1 + Liquid Dirt $5,000 10 N/A N/A 2 + Dirt Charge $5,000 5 N/A N/A 1 Earth Disrupter $5,000 10 N/A N/A 0 Plasma Blast $9,000 5 10-75 20-150 3 + Shield Sapper $10,000 2 N/I 0 3 Laser $5,000 5 N/A N/A 2 * potentials * Sticky Air (implement with object land type and tracers) Sticky Air Disruptor (see above) Tunnel Tracking (accessory >:) Teleporter (accessory, chosen, or random location? preference for random) Jump Jets (accessory, thoughts?) Popcorn Bomb (weapon, sounds a lot like a funky bomb, hmm) Dirt tower (weapon?) Teleport shield (accessory, sort of pairs with warp shield) a) you're hit, you're transported. Warp Shield (accessory, sort of pairs with teleport shield) b) you're hit, weapon is transported >:) Flicker Shield (accessory, what the heck is this anyway?) Patriot Missles (weapon, any ideas?) Plasma laser (weapon, gnifty looking laser I assume) * special cases * Rollers are implemented as a new phoenix case (CONVERT). The Chaos and Mr. Napalm really are mostly for testing. But they are fun. So who knows what the future holds... And as for The Chaos^2, well ... ask Justin. ;-) FEATURES NOT YET IMPLEMENTED/KNOWN PROBLEMS Economics: * Free market not implemented * Greedy scoring not properly implemented Interface: * Mouse support partially implemented Landscape: * Hostile environments not implemented Physics: * Suspend dirt not implemented * Tanks fall not implemented These will probably come along soon, now that tank profiles are implemented == bug with land falling on the tank can finally be avoided. * Viscosity does not currently work This has been removed, because the trajectory functions cannot currently compensate for the viscosity of air. * Springy walls are not properly implemented (no damping over time!) Play options: * Player Teams not implemented Players: * Insanity AI not implemented Sound: * Soundtracks are implemented but as yet have no music to play This causes some "file not found" warnings during gameplay * Sound effects are still a ways down the line WAIF'S NOTES ON log_accum.pl Let it be noted that log_accum.pl is a pain in the ass Summaries are broken until further notice. May be that current cvs version is incompatibile with script assumptions. xscorch-0.2.1/doc/NETWORK0000644000175000001440000000753410030601452011721 00000000000000$Header: /fridge/cvs/xscorch/doc/NETWORK,v 1.4 2004/03/25 16:04:58 jacob Exp $ NETWORK file for XScorch. Copyright(c) 2000-2004 Justin David Smith Copyright(c) 2004 Jacob Luna Lundberg. This document agrees with version 0.2.0. HOW TO USE NETWORK PLAY Because network play is unstable and incomplete, it is not enabled by default. You cannot play a full, ``normal'' game of xscorch in network mode, and there are several easy ways to get the game horribly out of sync with network mode. But if you want to try what is there currently, configure xscorch with ./configure --enable-network This will build a binary with network support. Once you have that, you can enable network mode in one of two ways: 1) xscorch --server --name= Creates a new server with one client. xscorch --client= --name= Creates a new client and connects it to an already-running server. The main disadvantage is you cannot configure the game this way; the game will be setup using the ~/.xscorch/config file where the server is run (or defaults if the file is not found). 2) From the Network menu: ``Create Server'' will turn the xscorch session into a new server. ``Connect as Client'' will connect to an already-running server. ``Disconnect'' will close any client connection and shutdown any server. You cannot configure the game once the server has been started; so you might want to go through the options first. In either case, a message is printed to the standard output of the server whenever a player joins the game. You can only join until the server player has selected ``Begin Game''. CURRENT STATUS OF NETWORK PLAY The network code that is currently present in the game is under heavy development; currently, we have loose game synchronization (although there is no error checking, and no attempt to realign clients if they get out of alignment). We need to be sending more data over about the other players; in particular there is no attempt to verify that damage is all dealt correctly on each client, since most simulation is done on the client. Some state describing the players is sent between the clients every turn, and if an error is detected, the appropriate messages are printed to standard output. No attempt is made to correct the problem, at this time. The game may appear to lock up locally while it is waiting for other players to end their turn, etc. Messages are displayed in the status bar whenever this happens; a more elegant solution will be implemented soon. There may also be an option to impose timeouts on each turn. KNOWN PROBLEMS/MISSING FEATURES * Server ought to be able to change config options, this will be fixed once synchronization issues are resolved. * Chat can send and receive, but chat window textfield is not updated with messages that are received. * Watch out for messages that random values are out of alignment. The game has basically gone to hell if this ever happens. * Recovery if a client drops off, is pathetic right now. * Recovery on misalignment is coming along... * Winnings not correct in network mode. The current cash values are correct, but the winnings calculation does not take into account inventory purchases. + While config data is sent out when a new client, it is _not_ when options are changed on the server -> misalignment. FIXED (?) + AI's cannot currently join a network game. FIXED (?) REPORTING ERRORS It is useful to me if you log the entire game session; so redirect the stdout and stderr of the xscorch server and any client that is connected. If you encounter an error, mail me the logs and I'll try to reconstruct whatever happened. xscorch-0.2.1/doc/AI0000644000175000001440000000333210030601452011051 00000000000000$Header: /fridge/cvs/xscorch/doc/AI,v 1.5 2004/03/25 16:04:58 jacob Exp $ AI file for XScorch. Copyright(c) 2000-2004 Justin David Smith Copyright(c) 2000-2004 Jacob Luna Lundberg. This document may agree with version 0.2.0. CONTENTS Immediate Attention AI Conservative Strategies Other thoughts IMMEDIATE ATTENTION AI purchasing needs a bunch of rewriting to make it more flexible and to allow us to suggest for example to buy something early on but only once. AI CONSERVATIVE STRATEGIES Suggestions from RJ Marquette: I have a suggestion for a new player, call him the "Economist": His goal, basically, is to get you to use your shields up via lots of napalm/missles that hit near the shields (rather than directly on them). What happens after two or three rounds is that the target can no longer afford to buy good shields or weapons. By the end of the game, they're almost helpless. (It's a long-term strategy instead of a one-round strategy.) Oh, yeah, he has to buy and use strong shields himself for this to work. I hope to merge these ideas as soon as I have some free time not hacking away at the network code :) OTHER THOUGHTS Need a hook to say whether AI hit the intended target; if not, then the AI should automagically modify the angle slightly to try to hit the target (note, they'll need to know if the tank was closer or farther from their strike) (this is also rather contingient on if either tank moves). Need an AI that maintains a list of targets to be attacked. Need to be able to restrict AI's from buying weapons above a certain yield -- this should make the AI's somewhat easier than they are now. xscorch-0.2.1/doc/make_text_data.pl0000755000175000001440000000054707737453534014206 00000000000000#!/usr/bin/env perl use strict; my $line; printf "const char %s[] = {\n ", $ARGV[0]; while($line = ) { my $i = 0; my $len = length($line); while($i < $len) { printf "0x%02x, ", ord(substr($line, $i, 1)); ++$i; if($i % 16 == 0 && $i < $len) { printf "\n "; } } printf "\n "; } printf "0x00 };\n"; xscorch-0.2.1/sai/0000755000175000001440000000000011615372006010735 500000000000000xscorch-0.2.1/sai/Makefile.am0000644000175000001440000000073707321776446012737 00000000000000## $Header: /fridge/cvs/xscorch/sai/Makefile.am,v 1.7 2001/07/08 06:26:46 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for AI code # noinst_LIBRARIES = libscorch_ai.a # Game code # libscorch_ai_a_SOURCES =\ sai.c \ sai.h \ saibuy.c \ saiint.h \ saitraj.c \ saiturn.c INCLUDES = xscorch-0.2.1/sai/Makefile.in0000644000175000001440000003713111615371715012735 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = sai DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_ai_a_AR = $(AR) $(ARFLAGS) libscorch_ai_a_LIBADD = am_libscorch_ai_a_OBJECTS = sai.$(OBJEXT) saibuy.$(OBJEXT) \ saitraj.$(OBJEXT) saiturn.$(OBJEXT) libscorch_ai_a_OBJECTS = $(am_libscorch_ai_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_ai_a_SOURCES) DIST_SOURCES = $(libscorch_ai_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for AI code # noinst_LIBRARIES = libscorch_ai.a # Game code # libscorch_ai_a_SOURCES = \ sai.c \ sai.h \ saibuy.c \ saiint.h \ saitraj.c \ saiturn.c INCLUDES = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sai/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sai/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_ai.a: $(libscorch_ai_a_OBJECTS) $(libscorch_ai_a_DEPENDENCIES) -rm -f libscorch_ai.a $(libscorch_ai_a_AR) libscorch_ai.a $(libscorch_ai_a_OBJECTS) $(libscorch_ai_a_LIBADD) $(RANLIB) libscorch_ai.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sai.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saibuy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saitraj.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saiturn.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/sai/sai.c0000644000175000001440000001254511175116126011604 00000000000000/* $Header: /fridge/cvs/xscorch/sai/sai.c,v 1.12 2009-04-26 17:39:34 jacob Exp $ */ /* xscorch - sai.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Main file for AI code This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include /* Main AI internal header */ #include /* Need config data structure */ #include /* Need sc_land_calculate_deltas */ #include /* Need for debugging code */ #include /* Need player data structure */ #include /* Random AI selection */ void sc_ai_init_game(__libj_unused const struct _sc_config *c, sc_player *p) { /* sc_ai_init_game */ if(p->aitype == SC_AI_RANDOM) { do { /* Need a random AI */ p->ai->realaitype = game_lrand(SC_AI_RANDOM); } while(p->ai->realaitype == SC_AI_HUMAN); } else { p->ai->realaitype = p->aitype; } /* Selecting a random AI? */ } void sc_ai_init_round(__libj_unused const struct _sc_config *c, sc_player *p) { /* sc_ai_init_round */ p->ai->victim = NULL; } sc_ai *sc_ai_new(void) { return((sc_ai *)malloc(sizeof(sc_ai))); } void sc_ai_free(sc_ai **ai) { if(ai == NULL || *ai == NULL) return; free(*ai); *ai = NULL; } sc_ai_controller *sc_ai_controller_new(void) { sc_ai_controller *aic; aic = (sc_ai_controller *)malloc(sizeof(sc_ai_controller)); if(aic == NULL) return(NULL); aic->humantargets = false; aic->allowoffsets = false; aic->alwaysoffset = false; aic->enablescan = false; aic->nobudget = false; return(aic); } void sc_ai_controller_free(sc_ai_controller **aic) { if(aic == NULL || *aic == NULL) return; free(*aic); *aic = NULL; } void sc_ai_trajectory_terminus(const sc_config *c, const sc_trajectory *tr) { if(SC_AI_DEBUG_VICTIMS) { const sc_player *vp; const sc_player *p; int dx; int dy; if(c == NULL || tr == NULL || tr->player == NULL) return; p = tr->player; if(p->ai == NULL || p->ai->victim == NULL) return; /* We hit something; was it near intended victim? */ vp = p->ai->victim; if(vp->index != tr->victim && tr->victim >= 0) { printf("trajectory(%d): intended victim %d, hit victim %d\n", p->index, vp->index, tr->victim); } if(sc_land_calculate_deltas(c->land, &dx, &dy, vp->x, vp->y, tr->curx, tr->cury)) { printf("trajectory(%d): was %g pixels away from intended victim %d\n", p->index, sqrt(SQR(dx) + SQR(dy)), vp->index); } } } /* AI types and codes */ static const char *_sc_player_ai_names[] = { "Human", "Network", "Moron", "Shooter", "Spreader", "Chooser", "Calculater", "Annihilater", "Insanity", "Unknown", NULL }; static const unsigned int _sc_player_ai_types[] = { SC_AI_HUMAN, SC_AI_NETWORK, SC_AI_MORON, SC_AI_SHOOTER, SC_AI_SPREADER, SC_AI_CHOOSER, SC_AI_CALCULATER, SC_AI_ANNIHILATER, SC_AI_INSANITY, SC_AI_RANDOM, 0 }; const char **sc_ai_names(void) { return(_sc_player_ai_names); } const unsigned int *sc_ai_types(void) { return(_sc_player_ai_types); } const char *sc_ai_name(sc_ai_type ai) { int index = 0; while(_sc_player_ai_names[index] != NULL) { if(_sc_player_ai_types[index] == ai) return(_sc_player_ai_names[index]); ++index; } return("Unknown"); } /* AI types and codes */ static const char *_sc_player_ai_names_nonet[] = { "Human", "Moron", "Shooter", "Spreader", "Chooser", "Calculater", "Annihilater", "Insanity", "Unknown", NULL }; static const unsigned int _sc_player_ai_types_nonet[] = { SC_AI_HUMAN, SC_AI_MORON, SC_AI_SHOOTER, SC_AI_SPREADER, SC_AI_CHOOSER, SC_AI_CALCULATER, SC_AI_ANNIHILATER, SC_AI_INSANITY, SC_AI_RANDOM, 0 }; const char **sc_ai_names_nonet(void) { return(_sc_player_ai_names_nonet); } const unsigned int *sc_ai_types_nonet(void) { return(_sc_player_ai_types_nonet); } /* AI types and codes */ static const char *_sc_player_ai_names_nohuman[] = { "Moron", "Shooter", "Spreader", "Chooser", "Calculater", "Annihilater", "Insanity", "Unknown", NULL }; static const unsigned int _sc_player_ai_types_nohuman[] = { SC_AI_MORON, SC_AI_SHOOTER, SC_AI_SPREADER, SC_AI_CHOOSER, SC_AI_CALCULATER, SC_AI_ANNIHILATER, SC_AI_INSANITY, SC_AI_RANDOM, 0 }; const char **sc_ai_names_nohuman(void) { return(_sc_player_ai_names_nohuman); } const unsigned int *sc_ai_types_nohuman(void) { return(_sc_player_ai_types_nohuman); } xscorch-0.2.1/sai/sai.h0000644000175000001440000000757011175116127011614 00000000000000/* $Header: /fridge/cvs/xscorch/sai/sai.h,v 1.8 2009-04-26 17:39:35 jacob Exp $ */ /* xscorch - sai.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Main header file for AI code This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sai_h_included #define __sai_h_included /* Includes */ #include /* Basic declarations */ /* Forward declarations */ struct _sc_config; struct _sc_player; struct _sc_trajectory; /* AI types */ typedef enum _sc_ai_type { SC_AI_HUMAN = 0, /* Human player */ SC_AI_NETWORK, /* Network-controlled player */ SC_AI_MORON, /* AI is a moron (random shooting) */ SC_AI_SHOOTER, /* Goes for line of sight; this AI will buy weapons that have the best yield/price, but will select weapons that have the best yield. */ SC_AI_SPREADER, /* Similar to SHOOTER, but buys weapons with best yield (not the most economical ones). */ SC_AI_CHOOSER, /* Chooses a victim, and attacks until they are dead. This AI buys only precision weaponry to increase its deadly accuracy to victim. */ SC_AI_CALCULATER, /* Like CHOOSER, but compensates for wind. */ SC_AI_ANNIHILATER, /* Shield? We don't need no steenking shield! */ SC_AI_INSANITY, /* No one knows ... */ SC_AI_RANDOM /* Randomly selected AI */ } sc_ai_type; /* AI function return codes */ typedef enum _sc_ai_result { SC_AI_NO_ACTION = 0, /* No action was taken (human player?) */ SC_AI_CONTINUE /* AI has acted; continue to next player */ } sc_ai_result; /* AI state */ typedef struct _sc_ai { const struct _sc_player *victim; /* Current victim of this AI */ sc_ai_type realaitype; /* The real AI type */ } sc_ai; /* AI controller config */ typedef struct _sc_ai_controller { bool humantargets; /* Human target practice */ bool allowoffsets; /* Allow offset to compensate for shielding */ bool alwaysoffset; /* Always offset targetting - assume shields */ bool enablescan; /* Enable scan refinement on harder AI's */ bool nobudget; /* Disable the "typical" budget constraints */ } sc_ai_controller; /* Condestructors */ sc_ai *sc_ai_new(void); void sc_ai_free(sc_ai **ai); sc_ai_controller *sc_ai_controller_new(void); void sc_ai_controller_free(sc_ai_controller **aic); /* AI functions */ void sc_ai_init_game(const struct _sc_config *c, struct _sc_player *p); void sc_ai_init_round(const struct _sc_config *c, struct _sc_player *p); sc_ai_result sc_ai_player_turn(const struct _sc_config *c, struct _sc_player *p); sc_ai_result sc_ai_player_buy(const struct _sc_config *c, struct _sc_player *p); void sc_ai_trajectory_terminus(const struct _sc_config *c, const struct _sc_trajectory *tr); const char * sc_ai_name(sc_ai_type ai); const char ** sc_ai_names(void); const unsigned int *sc_ai_types(void); const char ** sc_ai_names_nonet(void); const unsigned int *sc_ai_types_nonet(void); const char ** sc_ai_names_nohuman(void); const unsigned int *sc_ai_types_nohuman(void); #endif /* __sai_h_included? */ xscorch-0.2.1/sai/saibuy.c0000644000175000001440000006052211615366344012332 00000000000000/* $Header: /fridge/cvs/xscorch/sai/saibuy.c,v 1.31 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - sai.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ AI purchasing code This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include /* AI internal header */ #include /* Need basic configuration */ #include /* Need current economical state */ #include /* Need to get player inventory */ #include /* Need player data */ #include /* Yield calculations */ #include /* Used for status messages */ static inline int _sc_ai_budget(const sc_config *c, const sc_player *p) { /* sc_ai_budget Calculate the amount of money the AI is permitted to spend this turn */ const sc_economy_config *ec; /* Economy data */ double percent; /* Percentage of rounds played */ /* Any budget constraints? */ if(c->aicontrol->nobudget) { return(p->money * 0.75); } ec = c->economics; if(ec->computersbuy) { /* Only buy based on current interest rate, or the default conservative budget, whichever is larger */ if(ec->computersaggressive) { percent = SC_AI_AGGRESSIVE_BUDGET; } else { percent = SC_AI_CONSERVATIVE_BUDGET; } /* What rate should we set as the "minimum"? */ if(ec->interestrate > percent) { percent = ec->currentinterest; } /* Take maximum of "percent" and current interest rate */ /* Also factor in the number of rounds remaining :) */ percent += ((double)(c->curround + 1) / c->numrounds) * (1 - percent); if(percent > 1) percent = 1; if(SC_AI_DEBUG_BUY) { printf("AI_budget: %s, %s has budget %d\n", sc_ai_name(p->aitype), p->name, (int)(p->money * percent)); } /* That ought to be sufficiently devastating. */ return(p->money * percent); } /* Can computers buy? */ /* Computers cannot buy. */ return(0); } static bool _sc_ai_buy_last_weapons(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_last_weapons Buy the last weapons on the list that we can afford. This is a rather naive approach, in assuming that weapons at the end of the list must surely be better? */ sc_weapon_info *info; /* Weapon information */ int count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); int inner, outer; /* Iterators */ bool result = false; for(outer = SC_AI_BUY_MAX_OF_WEAPON; outer > 0; --outer) { info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); for(inner = count; inner > 0; --inner) { if(sc_inventory_can_buy_weapon(p, info, *budget) && sc_weapon_statistic(c->weapons, info, p, SC_WEAPON_STAT_YIELD) > 0) { /* Buy some of this weapon. */ sc_inventory_buy_weapon(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } result = true; } /* Can we buy this weapon? */ info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); } /* Iteration on info lists */ } /* Iterate multiples of weapons */ return(result); } static void _sc_ai_sorted_weapon_scores(sc_weapon_config *wc, int *ordering, double *scores) { /* sc_ai_sorted_weapon_scores Impose an ordering on the weapons, based on scores loaded into *scores. */ int inner, outer; /* Iterator variables... */ int count = sc_weapon_count(wc, SC_WEAPON_LIMIT_ALL); /* Bubble-sort the scores */ for(outer = 0; outer < count; ++outer) { for(inner = 0; inner < outer; ++inner) { if(scores[inner] > scores[outer]) { scores[inner] += scores[outer]; scores[outer] = scores[inner] - scores[outer]; scores[inner] = scores[inner] - scores[outer]; ordering[inner] += ordering[outer]; ordering[outer] = ordering[inner] - ordering[outer]; ordering[inner] = ordering[inner] - ordering[outer]; } } } } static bool _sc_ai_buy_weapons_from_list(const sc_config *c, sc_player *p, int *budget, const int *ordering) { /* sc_ai_buy_weapons_from_list Buys weapons from a presorted list, beginning at the _end_ of the list. */ sc_weapon_info *info; /* Weapon information. */ int count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); int inner, outer; /* iterators */ bool result = false; /* Iterate through, beginning with the "best" weapons. */ for(outer = 0; outer < SC_AI_BUY_MAX_OF_WEAPON; ++outer) { for(inner = count - 1; inner >= 0; --inner) { info = sc_weapon_lookup(c->weapons, ordering[inner], SC_WEAPON_LIMIT_ALL); /* We don't want to buy weapons that won't kill things! We also bias slightly in favor of buying weapons we don't own yet. */ if(sc_inventory_can_buy_weapon(p, info, *budget) && sc_weapon_statistic(c->weapons, info, p, SC_WEAPON_STAT_YIELD) && (outer || (info->inventories[p->index] / info->bundle) < SC_AI_INVENTORY_HIGH)) { /* buy some of this weapon. */ sc_inventory_buy_weapon(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } result = true; } /* Can we buy this weapon? */ } /* Buying weapons */ } /* Iterate multiples of weapons */ return(result); } static bool _sc_ai_buy_weapons_by_score(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_weapons_by_score Buy the weapons yielding the best destructive power. This is a great buying strategy for players that just want to annihilate the entire playing field. Coupled with agressive, this can be quite deadly! */ sc_weapon_info *info; int count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); /* Sorted indices, based on score. */ int *ordering = (int *)malloc(sizeof(int) * count); /* Sorted scores corresponding to ordering */ double *scores = (double *)malloc(sizeof(double) * count); int i; /* Iterator */ bool result; if(ordering == NULL || scores == NULL) { fprintf(stderr, "Malloc error in sc_ai_buy_weapons_by_score!\n"); free(ordering); free(scores); return(false); } /* Calculate scores, and set initial ordering */ info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_FORWARD); for(i = 0; i < count; ++i) { ordering[i] = info->ident; scores[i] = sc_weapon_statistic(c->weapons, info, p, SC_WEAPON_STAT_YIELD); info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_FORWARD); } /* Bubble-sort the scores */ _sc_ai_sorted_weapon_scores(c->weapons, ordering, scores); /* Iterate through, beginning with the "best" weapons. */ result = _sc_ai_buy_weapons_from_list(c, p, budget, ordering); free(ordering); free(scores); return(result); } static bool _sc_ai_buy_weapons_by_weighted_score(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_weapons_by_weighted_score Buy the weapons yielding the best destructive power per price of unit. This is the "efficient" way to buy, but there are times when a good screen-destroying weapon is better than a weapon that will take us 100 turns to wipe out the opponent... */ sc_weapon_info *info; int count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); /* Sorted indices, based on score. */ int *ordering = (int *)malloc(sizeof(int) * count); /* Sorted scores corresponding to ordering */ double *scores = (double *)malloc(sizeof(double) * count); int i; /* Iterator */ bool result; if(ordering == NULL || scores == NULL) { fprintf(stderr, "Malloc error in sc_ai_buy_weapons_by_weighted_score!\n"); free(ordering); free(scores); return(false); } /* Calculate scores, and set initial ordering */ info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_FORWARD); for(i = 0; i < count; ++i) { ordering[i] = info->ident; scores[i] = sc_weapon_statistic(c->weapons, info, p, SC_WEAPON_STAT_ECON_YIELD); info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_FORWARD); } /* Bubble-sort the scores */ _sc_ai_sorted_weapon_scores(c->weapons, ordering, scores); /* Iterate through, beginning with the "best" weapons. */ result = _sc_ai_buy_weapons_from_list(c, p, budget, ordering); free(ordering); free(scores); return(result); } static bool _sc_ai_buy_precision_weapons(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_precision_weapons Buy the weapons yielding high power and precision. This is for use by AI players who know exactly how to aim and exactly what/who they want to destroy. Such a player can take out her neighbor without also destroying herself as one might expect of AI players that make use of _sc_ai_buy_weapons_by_score(). */ sc_weapon_info *info; int count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); /* Sorted indices, based on score. */ int *ordering = (int *)malloc(sizeof(int) * count); /* Sorted scores corresponding to ordering */ double *scores = (double *)malloc(sizeof(double) * count); int i; /* Iterator */ bool result; if(ordering == NULL || scores == NULL) { fprintf(stderr, "Malloc error in sc_ai_buy_precision_weapons!\n"); free(ordering); free(scores); return(false); } /* Calculate scores, and set initial ordering */ info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_FORWARD); for(i = 0; i < count; ++i) { ordering[i] = info->ident; scores[i] = sc_weapon_statistic(c->weapons, info, p, SC_WEAPON_STAT_PRECISION_YIELD); info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_FORWARD); } /* Bubble-sort the scores */ _sc_ai_sorted_weapon_scores(c->weapons, ordering, scores); /* Iterate through, beginning with the "best" weapons. */ result = _sc_ai_buy_weapons_from_list(c, p, budget, ordering); free(ordering); free(scores); return(result); } static bool _sc_ai_buy_shield_sappers(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_shield_sappers Buy up Shield Sappers, which have no yield, but AIs can use them against shielded players. */ sc_weapon_info *info; /* Weapon information */ int count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); int sapbudget = *budget / 4; /* Sappers shouldn't drain the budget */ int inner, outer; /* Iterators */ bool result = false; /* TEMP - We're not using this for now. See the comment in the shield sappers section of saiturn.c for more information... */ return(result); for(outer = SC_AI_BUY_MAX_OF_WEAPON; outer > 0; --outer) { info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); for(inner = count; inner > 0; --inner) { if(sc_inventory_can_buy_weapon(p, info, sapbudget) && SC_WEAPON_IS_SAPPER(info)) { /* Buy some of this weapon. */ sc_inventory_buy_weapon(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } result = true; } /* Can we buy this weapon? */ info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); } /* Iteration on info lists */ } /* Iterate multiples of weapons */ return(result); } static bool _sc_ai_buy_auto_defense(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_auto_defense Buy auto-defense, only if this is a sequential game. */ sc_accessory_info *info; /* Item information */ int count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); /* Check if this is a sequential game. */ if(c->options.mode == SC_CONFIG_MODE_SYNCHRONOUS) return(false); /* If this is a sequential game, make damn sure we buy autodefense */ info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); for(; count > 0; --count) { if(sc_inventory_can_buy_accessory(p, info, *budget)) { /* Make sure the damn thing is auto-defence. */ if(SC_ACCESSORY_IS_AUTO_DEF(info)) { /* Buy some of this autodefense */ sc_inventory_buy_accessory(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } return(true); } /* Is accessory auto-defense? */ } /* Can we buy? */ info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); } /* Iterate through */ return(false); } static bool _sc_ai_buy_contact_triggers(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_contact_triggers Buy contact triggers if tunneling is allowed. */ sc_accessory_info *info; /* Item information */ int count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); /* Only buy if tunneling is allowed. */ if(!c->weapons->tunneling) return(false); /* Buy contact triggers if we can. */ info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); for(; count > 0; --count) { /* Make sure the damn thing is a contact trigger. */ if(SC_ACCESSORY_IS_TRIGGER(info)) { while(sc_inventory_can_buy_accessory(p, info, *budget)) { /* Buy some of these contact triggers */ sc_inventory_buy_accessory(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } return(true); } /* Can we buy? */ } /* Is accessory a contact trigger? */ info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); } /* Iterate through */ return(false); } static bool _sc_ai_buy_last_shields(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_last_shields Buy the last shields on the list that we can afford. This is a rather naive approach, in assuming that shields at the end of the list must surely be better? */ sc_accessory_info *info; /* Shield information */ int count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); /* Buy some shielding */ info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_REVERSE); for(; count > 0; --count) { if(sc_inventory_can_buy_accessory(p, info, *budget)) { /* Make sure the damn thing is a shield. */ if(SC_ACCESSORY_IS_SHIELD(info)) { /* Buy some of this shield */ sc_inventory_buy_accessory(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } return(true); /* That's all, for now */ } /* Is accessory a shield? */ } /* Can we buy? */ info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_REVERSE); } /* Iterate up the accessory list. */ return(false); } static void _sc_ai_sorted_accessory_scores(sc_accessory_config *ac, int *ordering, int *scores) { /* sc_ai_sorted_accessory_scores Impose an ordering on the accessorys, based on scores loaded into *scores. */ int inner, outer; /* Iterator variables... */ int count = sc_accessory_count(ac, SC_ACCESSORY_LIMIT_ALL); /* Bubble-sort the scores */ for(outer = 0; outer < count; ++outer) { for(inner = 0; inner < outer; ++inner) { if(scores[inner] > scores[outer]) { scores[inner] += scores[outer]; scores[outer] = scores[inner] - scores[outer]; scores[inner] = scores[inner] - scores[outer]; ordering[inner] += ordering[outer]; ordering[outer] = ordering[inner] - ordering[outer]; ordering[inner] = ordering[inner] - ordering[outer]; } } } } static bool _sc_ai_buy_shields_from_list(const sc_config *c, sc_player *p, int *budget, const int *ordering) { /* sc_ai_buy_shields_from_list Buy shields from the ordered list given; keep trying to buy until we find a set we can afford, then stop there. */ sc_accessory_info *info; /* Accessory information. */ int count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); /* Iterate through, beginning with the "best" shields. */ for(--count; count >= 0; --count) { /* Make sure the damn thing is a shield. */ info = sc_accessory_lookup(c->accessories, ordering[count], SC_ACCESSORY_LIMIT_ALL); if(SC_ACCESSORY_IS_SHIELD(info)) { /* Can we afford this set of shields? */ if(sc_inventory_can_buy_accessory(p, info, *budget)) { /* buy some of this shielding. */ sc_inventory_buy_accessory(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } return(true); /* That's all, for now */ } /* Can we buy these shields? */ } /* Is this accessory a shield? */ } /* Iterate through the shields */ return(false); } static bool _sc_ai_buy_best_shields(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_best_shields Buy the best shields on the list that we can afford. We will want to sort the shields out before deciding which to buy. */ sc_accessory_info *info; int count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); /* Sorted indices, based on score. */ int *ordering = (int *)malloc(sizeof(int) * count); /* Sorted scores corresponding to ordering */ int *scores = (int *)malloc(sizeof(int) * count); int i; /* Iterator */ bool result; if(ordering == NULL || scores == NULL) { fprintf(stderr, "Malloc error in sc_ai_buy_best_shields!\n"); free(ordering); free(scores); return(false); } /* Calculate scores, and set initial ordering */ info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); for(i = 0; i < count; ++i) { ordering[i] = info->ident; /* TEMP HACK - This should call a function in sgame/saccessory.c like the weapon version does. -JL */ /* TEMP NOTE ABOUT MY TEMP HACK - Actually maybe sgame/sshield.c would make more sense, heh... */ scores[i] = info->shield; /* = sc_accessory_yield(c->accessories, info); */ info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); } /* TEMP NOTE NO. 2 - Ideally we should decide what's best based on type as well... For example, a spreader probably prefers standard shielding. ? */ /* Bubble-sort the scores */ _sc_ai_sorted_accessory_scores(c->accessories, ordering, scores); /* Iterate through, beginning with the "best" shields. */ result = _sc_ai_buy_shields_from_list(c, p, budget, ordering); free(ordering); free(scores); return(result); } static bool _sc_ai_buy_batteries(const sc_config *c, sc_player *p, int *budget) { /* sc_ai_buy_batteries Buys some batteries for the AI. */ sc_accessory_info *info; int count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); /* Buy batteries if we can. */ info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); for(; count > 0; --count) { /* Make sure the damn thing is a battery. */ if(SC_ACCESSORY_IS_BATTERY(info)) { while(sc_inventory_can_buy_accessory(p, info, *budget) && sc_player_battery_count(c, p) < SC_AI_MAX_BATTERIES) { /* Buy some of these here batteries */ sc_inventory_buy_accessory(p, info); *budget -= info->price; if(SC_AI_DEBUG_BUY) { printf(" AI_buy: %s, %s bought %s. $%d\n", sc_ai_name(p->aitype), p->name, info->name, *budget); } return(true); } /* Can we buy? */ } /* Is accessory a battery? */ info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_FORWARD); } /* Iterate through */ return(false); } static inline void _sc_ai_buy_status(const sc_config *c, const sc_player *p) { /* sc_ai_buy_status */ if(SC_CONFIG_GFX_FAST(c)) return; sc_status_player_message(c->window, p, "AI player is buying ..."); sc_window_idle(c->window); } sc_ai_result sc_ai_player_buy(const sc_config *c, sc_player *p) { /* sc_ai_player_buy Buy some weapons and accessories. */ int budget; /* Amount of money allocated to spend */ budget = _sc_ai_budget(c, p); switch(p->ai->realaitype) { case SC_AI_HUMAN: return(SC_AI_NO_ACTION); break; case SC_AI_NETWORK: case SC_AI_RANDOM: /* No-ops */ break; case SC_AI_MORON: _sc_ai_buy_status(c, p); _sc_ai_buy_contact_triggers(c, p, &budget); _sc_ai_buy_auto_defense(c, p, &budget); _sc_ai_buy_last_shields(c, p, &budget); _sc_ai_buy_last_weapons(c, p, &budget); break; case SC_AI_SHOOTER: _sc_ai_buy_status(c, p); _sc_ai_buy_contact_triggers(c, p, &budget); _sc_ai_buy_auto_defense(c, p, &budget); _sc_ai_buy_best_shields(c, p, &budget); _sc_ai_buy_shield_sappers(c, p, &budget); _sc_ai_buy_weapons_by_weighted_score(c, p, &budget); break; case SC_AI_SPREADER: _sc_ai_buy_status(c, p); _sc_ai_buy_contact_triggers(c, p, &budget); _sc_ai_buy_auto_defense(c, p, &budget); _sc_ai_buy_best_shields(c, p, &budget); _sc_ai_buy_weapons_by_score(c, p, &budget); _sc_ai_buy_shield_sappers(c, p, &budget); break; case SC_AI_CHOOSER: _sc_ai_buy_status(c, p); _sc_ai_buy_contact_triggers(c, p, &budget); _sc_ai_buy_auto_defense(c, p, &budget); _sc_ai_buy_best_shields(c, p, &budget); _sc_ai_buy_shield_sappers(c, p, &budget); _sc_ai_buy_precision_weapons(c, p, &budget); _sc_ai_buy_batteries(c, p, &budget); break; case SC_AI_CALCULATER: _sc_ai_buy_status(c, p); _sc_ai_buy_contact_triggers(c, p, &budget); _sc_ai_buy_auto_defense(c, p, &budget); _sc_ai_buy_best_shields(c, p, &budget); _sc_ai_buy_shield_sappers(c, p, &budget); _sc_ai_buy_precision_weapons(c, p, &budget); _sc_ai_buy_batteries(c, p, &budget); break; case SC_AI_ANNIHILATER: case SC_AI_INSANITY: _sc_ai_buy_status(c, p); budget = p->money * 0.85; _sc_ai_buy_contact_triggers(c, p, &budget); _sc_ai_buy_weapons_by_score(c, p, &budget); budget = p->money; _sc_ai_buy_auto_defense(c, p, &budget); _sc_ai_buy_best_shields(c, p, &budget); _sc_ai_buy_batteries(c, p, &budget); _sc_ai_buy_shield_sappers(c, p, &budget); break; } return(SC_AI_CONTINUE); } xscorch-0.2.1/sai/saiint.h0000644000175000001440000000707011615366344012331 00000000000000/* $Header: /fridge/cvs/xscorch/sai/saiint.h,v 1.17 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - saiint.h Copyright(c) 2001,2000 Justin David Smith Copyright(c) 2002 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Internal header file for AI code This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __saiint_h_included #define __saiint_h_included /* Includes */ #include /* AI basic header */ /* Structures */ struct _sc_config; /* Debugging definitions */ #define SC_AI_DEBUG_BUY 0 #define SC_AI_DEBUG_TRAJECTORY 0 #define SC_AI_DEBUG_SELECT 0 #define SC_AI_DEBUG_VICTIMS 0 #define SC_AI_DEBUG_SCAN 0 /* General definitions */ #define SC_AI_POWER_DELTA_MAX 100 /* Maximum change in power */ #define SC_AI_ANGLE_DELTA_MAX 60 /* Maximum change in angle */ #define SC_AI_COMPENSATE_DELTA 8 /* Compensation for shields */ /* Definitions specific to moron */ #define SC_AI_MORON_MIN_POWER 200 /* Minimum permitted power */ /* Definitions specific to shooter */ #define SC_AI_SHOOTER_START_A 3 /* Start angle for shooter */ #define SC_AI_SHOOTER_DELTA_A 45 /* Delta angle (no line-of-sight) */ #define SC_AI_SHOOTER_SIGHT_A 70 /* Sight angle (if we have line-of-sight) */ /* Constants for scan refinement */ #define SC_AI_SCAN_MIN_POWER 200 /* Minimum permitted refinement power */ /* Definitions used by the validation */ #define SC_AI_VALIDATE_DIST 100 /* Distance to validate trajectory to */ /* Budget concerns */ #define SC_AI_CONSERVATIVE_BUDGET 0.10 /* Conservative budget (naive) */ #define SC_AI_AGGRESSIVE_BUDGET 0.30 /* Aggressive budget (naive) */ #define SC_AI_BUY_MAX_OF_WEAPON 3 /* Maximum amt of one weapon to buy */ #define SC_AI_BUY_MAX_OF_ACCESSORY 1 /* Maximum amt of one acces. to buy */ #define SC_AI_INVENTORY_HIGH 2 /* AI target purchase in bundles */ #define SC_AI_MAX_BATTERIES 30 /* Maximum number of batteries to buy */ /* AI prediction for trajectory selection */ #define SC_AI_WILL_OFFSET(c, p) ( (c)->aicontrol->allowoffsets && \ ((c)->aicontrol->alwaysoffset || \ (p)->shield != NULL) ) /* Trajectory selection code */ bool sc_ai_trajectory(const struct _sc_config *c, struct _sc_player *p, const struct _sc_player *victim); bool sc_ai_trajectory_line(const struct _sc_config *c, struct _sc_player *p, const struct _sc_player *victim); bool sc_ai_trajectory_wind(const struct _sc_config *c, struct _sc_player *p, const struct _sc_player *victim); bool sc_ai_trajectory_line_wind(const struct _sc_config *c, struct _sc_player *p, const struct _sc_player *victim); bool sc_ai_trajectory_scan(const struct _sc_config *c, struct _sc_player *p, const struct _sc_player *victim); #endif /* __saiint_h_included? */ xscorch-0.2.1/sai/saitraj.c0000644000175000001440000005642411175116127012472 00000000000000/* $Header: /fridge/cvs/xscorch/sai/saitraj.c,v 1.17 2009-04-26 17:39:35 jacob Exp $ */ /* xscorch - saitraj.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ AI turn code: specific functions to calculate, refine trajectory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include /* Main internal AI */ #include /* Need config struct */ #include /* We work with land/validate */ #include /* Need trajectories */ #include /* Need player structure */ #include /* Need tank/shield radius */ #include /* Need tunneling data */ /* TURN BACK NOW */ static inline void _sc_ai_trajectory_compensation(const sc_config *c, const sc_player *p, const sc_player *victim, int *deltax, int *deltay) { /* sc_ai_trajectory_compensation Compensation for shields, if offset targetting is allowed. The deltax, deltay values indicate the current position being targeted; they may be revised to indicate a new coordinate to target if offset targetting is used. */ assert(c != NULL && p != NULL && victim != NULL); assert(deltax != NULL && deltay != NULL); assert(SC_PLAYER_IS_ALIVE(victim)); assert(p->index != victim->index); if(SC_AI_WILL_OFFSET(c, victim)) { /* deltax is always along the shortest path, so we will choose to compensate even _closer_, i.e. bring the target nearer to us in all possible cases. If they are on a peak, this way instead of overshooting the mountain we take out the mountain >:) */ *deltax -= (SC_AI_COMPENSATE_DELTA + victim->tank->radius) * SGN(*deltax); } } static int _sc_ai_trajectory_angle_bounds(int deltax, int deltay, int maxdelta) { /* sc_ai_trajectory_angle_bounds Calculate the maximum permitted delta angle, for scanning for an optimal angle to fire at. maxdelta is the maximum delta angle permitted from the vertical, to either side. This function is also aware that angle cannot go below the vector angle from us to the victim. The value returned is the maximum delta from the vertical that angle may take on, and the return value <= maxdelta. */ double vectorangle;/*Vector angle from player to (dx,dy) */ int delta; /* Maximum angle we should take on, here. */ /* Calculate the vector angle. */ vectorangle = atan2(deltay, deltax) * 180 / M_PI; /* Start at the steepest angle allowed, and go down until we find a suitable trajectory. Note, we only have to check angles from the vertical, down to vectorangle; the trajectory cannot be below the vector angle, due to gravity. */ if(deltax >= 0) { /* We are firing to the right. */ if(vectorangle < 0) vectorangle = 0; delta = 90 - ceil(vectorangle); } else { /* We are firing to the left. */ if(vectorangle < 0) vectorangle = 180; delta = floor(vectorangle) - 90; } /* Which way are we firing? */ /* The AI also imposes certain max angles, as an extra sanity check. */ if(delta > maxdelta) delta = maxdelta; return(delta); } static bool _sc_ai_validate_angle(const sc_config *c, sc_player *p, int angle) { /* sc_ai_validate_angle Checks to see if there is a line of sight at least SC_AI_VALIDATE_DIST pixels away from the AI tank in the specified angle. This is to prevent the AI from firing directly into an adjacent cliff, causing the AI to get absorbed into its own explosion. Returns true if the path appears to be clear along the angle, and false otherwise. This is HEURISTIC! */ double dx; double dy; double x; double y; int step; int cx; int cy; assert(c != NULL && p != NULL); dx = SC_AI_VALIDATE_DIST * cos(angle * M_PI / 180); dy = SC_AI_VALIDATE_DIST * sin(angle * M_PI / 180); if(fabs(dx) > fabs(dy)) { step = ceil(fabs(dx)); } else { step = ceil(fabs(dy)); } x = sc_player_turret_x(p, angle); y = sc_player_turret_y(p, angle); dx /= step; dy /= step; while(step > 0) { cx = rint(x); cy = rint(y); if(sc_land_translate_xy(c->land, &cx, &cy)) { if(!SC_LAND_IS_SKY(*SC_LAND_XY(c->land, cx, cy))) { return(false); } } x += dx; y += dy; --step; } return(true); } bool sc_ai_trajectory(const sc_config *c, sc_player *p, const sc_player *victim) { /* sc_ai_trajectory Calculates trajectory to the specified coordinates, taking into account only the gravity. This function assumes we do not have a direct line of sight to (dx,dy); therefore, we must assume there is a tall mountain in the way, and find the steepest trajectory that is within our power limitations. This function returns true if a suitable trajectory was found, and false if the target is "unreachable". SHOOTER's use this mechanism primarily. */ sc_trajectory *t; /* Trajectory (temp variable) */ int deltax; /* Change in X, from player's position */ int deltay; /* Change in Y, from player's position */ int angle; /* Current angle we are trying. */ int power; /* Power required to reach (dx,dy) */ int maxdelta; /* Maximum delta scanning angle */ assert(c != NULL && p != NULL && victim != NULL); assert(SC_PLAYER_IS_ALIVE(victim)); assert(p->index != victim->index); /* Determine distance & angle between player and (dx,dy) */ if(!sc_land_calculate_deltas(c->land, &deltax, &deltay, p->x, p->y, victim->x, victim->y)) { deltax = victim->x - p->x; deltay = victim->y - p->y; } /* Compensation for shields */ _sc_ai_trajectory_compensation(c, p, victim, &deltax, &deltay); /* Start at the steepest angle allowed, and go down until we find a suitable trajectory. Note, we only have to check angles from the vertical, down to vectorangle; the trajectory cannot be below the vector angle, due to gravity. */ angle = 90 - SGN(deltax) * SC_AI_SHOOTER_START_A; maxdelta = _sc_ai_trajectory_angle_bounds(deltax, deltay, SC_AI_SHOOTER_DELTA_A); /* Scan for the steepest angle that gets us the trajectory we need. */ while(abs(angle - 90) <= maxdelta) { if(_sc_ai_validate_angle(c, p, angle)) { t = sc_traj_new_dest_angle(c, p, SC_TRAJ_IGNORE_WIND | SC_TRAJ_IGNORE_VISC, sc_player_turret_x(p, angle), sc_player_turret_y(p, angle), deltax, deltay, angle, SC_PLAYER_MAX_POWER * SC_PHYSICS_VELOCITY_SCL); if(t != NULL) { /* Found a suitable power level! */ power = DIST(t->velx, t->vely) / SC_PHYSICS_VELOCITY_SCL; sc_traj_free(&t); sc_player_set_power(c, p, power); sc_player_set_turret(c, p, angle); p->ai->victim = victim; if(SC_AI_DEBUG_TRAJECTORY) { printf("AI_trajectory: %s, %s no-line to %d, %d with power=%d, angle=%d\n", sc_ai_name(p->aitype), p->name, deltax, deltay, power, angle); } return(true); } /* Found a trajectory? */ } /* Is the angle valid? */ /* Try the next angle down... */ angle -= SGN(deltax); } /* No suitable trajectory was found. */ return(false); } bool sc_ai_trajectory_line(const sc_config *c, sc_player *p, const sc_player *victim) { /* sc_ai_trajectory_line Calculates trajectory to the specified coordinates, taking into account only the gravity. This function assumes we do have a direct line of sight to (dx,dy); therefore, we can choose any trajectory we like. Let's opt for the trajectory requiring the least amount of power. */ sc_trajectory *t; /* Trajectory (temp variable) */ int deltax; /* Change in X, from player's position */ int deltay; /* Change in Y, from player's position */ int angle; /* Current angle we are trying. */ int power; /* Power required to reach (dx,dy) */ int maxdelta; /* Maximum delta scanning angle */ int powermin; /* Best power value found. */ int anglemin; /* Best angle found so far */ assert(c != NULL && p != NULL && victim != NULL); assert(SC_PLAYER_IS_ALIVE(victim)); assert(p->index != victim->index); /* Determine distance & angle between player and (dx,dy) */ if(!sc_land_calculate_deltas(c->land, &deltax, &deltay, p->x, p->y, victim->x, victim->y)) { deltax = victim->x - p->x; deltay = victim->y - p->y; } /* Compensation for shields */ _sc_ai_trajectory_compensation(c, p, victim, &deltax, &deltay); /* Start at the steepest angle allowed, and go down until we find a suitable trajectory. Note, we only have to check angles from the vertical, down to vectorangle; the trajectory cannot be below the vector angle, due to gravity. */ angle = 90 - SGN(deltax) * SC_AI_SHOOTER_START_A; maxdelta = _sc_ai_trajectory_angle_bounds(deltax, deltay, SC_AI_SHOOTER_SIGHT_A); /* Try to find a trajectory consuming the least amount of power. */ anglemin = 90; powermin = SC_PLAYER_MAX_POWER + 1; while(abs(angle - 90) <= maxdelta) { if(_sc_ai_validate_angle(c, p, angle)) { t = sc_traj_new_dest_angle(c, p, SC_TRAJ_IGNORE_WIND | SC_TRAJ_IGNORE_VISC | SC_TRAJ_RESTRICTIVE, sc_player_turret_x(p, angle), sc_player_turret_y(p, angle), deltax, deltay, angle, SC_PLAYER_MAX_POWER * SC_PHYSICS_VELOCITY_SCL); if(t != NULL) { power = DIST(t->velx, t->vely) / SC_PHYSICS_VELOCITY_SCL; sc_traj_free(&t); if(power < powermin) { /* Found a better solution. */ anglemin = angle; powermin = power; } /* Is this sol'n better? */ } /* Found a valid trajectory */ } /* Is the angle valid? */ angle -= SGN(deltax); } /* Did we find an acceptable solution? */ if(powermin <= SC_PLAYER_MAX_POWER) { /* Yes; set new trajectory and power. */ sc_player_set_power(c, p, powermin); sc_player_set_turret(c, p, anglemin); p->ai->victim = victim; if(SC_AI_DEBUG_TRAJECTORY) { printf("AI_trajectory: %s, %s line to %d, %d with power=%d, angle=%d\n", sc_ai_name(p->aitype), p->name, deltax, deltay, powermin, anglemin); } return(true); } /* No suitable trajectory found */ return(false); } bool sc_ai_trajectory_wind(const sc_config *c, sc_player *p, const sc_player *victim) { /* sc_ai_trajectory_wind Calculates trajectory to the specified coordinates, taking into account gravity and wind. This function assumes we do not have a direct line of sight to (dx,dy); therefore, we must assume there is a tall mountain in the way, and find the steepest trajectory that is within our power limitations. This function returns 1 if a suitable trajectory was found, and zero if the target is "unreachable". CALCULATER's use this mechanism primarily. */ sc_trajectory *t; /* Trajectory (temp variable) */ int deltax; /* Change in X, from player's position */ int deltay; /* Change in Y, from player's position */ int angle; /* Current angle we are trying. */ int power; /* Power required to reach (dx,dy) */ int height; /* Height reached by this trajectory */ int powermax; /* Power which maximizes height */ int anglemax; /* Angle which maximizes height */ int heightmax; /* Maximum attained height. */ int flags; /* Default trajectory flags */ assert(c != NULL && p != NULL && victim != NULL); assert(SC_PLAYER_IS_ALIVE(victim)); assert(p->index != victim->index); /* Determine distance & angle between player and (dx,dy) */ if(!sc_land_calculate_deltas(c->land, &deltax, &deltay, p->x, p->y, victim->x, victim->y)) { deltax = victim->x - p->x; deltay = victim->y - p->y; } /* Compensation for shields */ _sc_ai_trajectory_compensation(c, p, victim, &deltax, &deltay); /* Start at the steepest angle allowed, and go down until we find a suitable trajectory. Note, we only have to check angles from the vertical, down to vectorangle; the trajectory cannot be below the vector angle, due to gravity. */ angle = 90 - SC_AI_SHOOTER_DELTA_A; /* Scan for the angle that gets us the highest trajectory we need. */ heightmax= -1; powermax = SC_PLAYER_MAX_POWER + 1; anglemax = 0; while(angle <= 90 + SC_AI_SHOOTER_DELTA_A) { if(_sc_ai_validate_angle(c, p, angle)) { if(c->weapons->tunneling && !p->contacttriggers) flags = SC_TRAJ_TUNNELING; else flags = SC_TRAJ_DEFAULTS; t = sc_traj_new_dest_angle(c, p, flags, sc_player_turret_x(p, angle), sc_player_turret_y(p, angle), deltax, deltay, angle, SC_PLAYER_MAX_POWER * SC_PHYSICS_VELOCITY_SCL); if(t != NULL) { power = DIST(t->velx, t->vely) / SC_PHYSICS_VELOCITY_SCL; height = sc_traj_height(t); sc_traj_free(&t); if(height > heightmax && power <= SC_PLAYER_MAX_POWER) { /* Found a new ideal trajectory */ heightmax= height; powermax = power; anglemax = angle; } /* Better traj? */ } /* Found a valid trajectory? */ } /* Is the angle valid? */ /* Try the next angle down... */ ++angle; } if(powermax <= SC_PLAYER_MAX_POWER) { /* Found a suitable power level! */ sc_player_set_power(c, p, powermax); sc_player_set_turret(c, p, anglemax); p->ai->victim = victim; if(SC_AI_DEBUG_TRAJECTORY) { printf("AI_trajectory: %s, %s no-line,wind to %d, %d with power=%d, angle=%d\n", sc_ai_name(p->aitype), p->name, deltax, deltay, powermax, anglemax); } return(true); } /* Found a trajectory? */ /* No suitable trajectory was found. */ return(false); } bool sc_ai_trajectory_line_wind(const sc_config *c, sc_player *p, const sc_player *victim) { /* sc_ai_trajectory_line_wind Calculates trajectory to the specified coordinates, taking into account gravity and wind. This function assumes we do have a direct line of sight to (dx,dy); therefore, we can choose any trajectory we like. Let's opt for the trajectory requiring the least amount of power. */ sc_trajectory *t; /* Trajectory (temp variable) */ int deltax; /* Change in X, from player's position */ int deltay; /* Change in Y, from player's position */ int angle; /* Current angle we are trying. */ int power; /* Power required to reach (dx,dy) */ int powermin; /* Best power value found. */ int anglemin; /* Best angle found so far */ assert(c != NULL && p != NULL && victim != NULL); assert(SC_PLAYER_IS_ALIVE(victim)); assert(p->index != victim->index); /* Determine distance & angle between player and (dx,dy) */ if(!sc_land_calculate_deltas(c->land, &deltax, &deltay, p->x, p->y, victim->x, victim->y)) { deltax = victim->x - p->x; deltay = victim->y - p->y; } /* Compensation for shields */ _sc_ai_trajectory_compensation(c, p, victim, &deltax, &deltay); /* Start at the steepest angle allowed, and go down until we find a suitable trajectory. Note, we only have to check angles from the vertical, down to vectorangle; the trajectory cannot be below the vector angle, due to gravity. */ angle = 90 - SC_AI_SHOOTER_SIGHT_A; /* Try to find a trajectory consuming the least amount of power. */ anglemin = 90; powermin = SC_PLAYER_MAX_POWER + 1; while(angle <= 90 + SC_AI_SHOOTER_SIGHT_A) { if(_sc_ai_validate_angle(c, p, angle)) { t = sc_traj_new_dest_angle(c, p, SC_TRAJ_RESTRICTIVE, sc_player_turret_x(p, angle), sc_player_turret_y(p, angle), deltax, deltay, angle, SC_PLAYER_MAX_POWER * SC_PHYSICS_VELOCITY_SCL); if(t != NULL) { power = DIST(t->velx, t->vely) / SC_PHYSICS_VELOCITY_SCL; sc_traj_free(&t); if(power < powermin) { /* Found a better solution. */ anglemin = angle; powermin = power; } /* Is this sol'n better? */ } /* Found a valid trajectory? */ } /* Is the angle valid? */ ++angle; } /* Did we find an acceptable solution? */ if(powermin <= SC_PLAYER_MAX_POWER) { /* Yes; set new trajectory and power. */ sc_player_set_power(c, p, powermin); sc_player_set_turret(c, p, anglemin); p->ai->victim = victim; if(SC_AI_DEBUG_TRAJECTORY) { printf("AI_trajectory: %s, %s line,wind to %d, %d with power=%d, angle=%d\n", sc_ai_name(p->aitype), p->name, deltax, deltay, powermin, anglemin); } return(true); } /* No suitable trajectory found */ return(false); } static bool _sc_ai_trajectory_scan(const sc_config *c, sc_player *p, const sc_player *victim, int *newpower, int *newangle, int minangle, int maxangle, int deltaangle, int minpower, int maxpower, int deltapower, double maxdist) { /* _sc_ai_trajectory_scan Scans all possible turret angles and power levels, trying to find the best way to hit the intended victim. This uses the real trajectory mechanism so this should take every possible contingency into account. */ sc_trajectory_result result; sc_trajectory *t; /* Trajectory (temp variable) */ int deltax; /* Change in X, from player's position */ int deltay; /* Change in Y, from player's position */ double dist; /* Distance off from desired destination */ int angle; /* Current angle we are trying. */ int power; /* Power required to reach (dx,dy) */ double distmin; /* Best distance found... */ int powermin; /* Best power value found. */ int anglemin; /* Best angle found so far */ int tx; /* Targetted X coordinate */ int ty; /* Targetted Y coordinate */ assert(c != NULL && p != NULL && victim != NULL); assert(newpower != NULL && newangle != NULL); assert(minangle <= maxangle); assert(minpower <= maxpower); assert(deltaangle > 0); assert(deltapower > 0); assert(maxdist > 0); assert(SC_PLAYER_IS_ALIVE(victim)); assert(p->index != victim->index); /* Determine distance & angle between player and (dx,dy) */ if(!sc_land_calculate_deltas(c->land, &deltax, &deltay, p->x, p->y, victim->x, victim->y)) { deltax = victim->x - p->x; deltay = victim->y - p->y; } /* Compensation for shields */ _sc_ai_trajectory_compensation(c, p, victim, &deltax, &deltay); /* Construct the desired target coordinate */ tx = p->x + deltax; ty = p->y + deltay; /* Try to find a trajectory consuming the least amount of power. */ if(SC_AI_DEBUG_SCAN) { printf("aiscan(%d): scanning\n", p->index); } anglemin = 90; powermin = SC_PLAYER_MAX_POWER + 1; distmin = 0; for(angle = minangle; angle <= maxangle; angle += deltaangle) { if(SC_AI_DEBUG_SCAN) { printf("aiscan(%d): scanning angle %d\n", p->index, angle); } for(power = minpower; power < maxpower && power < SC_PLAYER_MAX_POWER; power += deltapower) { if(power >= SC_AI_SCAN_MIN_POWER) { t = sc_traj_new_power_angle(c, p, SC_TRAJ_NO_MODIFY, sc_player_turret_x(p, angle), sc_player_turret_y(p, angle), power * SC_PHYSICS_VELOCITY_SCL, angle); if(t != NULL) { result = sc_traj_run((sc_config *)c, t, SC_TRAJ_NO_MODIFY, NULL, NULL); if(SC_TRAJ_IS_IMPACT(result) && result != SC_TRAJ_IMPACT_SHIELD) { /* Check to see how close the impact was */ if(sc_land_calculate_deltas(c->land, &deltax, &deltay, tx, ty, rint(t->curx), rint(t->cury))) { dist = SQR((double)deltax) + SQR((double)deltay); if(dist < distmin || powermin > SC_PLAYER_MAX_POWER) { anglemin = angle; powermin = power; distmin = dist; } /* new optimal */ } else if(SC_AI_DEBUG_SCAN) { printf(" %d, %d: no deltas!\n", power, angle); } } else if(SC_AI_DEBUG_SCAN) { printf(" %d, %d: no impact!\n", power, angle); } sc_traj_free(&t); } else if(SC_AI_DEBUG_SCAN) { printf(" %d, %d: no traj!\n", power, angle); } } /* min power satisfied? */ } /* power loop */ } /* angle loop */ /* Did we find an acceptable solution? */ if(powermin <= SC_PLAYER_MAX_POWER && distmin >= 0 && distmin <= SQR(maxdist)) { /* Yes; set new trajectory and power. */ *newpower = powermin; *newangle = anglemin; if(SC_AI_DEBUG_SCAN) { printf("aiscan(%d): done with %g at pow %d, ang %d\n", p->index, sqrt(distmin), powermin, anglemin); } return(true); } /* No suitable trajectory found */ if(SC_AI_DEBUG_SCAN) { printf("aiscan(%d): done with %g, bad\n", p->index, sqrt(distmin)); } return(false); } bool sc_ai_trajectory_scan(const sc_config *c, sc_player *p, const sc_player *victim) { /* sc_ai_trajectory_scan Scan for an optimal trajectory to the specified victim. Returns true if one was found, false otherwise. */ int power; int angle; assert(c != NULL && p != NULL && victim != NULL); assert(SC_PLAYER_IS_ALIVE(victim)); assert(p->index != victim->index); power = p->power; angle = p->turret; if(SC_AI_DEBUG_SCAN) { printf("aiscan(%d): initial configuration is pow %d ang %d\n", p->index, power, angle); } if(!_sc_ai_trajectory_scan(c, p, victim, &power, &angle, angle - 20, angle + 20, 10, power - 100, power + 100, 50, 150)) return(false); if(!_sc_ai_trajectory_scan(c, p, victim, &power, &angle, angle - 4, angle + 4, 1, power - 20, power + 20, 5, 50)) return(false); if(power == p->power && angle == p->turret) return(false); if(SC_AI_DEBUG_SCAN) { printf("aiscan(%d): accepted refinement to pow %d ang %d\n", p->index, power, angle); } sc_player_set_power(c, p, power); sc_player_set_turret(c, p, angle); p->ai->victim = victim; return(true); } xscorch-0.2.1/sai/saiturn.c0000644000175000001440000004267711615366344012536 00000000000000/* $Header: /fridge/cvs/xscorch/sai/saiturn.c,v 1.33 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - saiturn.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2002-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ AI turn code This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include /* Main internal AI header */ #include /* Dereference config for ph ptr */ #include /* Need inv count (weapon selection) */ #include /* Land's line-of-sight function */ #include /* Need access to player functions */ #include /* Raising/lowering shields */ #include /* Need tank radius data */ #include /* How many weapons are there? */ #include /* Needed for the status display */ #include /* Needed for random trajectory */ /* Not you again. *sigh* Ed: Do you own a video camera? Renee: No, Fred hates them. Fred: I like to remember things my own way. Ed: What do you mean by that? Fred: How I remember them, not necessarily the way they happened. The whole key is right there. It's just a matter of applying it */ typedef bool (*trajfn)(const struct _sc_config *c, sc_player *p, const sc_player *vp); static void _sc_ai_select_last_weapon(const sc_config *c, sc_player *p) { /* sc_ai_select_last_weapon Selects the last (highest-index) weapon available to the AI. The naive AI's make the assumption that weapons further down the inventory list must clearly be better. */ sc_weapon_info *info; int count; assert(c != NULL && p != NULL); count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); for(/* No initializer */; count > 0; --count) { if(info->inventories[p->index] > 0) { /* We found a weapon.. */ if(SC_AI_DEBUG_SELECT) { printf(" AI %s selected weapon \"%s\"\n", sc_ai_name(p->aitype), info->name); } sc_player_set_weapon(c, p, info); return; } /* Do we have this weapon? */ } /* Looking for a weapon... */ /* Well, heh, if we get here we have no weapons -- should be impossible. */ if(SC_AI_DEBUG_SELECT) { printf(" AI %s has no weapons to fire!\n", sc_ai_name(p->aitype)); } } static void _sc_ai_select_weapon_by_score(const sc_config *c, sc_player *p) { /* sc_ai_select_weapon_by_score Selects the highest-ranked weapon available to the AI. This is slightly better, but we might end up selecting a very powerful weapon to kill only a single tank. */ sc_weapon_info *info; /* Weapon tracking */ sc_weapon_info *maxinfo; /* Weapon index of best weapon */ sc_weapon_info *nextinfo; /* Weapon index of second-best */ int maxscore; /* Score of best weapon so far */ int nextscore; /* Score of second best weapon */ int score; /* Score of current weapon */ int count; /* Iterator */ assert(c != NULL && p != NULL); /* Setup and iterate */ count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); maxinfo = NULL; nextinfo= NULL; maxscore = 0; nextscore= -1; for(/* No initializer */; count > 0; --count) { if(info->inventories[p->index] > 0) { /* We have some of this weapon; is it ideal? */ score = sc_weapon_statistic(c->weapons, info, p, SC_WEAPON_STAT_YIELD); if(score > maxscore) { /* This weapon is ideal (so far) */ nextinfo = maxinfo; nextscore= maxscore; maxinfo = info; maxscore = score; } else if(score > nextscore) { /* weapon is second-best (so far) */ nextinfo = info; nextscore= score; } /* Does this weapon have a better score? */ } /* Do we have this weapon in inventory? */ info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); } /* Loop through all weapons. */ /* Set new weapon to one of the "best" found. */ if(nextinfo != NULL && game_drand() < (double)nextscore / (nextscore + maxscore)) { /* Probabilistically select "next best" */ maxinfo = nextinfo; } /* We have only one option now */ if(maxinfo != NULL) { sc_player_set_weapon(c, p, maxinfo); if(SC_AI_DEBUG_SELECT) { printf(" AI %s selected weapon \"%s\"\n", sc_ai_name(p->aitype), maxinfo->name); } } else if(SC_AI_DEBUG_SELECT) { printf(" AI %s has no weapons to fire!\n", sc_ai_name(p->aitype)); } } static void _sc_ai_select_shield_sappers(const sc_config *c, sc_player *p, const sc_player *target) { /* sc_ai_select_shield_sappers If we are not selecting offset targetting and the target is shielded, then we will fire shield sappers if we have them. */ int count; sc_weapon_info *info; sc_weapon_info *sapper; assert(c != NULL && p != NULL); assert(target == NULL || SC_PLAYER_IS_ALIVE(target)); assert(target == NULL || p->index != target->index); /* TEMP - We cannot use shield sappers because AI purchasing economics are currently too fucked up. Also most AIs couldn't hit a mountain if they were in the middle of it! */ return; /* We only use the Shield Sappers if the AI intends to hit dead on. */ if(target == NULL || SC_AI_WILL_OFFSET(c, target)) return; /* We only use Sappers if the target is shielded. */ if(target->shield == NULL) return; /* We don't use Sappers if our primary weapon choice is a spread weapon. */ if(SC_WEAPON_SCATTERING(p->selweapon)) return; /* Search for a shield sapping weapon in AI inventory. */ count = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); sapper = NULL; for(; count > 0; --count) { if(SC_WEAPON_IS_SAPPER(info) && info->inventories[p->index] > 0) { sapper = info; break; } else { info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); } } /* Set the weapon, if we found one. */ if(sapper != NULL) { sc_player_set_weapon(c, p, sapper); if(SC_AI_DEBUG_SELECT) { printf(" AI %s using Shield Sappers (special select)\n", sc_ai_name(p->aitype)); } } else if(SC_AI_DEBUG_SELECT) { printf(" AI %s wanted Shield Sappers but has none\n", sc_ai_name(p->aitype)); } } static const sc_player *_sc_ai_random_fire(const sc_config *c, sc_player *p) { /* sc_ai_random_fire Fires a random trajectory and power. This is the simplest form of AI; currently, MORON uses it exclusively, and other AI's may use this mechanism as a starter or a fallback targetting system. */ int min_power; int max_power; int power_range; int power; assert(c != NULL && p != NULL); /* Mark Anderson corrected this in 20011029015201.A3951@www.muking.org */ min_power = max(SC_AI_MORON_MIN_POWER, p->power - SC_AI_POWER_DELTA_MAX); max_power = max(SC_AI_MORON_MIN_POWER, p->power + SC_AI_POWER_DELTA_MAX); power_range = max_power - min_power; power = min_power + game_lrand(power_range + 1); /* Set a new angle and power level. */ sc_player_advance_turret(c, p, game_lrand(SC_AI_ANGLE_DELTA_MAX * 2 + 1) - SC_AI_ANGLE_DELTA_MAX); sc_player_set_power(c, p, power); /* No victim used */ p->ai->victim = NULL; if(SC_AI_DEBUG_TRAJECTORY) { printf("AI_trajectory: %s, %s random fire.\n", sc_ai_name(p->aitype), p->name); } return(NULL); } static inline int _sc_ai_line_of_sight(const sc_config *c, sc_player *p, const sc_player *vp, trajfn line, trajfn noline) { /* sc_ai_line_of_sight Call the appropriate trajectory function. */ assert(c != NULL && p != NULL && vp != NULL); assert(SC_PLAYER_IS_ALIVE(vp)); assert(p->index != vp->index); if(sc_land_line_of_sight(c,c->land, p->x - p->tank->radius, p->y, vp->x - p->tank->radius, vp->y) || sc_land_line_of_sight(c, c->land, p->x - p->tank->radius, p->y, vp->x + p->tank->radius, vp->y) || sc_land_line_of_sight(c, c->land, p->x + p->tank->radius, p->y, vp->x - p->tank->radius, vp->y) || sc_land_line_of_sight(c, c->land, p->x + p->tank->radius, p->y, vp->x + p->tank->radius, vp->y)) { return(line(c, p, vp)); } else { return(noline(c, p, vp)); } } static void _sc_ai_target_practice(const sc_config *c, sc_player **playerlist) { /* sc_ai_target_practice I feel kind of sorry for the poor, poor humans... Actually, no, I don't :) */ sc_player *tmp; int i; int j; assert(c != NULL && playerlist != NULL); if(!c->aicontrol->humantargets) return; for(i = 0; i < c->numplayers; ++i) { if(playerlist[i]->aitype == SC_AI_HUMAN) { tmp = playerlist[i]; for(j = 0; j < i && tmp != NULL; ++j) { if(playerlist[j]->aitype != SC_AI_HUMAN) { playerlist[i] = playerlist[j]; playerlist[j] = tmp; tmp = NULL; } } } } } static const sc_player *_sc_ai_calculated_fire(const sc_config *c, sc_player *p) { /* sc_ai_calculated_fire See if we can shoot anyone with the above two trajectory mechanisms. We check players in random order, and if we can reach any of them, then fire we go. Otherwise, we fall back on random firing scheme. This mechanism only considers gravity, which is sufficient for up to CHOOSER. */ const sc_player *playerlist[SC_MAX_PLAYERS]; /* List of players, random order */ const sc_player *vp; /* Current "victim" */ int victim; /* Index to "victim" */ assert(c != NULL && p != NULL); /* Get a random ordering of players */ sc_player_random_order((sc_config *)c, (sc_player **)playerlist); _sc_ai_target_practice(c, (sc_player **)playerlist); /* Try to find a victim. */ victim = 0; while(victim < c->numplayers) { vp = playerlist[victim]; if(p->index != vp->index && SC_PLAYER_IS_ALIVE(vp)) { /* "Victim" isn't ourself (that would suck) */ if(_sc_ai_line_of_sight(c, p, vp, sc_ai_trajectory_line, sc_ai_trajectory)) { /* Victim selected */ return(vp); } } /* Make sure victim isn't self */ ++victim; /* Next please */ } /* Looking for a victim ... */ /* No suitable victim; just fire at random. */ return(_sc_ai_random_fire(c, p)); } static const sc_player *_sc_ai_calculated_fire_wind(const sc_config *c, sc_player *p) { /* sc_ai_calculated_fire_wind See if we can shoot anyone with the above two trajectory mechanisms. We check players in random order, and if we can reach any of them, then fire we go. Otherwise, we fall back on random firing scheme. This mechanism considers gravity and wind, which CALCULATER needs. */ const sc_player *playerlist[SC_MAX_PLAYERS]; /* List of players, random order */ const sc_player *vp; /* Current "victim" */ int victim; /* Index to "victim" */ assert(c != NULL && p != NULL); /* Get a random ordering of players */ sc_player_random_order((sc_config *)c, (sc_player **)playerlist); _sc_ai_target_practice(c, (sc_player **)playerlist); /* Try to find a victim. */ victim = 0; while(victim < c->numplayers) { vp = playerlist[victim]; if(p->index != vp->index && SC_PLAYER_IS_ALIVE(vp)) { /* "Victim" isn't ourself (that would suck) */ if(_sc_ai_line_of_sight(c, p, vp, sc_ai_trajectory_line_wind, sc_ai_trajectory_wind)) { /* Victim selected */ return(vp); } } /* Make sure victim isn't self */ ++victim; /* Next please */ } /* Looking for a victim ... */ /* No suitable victim; just fire at random. */ return(_sc_ai_random_fire(c, p)); } static const sc_player *_sc_ai_fire_at_victim(const sc_config *c, sc_player *p) { /* sc_ai_fire_at_victim Attack victim in AI state. If NULL or they are dead, then behave like calculated_fire. This is the "big bully" behaviour; once a victim is chosen, well, they're pretty much dead. */ const sc_player *vp; assert(c != NULL && p != NULL); /* Is the victim still alive? */ vp = p->ai->victim; if(vp != NULL && SC_PLAYER_IS_ALIVE(vp)) { /* "Victim" isn't dead; can we shoot them? */ if(_sc_ai_line_of_sight(c, p, vp, sc_ai_trajectory_line, sc_ai_trajectory)) { /* I AM A RETURN STATEMENT! FEAR MY WRATH! */ return(vp); } } /* Was victim alive? */ /* If at this point, we have no victim; find another. */ return(_sc_ai_calculated_fire(c, p)); } static const sc_player *_sc_ai_fire_at_victim_ruthlessly(const sc_config *c, sc_player *p) { /* sc_ai_fire_at_victim_ruthlessly Attack victim in AI state. If NULL or they are dead, then behave like calculated_fire. This is the "big bully" behaviour; once a victim is chosen, well, they're pretty much dead. This is insane, it compensates for wind. */ const sc_player *vp; assert(c != NULL && p != NULL); /* Is the victim still alive? */ vp = p->ai->victim; if(vp != NULL && SC_PLAYER_IS_ALIVE(vp)) { /* "Victim" isn't dead; can we shoot them? */ if(_sc_ai_line_of_sight(c, p, vp, sc_ai_trajectory_line_wind, sc_ai_trajectory_wind)) { /* I AM A RETURN STATEMENT! PH33R MY LACK OF B33R! */ return(vp); } } /* Was victim alive? */ /* If at this point, we have no victim; find another. */ return(_sc_ai_calculated_fire_wind(c, p)); } static void _sc_ai_raise_shields(const sc_config *c, sc_player *p) { /* sc_ai_raise_shields If we don't have any shielding, raise them now. */ assert(c != NULL && p != NULL); if(p->shield == NULL || p->shield->life <= 0) { sc_player_activate_best_shield(c, p); } } static void _sc_ai_set_contact_triggers(const sc_config *c, sc_player *p) { /* sc_ai_set_contact_triggers Always try to arm the contact triggers, if we have any. */ assert(c != NULL && p != NULL); sc_player_set_contact_triggers(c, p, true); } static void _sc_ai_recharge_tank(const sc_config *c, sc_player *p) { /* sc_ai_recharge_tank Recharge tank to full health, if weakened. */ assert(c != NULL && p != NULL); while(sc_player_activate_battery(c, p)) /* Just loop */; } static inline void _sc_ai_turn_status(const sc_config *c, const sc_player *p) { /* sc_ai_turn_status */ assert(c != NULL && p != NULL); if(SC_CONFIG_GFX_FAST(c)) return; sc_status_player_message(c->window, p, "AI player is taking their turn ..."); sc_window_idle(c->window); } sc_ai_result sc_ai_player_turn(const sc_config *c, sc_player *p) { /* sc_ai_player_turn AI player takes a turn. */ const sc_player *target = NULL; assert(c != NULL && p != NULL); switch(p->ai->realaitype) { case SC_AI_HUMAN: return(SC_AI_NO_ACTION); break; case SC_AI_RANDOM: case SC_AI_NETWORK: /* No-ops */ break; case SC_AI_MORON: _sc_ai_turn_status(c, p); _sc_ai_raise_shields(c, p); _sc_ai_set_contact_triggers(c, p); _sc_ai_recharge_tank(c, p); _sc_ai_select_last_weapon(c, p); target = _sc_ai_random_fire(c, p); _sc_ai_select_shield_sappers(c, p, target); break; case SC_AI_SHOOTER: case SC_AI_SPREADER: _sc_ai_turn_status(c, p); _sc_ai_raise_shields(c, p); _sc_ai_set_contact_triggers(c, p); _sc_ai_recharge_tank(c, p); _sc_ai_select_weapon_by_score(c, p); target = _sc_ai_calculated_fire(c, p); _sc_ai_select_shield_sappers(c, p, target); break; case SC_AI_CHOOSER: _sc_ai_turn_status(c, p); _sc_ai_raise_shields(c, p); _sc_ai_set_contact_triggers(c, p); _sc_ai_recharge_tank(c, p); _sc_ai_select_weapon_by_score(c, p); target = _sc_ai_fire_at_victim(c, p); _sc_ai_select_shield_sappers(c, p, target); break; case SC_AI_CALCULATER: case SC_AI_ANNIHILATER: case SC_AI_INSANITY: _sc_ai_turn_status(c, p); _sc_ai_raise_shields(c, p); _sc_ai_set_contact_triggers(c, p); _sc_ai_recharge_tank(c, p); _sc_ai_select_weapon_by_score(c, p); target = _sc_ai_fire_at_victim_ruthlessly(c, p); _sc_ai_select_shield_sappers(c, p, target); if(c->aicontrol->enablescan) { if(p->ai->victim != NULL) sc_ai_trajectory_scan(c, p, p->ai->victim); } /* scan refinement? */ break; } return(SC_AI_CONTINUE); } xscorch-0.2.1/sconsole/0000755000175000001440000000000011615372006012006 500000000000000xscorch-0.2.1/sconsole/Makefile.am0000644000175000001440000000066107263671465014004 00000000000000## $Header: /fridge/cvs/xscorch/sconsole/Makefile.am,v 1.3 2001/04/07 20:06:13 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig if NETWORK noinst_LIBRARIES = libscorch_console.a endif libscorch_console_a_SOURCES =\ swindow-console.c \ swindow-console.h INCLUDES = xscorch-0.2.1/sconsole/Makefile.in0000644000175000001440000003661411615371715014013 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = sconsole DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_console_a_AR = $(AR) $(ARFLAGS) libscorch_console_a_LIBADD = am_libscorch_console_a_OBJECTS = swindow-console.$(OBJEXT) libscorch_console_a_OBJECTS = $(am_libscorch_console_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_console_a_SOURCES) DIST_SOURCES = $(libscorch_console_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig @NETWORK_TRUE@noinst_LIBRARIES = libscorch_console.a libscorch_console_a_SOURCES = \ swindow-console.c \ swindow-console.h INCLUDES = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sconsole/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sconsole/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_console.a: $(libscorch_console_a_OBJECTS) $(libscorch_console_a_DEPENDENCIES) -rm -f libscorch_console.a $(libscorch_console_a_AR) libscorch_console.a $(libscorch_console_a_OBJECTS) $(libscorch_console_a_LIBADD) $(RANLIB) libscorch_console.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swindow-console.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/sconsole/swindow-console.c0000644000175000001440000001543611175116130015230 00000000000000/* $Header: /fridge/cvs/xscorch/sconsole/swindow-console.c,v 1.14 2009-04-26 17:39:36 jacob Exp $ */ /* xscorch - swindow-console.c Copyright(c) 2001-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Console interface to xscorch (server) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #define _BSD_SOURCE /* Needed for usleep */ #include #include #include #include #include sc_window *sc_window_new(struct _sc_config *c, __libj_unused int argc, __libj_unused char **argv) { /* sc_window_new */ sc_window_console *w; /* Window data structure */ /* TEMP WARNING */ fprintf(stderr, "xscorch-server: This program doesn't actually do anything (yet).\n"); fprintf(stderr, " Eventually it will allow for xscorch metaservers and\n"); fprintf(stderr, " for running a server without the graphical client.\n"); /* Allocate the window data structure */ w = (sc_window_console *)malloc(sizeof(sc_window_console)); if(w == NULL) { fprintf(stderr, "Malloc error creating console window.\n"); return(NULL); } /* Initialise the window data structure */ w->c = c; /* That's all! */ return((sc_window *)w); } void sc_window_free(sc_window **w) { /* sc_window_free */ if(w == NULL || *w == NULL) return; free(*w); *w = NULL; } void sc_window_run(sc_window *w_) { /* sc_window_run */ sc_window_console *w = (sc_window_console *)w_; if(w == NULL) return; while(true) { sc_state_run(w->c, w->c->game); usleep(SC_SLEEP_TIME * 1000); } /* Execution loop */ } void sc_window_idle(__libj_unused sc_window *w) { /* sc_window_idle */ } void sc_window_update(__libj_unused sc_window *w) { /* sc_winodw_update */ } void sc_window_message(__libj_unused sc_window *w, const char *title, const char *msg) { /* sc_winodw_message */ printf("%s: %s\n", title, msg); } void sc_status_update(__libj_unused sc_window *w, const sc_player *p) { /* sc_status_update */ printf("status: Player \"%s\" update.\n", p->name); } void sc_status_message(__libj_unused sc_window *w, const char *msg) { /* sc_status_message */ printf("status: %s\n", msg); } void sc_status_player_message(__libj_unused sc_window *w, const struct _sc_player *p, const char *msg) { /* sc_status_player_message */ printf("status: %s: %s\n", p->name, msg); } void sc_status_setup(__libj_unused sc_window *w) { /* sc_status_setup */ } void sc_status_suspend(__libj_unused sc_window *w) { /* sc_status_suspend */ } void sc_status_resume(__libj_unused sc_window *w) { /* sc_status_resume */ } void sc_window_paint(__libj_unused sc_window *w, __libj_unused int x1, __libj_unused int y1, __libj_unused int x2, __libj_unused int y2, __libj_unused int flag) { /* sc_window_paint */ } void sc_window_paint_circular(__libj_unused sc_window *w, __libj_unused int centerx, __libj_unused int centery, __libj_unused int rad, __libj_unused int flag) { /* sc_window_paint_circular */ } void sc_window_resize(__libj_unused sc_window *w) { /* sc_window_resize */ } void sc_window_draw_tank(__libj_unused sc_window *w, __libj_unused const struct _sc_player *p) { /* sc_window_draw_tank */ } void sc_window_undraw_tank(__libj_unused sc_window *w, __libj_unused const struct _sc_player *p) { /* sc_window_undraw_tank */ } void sc_window_redraw_tank(__libj_unused sc_window *w, __libj_unused const struct _sc_player *p) { /* sc_window_redraw_tank */ } void sc_window_draw_weapon(__libj_unused sc_window *w, __libj_unused const struct _sc_weapon *wp) { /* sc_window_draw_weapon */ } void sc_window_undraw_weapon(__libj_unused sc_window *w, __libj_unused const struct _sc_weapon *wp) { /* sc_window_undraw_weapon */ } void sc_window_main_menu(__libj_unused sc_window *w) { /* sc_window_main_menu */ } void sc_window_paint_blank(__libj_unused sc_window *w) { /* sc_window_paint_blank */ } void sc_window_paint_end_round(__libj_unused sc_window *w) { /* sc_window_paint_end_round */ printf("End of round.\n"); } void sc_window_paint_end_game(__libj_unused sc_window *w) { /* sc_window_paint_end_game */ printf("End of game.\n"); } void sc_window_inventory(__libj_unused sc_window *w, __libj_unused struct _sc_player *p) { /* sc_window_inventory */ } void sc_window_auto_defense(__libj_unused sc_window *w, __libj_unused struct _sc_player *p) { /* sc_window_auto_defense */ } void sc_window_lottery_result(__libj_unused sc_window *w, __libj_unused bool showstake) { /* sc_window_lottery_result */ } int sc_expl_cache_new(__libj_unused sc_window *w, __libj_unused int radius, __libj_unused enum _sc_explosion_type type) { /* sc_expl_cache_new */ return(0); } void sc_expl_cache_draw(__libj_unused sc_window *w, __libj_unused int ptr, __libj_unused int centerx, __libj_unused int centery, __libj_unused int cacheid) { /* sc_expl_cache_draw */ } void sc_window_draw_arc(__libj_unused sc_window *w, __libj_unused struct _sc_trajectory *tr, __libj_unused int playerid) { /* sc_window_draw_arc */ } void sc_window_clear_arc(__libj_unused sc_window *w, __libj_unused struct _sc_trajectory *tr) { /* sc_window_clear_arc */ } void sc_window_draw_napalm_frame(__libj_unused sc_window *w, __libj_unused const int *xlist, __libj_unused const int *ylist, __libj_unused int size) { /* sc_window_draw_napalm_frame */ } void sc_window_draw_napalm_final(__libj_unused sc_window *w, __libj_unused const int *xlist, __libj_unused const int *ylist, __libj_unused int totalsize) { /* sc_window_draw_napalm_final */ } void sc_window_clear_napalm(__libj_unused sc_window *w, __libj_unused const int *xlist, __libj_unused const int *ylist, __libj_unused int totalsize) { /* sc_window_clear_napalm */ } void sc_chat_window_update(__libj_unused sc_window *w, const char *msg) { /* sc_chat_window_update */ printf("chat: %s\n", msg); } xscorch-0.2.1/sconsole/swindow-console.h0000644000175000001440000000253711175116130015233 00000000000000/* $Header: /fridge/cvs/xscorch/sconsole/swindow-console.h,v 1.4 2009-04-26 17:39:36 jacob Exp $ */ /* xscorch - swindow-console.h Copyright(c) 2001 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Console interface to xscorch (server) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __swindow_console_h_included #define __swindow_console_h_included /* The order of includes does matter! */ #include #include /* Forward structure declarations */ struct _sc_config; /* Main window structure */ typedef struct _sc_window_console { struct _sc_config *c; /* Game config structure */ } sc_window_console; #endif /* __swindow_console_h_included */ xscorch-0.2.1/sgame/0000755000175000001440000000000011615372007011256 500000000000000xscorch-0.2.1/sgame/Makefile.am0000644000175000001440000000251110006124054013217 00000000000000## $Header: /fridge/cvs/xscorch/sgame/Makefile.am,v 1.10 2003/10/04 05:15:08 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov shelpdata.c MAINTAINERCLEANFILES = *.orig # Convenience library for AI code # noinst_LIBRARIES = libscorch_game.a # Game code # libscorch_game_a_SOURCES =\ saccessory.c \ saccessory.h \ saddconf.c \ saddconf.h \ scffile.c \ scffile.h \ scffileold.c \ scolor.c \ scolor.h \ sconfig.c \ sconfig.h \ seconomy.c \ seconomy.h \ sexplosion.c \ sexplosion.h \ sgame.c \ sgame.h \ shelp.c \ shelp.h \ shelpdata.c \ shelpdata.h \ sinfo.c \ sinfo.h \ sinventory.c \ sinventory.h \ sland.c \ sland.h \ slscape.c \ slscape.h \ slscapetools.c \ slscapetools.h \ soptions.c \ soptions.h \ sphoenix.c \ sphoenix.h \ sphysics.c \ sphysics.h \ splayer.c \ splayer.h \ spreround.c \ spreround.h \ sregistry.c \ sregistry.h \ sshield.c \ sshield.h \ sspill.c \ sspill.h \ sstate.c \ sstate.h \ stankpro.c \ stankpro.h \ strack.c \ strack.h \ sweapon.c \ sweapon.h \ swindow.h shelpdata.c: ../doc/shelpdata.c cp -f ../doc/shelpdata.c shelpdata.c ## idiot justin.. don't remove -I../sutil, it'll mess up getopt. INCLUDES = -I../sutil -I../libj xscorch-0.2.1/sgame/Makefile.in0000644000175000001440000004510011615371715013250 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = sgame DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_game_a_AR = $(AR) $(ARFLAGS) libscorch_game_a_LIBADD = am_libscorch_game_a_OBJECTS = saccessory.$(OBJEXT) saddconf.$(OBJEXT) \ scffile.$(OBJEXT) scffileold.$(OBJEXT) scolor.$(OBJEXT) \ sconfig.$(OBJEXT) seconomy.$(OBJEXT) sexplosion.$(OBJEXT) \ sgame.$(OBJEXT) shelp.$(OBJEXT) shelpdata.$(OBJEXT) \ sinfo.$(OBJEXT) sinventory.$(OBJEXT) sland.$(OBJEXT) \ slscape.$(OBJEXT) slscapetools.$(OBJEXT) soptions.$(OBJEXT) \ sphoenix.$(OBJEXT) sphysics.$(OBJEXT) splayer.$(OBJEXT) \ spreround.$(OBJEXT) sregistry.$(OBJEXT) sshield.$(OBJEXT) \ sspill.$(OBJEXT) sstate.$(OBJEXT) stankpro.$(OBJEXT) \ strack.$(OBJEXT) sweapon.$(OBJEXT) libscorch_game_a_OBJECTS = $(am_libscorch_game_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_game_a_SOURCES) DIST_SOURCES = $(libscorch_game_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov shelpdata.c MAINTAINERCLEANFILES = *.orig # Convenience library for AI code # noinst_LIBRARIES = libscorch_game.a # Game code # libscorch_game_a_SOURCES = \ saccessory.c \ saccessory.h \ saddconf.c \ saddconf.h \ scffile.c \ scffile.h \ scffileold.c \ scolor.c \ scolor.h \ sconfig.c \ sconfig.h \ seconomy.c \ seconomy.h \ sexplosion.c \ sexplosion.h \ sgame.c \ sgame.h \ shelp.c \ shelp.h \ shelpdata.c \ shelpdata.h \ sinfo.c \ sinfo.h \ sinventory.c \ sinventory.h \ sland.c \ sland.h \ slscape.c \ slscape.h \ slscapetools.c \ slscapetools.h \ soptions.c \ soptions.h \ sphoenix.c \ sphoenix.h \ sphysics.c \ sphysics.h \ splayer.c \ splayer.h \ spreround.c \ spreround.h \ sregistry.c \ sregistry.h \ sshield.c \ sshield.h \ sspill.c \ sspill.h \ sstate.c \ sstate.h \ stankpro.c \ stankpro.h \ strack.c \ strack.h \ sweapon.c \ sweapon.h \ swindow.h INCLUDES = -I../sutil -I../libj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sgame/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sgame/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_game.a: $(libscorch_game_a_OBJECTS) $(libscorch_game_a_DEPENDENCIES) -rm -f libscorch_game.a $(libscorch_game_a_AR) libscorch_game.a $(libscorch_game_a_OBJECTS) $(libscorch_game_a_LIBADD) $(RANLIB) libscorch_game.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saccessory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saddconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scffile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scffileold.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scolor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sconfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seconomy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sexplosion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgame.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shelp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shelpdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sinventory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sland.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slscape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slscapetools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/soptions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sphoenix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sphysics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splayer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spreround.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sregistry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sshield.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sspill.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sstate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stankpro.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sweapon.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am shelpdata.c: ../doc/shelpdata.c cp -f ../doc/shelpdata.c shelpdata.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/sgame/saccessory.c0000644000175000001440000003502211615366344013531 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/saccessory.c,v 1.34 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - saccessory.c Copyright(c) 2000-2004 Jacob Luna Lundberg Copyright(c) 2000-2003 Justin David Smith jacob(at)gnifty.net http://www.gnifty.net/ justins(at)chaos2.org http://chaos2.org/ Scorched tank accessories This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include /* Get accessory data */ #include /* Adding accessories */ #include /* Config constants */ #include /* Need inventory constants */ #include /* Access to the registry */ #include /*** Accessory Data ***/ typedef struct _sc_accessory_test_arg { int counter; int flags; const char *name; const sc_accessory_config *ac; } sc_accessory_test_arg; static inline bool _sc_accessory_viewable(const sc_accessory_config *ac, const sc_accessory_info *info, int flags) { /* _sc_accessory_viewable We return true if the accessory is viewable under the given rules. */ if( (!(flags & SC_ACCESSORY_LIMIT_ARMS) || info->armslevel <= ac->armslevel) && (!(flags & SC_ACCESSORY_LIMIT_USELESS) || ac->uselessitems || !info->useless) && (!(flags & SC_ACCESSORY_LIMIT_INDIRECT) || !info->indirect) ) { return(true); } else { return(false); } } static bool _sc_accessory_test_count(void *data, long arg) { /* _sc_accessory_test_count This is an sc_registry_test function. We will iterate, incrementing a counter, but always returning false. */ sc_accessory_info *info = (sc_accessory_info *)data; sc_accessory_test_arg *ata = (sc_accessory_test_arg *)arg; /* We don't validate args; please do so in the caller! */ const sc_accessory_config *ac = ata->ac; int flags = ata->flags; if(_sc_accessory_viewable(ac, info, flags)) ++ata->counter; return(false); } int sc_accessory_count(const sc_accessory_config *ac, int flags) { /* sc_accessory_count Counts the number of accessories that have been registered with the game's data registry. This is optimized but of course if you're calling it a lot you should cache the data. The only exception is that the count may change if a new accessory list file is appended. */ sc_registry_iter *iter; sc_accessory_test_arg ata; if(ac == NULL) return(0); /* Set up for iteration. */ ata.counter = 0; ata.flags = flags; ata.ac = ac; iter = sc_registry_iter_new(ac->registry, ac->registryclass, SC_REGISTRY_FORWARD, _sc_accessory_test_count, (long)(&ata)); if(iter == NULL) return(0); /* Iterate using the fast registry iterators. */ sc_registry_iterate(iter); /* Clean up. */ sc_registry_iter_free(&iter); return(ata.counter); } sc_accessory_info *sc_accessory_lookup(const sc_accessory_config *ac, int id, int flags) { /* sc_accessory_lookup Pass along a registry request for the accessory. */ sc_accessory_info *info; if(ac == NULL || id < 0) return(NULL); /* Find the accessory in the registry. */ info = (sc_accessory_info *)sc_registry_find_by_int(ac->registry, id); /* Verify that the rules in place allow viewing the accessory. */ if(info != NULL && _sc_accessory_viewable(ac, info, flags)) return(info); else return(NULL); } static bool _sc_accessory_test_lookup_name(void *data, long arg) { /* _sc_accessory_test_lookup_name This is an sc_registry_test function. We will seek, search, discover the accessory by name. */ sc_accessory_info *info = (sc_accessory_info *)data; sc_accessory_test_arg *ata = (sc_accessory_test_arg *)arg; /* We don't validate args; please do so in the caller! */ const char *name = ata->name; /* Use sloppy string comparison on the name (true if similar). */ return(strsimilar(info->name, name)); } sc_accessory_info *sc_accessory_lookup_by_name(const sc_accessory_config *ac, const char *name, int flags) { /* sc_accessory_lookup_by_name Tries to find an accessory by roughly the requested name. This is much slower than sc_accessory_lookup. */ sc_registry_iter *iter; sc_accessory_test_arg ata; sc_accessory_info *info; if(ac == NULL || name == NULL) return(NULL); /* Set up for iteration. */ ata.name = name; iter = sc_registry_iter_new(ac->registry, ac->registryclass, (flags & SC_ACCESSORY_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, _sc_accessory_test_lookup_name, (long)(&ata)); if(iter == NULL) return(NULL); /* Iterate using the fast registry iterators. */ info = (sc_accessory_info *)sc_registry_iterate(iter); /* Clean up. */ sc_registry_iter_free(&iter); /* Verify that the rules in place allow viewing the accessory. */ if(info != NULL && _sc_accessory_viewable(ac, info, flags)) return(info); else return(NULL); } static bool _sc_accessory_test_viewable(void *data, long arg) { /* _sc_accessory_test_viewable This is an sc_registry_test function. We will return true for the first viewable accessory. */ sc_accessory_info *info = (sc_accessory_info *)data; sc_accessory_test_arg *ata = (sc_accessory_test_arg *)arg; /* We don't validate args; please do so in the caller! */ const sc_accessory_config *ac = ata->ac; int flags = ata->flags; return(_sc_accessory_viewable(ac, info, flags)); } sc_accessory_info *sc_accessory_first(const sc_accessory_config *ac, int flags) { /* sc_accessory_first Return the first/last viable accessory in the accessory config space. */ sc_accessory_test_arg ata; sc_accessory_info *info; if(ac == NULL) return(NULL); ata.ac = ac; ata.flags = flags; /* Try and find the first/last accessory that meets our criteria. */ info = sc_registry_find_first(ac->registry, ac->registryclass, (flags & SC_ACCESSORY_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, _sc_accessory_test_viewable, (long)(&ata)); return(info); } sc_accessory_info *sc_accessory_next(const sc_accessory_config *ac, const sc_accessory_info *info, int flags) { /* sc_accessory_next Advance to the next/prev accessory in the list (with wrapping). */ sc_accessory_test_arg ata; sc_accessory_info *nxtnfo; if(ac == NULL || info == NULL) return(NULL); /* Set up the flags and args for the mission. */ ata.ac = ac; ata.flags = flags; /* Try and find the first/last accessory that meets our criteria. */ nxtnfo = sc_registry_find_next(ac->registry, ac->registryclass, info->ident, (flags & SC_ACCESSORY_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, _sc_accessory_test_viewable, (long)(&ata)); /* In case we iterated off the end of the list, wrap to the beginning. */ if(nxtnfo == NULL) nxtnfo = sc_accessory_first(ac, flags); return(nxtnfo); } void sc_accessory_info_line(const sc_accessory_config *ac, const sc_accessory_info *info, char *buffer, int buflen) { /* sc_accessory_info_line Create a line of information about the accessory. */ int moving; assert(ac != NULL); assert(buflen >= 0); if(buffer == NULL || buflen == 0) return; if(info == NULL) { buffer[0] = '\0'; return; } /* Clear the buffer. */ memset(buffer, 0, buflen * sizeof(char)); /* Terminating NULL character. */ --buflen; /* Add the name to the buffer. */ sbprintf(buffer, buflen, "%s:", info->name); moving = strblenn(info->name, SC_INVENTORY_MAX_NAME_LEN) + 1; buffer += moving; buflen -= moving; /* Add spaces out to the end of the name area. */ while(++moving < 20 && --buflen > 0) *(buffer++) = ' '; /* Display the accessory's arms level. */ sbprintf(buffer, buflen, "arms = %1i, ", info->armslevel); moving = 10; buffer += moving; buflen -= moving; /* We display much different stuff for shields than for other accessories. */ if(SC_ACCESSORY_IS_SHIELD(info)) { /* Display the shield level. */ moving = info->shield; sbprintf(buffer, buflen, "shield = %-5i", moving); moving = 9 + (moving ? (int)log10(moving) : 1); buffer += moving; buflen -= moving; /* Add the comma. */ if(buflen-- > 0) *(buffer++) = ','; /* Add spaces out to the end of the yield area, plus two. */ while(++moving < 16 && --buflen > 0) *(buffer++) = ' '; /* Write out the shield short name. */ sbprintf(buffer, buflen, "%3i%1c ", info->shield / 100, SC_ACCESSORY_SHIELD_CHAR(info)); moving = 5; buffer += moving; buflen -= moving; /* And the shield type, of course. */ sbprintf(buffer, buflen, "%s", SC_ACCESSORY_SHIELD_IS_FORCE(info) ? "force" : (SC_ACCESSORY_SHIELD_IS_MAGNETIC(info) ? "magnetic" : (SC_ACCESSORY_SHIELD_IS_STANDARD(info) ? "standard" : "unknown"))); moving = 8; buffer += moving; buflen -= moving; /* If magnetic, also give repulsion. */ if(SC_ACCESSORY_SHIELD_IS_MAGNETIC(info)) sbprintf(buffer, buflen, " (repulsion = %i)", info->repulsion); } else { /* Write out some accessory info flags. */ sbprintf(buffer, buflen, " %10s %8s %9s %7s", SC_ACCESSORY_IS_CONSUMABLE(info) ? "consumable" : "", SC_ACCESSORY_IS_INFINITE(info) ? "infinite" : "", SC_ACCESSORY_IS_PERMANENT(info) ? "permanent" : "", info->useless ? "useless" : ""); } } sc_accessory_config *sc_accessory_config_create(const sc_config *c) { /* sc_accessory_config_create Allocate space and set defaults on a new sc_accessory_config struct. */ sc_accessory_config *ac; const char *filename; assert(c != NULL && c->registry != NULL); ac = (sc_accessory_config *)malloc(sizeof(sc_accessory_config)); if(ac == NULL) return(NULL); /* Default settings for weapon config. */ ac->armslevel = SC_ARMS_LEVEL_DEF; ac->uselessitems = true; /* Get a class ID for this accessory config. */ ac->registryclass = sc_registry_get_new_class_id(c->registry); ac->registry = c->registry; /* Read in the accessory info list */ filename = SC_GLOBAL_DIR "/" SC_ACCESSORY_FILE; if(!sc_addconf_append_file(SC_ADDCONF_ACCESSORIES, filename, ac) || sc_accessory_count(ac, SC_ACCESSORY_LIMIT_INDIRECT) <= 0) { /* This is the root accessory list... Die! */ free(ac); return(NULL); } return(ac); } void sc_accessory_config_destroy(sc_accessory_config **ac) { /* sc_accessory_config_destroy Invalidate memory used by an accessory config struct. */ sc_accessory_info *info, *temp; if(ac == NULL || *ac == NULL) return; /* Delete all of our registry entries. */ info = (sc_accessory_info *)sc_registry_find_first((*ac)->registry, (*ac)->registryclass, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); while(info != NULL) { temp = info; info = (sc_accessory_info *)sc_registry_find_next((*ac)->registry, (*ac)->registryclass, info->ident, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); sc_registry_del_by_int((*ac)->registry, temp->ident); sc_accessory_info_free(&temp); } /* And delete ourself. */ free(*ac); *ac = NULL; } void sc_accessory_info_free(sc_accessory_info **ai) { /* sc_accessory_info_free Invalidate memory used by an sc_accessory_info. */ /* Make sure there is an item to free */ if(ai == NULL || *ai == NULL) return; /* Free the item's name if it has one */ if((*ai)->name != NULL) free((*ai)->name); /* Free the item */ free(*ai); *ai = NULL; } static bool _sc_accessory_inventory_clear_func(void *data, __libj_unused long arg) { /* _sc_accessory_inventory_clear_func Clear accessory inventory data, in registry fast iterators. */ sc_accessory_info *info; if(data == NULL) return(false); info = (sc_accessory_info *)data; /* Clear the accessory's inventory. */ if(!SC_ACCESSORY_IS_INFINITE(info)) memset(info->inventories, 0, SC_MAX_PLAYERS * sizeof(int)); /* We never "find the right accessory" ... it's faster this way. */ return(false); } void sc_accessory_inventory_clear(sc_accessory_config *ac) { /* sc_accessory_inventory_clear Clear out the player accessory inventories. */ sc_registry_iter *iter; if(ac == NULL) return; /* Prepare a registry iterator. */ iter = sc_registry_iter_new(ac->registry, ac->registryclass, SC_REGISTRY_FORWARD, _sc_accessory_inventory_clear_func, 0); /* Iterate the entire accessories registry, with the side effect of erasing inventories. */ sc_registry_iterate(iter); /* Clean up. */ sc_registry_iter_free(&iter); } /* Summary of the accessory state bits, for use in saddconf.c */ static const char *_sc_accessory_state_bit_names[] = { "force", "magnetic", "standard", "auto_defense", "battery", "consumable", "contact_trigger", "fuel", "null", "permanent", "recharge", "shield", "triple_turret", NULL }; static const unsigned int _sc_accessory_state_bit_items[] = { SC_ACCESSORY_SHIELD_FORCE, SC_ACCESSORY_SHIELD_MAGNETIC, SC_ACCESSORY_SHIELD_STANDARD, SC_ACCESSORY_STATE_AUTO_DEF, SC_ACCESSORY_STATE_BATTERY, SC_ACCESSORY_STATE_CONSUMABLE, SC_ACCESSORY_STATE_TRIGGER, SC_ACCESSORY_STATE_FUEL, SC_ACCESSORY_STATE_NULL, SC_ACCESSORY_STATE_PERMANENT, SC_ACCESSORY_STATE_RECHARGE, SC_ACCESSORY_STATE_SHIELD, SC_ACCESSORY_STATE_TRIPLE, 0 }; const char **sc_accessory_state_bit_names(void) { return(_sc_accessory_state_bit_names); } const unsigned int *sc_accessory_state_bit_items(void) { return(_sc_accessory_state_bit_items); } xscorch-0.2.1/sgame/saccessory.h0000644000175000001440000001635511615366344013546 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/saccessory.h,v 1.27 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - saccessory.h Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2000-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched tank accessories This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __saccessory_h_included #define __saccessory_h_included /* Includes */ #include /* Forward declarations */ struct _sc_registry; struct _sc_config; /* Data on the various types of accessories */ typedef struct _sc_accessory_info { /* DO NOT CHANGE the order of the first four items: should be ident, armslevel, price, bundle. */ int ident; /* Accessory identifier */ int armslevel; /* Arms level for this accessory */ int price; /* Price ($) */ int bundle; /* Bundle size */ int shield; /* Shield strength (0 == not a shield) */ int fuel; /* Amount of fuel (0 == not a fuel tank) */ int repulsion; /* Shield repulsion power */ int state; /* Accessory state/type bits */ int inventories[SC_MAX_PLAYERS]; /* Player accessory inventories */ bool useless; /* Is this a useless item? */ bool indirect; /* Accessed only internally? */ char *name; /* Accessory name */ char *description; /* Accessory information */ } sc_accessory_info; /* Accessory scanning functions need to know what to find and what not to. */ #define SC_ACCESSORY_LIMIT_NONE 0x0000 #define SC_ACCESSORY_LIMIT_ARMS 0x0001 #define SC_ACCESSORY_LIMIT_USELESS 0x0002 #define SC_ACCESSORY_LIMIT_INDIRECT 0x0004 #define SC_ACCESSORY_LIMIT_ALL 0x00ff /* Accessory scanning functions need to know in what direction to scan. */ #define SC_ACCESSORY_SCAN_DEFAULT 0x0000 #define SC_ACCESSORY_SCAN_FORWARD 0x0100 #define SC_ACCESSORY_SCAN_REVERSE 0x0200 /* Bit names in the state flag. Changes to these bits must be reflected in the functions at the bottom of saccessory.c. Also they may require some changes to saddconf.c, and perhaps to the accessories.def file as well. Note that there are still a couple bytes to spare. */ #define SC_ACCESSORY_STATE_TYPES 0xff0000 #define SC_ACCESSORY_STATE_SHIELDS 0x00ff00 #define SC_ACCESSORY_STATE_FLAGS 0x0000ff /* Bits in the accessory state FLAGS flag */ #define SC_ACCESSORY_STATE_NULL 0x000001 #define SC_ACCESSORY_STATE_CONSUMABLE 0x000002 #define SC_ACCESSORY_STATE_PERMANENT 0x000004 /* Bits in the accessory state SHIELD flag */ #define SC_ACCESSORY_SHIELD_STANDARD 0x000100 #define SC_ACCESSORY_SHIELD_MAGNETIC 0x000200 #define SC_ACCESSORY_SHIELD_FORCE 0x000400 /* Bits in the accessory state TYPES flag */ #define SC_ACCESSORY_STATE_SHIELD 0x010000 #define SC_ACCESSORY_STATE_TRIPLE 0x020000 #define SC_ACCESSORY_STATE_AUTO_DEF 0x040000 #define SC_ACCESSORY_STATE_TRIGGER 0x080000 #define SC_ACCESSORY_STATE_FUEL 0x100000 #define SC_ACCESSORY_STATE_BATTERY 0x200000 #define SC_ACCESSORY_STATE_RECHARGE 0x400000 #define SC_ACCESSORY_STATE_GUIDANCE 0x800000 /* Macros for accessory info */ #define SC_ACCESSORY_TYPE(a) ((a)->ident) #define SC_ACCESSORY_IS_USELESS(a) ((a)->useless) #define SC_ACCESSORY_IS_INFINITE(a) ((a)->bundle <= 0 || (a)->price <= 0) #define SC_ACCESSORY_IS_NULL(a) ((a) == NULL || (a)->state & SC_ACCESSORY_STATE_NULL) #define SC_ACCESSORY_IS_FUEL(a) ((a)->state & SC_ACCESSORY_STATE_FUEL) #define SC_ACCESSORY_IS_SHIELD(a) ((a)->state & SC_ACCESSORY_STATE_SHIELD) #define SC_ACCESSORY_IS_TRIPLE(a) ((a)->state & SC_ACCESSORY_STATE_TRIPLE) #define SC_ACCESSORY_IS_TRIGGER(a) ((a)->state & SC_ACCESSORY_STATE_TRIGGER) #define SC_ACCESSORY_IS_AUTO_DEF(a) ((a)->state & SC_ACCESSORY_STATE_AUTO_DEF) #define SC_ACCESSORY_IS_PERMANENT(a) ((a)->state & SC_ACCESSORY_STATE_PERMANENT) #define SC_ACCESSORY_IS_CONSUMABLE(a) ((a)->state & SC_ACCESSORY_STATE_CONSUMABLE) #define SC_ACCESSORY_IS_BATTERY(a) ((a)->state & SC_ACCESSORY_STATE_BATTERY) #define SC_ACCESSORY_IS_RECHARGER(a) ((a)->state & SC_ACCESSORY_STATE_RECHARGE) #define SC_ACCESSORY_IS_GUIDANCE(a) ((a)->state & SC_ACCESSORY_STATE_GUIDANCE) /* Macros for shield info */ #define SC_ACCESSORY_SHIELD_IS_STANDARD(a) ((a)->state & SC_ACCESSORY_SHIELD_STANDARD) #define SC_ACCESSORY_SHIELD_IS_MAGNETIC(a) ((a)->state & SC_ACCESSORY_SHIELD_MAGNETIC) #define SC_ACCESSORY_SHIELD_IS_FORCE(a) ((a)->state & SC_ACCESSORY_SHIELD_FORCE) #define SC_ACCESSORY_SHIELD_CHAR(a) (SC_ACCESSORY_SHIELD_IS_MAGNETIC(a) ? 'M' : \ (SC_ACCESSORY_SHIELD_IS_FORCE(a) ? 'F' : 'S')) /* Stuff we can call on accessory_configs */ #define SC_ACCESSORY_DEFAULT(ac) (sc_accessory_first((ac), SC_ACCESSORY_LIMIT_ALL)) /* Accessory configuration */ typedef struct _sc_accessory_config { struct _sc_registry *registry; /* The game data registry */ int armslevel; /* Current technology (arms) level */ int registryclass; /* Registry class ID for accessories */ bool uselessitems; /* Useless items appear in inventory? */ } sc_accessory_config; /* Accessory information lookup */ int sc_accessory_count(const sc_accessory_config *ac, int flags); sc_accessory_info *sc_accessory_lookup(const sc_accessory_config *ac, int id, int flags); sc_accessory_info *sc_accessory_lookup_by_name(const sc_accessory_config *ac, const char *name, int flags); sc_accessory_info *sc_accessory_first(const sc_accessory_config *ac, int flags); sc_accessory_info *sc_accessory_next(const sc_accessory_config *ac, const sc_accessory_info *info, int flags); /* Accessory statistics */ void sc_accessory_info_line(const sc_accessory_config *ac, const sc_accessory_info *info, char *buffer, int buflen); /* Weapon configuration setup */ sc_accessory_config *sc_accessory_config_create(const struct _sc_config *c); void sc_accessory_config_destroy(sc_accessory_config **ac); void sc_accessory_info_free(sc_accessory_info **ai); /* Misc.: Clear player inventories. */ void sc_accessory_inventory_clear(sc_accessory_config *ac); /* Summary of the accessory state bits, for use in saddconf.c */ const char **sc_accessory_state_bit_names(void); const unsigned int *sc_accessory_state_bit_items(void); #endif /* __saccessory_h_included */ xscorch-0.2.1/sgame/saddconf.c0000644000175000001440000004123311615366344013135 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/saddconf.c,v 1.49 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - saddconf.c Copyright(c) 2001-2003 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched read/append config files This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include static const reg_class_default_data _reg_accessories_class[] = { REG_CLASS_DEFAULT_STRING ("accessoryName", "" ), REG_CLASS_DEFAULT_STRING ("description", "" ), REG_CLASS_DEFAULT_INTEGER ("armsLevel", 0 ), REG_CLASS_DEFAULT_INTEGER ("price", 1 ), REG_CLASS_DEFAULT_INTEGER ("bundle", 1 ), REG_CLASS_DEFAULT_INTEGER ("shielding", 0 ), REG_CLASS_DEFAULT_INTEGER ("repulsion", 0 ), REG_CLASS_DEFAULT_INTEGER ("fuel", 0 ), REG_CLASS_DEFAULT_BOOLEAN ("useless", false ), REG_CLASS_DEFAULT_BOOLEAN ("indirect", false ), REG_CLASS_DEFAULT_BITFIELD("stateFlags", "" ), REG_CLASS_DEFAULT_END }; static const reg_class_default_list _reg_class_accessories_parent[] = { REG_CLASS_DEFAULT_LIST("accessories_class", _reg_accessories_class), REG_CLASS_DEFAULT_LIST_END }; bool _sc_accessory_read_item(sc_accessory_config *ac, reg *reader, reg_var *item) { /* _sc_accessory_read_item Read an accessory info and insert it into the registry. */ int iterator; sc_accessory_info *info; char desc[SC_INVENTORY_MAX_DESC_LEN]; char name[SC_INVENTORY_MAX_NAME_LEN]; assert(ac != NULL); assert(reader != NULL); assert(item != NULL); /* Make sure we're loading an accessory definition here. */ if(strcomp(reg_get_var_class(item), "accessories_class")) goto out; /* Set defaults for this item. */ if(!reg_set_var_class_defaults(reader, item, NULL, _reg_accessories_class)) goto out; /* Allocate the new info struct. */ info = (sc_accessory_info *)malloc(sizeof(sc_accessory_info)); if(info == NULL) goto out; /* Find out what it'll be named... */ if(!reg_get_string(reader, item, "accessoryName", name, SC_INVENTORY_MAX_NAME_LEN) || name[0] == '\0') goto out_info; /* Check the name for duplication */ if(sc_accessory_lookup_by_name(ac, name, SC_ACCESSORY_LIMIT_NONE)) goto out_info; /* Allocate space for the accessory's name. */ info->name = (char *)malloc(strlenn(name) + 1); if(info->name == NULL) goto out_info; /* Copy the name from the temp buffer. */ strcopyn(info->name, name, strlenn(name)); /* Ask the registry for a unique ID for this accessory. */ info->ident = sc_registry_get_next_new_key(ac->registry); if(info->ident < 0) goto out_name; /* Set in the other fields in the accessory_info struct */ reg_get_integer(reader, item, "armsLevel", &info->armslevel); reg_get_integer(reader, item, "price", &info->price); reg_get_integer(reader, item, "bundle", &info->bundle); reg_get_integer(reader, item, "shielding", &info->shield); reg_get_integer(reader, item, "repulsion", &info->repulsion); reg_get_integer(reader, item, "fuel", &info->fuel); reg_get_boolean(reader, item, "useless", &info->useless); reg_get_boolean(reader, item, "indirect", &info->indirect); info->state = reg_get_bitmask_from_values(reader, item, "stateFlags", 0, sc_accessory_state_bit_names(), sc_accessory_state_bit_items()); /* Read in the accessory description if there is one. */ if(!reg_get_string(reader, item, "description", desc, SC_INVENTORY_MAX_DESC_LEN) || desc[0] == '\0') { info->description = NULL; } else { info->description = (char *)malloc(strlenn(desc) + 1); /* If the description allocation fails, let it slide... */ if(info->description != NULL) strcopyn(info->description, desc, strlenn(desc)); } /* Clean up minor details such as player inventories. */ for(iterator = 0; iterator < SC_MAX_PLAYERS; ++iterator) { if(SC_ACCESSORY_IS_INFINITE(info)) info->inventories[iterator] = SC_INVENTORY_MAX_ITEMS; else info->inventories[iterator] = 0; } /* Register the accessory with the data registry. */ if(!sc_registry_add_by_int(ac->registry, info, ac->registryclass, info->ident)) goto out_desc; /* Successful exit, return true! */ return(true); /* Error paths... */ out_desc: free(info->description); out_name: free(info->name); out_info: free(info); out: return(false); } static const reg_class_default_data _reg_scorings_class[] = { REG_CLASS_DEFAULT_STRING ("scoringName", "" ), REG_CLASS_DEFAULT_STRING ("description", "" ), REG_CLASS_DEFAULT_INTEGER ("survivalBonus", 100000), REG_CLASS_DEFAULT_INTEGER ("damageBonus", 0 ), REG_CLASS_DEFAULT_INTEGER ("killBonus", 40000 ), REG_CLASS_DEFAULT_INTEGER ("damageLoss", 0 ), REG_CLASS_DEFAULT_INTEGER ("deathLoss", 20000 ), REG_CLASS_DEFAULT_INTEGER ("suicideLoss", 100000), REG_CLASS_DEFAULT_BOOLEAN ("fixed", false ), REG_CLASS_DEFAULT_END }; static const reg_class_default_list _reg_class_scorings_parent[] = { REG_CLASS_DEFAULT_LIST("scorings_class", _reg_scorings_class), REG_CLASS_DEFAULT_LIST_END }; bool _sc_scoring_read_item(sc_economy_config *ec, reg *reader, reg_var *item) { /* _sc_scoring_read_item Read an economy scoring info and insert it into the registry. */ sc_scoring_info *info; char desc[SC_ECONOMY_MAX_DESC_LEN]; char name[SC_ECONOMY_MAX_NAME_LEN]; assert(ec != NULL); assert(reader != NULL); assert(item != NULL); /* Make sure we're loading an scoring definition here. */ if(strcomp(reg_get_var_class(item), "scorings_class")) goto out; /* Set defaults for this item. */ if(!reg_set_var_class_defaults(reader, item, NULL, _reg_scorings_class)) goto out; /* Allocate the new info struct. */ info = (sc_scoring_info *)malloc(sizeof(sc_scoring_info)); if(info == NULL) goto out; /* Find out what it'll be named... */ if(!reg_get_string(reader, item, "scoringName", name, SC_ECONOMY_MAX_NAME_LEN) || name[0] == '\0') goto out_info; /* Check the name for duplication */ if(sc_scoring_lookup_by_name(ec, name)) goto out_info; /* Allocate space for the scoring's name. */ info->name = (char *)malloc(strlenn(name) + 1); if(info->name == NULL) goto out_info; /* Copy the name from the temp buffer. */ strcopyn(info->name, name, strlenn(name)); /* Ask the registry for a unique ID for this economy scoring. */ info->ident = sc_registry_get_next_new_key(ec->registry); if(info->ident < 0) goto out_name; /* Set in the other fields in the scoring_info struct. */ reg_get_integer(reader, item, "survivalBonus", &info->survivalbonus); reg_get_integer(reader, item, "damageBonus", &info->damagebonus); reg_get_integer(reader, item, "killBonus", &info->killbonus); reg_get_integer(reader, item, "damageLoss", &info->damageloss); reg_get_integer(reader, item, "deathLoss", &info->deathloss); reg_get_integer(reader, item, "suicideLoss", &info->suicideloss); reg_get_boolean(reader, item, "fixed", &info->fixed); /* Read in the scoring description if there is one. */ if(!reg_get_string(reader, item, "description", desc, SC_ECONOMY_MAX_DESC_LEN) || desc[0] == '\0') { info->description = NULL; } else { info->description = (char *)malloc(strlenn(desc) + 1); /* If the description allocation fails, let it slide... */ if(info->description != NULL) strcopyn(info->description, desc, strlenn(desc)); } /* Register the scoring with the data registry. */ if(!sc_registry_add_by_int(ec->registry, info, ec->registryclass, info->ident)) goto out_desc; /* Successful exit, return true! */ return(true); /* Error paths... */ out_desc: free(info->description); out_name: free(info->name); out_info: free(info); out: return(false); } static const reg_class_default_data _reg_weapons_class[] = { REG_CLASS_DEFAULT_STRING ("weaponName", "" ), REG_CLASS_DEFAULT_STRING ("description", "" ), REG_CLASS_DEFAULT_INTEGER ("armsLevel", 0 ), REG_CLASS_DEFAULT_INTEGER ("price", 1 ), REG_CLASS_DEFAULT_INTEGER ("bundle", 1 ), REG_CLASS_DEFAULT_INTEGER ("radius", 0 ), REG_CLASS_DEFAULT_INTEGER ("force", 0 ), REG_CLASS_DEFAULT_INTEGER ("liquid", 0 ), REG_CLASS_DEFAULT_INTEGER ("scatter", 0 ), REG_CLASS_DEFAULT_INTEGER ("children", 0 ), REG_CLASS_DEFAULT_DOUBLEV ("angularWidth", 0.0 ), REG_CLASS_DEFAULT_BOOLEAN ("useless", false), REG_CLASS_DEFAULT_BOOLEAN ("indirect", false), REG_CLASS_DEFAULT_BITFIELD("stateFlags", "" ), REG_CLASS_DEFAULT_BITFIELD("phoenixFlags", "" ), REG_CLASS_DEFAULT_STRING ("phoenixChild", "" ), REG_CLASS_DEFAULT_END }; static const reg_class_default_list _reg_class_weapons_parent[] = { REG_CLASS_DEFAULT_LIST("weapons_class", _reg_weapons_class), REG_CLASS_DEFAULT_LIST_END }; bool _sc_weapon_read_item(sc_weapon_config *wc, reg *reader, reg_var *item) { /* _sc_weapon_read_item Read a weapon info and insert it into the registry. */ int iterator; sc_weapon_info *info; sc_weapon_info *child; char childname[SC_INVENTORY_MAX_NAME_LEN]; char desc[SC_INVENTORY_MAX_DESC_LEN]; char name[SC_INVENTORY_MAX_NAME_LEN]; assert(wc != NULL); assert(reader != NULL); assert(item != NULL); /* Make sure we're loading a weapon definition here. */ if(strcomp(reg_get_var_class(item), "weapons_class")) goto out; /* Set defaults for this item. */ if(!reg_set_var_class_defaults(reader, item, NULL, _reg_weapons_class)) goto out; /* Allocate the new info struct. */ info = (sc_weapon_info *)malloc(sizeof(sc_weapon_info)); if(info == NULL) goto out; /* Find out what it'll be named... */ if(!reg_get_string(reader, item, "weaponName", name, SC_INVENTORY_MAX_NAME_LEN) || name[0] == '\0') goto out_info; /* Check the name for duplication */ if(sc_weapon_lookup_by_name(wc, name, SC_WEAPON_LIMIT_NONE)) goto out_info; /* Allocate space for the weapon's name. */ info->name = (char *)malloc(strlenn(name) + 1); if(info->name == NULL) goto out_info; /* Copy the name from the temp buffer. */ strcopyn(info->name, name, strlenn(name)); /* Ask the registry for a unique ID for this weapon. */ info->ident = sc_registry_get_next_new_key(wc->registry); if(info->ident < 0) goto out_name; /* Set in the other fields in the weapon_info struct. */ reg_get_integer(reader, item, "armsLevel", &info->armslevel); reg_get_integer(reader, item, "price", &info->price); reg_get_integer(reader, item, "bundle", &info->bundle); reg_get_integer(reader, item, "radius", &info->radius); reg_get_integer(reader, item, "force", &info->force); reg_get_integer(reader, item, "liquid", &info->liquid); reg_get_integer(reader, item, "scatter", &info->scatter); reg_get_integer(reader, item, "children", &info->children); /* Convert the angle for the explosion from degrees to radians. */ reg_get_doublev(reader, item, "angularWidth", &info->angular_width); info->angular_width *= M_PI / 180.0; reg_get_boolean(reader, item, "useless", &info->useless); reg_get_boolean(reader, item, "indirect", &info->indirect); info->state = reg_get_bitmask_from_values(reader, item, "stateFlags", 0, sc_weapon_state_bit_names(), sc_weapon_state_bit_items()); info->ph_fl = reg_get_bitmask_from_values(reader, item, "phoenixFlags", 0, sc_phoenix_flags_bit_names(), sc_phoenix_flags_bit_items()); /* Read in the weapon description if there is one. */ if(!reg_get_string(reader, item, "description", desc, SC_INVENTORY_MAX_DESC_LEN) || desc[0] == '\0') { info->description = NULL; } else { info->description = (char *)malloc(strlenn(desc) + 1); /* If the description allocation fails, let it slide... */ if(info->description != NULL) strcopyn(info->description, desc, strlenn(desc)); } /* Set the child if there is one. */ if(reg_get_string(reader, item, "phoenixChild", childname, SC_INVENTORY_MAX_NAME_LEN) && childname[0] != '\0') { /* Try and find the child. */ if(strsimilar(info->name, childname)) child = info; else child = sc_weapon_lookup_by_name(wc, childname, SC_WEAPON_LIMIT_NONE); /* If we found the child, set it. Otherwise, warn. */ if(child == NULL) printf("saddconf - warning, \"%s\" has missing child \"%s\"\n", name, childname); else info->ph_ch = child->ident; } /* Test for weapon acceptance... */ if(SC_WEAPON_IS_PHOENIX(info) && !sc_phoenix_verify(wc, info)) { printf("saddconf - \"%s\" is an invalid phoenix weapon, rejecting it\n", name); goto out_desc; } /* Clean up minor details such as player inventories. */ for(iterator = 0; iterator < SC_MAX_PLAYERS; ++iterator) { if(SC_WEAPON_IS_INFINITE(info)) info->inventories[iterator] = SC_INVENTORY_MAX_ITEMS; else info->inventories[iterator] = 0; } /* Register the weapon with the data registry. */ if(!sc_registry_add_by_int(wc->registry, info, wc->registryclass, info->ident)) goto out_desc; /* Successful exit, return true! */ return(true); /* Error paths... */ out_desc: free(info->description); out_name: free(info->name); out_info: free(info); out: return(false); } bool sc_addconf_append_file(sc_addconf_type type, const char *filename, void *container) { /* sc_addconf_append_file Append a conf file to the data registry. Returns true on success. */ int count = 0; reg_var *item; reg_var *top; reg *reader; if(filename == NULL || container == NULL) return(false); /* Read the file into the file registry. */ reader = reg_new(filename); if(reader == NULL) return(false); /* Inform the file regsitry how to parse the file. */ switch(type) { case SC_ADDCONF_ACCESSORIES: reg_class_register_default_list(reader, _reg_class_accessories_parent); break; case SC_ADDCONF_SCORINGS: reg_class_register_default_list(reader, _reg_class_scorings_parent); break; case SC_ADDCONF_WEAPONS: reg_class_register_default_list(reader, _reg_class_weapons_parent); break; } /* Try to parse the conf file using the file registry. */ if(!reg_load(reader)) { /* Failed to read file; signal error */ printf("saddconf - aborting, can't load \"%s\"\n", filename); reg_free(&reader); return(false); } /* To simplify the switch below, we break this out with the preprocessor. */ #define iterate_calling(function) while(item != NULL) { \ if(function(container, reader, item)) ++count; \ item = reg_get_next_var(item); \ } /* Read the variables in order. */ top = reg_get_top(reader); item = reg_get_block_head(top); switch(type) { case SC_ADDCONF_ACCESSORIES: iterate_calling(_sc_accessory_read_item); break; case SC_ADDCONF_SCORINGS: iterate_calling(_sc_scoring_read_item); break; case SC_ADDCONF_WEAPONS: iterate_calling(_sc_weapon_read_item); break; } /* Symmetry is Beautiful. */ #undef iterate_calling /* Release the registry. */ reg_free(&reader); /* Let the next layer up know whether we found some configuration items. */ if(count) return(true); else return(false); } xscorch-0.2.1/sgame/saddconf.h0000644000175000001440000000260611615366344013143 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/saddconf.h,v 1.14 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - saddconf.h Copyright(c) 2001 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched basic read files on the fly stuff This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __saddconf_h_included #define __saddconf_h_included /* Includes */ #include /* Forward structure decl's */ struct _sc_weapon_config; struct _sc_accessory_config; typedef enum _sc_addconf_type { SC_ADDCONF_ACCESSORIES, SC_ADDCONF_SCORINGS, SC_ADDCONF_WEAPONS } sc_addconf_type; /* Append to a conf list. */ bool sc_addconf_append_file(sc_addconf_type type, const char *filename, void *container); #endif /* __saddconf_h_included */ xscorch-0.2.1/sgame/scffile.c0000644000175000001440000005457511175116132012771 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/scffile.c,v 1.30 2009-04-26 17:39:38 jacob Exp $ */ /* xscorch - scffile.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Configuration file processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Old loaders */ int sc_old_config_file_load(sc_config *c); /* Config class definitions */ static const reg_class_data _reg_file_class[] = { { "accessoryDefs", REG_STRING, NULL }, { "economyDefs", REG_STRING, NULL }, { "tankProfiles", REG_STRING, NULL }, { "weaponDefs", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_font_class[] = { { "fixedFont", REG_STRING, NULL }, { "italicFixedFont", REG_STRING, NULL }, { "boldFixedFont", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_options_class[] = { { "mode", REG_STRING, NULL }, { "interleave", REG_BOOLEAN, NULL }, { "teams", REG_STRING, NULL }, { "order", REG_STRING, NULL }, { "talkMode", REG_STRING, NULL }, { "talkProbability", REG_INTEGER, NULL }, { "extendedStatus", REG_BOOLEAN, NULL }, { "tooltips", REG_BOOLEAN, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_player_class[] = { { "playerType", REG_STRING, NULL }, { "playerName", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_players_class[] = { { "numPlayers", REG_INTEGER, NULL }, { "numRounds", REG_INTEGER, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_graphics_class[] = { { "fieldWidth", REG_INTEGER, NULL }, { "fieldHeight", REG_INTEGER, NULL }, { "maxHeight", REG_INTEGER, NULL }, { "dithering", REG_BOOLEAN, NULL }, { "animation", REG_BOOLEAN, NULL }, { "graphicsFast", REG_BOOLEAN, NULL }, { "computersFast", REG_BOOLEAN, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_economics_class[] = { { "interestRate", REG_DOUBLEV, NULL }, { "dynamicInterest", REG_BOOLEAN, NULL }, { "initialCash", REG_INTEGER, NULL }, { "computersBuy", REG_BOOLEAN, NULL }, { "computersAggressive",REG_BOOLEAN,NULL }, { "freeMarket", REG_BOOLEAN, NULL }, { "lottery", REG_BOOLEAN, NULL }, { "scoring", REG_STRING, NULL }, /* TEMP - OBSOLETE */ { "economy", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_physics_class[] = { { "airViscosity", REG_DOUBLEV, NULL }, { "gravity", REG_DOUBLEV, NULL }, { "groundDamping", REG_DOUBLEV, NULL }, { "maxWindSpeed", REG_DOUBLEV, NULL }, { "dynamicWind", REG_BOOLEAN, NULL }, { "suspendDirt", REG_INTEGER, NULL }, { "tanksFall", REG_INTEGER, NULL }, { "bordersExtend", REG_INTEGER, NULL }, { "walls", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_weapons_class[] = { { "armsLevel", REG_INTEGER, NULL }, { "bombIconSize", REG_INTEGER, NULL }, { "tunneling", REG_BOOLEAN, NULL }, { "scaling", REG_DOUBLEV, NULL }, { "tracePaths", REG_BOOLEAN, NULL }, { "uselessItems", REG_BOOLEAN, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_landscape_class[] = { { "sky", REG_STRING, NULL }, { "hostile", REG_BOOLEAN, NULL }, { "generator", REG_STRING, NULL }, { "bumpiness", REG_DOUBLEV, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_ai_controller_class[] = { { "humanTargets", REG_BOOLEAN, NULL }, { "allowOffsets", REG_BOOLEAN, NULL }, { "alwaysOffset", REG_BOOLEAN, NULL }, { "enableScan", REG_BOOLEAN, NULL }, { "noBudget", REG_BOOLEAN, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_sound_class[] = { { "enableSound", REG_BOOLEAN, NULL }, { "useHQMixer", REG_BOOLEAN, NULL }, { 0, 0, 0 } }; /* Configuration class names */ static const reg_class_list _reg_class_dataes[] = { { "file_class", _reg_file_class }, { "font_class", _reg_font_class }, { "player_class", _reg_player_class }, { "players_class", _reg_players_class }, { "options_class", _reg_options_class }, { "graphics_class", _reg_graphics_class }, { "economics_class", _reg_economics_class }, { "physics_class", _reg_physics_class }, { "weapons_class", _reg_weapons_class }, { "landscape_class", _reg_landscape_class }, { "aicontroller_class",_reg_ai_controller_class }, { "sound_class", _reg_sound_class }, { 0, 0 } }; /* Expected toplevel variables */ static const reg_class_data _reg_top_class[] = { { "files", REG_BLOCK, "file_class" }, { "fonts", REG_BLOCK, "font_class" }, { "players", REG_BLOCK, "players_class" }, { "options", REG_BLOCK, "options_class" }, { "graphics", REG_BLOCK, "graphics_class" }, { "economics", REG_BLOCK, "economics_class" }, { "physics", REG_BLOCK, "physics_class" }, { "weapons", REG_BLOCK, "weapons_class" }, { "landscape", REG_BLOCK, "landscape_class" }, { "aicontroller", REG_BLOCK, "aicontroller_class" }, { "sound", REG_BLOCK, "sound_class" }, { 0, 0, 0 } }; static int _sc_config_make_directory(void) { /* sc_config_make_directory Construct a new local directory for config files, etc. */ char dirname[SC_FILENAME_LENGTH]; /* Name of the directory */ struct stat s; /* For the stat() calls */ /* Figure out the appropriate directory name */ sbprintf(dirname, sizeof(dirname), "%s/%s", getenv("HOME"), SC_LOCAL_CONFIG_DIR); /* Check if the directory exists; try to make it otherwise. */ if(stat(dirname, &s) < 0) { if(mkdir(dirname, 0755) < 0) { fprintf(stderr, "warning: cannot create configuration directory \"%s\"\n", dirname); return(false); } /* Made a new directory? */ } /* Did the directory exist? */ /* Return success */ return(true); } int sc_config_file_init(sc_config *c) { /* sc_config_file_init Initialise a registry database. This function only initialises the registry structure with the classes and variables defined above; it does not (yet) read the configuration file. */ char buf[REG_BUFFER]; /* Random buffer */ reg *r; /* New registry DB */ int i; /* Player iterator */ /* Make sure the local directory exists. */ if(!_sc_config_make_directory()) return(false); /* Figure out the filename for the conf file, and allocate the new registry database now. */ sbprintf(buf, sizeof(buf), "%s/%s/%s", getenv("HOME"), SC_LOCAL_CONFIG_DIR, SC_LOCAL_CONFIGURATION); c->cfreg = reg_new(buf); if(c->cfreg == NULL) return(false); /* Setup the class listing */ r = c->cfreg; reg_class_register_list(r, _reg_class_dataes); /* Register required toplevel variables, by setting a default type for the variables. */ reg_class_register_vars(r, REG_TOP, _reg_top_class); for(i = 0; _reg_top_class[i].name != NULL; ++i) { reg_set_block(r, NULL, _reg_top_class[i].name, _reg_top_class[i].klass); } /* Setup the players class, which has to be constructed dynamically (because we don't know the number of players available). */ for(i = 0; i < SC_MAX_PLAYERS; ++i) { sbprintf(buf, sizeof(buf), "player_%d", i + 1); reg_class_register_var(r, "players_class", buf, REG_BLOCK, "player_class"); sbprintf(buf, sizeof(buf), "players/player_%d", i + 1); reg_set_block(r, NULL, buf, "player_class"); } /* Success */ return(true); } int sc_config_file_load(sc_config *c) { /* sc_config_file_load Load the registry from user's config file. */ int version; /* Version of the config file */ char buf[REG_BUFFER]; /* A temporary buffer */ reg *r; /* Registry database */ reg_var *player; /* Player structure */ int i; /* Player iterator */ /* Load the registry */ r = c->cfreg; if(!reg_load(r)) { printf("Didn't find a configuration file, will use game defaults.\n"); return(true); } /* Find out what version we're playing with */ version = 0; reg_get_integer(r, NULL, "version", &version); if(version < SC_CONFIG_VERSION) { fprintf(stderr, "config_file_load: failed to load registry version %d\n", SC_CONFIG_VERSION); fprintf(stderr, "config_file_load: trying to load using older reader.\n"); fprintf(stderr, "config_file_load: please update your config file by resaving it.\n"); return(sc_old_config_file_load(c)); } /* Get the file datum */ reg_get_string(r, NULL, "files/accessoryDefs", c->accessory_file, SC_FILENAME_LENGTH); reg_get_string(r, NULL, "files/tankProfiles", c->profile_file, SC_FILENAME_LENGTH); reg_get_string(r, NULL, "files/scoringDefs", c->scoring_file, SC_FILENAME_LENGTH); reg_get_string(r, NULL, "files/weaponDefs", c->weapon_file, SC_FILENAME_LENGTH); /* Get the font datum */ reg_get_string(r, NULL, "fonts/fixedFont", c->fixed_font, SC_FONT_LENGTH); reg_get_string(r, NULL, "fonts/italicFixedFont", c->italic_fixed_font, SC_FONT_LENGTH); reg_get_string(r, NULL, "fonts/boldFixedFont", c->bold_fixed_font, SC_FONT_LENGTH); /* Load the auxiliary files here */ if(*c->accessory_file != '\0' && !sc_addconf_append_file(SC_ADDCONF_ACCESSORIES, c->accessory_file, c->accessories)) { fprintf(stderr, "Failed to load additional accessories data from \"%s\"\n", c->accessory_file); } /* Loading accessories... */ if(*c->profile_file != '\0' && !sc_tank_profile_add(&c->tanks, c->profile_file)) { fprintf(stderr, "Failed to load additional tank profile data from \"%s\"\n", c->profile_file); } /* Loading tank profiles... */ if(*c->scoring_file != '\0' && !sc_addconf_append_file(SC_ADDCONF_SCORINGS, c->scoring_file, c->economics)) { fprintf(stderr, "Failed to load additional economy scoring data from \"%s\"\n", c->scoring_file); } /* Loading economy scoring... */ if(*c->weapon_file != '\0' && !sc_addconf_append_file(SC_ADDCONF_WEAPONS, c->weapon_file, c->weapons)) { fprintf(stderr, "Failed to load additional weapons data from \"%s\"\n", c->weapon_file); } /* Loading weapons... */ /* Load player data */ reg_get_integer(r, NULL, "players/numPlayers", &c->numplayers); reg_get_integer(r, NULL, "players/numRounds", &c->numrounds); for(i = 0; i < SC_MAX_PLAYERS; ++i) { sbprintf(buf, sizeof(buf), "players/player_%d", i + 1); player = reg_get_var(r, NULL, buf); c->players[i]->aitype = reg_get_integer_from_values(r, player, "playerType", c->players[i]->aitype, sc_ai_names(), sc_ai_types()); reg_get_string(r, player, "playerName", c->players[i]->name, SC_PLAYER_NAME_LENGTH); } /* Load basic options */ c->options.mode = reg_get_integer_from_values(r, NULL, "options/mode", c->options.mode, sc_config_mode_names(), sc_config_mode_types()); c->options.team = reg_get_integer_from_values(r, NULL, "options/teams", c->options.team, sc_config_team_names(), sc_config_team_types()); c->options.order = reg_get_integer_from_values(r, NULL, "options/order", c->options.order, sc_config_order_names(), sc_config_order_types()); c->options.talk = reg_get_integer_from_values(r, NULL, "options/talkMode", c->options.talk, sc_config_talk_names(), sc_config_talk_types()); reg_get_integer(r, NULL, "options/talkProbability", &c->options.talkprob); reg_get_boolean(r, NULL, "options/extendedStatus", &c->options.extstatus); reg_get_boolean(r, NULL, "options/tooltips", &c->options.tooltips); reg_get_boolean(r, NULL, "options/interleave", &c->options.interleave); /* Load graphics settings */ reg_get_integer(r, NULL, "graphics/fieldWidth", &c->fieldwidth); reg_get_integer(r, NULL, "graphics/fieldHeight", &c->fieldheight); reg_get_integer(r, NULL, "graphics/maxHeight", &c->maxheight); reg_get_boolean(r, NULL, "graphics/dithering", &c->graphics.gfxdither); reg_get_boolean(r, NULL, "graphics/animation", &c->graphics.gfxanimate); reg_get_boolean(r, NULL, "graphics/graphicsFast", &c->graphics.gfxfast); reg_get_boolean(r, NULL, "graphics/computersFast", &c->graphics.gfxcompfast); sc_land_setup(c->land, c->fieldwidth, c->fieldheight, sc_land_flags(c)); /* Load economy options */ reg_get_doublev(r, NULL, "economics/interestRate", &c->economics->interestrate); reg_get_boolean(r, NULL, "economics/dynamicInterest", &c->economics->dynamicinterest); reg_get_integer(r, NULL, "economics/initialCash", &c->economics->initialcash); reg_get_boolean(r, NULL, "economics/computersBuy", &c->economics->computersbuy); reg_get_boolean(r, NULL, "economics/computersAggressive", &c->economics->computersaggressive); reg_get_boolean(r, NULL, "economics/freeMarket", &c->economics->freemarket); reg_get_boolean(r, NULL, "economics/lottery", &c->economics->lottery); reg_get_string( r, NULL, "economics/scoring", c->economics->scoringname, SC_ECONOMY_MAX_NAME_LEN); /* Load physics options */ reg_get_doublev(r, NULL, "physics/airViscosity", &c->physics->airviscosity); reg_get_doublev(r, NULL, "physics/gravity", &c->physics->gravity); reg_get_doublev(r, NULL, "physics/tunnelDamping", &c->physics->damping); reg_get_doublev(r, NULL, "physics/maxWindSpeed", &c->physics->maxwind); reg_get_boolean(r, NULL, "physics/dynamicWind", &c->physics->dynamicwind); reg_get_integer(r, NULL, "physics/suspendDirt", &c->physics->suspenddirt); reg_get_integer(r, NULL, "physics/tanksFall", &c->physics->tanksfall); reg_get_integer(r, NULL, "physics/bordersExtend", &c->physics->bordersextend); c->physics->walls = reg_get_integer_from_values(r, NULL, "physics/walls", c->physics->walls, sc_physics_wall_names(), sc_physics_wall_types()); /* Load weapons options */ reg_get_integer(r, NULL, "weapons/armsLevel", &c->weapons->armslevel); reg_get_integer(r, NULL, "weapons/bombIconSize", &c->weapons->bombiconsize); reg_get_boolean(r, NULL, "weapons/tunneling", &c->weapons->tunneling); reg_get_doublev(r, NULL, "weapons/scaling", &c->weapons->scaling); reg_get_boolean(r, NULL, "weapons/tracePaths", &c->weapons->tracepaths); reg_get_boolean(r, NULL, "weapons/uselessItems", &c->weapons->uselessitems); /* Load AI Controller options */ reg_get_boolean(r, NULL, "aicontroller/humanTargets", &c->aicontrol->humantargets); reg_get_boolean(r, NULL, "aicontroller/allowOffsets", &c->aicontrol->allowoffsets); reg_get_boolean(r, NULL, "aicontroller/alwaysOffset", &c->aicontrol->alwaysoffset); reg_get_boolean(r, NULL, "aicontroller/enableScan", &c->aicontrol->enablescan); reg_get_boolean(r, NULL, "aicontroller/noBudget", &c->aicontrol->nobudget); /* Load sound settings */ reg_get_boolean(r, NULL, "sound/enableSound", &c->enablesound); reg_get_boolean(r, NULL, "sound/useHQMixer", &c->usehqmixer); /* Load landscaping options */ c->land->sky = reg_get_integer_from_values(r, NULL, "landscape/sky", c->land->sky, sc_land_sky_names(), sc_land_sky_types()); reg_get_boolean(r, NULL, "landscape/hostile", &c->land->hostileenv); c->land->generator = reg_get_integer_from_values(r, NULL, "landscape/generator", c->land->generator, sc_land_generator_names(), sc_land_generator_types()); reg_get_doublev(r, NULL, "landscape/bumpiness", &c->land->bumpiness); /* Success */ return(true); } int sc_config_file_save(sc_config *c) { /* sc_config_file_save Save the user options. */ char buf[REG_BUFFER]; /* A temporary buffer */ reg *r; /* Registry database */ reg_var *player; /* Player variable */ int i; /* Player iterator */ /* Get the registry DB */ r = c->cfreg; /* Save the proper version number. */ reg_set_integer(r, NULL, "version", SC_CONFIG_VERSION); /* Save the file datum */ reg_set_string(r, NULL, "files/accessoryDefs", c->accessory_file); reg_set_string(r, NULL, "files/tankProfiles", c->profile_file); reg_set_string(r, NULL, "files/scoringDefs", c->scoring_file); reg_set_string(r, NULL, "files/weaponDefs", c->weapon_file); /* Save the font datum */ reg_set_string(r, NULL, "fonts/fixedFont", c->fixed_font); reg_set_string(r, NULL, "fonts/italicFixedFont", c->italic_fixed_font); reg_set_string(r, NULL, "fonts/boldFixedFont", c->bold_fixed_font); /* Save the current player data. */ reg_set_integer(r, NULL, "players/numPlayers", c->numplayers); reg_set_integer(r, NULL, "players/numRounds", c->numrounds); for(i = 0; i < SC_MAX_PLAYERS; ++i) { sbprintf(buf, sizeof(buf), "players/player_%d", i + 1); player = reg_get_var(r, NULL, buf); reg_set_string_from_values(r, player, "playerType", c->players[i]->aitype, sc_ai_names(), sc_ai_types()); reg_set_string(r, player, "playerName", c->players[i]->name); } /* Save the basic options */ reg_set_string_from_values(r, NULL, "options/mode", c->options.mode, sc_config_mode_names(), sc_config_mode_types()); reg_set_string_from_values(r, NULL, "options/teams", c->options.team, sc_config_team_names(), sc_config_team_types()); reg_set_string_from_values(r, NULL, "options/order", c->options.order, sc_config_order_names(), sc_config_order_types()); reg_set_string_from_values(r, NULL, "options/talkMode", c->options.talk, sc_config_talk_names(), sc_config_talk_types()); reg_set_integer(r, NULL, "options/talkProbability", c->options.talkprob); reg_set_boolean(r, NULL, "options/extendedStatus", c->options.extstatus); reg_set_boolean(r, NULL, "options/tooltips", c->options.tooltips); reg_set_boolean(r, NULL, "options/interleave", c->options.interleave); /* Save the graphics options */ reg_set_integer(r, NULL, "graphics/fieldWidth", c->fieldwidth); reg_set_integer(r, NULL, "graphics/fieldHeight", c->fieldheight); reg_set_integer(r, NULL, "graphics/maxHeight", c->maxheight); reg_set_boolean(r, NULL, "graphics/dithering", c->graphics.gfxdither); reg_set_boolean(r, NULL, "graphics/animation", c->graphics.gfxanimate); reg_set_boolean(r, NULL, "graphics/graphicsFast", c->graphics.gfxfast); reg_set_boolean(r, NULL, "graphics/computersFast", c->graphics.gfxcompfast); /* Save the economics options */ reg_set_doublev(r, NULL, "economics/interestRate", c->economics->interestrate); reg_set_boolean(r, NULL, "economics/dynamicInterest", c->economics->dynamicinterest); reg_set_integer(r, NULL, "economics/initialCash", c->economics->initialcash); reg_set_boolean(r, NULL, "economics/computersBuy", c->economics->computersbuy); reg_set_boolean(r, NULL, "economics/computersAggressive", c->economics->computersaggressive); reg_set_boolean(r, NULL, "economics/freeMarket", c->economics->freemarket); reg_set_boolean(r, NULL, "economics/lottery", c->economics->lottery); reg_set_string( r, NULL, "economics/scoring", c->economics->scoringname); /* Save the physics options */ reg_set_doublev(r, NULL, "physics/airViscosity", c->physics->airviscosity); reg_set_doublev(r, NULL, "physics/gravity", c->physics->gravity); reg_set_doublev(r, NULL, "physics/tunnelDamping", c->physics->damping); reg_set_doublev(r, NULL, "physics/maxWindSpeed", c->physics->maxwind); reg_set_boolean(r, NULL, "physics/dynamicWind", c->physics->dynamicwind); reg_set_integer(r, NULL, "physics/suspendDirt", c->physics->suspenddirt); reg_set_integer(r, NULL, "physics/tanksFall", c->physics->tanksfall); reg_set_integer(r, NULL, "physics/bordersExtend", c->physics->bordersextend); reg_set_string_from_values(r, NULL, "physics/walls", c->physics->walls, sc_physics_wall_names(), sc_physics_wall_types()); /* Save the weapons options */ reg_set_integer(r, NULL, "weapons/armsLevel", c->weapons->armslevel); reg_set_integer(r, NULL, "weapons/bombIconSize", c->weapons->bombiconsize); reg_set_boolean(r, NULL, "weapons/tunneling", c->weapons->tunneling); reg_set_doublev(r, NULL, "weapons/scaling", c->weapons->scaling); reg_set_boolean(r, NULL, "weapons/tracePaths", c->weapons->tracepaths); reg_set_boolean(r, NULL, "weapons/uselessItems", c->weapons->uselessitems); /* Save AI controller options */ reg_set_boolean(r, NULL, "aicontroller/humanTargets", c->aicontrol->humantargets); reg_set_boolean(r, NULL, "aicontroller/allowOffsets", c->aicontrol->allowoffsets); reg_set_boolean(r, NULL, "aicontroller/alwaysOffset", c->aicontrol->alwaysoffset); reg_set_boolean(r, NULL, "aicontroller/enableScan", c->aicontrol->enablescan); reg_set_boolean(r, NULL, "aicontroller/noBudget", c->aicontrol->nobudget); /* Save sound settings */ reg_set_boolean(r, NULL, "sound/enableSound", c->enablesound); reg_set_boolean(r, NULL, "sound/useHQMixer", c->usehqmixer); /* Save landscaping options */ reg_set_string_from_values(r, NULL, "landscape/sky", c->land->sky, sc_land_sky_names(), sc_land_sky_types()); reg_set_boolean(r, NULL, "landscape/hostile", c->land->hostileenv); reg_set_string_from_values(r, NULL, "landscape/generator", c->land->generator, sc_land_generator_names(), sc_land_generator_types()); reg_set_doublev(r, NULL, "landscape/bumpiness", c->land->bumpiness); /* Write everything to a file. */ return(reg_save(r)); } xscorch-0.2.1/sgame/scffile.h0000644000175000001440000000246211175116132012762 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/scffile.h,v 1.6 2009-04-26 17:39:38 jacob Exp $ */ /* xscorch - scffile.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Configuration file processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __scffile_h_included #define __scffile_h_included /* Includes */ #include /* Forward structure definitions */ struct _sc_config; /* Constants */ #define SC_CONFIG_VERSION 0x0002 int sc_config_file_init(struct _sc_config *c); int sc_config_file_load(struct _sc_config *c); int sc_config_file_save(struct _sc_config *c); #endif /* __scffile_h_included */ xscorch-0.2.1/sgame/scffileold.c0000644000175000001440000003153311175116132013455 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/scffileold.c,v 1.14 2009-04-26 17:39:38 jacob Exp $ */ /* xscorch - scffileold.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Older configuration file reader This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Config class definitions */ static const reg_class_data _reg_file_class[] = { { "tankProfiles", REG_STRING, NULL }, { "weaponDefs", REG_STRING, NULL }, { "accessoryDefs", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_options_class[] = { { "mode", REG_STRING, NULL }, { "teams", REG_STRING, NULL }, { "order", REG_STRING, NULL }, { "talkMode", REG_STRING, NULL }, { "talkProbability", REG_INTEGER, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_player_class[] = { { "playerType", REG_STRING, NULL }, { "playerName", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_players_class[] = { { "numPlayers", REG_INTEGER, NULL }, { "numRounds", REG_INTEGER, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_graphics_class[] = { { "fieldWidth", REG_INTEGER, NULL }, { "fieldHeight", REG_INTEGER, NULL }, { "maxHeight", REG_INTEGER, NULL }, { "dithering", REG_INTEGER, NULL }, { "animation", REG_INTEGER, NULL }, { "graphicsFast", REG_INTEGER, NULL }, { "computersFast", REG_INTEGER, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_economics_class[] = { { "interestRate", REG_DOUBLEV, NULL }, { "dynamicInterest", REG_INTEGER, NULL }, { "initialCash", REG_INTEGER, NULL }, { "computersBuy", REG_INTEGER, NULL }, { "computersAggressive",REG_INTEGER,NULL }, { "freeMarket", REG_INTEGER, NULL }, { "lottery", REG_INTEGER, NULL }, { "scoring", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_physics_class[] = { { "airViscosity", REG_DOUBLEV, NULL }, { "gravity", REG_DOUBLEV, NULL }, { "maxWindSpeed", REG_DOUBLEV, NULL }, { "dynamicWind", REG_INTEGER, NULL }, { "suspendDirt", REG_INTEGER, NULL }, { "tanksFall", REG_INTEGER, NULL }, { "bordersExtend", REG_INTEGER, NULL }, { "walls", REG_STRING, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_weapons_class[] = { { "armsLevel", REG_INTEGER, NULL }, { "bombIconSize", REG_INTEGER, NULL }, { "tunneling", REG_INTEGER, NULL }, { "scaling", REG_DOUBLEV, NULL }, { "tracePaths", REG_INTEGER, NULL }, { "uselessItems", REG_INTEGER, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_landscape_class[] = { { "sky", REG_STRING, NULL }, { "hostile", REG_INTEGER, NULL }, { "generator", REG_STRING, NULL }, { "bumpiness", REG_DOUBLEV, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_ai_controller_class[] = { { "humanTargets", REG_INTEGER, NULL }, { "allowOffsets", REG_INTEGER, NULL }, { "noBudget", REG_INTEGER, NULL }, { 0, 0, 0 } }; static const reg_class_data _reg_sound_class[] = { { "enableSound", REG_INTEGER, NULL }, { "useHQMixer", REG_INTEGER, NULL }, { 0, 0, 0 } }; /* Configuration class names */ static const reg_class_list _reg_class_dataes[] = { { "file_class", _reg_file_class }, { "player_class", _reg_player_class }, { "players_class", _reg_players_class }, { "options_class", _reg_options_class }, { "graphics_class", _reg_graphics_class }, { "economics_class", _reg_economics_class }, { "physics_class", _reg_physics_class }, { "weapons_class", _reg_weapons_class }, { "landscape_class", _reg_landscape_class }, { "aicontroller_class",_reg_ai_controller_class }, { "sound_class", _reg_sound_class }, { 0, 0 } }; /* Expected toplevel variables */ static const reg_class_data _reg_top_class[] = { { "files", REG_BLOCK, "file_class" }, { "players", REG_BLOCK, "players_class" }, { "options", REG_BLOCK, "options_class" }, { "graphics", REG_BLOCK, "graphics_class" }, { "economics", REG_BLOCK, "economics_class" }, { "physics", REG_BLOCK, "physics_class" }, { "weapons", REG_BLOCK, "weapons_class" }, { "landscape", REG_BLOCK, "landscape_class" }, { "aicontroller", REG_BLOCK, "aicontroller_class" }, { "sound", REG_BLOCK, "sound_class" }, { 0, 0, 0 } }; int sc_old_config_file_load(sc_config *c) { /* sc_old_config_file_load */ int version; /* Version of the config file */ char buf[0x1000]; /* A temporary buffer */ reg_var *player; /* Player structure */ reg *r; /* New registry DB */ int i; /* Player iterator */ /* Sanity checks */ if(c == NULL || c->cfreg == NULL) return(false); /* Setup the class listing */ r = reg_new(c->cfreg->filename); reg_class_register_list(r, _reg_class_dataes); /* Register required toplevel variables, by setting a default type for the variables. */ reg_class_register_vars(r, REG_TOP, _reg_top_class); for(i = 0; _reg_top_class[i].name != NULL; ++i) { reg_set_block(r, NULL, _reg_top_class[i].name, _reg_top_class[i].klass); } /* Setup the players class, which has to be constructed dynamically (because we don't know the number of players available). */ for(i = 0; i < SC_MAX_PLAYERS; ++i) { sbprintf(buf, sizeof(buf), "player_%d", i + 1); reg_class_register_var(r, "players_class", buf, REG_BLOCK, "player_class"); sbprintf(buf, sizeof(buf), "players/player_%d", i + 1); reg_set_block(r, NULL, buf, "player_class"); } /* Load the registry */ if(!reg_load(r)) { return(true); } /* Find out what version we're playing with */ version = 0; reg_get_integer(r, NULL, "version", &version); /* Get the file datum */ reg_get_string(r, NULL, "files/accessoryDefs", c->accessory_file, SC_FILENAME_LENGTH); reg_get_string(r, NULL, "files/tankProfiles", c->profile_file, SC_FILENAME_LENGTH); reg_get_string(r, NULL, "files/weaponDefs", c->weapon_file, SC_FILENAME_LENGTH); /* Load the auxiliary files here */ if(*c->accessory_file != '\0' && !sc_addconf_append_file(SC_ADDCONF_ACCESSORIES, c->accessory_file, c->accessories)) { fprintf(stderr, "Failed to load additional accessories data from \"%s\"\n", c->accessory_file); } /* Loading accessories... */ if(*c->profile_file != '\0' && !sc_tank_profile_add(&c->tanks, c->profile_file)) { fprintf(stderr, "Failed to load additional tank profile data from \"%s\"\n", c->profile_file); } /* Loading tank profiles... */ if(*c->weapon_file != '\0' && !sc_addconf_append_file(SC_ADDCONF_WEAPONS, c->weapon_file, c->weapons)) { fprintf(stderr, "Failed to load additional weapons data from \"%s\"\n", c->weapon_file); } /* Loading weapons... */ /* Load player data */ reg_get_integer(r, NULL, "players/numPlayers", &c->numplayers); reg_get_integer(r, NULL, "players/numRounds", &c->numrounds); for(i = 0; i < SC_MAX_PLAYERS; ++i) { sbprintf(buf, sizeof(buf), "players/player_%d", i + 1); player = reg_get_var(r, NULL, buf); c->players[i]->aitype = reg_get_integer_from_values(r, player, "playerType", c->players[i]->aitype, sc_ai_names(), sc_ai_types()); reg_get_string(r, player, "playerName", c->players[i]->name, SC_PLAYER_NAME_LENGTH); } /* Load basic options */ c->options.mode = reg_get_integer_from_values(r, NULL, "options/mode", c->options.mode, sc_config_mode_names(), sc_config_mode_types()); c->options.team = reg_get_integer_from_values(r, NULL, "options/teams", c->options.team, sc_config_team_names(), sc_config_team_types()); c->options.order = reg_get_integer_from_values(r, NULL, "options/order", c->options.order, sc_config_order_names(), sc_config_order_types()); c->options.talk = reg_get_integer_from_values(r, NULL, "options/talkMode", c->options.talk, sc_config_talk_names(), sc_config_talk_types()); reg_get_integer(r, NULL, "options/talkProbability", &c->options.talkprob); /* Load graphics settings */ reg_get_integer(r, NULL, "graphics/fieldWidth", &c->fieldwidth); reg_get_integer(r, NULL, "graphics/fieldHeight", &c->fieldheight); reg_get_integer(r, NULL, "graphics/maxHeight", &c->maxheight); reg_get_integer(r, NULL, "graphics/dithering", (int *)&c->graphics.gfxdither); reg_get_integer(r, NULL, "graphics/animation", (int *)&c->graphics.gfxanimate); reg_get_integer(r, NULL, "graphics/graphicsFast", (int *)&c->graphics.gfxfast); reg_get_integer(r, NULL, "graphics/computersFast", (int *)&c->graphics.gfxcompfast); sc_land_setup(c->land, c->fieldwidth, c->fieldheight, sc_land_flags(c)); /* Load economy options */ reg_get_doublev(r, NULL, "economics/interestRate", &c->economics->interestrate); reg_get_integer(r, NULL, "economics/dynamicInterest", (int *)&c->economics->dynamicinterest); reg_get_integer(r, NULL, "economics/initialCash", &c->economics->initialcash); reg_get_integer(r, NULL, "economics/computersBuy", (int *)&c->economics->computersbuy); reg_get_integer(r, NULL, "economics/computersAggressive", (int *)&c->economics->computersaggressive); reg_get_integer(r, NULL, "economics/freeMarket", (int *)&c->economics->freemarket); reg_get_integer(r, NULL, "economics/lottery", (int *)&c->economics->lottery); /* TEMP - This is obsolete; ->scoring no longer exists. -JL * c->economy->scoring = reg_get_integer_from_values(r, NULL, "economics/scoring", c->economics->scoring, sc_economy_scoring_names(), sc_economy_scoring_types()); */ /* Load physics options */ reg_get_doublev(r, NULL, "physics/airViscosity", &c->physics->airviscosity); reg_get_doublev(r, NULL, "physics/gravity", &c->physics->gravity); reg_get_doublev(r, NULL, "physics/maxWindSpeed", &c->physics->maxwind); reg_get_integer(r, NULL, "physics/dynamicWind", (int *)&c->physics->dynamicwind); reg_get_integer(r, NULL, "physics/suspendDirt", &c->physics->suspenddirt); reg_get_integer(r, NULL, "physics/tanksFall", &c->physics->tanksfall); reg_get_integer(r, NULL, "physics/bordersExtend", &c->physics->bordersextend); c->physics->walls = reg_get_integer_from_values(r, NULL, "physics/walls", c->physics->walls, sc_physics_wall_names(), sc_physics_wall_types()); /* Load weapons options */ reg_get_integer(r, NULL, "weapons/armsLevel", &c->weapons->armslevel); reg_get_integer(r, NULL, "weapons/bombIconSize", &c->weapons->bombiconsize); reg_get_integer(r, NULL, "weapons/tunneling", (int *)&c->weapons->tunneling); reg_get_doublev(r, NULL, "weapons/scaling", &c->weapons->scaling); reg_get_integer(r, NULL, "weapons/tracePaths", (int *)&c->weapons->tracepaths); reg_get_integer(r, NULL, "weapons/uselessItems", (int *)&c->weapons->uselessitems); /* Load AI Controller options */ reg_get_integer(r, NULL, "aicontroller/humanTargets", (int *)&c->aicontrol->humantargets); reg_get_integer(r, NULL, "aicontroller/allowOffsets", (int *)&c->aicontrol->allowoffsets); reg_get_integer(r, NULL, "aicontroller/noBudget", (int *)&c->aicontrol->nobudget); /* Load sound settings */ reg_get_integer(r, NULL, "sound/enableSound", (int *)&c->enablesound); reg_get_integer(r, NULL, "sound/useHQMixer", (int *)&c->usehqmixer); /* Load landscaping options */ c->land->sky = reg_get_integer_from_values(r, NULL, "landscape/sky", c->land->sky, sc_land_sky_names(), sc_land_sky_types()); reg_get_integer(r, NULL, "landscape/hostile", (int *)&c->land->hostileenv); c->land->generator = reg_get_integer_from_values(r, NULL, "landscape/generator", c->land->generator, sc_land_generator_names(), sc_land_generator_types()); reg_get_doublev(r, NULL, "landscape/bumpiness", &c->land->bumpiness); /* Release the registry */ reg_free(&r); /* Success */ return(true); } xscorch-0.2.1/sgame/scolor.c0000644000175000001440000000475411175116132012651 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/scolor.c,v 1.5 2009-04-26 17:39:38 jacob Exp $ */ /* xscorch - scolor.c Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched color manipulation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include /* get color header */ #include /* Need for field height */ static unsigned long _sc_grand_val; static inline unsigned short _sc_color_gradient_rand(void) { _sc_grand_val = _sc_grand_val * 1664525L + 1013904223L; return((unsigned short)(_sc_grand_val ^ 0xffff)); } int sc_color_gradient_index(bool dither, const int *gradient, int y) { const int *gp; int low; int wid; int probdither; /*** This is the dither subsystem ***/ if(dither) { gp = gradient + 1; while(*gp < y) ++gp; low = *(gp - 1); wid = *gp - low; if(wid > 0) probdither = (0x10000 * (y - low)) / wid; else probdither = 0x10000; if(_sc_color_gradient_rand() < probdither) return(gp - gradient); return(gp - gradient - 1); } else { gp = gradient + 1; while(*gp < y) ++gp; return(gp - gradient - 1); } } void sc_color_gradient_init(const sc_config *c, sc_color *color) { struct timeval tv; int i; int j; gettimeofday(&tv, NULL); _sc_grand_val = tv.tv_usec / 1000 + tv.tv_sec * 1000; for(j = 0; j < SC_NUM_GRADIENTS; ++j) { for(i = 0; i < SC_MAX_GRADIENT_SIZE; ++i) { color->gradindex[j][i] = i * c->fieldheight / (color->gradsize[j] - 1); } } } sc_color *sc_color_new(void) { sc_color *color; color = (sc_color *)malloc(sizeof(sc_color)); if(color == NULL) return(NULL); return(color); } void sc_color_free(sc_color **color) { if(color == NULL || *color == NULL) return; free(*color); *color = NULL; } xscorch-0.2.1/sgame/scolor.h0000644000175000001440000000445711175116132012656 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/scolor.h,v 1.6 2009-04-26 17:39:38 jacob Exp $ */ /* xscorch - scolor.h Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched color manipulation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __scolor_h_included #define __scolor_h_included #include /* Forward structure declarations */ struct _sc_window; struct _sc_config; /* General, useful constants */ #define SC_MAX_GRADIENT_SIZE 128 /* Maximum size of the land gradient. */ /* Definitions of specific, useful gradients */ typedef enum _sc_gradient_list { SC_GRAD_GROUND = 0, /* Ground */ SC_GRAD_NIGHT_SKY, /* Night sky */ SC_GRAD_EXPLOSION, /* Explosion */ SC_GRAD_FUNKY_EXPLOSION,/* Funky explosions */ SC_GRAD_FIRE_SKY, /* Fiery sky */ SC_GRAD_MAGNETIC, /* Gradient for magnetic shields */ SC_GRAD_SHIELD, /* Gradient for standard shields */ SC_GRAD_FORCE, /* Gradient for force shields */ SC_GRAD_FLAMES, /* Flaming idiots! */ SC_NUM_GRADIENTS /* Total number of gradients */ } sc_gradient_list; typedef struct _sc_color { /* Size of each gradient */ int gradsize[SC_NUM_GRADIENTS]; /* Size of all gradients */ /* These constants are useful for dithering; what height does each color begin? */ int gradindex[SC_NUM_GRADIENTS][SC_MAX_GRADIENT_SIZE]; } sc_color; sc_color *sc_color_new(void); void sc_color_free(sc_color **color); void sc_color_gradient_init(const struct _sc_config *c, sc_color *color); int sc_color_gradient_index(bool dither, const int *gradient, int y); #endif /* __scolor_h_included */ xscorch-0.2.1/sgame/sconfig.c0000644000175000001440000003612211175116132012772 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sconfig.c,v 1.30 2009-04-26 17:39:38 jacob Exp $ */ /* xscorch - sconfig.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched configuration This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include /* Configuration header */ #include /* Accessory config */ #include /* Configuration file */ #include /* The colormap */ #include /* Economy config */ #include /* Set up game state */ #include /* Ahoy, landmass!*/ #include /* Landscape init */ #include /* Need to init game options */ #include /* Game physics model */ #include /* Init each player */ #include /* Run the lottery */ #include /* Game data registry */ #include /* Tank profile data */ #include /* Weapon config */ #include /* okay_to_begin needs */ #include /* AI controller structure */ #include /* If networking is permitted */ #include /* We manipulate sound */ #include /* Need to init random seed */ #include #include sc_config *sc_config_new(int *argc, char ***argv) { /* sc_config_new This function creates the configuration structure, initialises all values, and then calls the config file reader and options parser to read in all the options. It accepts the command line arguments as input. */ sc_config *c; /* A new configuration structure */ int i; /* General iterator */ /* Initialise the random number generator */ sys_randomize(); /* Allocate the new configuration structure */ c = (sc_config *)malloc(sizeof(sc_config)); if(c == NULL) { fprintf(stderr, "config_new: failed to allocate config structure, this is critical.\n"); return(NULL); } /* Setup config file parse tree */ if(!sc_config_file_init(c) || c->cfreg == NULL) { fprintf(stderr, "config_new: failed to construct config file parser, this is critical.\n"); return(NULL); } /* Clear out the user filenames */ strcopyb(c->profile_file, "", SC_FILENAME_LENGTH); strcopyb(c->weapon_file, "", SC_FILENAME_LENGTH); strcopyb(c->accessory_file, "", SC_FILENAME_LENGTH); /* Set default fontspecs */ strcopyb(c->fixed_font, "-adobe-courier-medium-r-*-*-*-120-*", SC_FONT_LENGTH); strcopyb(c->italic_fixed_font, "-adobe-courier-medium-o-*-*-*-120-*", SC_FONT_LENGTH); strcopyb(c->bold_fixed_font, "-adobe-courier-bold-r-*-*-*-120-*", SC_FONT_LENGTH); /* Initialise screen size */ c->fieldwidth = SC_DEF_FIELD_WIDTH; c->fieldheight= SC_DEF_FIELD_HEIGHT; c->maxheight = SC_DEF_MAX_HEIGHT; /* Initialise local parameters/structures */ c->insanity = false; c->numrounds = SC_DEF_ROUNDS; c->numplayers = SC_DEF_PLAYERS; c->window = NULL; c->componly = false; /* Set default configuration options */ c->options.mode = SC_CONFIG_MODE_SYNCHRONOUS; c->options.team = SC_CONFIG_TEAM_NONE; c->options.order = SC_CONFIG_ORDER_RANDOM; c->options.talk = SC_CONFIG_TALK_ALL; c->options.talkprob = SC_CONFIG_TALK_PROB_DEF; c->options.extstatus = true; c->options.tooltips = true; c->options.interleave= false; /* Set the default graphics options */ c->graphics.gfxdither = true; c->graphics.gfxanimate = true; c->graphics.gfxfast = false; c->graphics.gfxcompfast = false; /* Setup AI controller */ c->aicontrol = sc_ai_controller_new(); if(c->aicontrol == NULL) { fprintf(stderr, "config_new: failed to build ai_controller.\n"); return(NULL); } /* Initialise the physics model */ c->physics = sc_physics_new(); if(c->physics == NULL) { fprintf(stderr, "config_new: failed to build physics.\n"); return(NULL); } /* Create the new land structure (uninitialised) */ /* WARNING: must be initialised AFTER physics model */ c->land = sc_land_new(c->fieldwidth, c->fieldheight, sc_land_flags(c)); if(c->land == NULL) { fprintf(stderr, "config_new: failed to build land.\n"); return(NULL); } /* Allocate and initialize the game data registry (this is over 64KiB) */ /* WARNING: must be initialized BEFORE any registry users (currently that means weapons and accessories storage) */ c->registry = sc_registry_new(); if(c->registry == NULL) { fprintf(stderr, "config_new: failed to build game data registry.\n"); return(NULL); } /* Create the new lottery structure */ c->lottery = sc_lottery_new(); if(c->lottery == NULL) { fprintf(stderr, "config_new: failed to build lottery.\n"); return(NULL); } /* Load default tank profiles */ c->tanks = NULL; if(!sc_tank_profile_add(&c->tanks, SC_GLOBAL_DIR "/" SC_TANK_PROFILE_FILE) || c->tanks == NULL) { fprintf(stderr, "config_new: failed to build tanks_profile, or no tanks in def file.\n"); return(NULL); } /* Create the players; clear the player order */ /* WARNING: must be initialised AFTER tank profiles */ for(i = 0; i < SC_MAX_PLAYERS; ++i) { c->plorder[i] = NULL; c->players[i] = sc_player_new(i, c->tanks); if(c->players[i] == NULL) { fprintf(stderr, "config_new: failed to build player, %d'th hunk failed.\n", i); return(NULL); } } /* Initialise the game state structure */ c->game = sc_game_new(); if(c->game == NULL) { fprintf(stderr, "config_new: failed to build game.\n"); return(NULL); } /* Initialise the color structure */ c->colors = sc_color_new(); if(c->colors == NULL) { fprintf(stderr, "config_new: failed to build colors.\n"); return(NULL); } /* Initialise the accessories configuration */ c->accessories = sc_accessory_config_create(c); if(c->accessories == NULL) { fprintf(stderr, "config_new: failed to build accessory_config, or no accessories in def file.\n"); return(NULL); } /* Initialise the economy and markets */ c->economics = sc_economy_config_create(c); if(c->economics == NULL) { fprintf(stderr, "config_new: failed to build economy_config, or no scorings in def file.\n"); return(NULL); } /* Initialise the weapons configuration */ c->weapons = sc_weapon_config_create(c); if(c->weapons == NULL) { fprintf(stderr, "config_new: failed to build weapon_config, or no weapons in def file.\n"); return(NULL); } /* Initialise sound controller */ c->enablesound = true; c->usehqmixer = false; sc_sound_init(); /* Initialise network connections? */ #if USE_NETWORK c->client = NULL; c->server = NULL; #endif /* Network allowed? */ /* Parse command-line and file options */ if(!sc_config_file_load(c)) { fprintf(stderr, "config_new: critical error loading config file.\n"); return(NULL); } if(sc_options_parse(c, *argc, *argv)) return(NULL); /* Start sound playback, if permitted */ c->sound = sc_sound_new(c->enablesound, c->usehqmixer); /* Return the new configuration structure */ return(c); } void sc_config_free(sc_config **c) { /* sc_config_free Release the configuration structure, and all associated substructures. */ int i; /* General iterator */ /* Sanity checks */ if(c == NULL || *c == NULL) return; /* Release all substructures */ sc_accessory_config_destroy(&(*c)->accessories); sc_economy_config_destroy(&(*c)->economics); sc_weapon_config_destroy(&(*c)->weapons); sc_color_free(&(*c)->colors); sc_game_free(&(*c)->game); sc_land_free(&(*c)->land); sc_physics_free(&(*c)->physics); sc_lottery_free(&(*c)->lottery); sc_ai_controller_free(&(*c)->aicontrol); sc_tank_profile_free(&(*c)->tanks); for(i = 0; i < SC_MAX_PLAYERS; ++i) { sc_player_free(&((*c)->players[i])); } reg_free(&(*c)->cfreg); sc_sound_free(&(*c)->sound); #if USE_NETWORK sc_net_client_free(&(*c)->client, "Client shutdown"); sc_net_server_free(&(*c)->server, "Server shutdown"); #endif /* Network allowed? */ sc_registry_free(&(*c)->registry); /* Release the config structure */ free(*c); *c = NULL; } bool sc_config_okay_to_begin(const sc_config *c) { /* sc_config_okay_to_begin Returns true if it is okay to begin a new game. This performs some sanity checking (right number of players, network game setup as appropriate, etc) and returns true if all sanity checks pass. Note this will try to spawn off some error windows if it finds a prob. */ bool networkplay; int numhuman; int i; /* Number of players? */ if(c->numplayers < 2) { sc_window_message( c->window, "Cannot Start", "There are fewer than 2 players in the game. "\ "If this is a network game, wait for someone "\ "else to connect. If this is a private game, "\ "add some human or AI players." ); return(false); } /* No network AI players in nonnetwork game; human count okay? */ #if USE_NETWORK networkplay = (c->client != NULL); #else /* Network not allowed */ networkplay = false; #endif /* Network game? */ numhuman = 0; /* Count human and network players */ for(i = 0; i < c->numplayers; ++i) { if(c->players[i]->aitype == SC_AI_HUMAN) ++numhuman; else if(c->players[i]->aitype == SC_AI_NETWORK && !networkplay) { sc_window_message( c->window, "Cannot Start", "A network player has been selected, but "\ "we are not in a network game. This should "\ "not have happened; please go to the Players "\ "window and setup the players to all be human "\ "or AI players." ); return(false); } } /* Make sure there is a human player */ if(numhuman == 0) { sc_window_message( c->window, "Cannot Start", "There are no (local) human players in the game. "\ "Please go to the Players window and setup some "\ "players to be Human." ); return(false); } /* Okay, we can start */ return(true); } void sc_config_init_game(sc_config *c) { int i; sc_physics_init_game(c->physics); for(i = 0; i < c->numplayers; ++i) { sc_player_init_game(c, c->players[i]); } sc_game_init(c->game); sc_economy_init(c->economics); c->curround = -1; /* Clear out inventories! */ sc_accessory_inventory_clear(c->accessories); sc_weapon_inventory_clear(c->weapons); } static void _sc_config_rotate_players(sc_config *c) { sc_player *pllast; int i; pllast = c->plorder[0]; for(i = 0; i < c->numplayers - 1; ++i) { c->plorder[i] = c->plorder[i + 1]; } c->plorder[c->numplayers - 1] = pllast; } void sc_config_init_round(sc_config *c) { int i; /* Clear the player location table */ for(i = 0; i < SC_MAX_PLAYERS; ++i) { c->field_position[i] = -1; } sc_physics_init_round(c->physics); sc_land_setup(c->land, c->fieldwidth, c->fieldheight, sc_land_flags(c)); sc_land_generate(c, c->land); for(i = 0; i < c->numplayers; ++i) { sc_player_init_round(c, c->players[i]); } ++c->curround; if(c->curround == 0) { sc_player_random_order(c, c->plorder); } else switch(c->options.order) { case SC_CONFIG_ORDER_RANDOM: sc_player_random_order(c, c->plorder); break; case SC_CONFIG_ORDER_ROUND_ROBIN: _sc_config_rotate_players(c); break; case SC_CONFIG_ORDER_WINNERS_FIRST: sc_player_winner_order(c, c->plorder); break; case SC_CONFIG_ORDER_LOSERS_FIRST: sc_player_loser_order(c, c->plorder); break; } /* Run the lotto, if it's turned on. */ if(c->economics->lottery) sc_lottery_run(c); c->componly = false; } void sc_config_init_turn(sc_config *c) { int i; c->componly = true; i = c->numplayers; while(--i >= 0) { if(c->players[i]->aitype == SC_AI_HUMAN && SC_PLAYER_IS_ALIVE(c->players[i])) c->componly = false; if(SC_PLAYER_IS_ALIVE(c->players[i])) sc_player_init_turn(c, c->players[i]); } sc_physics_update_wind(c->physics); /* Update the status bar and display */ sc_window_paint(c->window, 0, 0, 0, 0, SC_CLEAR_WIND_ARROW | SC_REDRAW_WIND_ARROW); } /*** Function hooks for enumerated types ***/ /* configuration modes */ static const unsigned int _sc_config_mode_types[] = { SC_CONFIG_MODE_SEQUENTIAL, SC_CONFIG_MODE_SYNCHRONOUS, 0 }; static const char *_sc_config_mode_names[] = { "Sequential", "Synchronous", NULL }; const unsigned int *sc_config_mode_types(void) { return(_sc_config_mode_types); } const char **sc_config_mode_names(void) { return(_sc_config_mode_names); } /* Team types */ static const unsigned int _sc_config_team_types[] = { SC_CONFIG_TEAM_NONE, SC_CONFIG_TEAM_STANDARD, SC_CONFIG_TEAM_CORPORATE, SC_CONFIG_TEAM_VICIOUS, 0 }; static const char *_sc_config_team_names[] = { "None", "Standard", "Corporate", "Viscious", NULL }; const unsigned int *sc_config_team_types(void) { return(_sc_config_team_types); } const char **sc_config_team_names(void) { return(_sc_config_team_names); } /* Play order configuration */ static const unsigned int _sc_config_order_types[] = { SC_CONFIG_ORDER_RANDOM, SC_CONFIG_ORDER_LOSERS_FIRST, SC_CONFIG_ORDER_WINNERS_FIRST, SC_CONFIG_ORDER_ROUND_ROBIN, 0 }; static const char *_sc_config_order_names[] = { "Random", "Losers first", "Winners first", "Round-robin", NULL }; const unsigned int *sc_config_order_types(void) { return(_sc_config_order_types); } const char **sc_config_order_names(void) { return(_sc_config_order_names); } /* Talk modes */ static const unsigned int _sc_config_talk_types[] = { SC_CONFIG_TALK_OFF, SC_CONFIG_TALK_COMPUTERS, SC_CONFIG_TALK_ALL, 0 }; static const char *_sc_config_talk_names[] = { "Off", "Computers only", "Everyone", NULL }; const unsigned int *sc_config_talk_types(void) { return(_sc_config_talk_types); } const char **sc_config_talk_names(void) { return(_sc_config_talk_names); } xscorch-0.2.1/sgame/sconfig.h0000644000175000001440000002020611615366344013006 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sconfig.h,v 1.18 2011-08-01 00:01:40 jacob Exp $ */ /* xscorch - sconfig.h Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched configuration header This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sconfig_h_included #define __sconfig_h_included /* Include files */ #include /* Forward structure declarations */ struct _sc_accessory_config; struct _sc_economy_config; struct _sc_weapon_config; struct _sc_ai_controller; struct _sc_tank_profile; struct _sc_registry; struct _sc_lottery; struct _sc_physics; struct _sc_window; struct _sc_player; struct _sc_color; struct _sc_land; struct _sc_game; struct _reg; struct _sc_sound; #if USE_NETWORK struct _sc_client; struct _sc_server; #endif /* Network? */ /* Arms level constants */ #define SC_ARMS_LEVEL_DEF 4 /* Default arms level */ #define SC_ARMS_LEVEL_MAX 4 /* Maximum allowed arms level */ /* Basic constants */ #define SC_DEF_PLAYERS 10 /* Default number of players */ #define SC_DEF_ROUNDS 10 /* Default number of rounds */ /* The following macro determines if we should be "fast" */ #define SC_CONFIG_GFX_FAST(c) ((c)->graphics.gfxfast || ((c)->componly && (c)->graphics.gfxcompfast)) #define SC_CONFIG_NO_ANIM(c) (SC_CONFIG_GFX_FAST(c) || !(c)->graphics.gfxanimate) #define SC_CONFIG_ANIM(c) (!SC_CONFIG_NO_ANIM(c)) /* Game mode */ typedef enum _sc_config_mode { SC_CONFIG_MODE_SEQUENTIAL, /* Turn-based */ SC_CONFIG_MODE_SYNCHRONOUS /* Everyone enters orders, shoot at once */ } sc_config_mode; const unsigned int *sc_config_mode_types(void); const char **sc_config_mode_names(void); /* Teams mode */ typedef enum _sc_config_team { SC_CONFIG_TEAM_NONE = 0, /* No teams; everyone for themselves */ SC_CONFIG_TEAM_STANDARD, /* Standard teams */ SC_CONFIG_TEAM_CORPORATE, /* Only one bank account per team */ SC_CONFIG_TEAM_VICIOUS /* Fend for self, once 1 team left */ } sc_config_team; const unsigned int *sc_config_team_types(void); const char **sc_config_team_names(void); /* Play order */ typedef enum _sc_config_order { SC_CONFIG_ORDER_RANDOM, /* Players go in random order */ SC_CONFIG_ORDER_LOSERS_FIRST, /* Whoever is last place goes 1st */ SC_CONFIG_ORDER_WINNERS_FIRST, /* Whoever is winning goes 1st */ SC_CONFIG_ORDER_ROUND_ROBIN /* First round is random; ++/round */ } sc_config_order; const unsigned int *sc_config_order_types(void); const char **sc_config_order_names(void); /* Who can talk? */ #define SC_CONFIG_TALK_PROB_DEF 10 /* 10% chance tanks will speak */ typedef enum _sc_config_talk { SC_CONFIG_TALK_OFF = 0, /* No one may speak */ SC_CONFIG_TALK_COMPUTERS, /* Only AI players speak */ SC_CONFIG_TALK_ALL /* All tanks may speak */ } sc_config_talk; const unsigned int *sc_config_talk_types(void); const char **sc_config_talk_names(void); /* Graphics configuration */ typedef struct _sc_config_graphics { bool gfxdither; /* Nonzero if dithering enabled */ bool gfxanimate; /* Animations enabled if nonzero */ bool gfxfast; /* Faster graphics if enabled */ bool gfxcompfast; /* Fast graphics if comp-only */ } sc_config_graphics; /* Options configuration */ typedef struct _sc_config_options { sc_config_mode mode; /* Game mode (sync, seq?) */ sc_config_team team; /* Teams enabled? */ sc_config_order order; /* Player turn order */ sc_config_talk talk; /* Is talking enabled? */ int talkprob; /* Probability tanks will talk. */ bool extstatus; /* Display extended status info? */ bool tooltips; /* Display tooltips? */ bool interleave; /* Interleaved tracking? */ } sc_config_options; typedef struct _sc_config { /* Screen size */ int fieldwidth; /* Field width */ int fieldheight; /* Field height */ int maxheight; /* Maximum land height */ /* User-specific data files */ char accessory_file[SC_FILENAME_LENGTH]; /* Accessories data */ char profile_file[SC_FILENAME_LENGTH]; /* Tank profiles data */ char scoring_file[SC_FILENAME_LENGTH]; /* Economy scoring data */ char weapon_file[SC_FILENAME_LENGTH]; /* Weapons data */ /* Interface fonts */ char fixed_font[SC_FONT_LENGTH]; /* Fixed normal font */ char italic_fixed_font[SC_FONT_LENGTH]; /* Fixed italicized font */ char bold_fixed_font[SC_FONT_LENGTH]; /* Fixed boldface font */ /* Basic options */ sc_config_options options; /* Basic gameplay options */ sc_config_graphics graphics; /* Graphics configuration */ bool insanity; /* DICK LAURANT IS DEAD */ /* Options with their own config files */ struct _sc_accessory_config *accessories; /* Accessories configuration */ struct _sc_ai_controller *aicontrol; /* AI controller configuration */ struct _sc_economy_config *economics; /* Economics configuration */ struct _sc_tank_profile *tanks; /* Player tank structures */ struct _sc_weapon_config *weapons; /* Weapons configuration */ /* Game data registry */ struct _sc_registry *registry; /* The runtime game data registry */ /* File controller */ struct _reg *cfreg; /* Config read from file */ /* Window interface */ struct _sc_window *window; /* Pointer to the game window */ /* Color manipulation */ struct _sc_color *colors; /* Information on each gradient */ /* Sound driver? */ bool enablesound; /* True if sound is permitted */ bool usehqmixer; /* True if use the hq mixer */ struct _sc_sound *sound; /* Sound controller */ /* Network? */ #if USE_NETWORK struct _sc_client *client; /* Network client connection */ struct _sc_server *server; /* Network server connection */ #endif /* Network enabled? */ /* Round information */ int curround; /* Current round number. */ int numrounds; /* Number of rounds to play */ /* Player information */ int numplayers; /* Total number of players */ struct _sc_player *players[SC_MAX_PLAYERS]; /* Info on each player */ struct _sc_player *plorder[SC_MAX_PLAYERS]; /* Game turn ordering */ bool componly; /* Only computer players survive */ int field_position[SC_MAX_PLAYERS]; /* Positions of players on the field */ /* Other game information */ struct _sc_land *land; /* Current landscape. */ struct _sc_game *game; /* Current game state */ struct _sc_physics *physics; /* Game physics */ struct _sc_lottery *lottery; /* Lottery state */ } sc_config; /* Configuration creation */ sc_config *sc_config_new(int *argc, char ***argv); void sc_config_free(sc_config **c); bool sc_config_okay_to_begin(const sc_config *c); void sc_config_init_game(sc_config *c); void sc_config_init_round(sc_config *c); void sc_config_init_turn(sc_config *c); #endif /* __sconfig_h_included */ xscorch-0.2.1/sgame/seconomy.c0000644000175000001440000001771311615366345013217 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/seconomy.c,v 1.17 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - seconomy.c Copyright(c) 2000 Justin David Smith Copyright(c) 2003-2004 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched economy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include /* A very economical header */ #include /* Conf file parsing */ #include /* Need to init player moneys */ #include /* More player cash init */ #include /* Registry access */ #include /* Random interest rate */ #include sc_economy_config *sc_economy_config_create(sc_config *c) { /* sc_economy_config_create Allocate space and read in economy scoring definitions. */ sc_economy_config *ec; const char *filename; ec = (sc_economy_config *)malloc(sizeof(sc_economy_config)); if(ec == NULL) return(NULL); ec->registry = c->registry; ec->interestrate = SC_ECONOMY_DEF_INTEREST; ec->dynamicinterest = false; ec->initialcash = SC_ECONOMY_DEF_CASH; ec->computersbuy = true; ec->computersaggressive = false; ec->freemarket = false; ec->lottery = false; ec->scoringname[0] = '\0'; /* Get a class ID for this economy config. */ ec->registryclass = sc_registry_get_new_class_id(c->registry); ec->registry = c->registry; /* Read in the scoring info list */ filename = SC_GLOBAL_DIR "/" SC_SCORING_FILE; if(!sc_addconf_append_file(SC_ADDCONF_SCORINGS, filename, ec)) { /* This is the root scoring types list... Die! */ free(ec); return(NULL); } return(ec); } void sc_economy_config_destroy(sc_economy_config **ec) { /* sc_economy_config_destroy Obliterate a poor innocent economy config that was doing nothing wrong. */ sc_scoring_info *info, *temp; if(ec == NULL || *ec == NULL) return; /* Delete all of our registry entries. */ info = (sc_scoring_info *)sc_registry_find_first((*ec)->registry, (*ec)->registryclass, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); while(info != NULL) { temp = info; info = (sc_scoring_info *)sc_registry_find_next((*ec)->registry, (*ec)->registryclass, info->ident, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); sc_registry_del_by_int((*ec)->registry, temp->ident); sc_scoring_info_free(&temp); } /* And delete ourself. */ free(*ec); *ec = NULL; } void sc_scoring_info_free(sc_scoring_info **info) { /* sc_scoring_info_free Invalidate memory used by an sc_scoring_info. */ /* Make sure there is an item to free */ if(info == NULL || *info == NULL) return; /* Free the item's name if it has one */ if((*info)->name != NULL) free((*info)->name); /* Free the item */ free(*info); *info = NULL; } void sc_economy_init(sc_economy_config *ec) { /* sc_economy_init Initialize the economics for start of each game. */ const sc_scoring_info *info; double ratio; assert(ec != NULL); /* If no scoring selected, use the default. */ if(strnlenn(ec->scoringname, SC_ECONOMY_MAX_NAME_LEN)) { info = sc_scoring_lookup_by_name(ec, ec->scoringname); } else { info = (sc_scoring_info *)sc_registry_find_first(ec->registry, ec->registryclass, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); strcopyb(ec->scoringname, info->name, SC_ECONOMY_MAX_NAME_LEN); } /* We *must* have have a scoring method. Should be impossible to trigger though. */ assert(info != NULL); /* Scale by initial cash (for fairness)? */ if(info->fixed) { ec->damagebonus = info->damagebonus; ec->damageloss = info->damageloss; ec->deathloss = info->deathloss; ec->killbonus = info->killbonus; ec->suicideloss = info->suicideloss; ec->survivalbonus = info->survivalbonus; } else { ratio = ec->initialcash / SC_ECONOMY_DEF_CASH; ec->damagebonus = info->damagebonus * ratio; ec->damageloss = info->damageloss * ratio; ec->deathloss = info->deathloss * ratio; ec->killbonus = info->killbonus * ratio; ec->suicideloss = info->suicideloss * ratio; ec->survivalbonus = info->survivalbonus * ratio; } /* Start at the default interest rate. */ ec->currentinterest = ec->interestrate; } void sc_economy_interest(sc_config *c, sc_economy_config *ec) { /* sc_economy_interest Adjust the floating interest rate. This is run before each round. */ int i; assert(c != NULL && ec != NULL); for(i = 0; i < c->numplayers; ++i) { c->players[i]->money *= (1 + ec->currentinterest); } if(ec->dynamicinterest) { ec->currentinterest += ((game_lrand(7) - 3) / 100.0); if(ec->currentinterest < 0) ec->currentinterest = 0; if(ec->currentinterest > SC_ECONOMY_MAX_INTEREST) ec->currentinterest = SC_ECONOMY_MAX_INTEREST; } } sc_scoring_info *sc_scoring_lookup(const sc_economy_config *ec, int id) { /* sc_scoring_lookup Pass along a registry request for the economy scoring. */ sc_scoring_info *info; if(ec == NULL || id < 0) return(NULL); /* Find the economy scoring in the registry. */ info = (sc_scoring_info *)sc_registry_find_by_int(ec->registry, id); return(info); } bool _sc_scoring_test_lookup_name(void *data, long arg) { /* _sc_scoring_test_lookup_name This is an sc_registry_test function. We will select from the registry by name. */ sc_scoring_info *info = (sc_scoring_info *)data; const char *name = (const char *)arg; /* We don't validate args; please do so in the caller! */ /* Use sloppy string comparison on the name (true if similar). */ return(strsimilar(info->name, name)); } sc_scoring_info *sc_scoring_lookup_by_name(const sc_economy_config *ec, const char *name) { /* sc_scoring_lookup_by_name Tries to find an economy scoring by roughly the requested name. This is much slower than sc_scoring_lookup. */ sc_registry_iter *iter; sc_scoring_info *info; /* Don't make these into asserts without fixing sgtk/seconomy-gtk.c:_sc_economy_init_names_gtk() first. */ if(ec == NULL || name == NULL) return(NULL); /* Set up for iteration. */ iter = sc_registry_iter_new(ec->registry, ec->registryclass, SC_REGISTRY_FORWARD, _sc_scoring_test_lookup_name, (long)(name)); if(iter == NULL) return(NULL); /* Iterate using the fast registry iterators. */ info = (sc_scoring_info *)sc_registry_iterate(iter); /* Clean up. */ sc_registry_iter_free(&iter); return(info); } #ifdef __BUTTERFLIES_HAVE_STOLEN_YOUR_FAVORITE_CAR__ static const char *_sc_economy_scoring_names[] = { "Basic", "Standard", "Greedy", NULL }; static const int _sc_economy_scoring_types[] = { SC_ECONOMY_SCORING_BASIC, SC_ECONOMY_SCORING_STANDARD, SC_ECONOMY_SCORING_GREEDY, 0 }; const char **sc_economy_scoring_names(void) { return(_sc_economy_scoring_names); } const int *sc_economy_scoring_types(void) { return(_sc_economy_scoring_types); } #endif /* def DEPRECATED */ xscorch-0.2.1/sgame/seconomy.h0000644000175000001440000001147411175116133013207 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/seconomy.h,v 1.11 2009-04-26 17:39:39 jacob Exp $ */ /* xscorch - seconomy.h Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched economy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __seconomy_h_included #define __seconomy_h_included #include /* Forward structure definitions */ struct _sc_registry; struct _sc_config; /* Basic economical constants */ #define SC_ECONOMY_MAX_CASH 1000000 /* 1mil dollars */ #define SC_ECONOMY_DEF_CASH 100000 /* Start as broke */ #define SC_ECONOMY_DEF_INTEREST 0.05 /* Default interest rate (percent) */ #define SC_ECONOMY_MAX_INTEREST 0.30 /* Maximum interest rate */ /* Markups (values > 1) and markdowns (values < 1) */ #define SC_ECONOMY_SPLIT_MARKUP 1.30 /* Percent markup if a bundle is split */ #define SC_ECONOMY_SELL_MARKUP 0.50 /* Percent markup to sell (<1, markdown) */ #define SC_ECONOMY_MAX_NAME_LEN 30 /* Longest allowed economy name */ #define SC_ECONOMY_MAX_DESC_LEN 80 /* Longest allowed economy description */ /* Data on the various types of economy scorings */ typedef struct _sc_scoring_info { int ident; /* Unique ID (none if <= 0) */ int survivalbonus; /* Amount of money recv'd for survival */ int damagebonus; /* Amount of money recv'd for damaging */ int killbonus; /* Bonus for killing an opponent */ int damageloss; /* Amount of money lost for sustaining damage */ int deathloss; /* Amount of money lost for dying */ int suicideloss; /* Amount of money lost for killing self */ bool fixed; /* Absolute or multiply by initialcash/100000 */ char *name; /* Scoring name */ char *description; /* Scoring information */ } sc_scoring_info; /* Economy configuration */ typedef struct _sc_economy_config { /* Various economics information */ struct _sc_registry *registry;/* The game data registry */ double interestrate; /* Current interest rate (%/round) */ bool dynamicinterest; /* Nonzero if interest rate can change */ double currentinterest; /* Current interest rate */ int initialcash; /* Initial cash for all players */ int registryclass; /* Registry class of economy scorings */ bool computersbuy; /* Nonzero if computers can buy */ bool computersaggressive; /* Computers are agressive with money? */ bool freemarket; /* Nonzero if simulating a free mkt */ bool lottery; /* The Scorched Lotto! */ char scoringname[SC_ECONOMY_MAX_NAME_LEN]; /* Current economy */ /* Run-time values (based on config->current) */ int survivalbonus; /* Amount of money recv'd for survival */ int damagebonus; /* Amount of money recv'd for damaging */ int killbonus; /* Bonus for killing an opponent */ int damageloss; /* Amt of money lost for sustaining damage */ int deathloss; /* Amt of money lost for dying */ int suicideloss; /* Amt of money lost for killing self */ } sc_economy_config; /* Create and destroy economy conf storage */ sc_economy_config *sc_economy_config_create(struct _sc_config *c); void sc_economy_config_destroy(sc_economy_config **ec); void sc_scoring_info_free(sc_scoring_info **info); /* Periodic maintenance on the economics. :) */ void sc_economy_init(sc_economy_config *ec); void sc_economy_interest(struct _sc_config *c, sc_economy_config *ec); /* Find economy scorings. */ sc_scoring_info *sc_scoring_lookup(const sc_economy_config *ec, int id); sc_scoring_info *sc_scoring_lookup_by_name(const sc_economy_config *ec, const char *name); /* * TEMP OBSOLETE? -JL * (__BUTTERFLIES_HAVE_STOLEN_YOUR_FAVORITE_CAR__) * It might work well to bring these back, actually. * I'm thinking about it; seconomy-gtk.c is *so* ugly right now... * const char **sc_economy_scoring_names(void); * const int *sc_economy_scoring_types(void); */ #endif /* __seconomy_h_included */ xscorch-0.2.1/sgame/sexplosion.c0000644000175000001440000012037111615366345013561 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sexplosion.c,v 1.18 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sexplosion.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2000-2003 Jacob Luna Lundberg Copyright(c) 2003 Jason House (wedge code) justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched zone explosions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include /* Explosion header */ #include /* Need colormap information */ #include /* Need to get colormap, land */ #include /* We clear the land */ #include /* Need current physics model */ #include /* Constructs spillage/napalm */ #include /* For expl_cache drawing functions */ sc_explosion *sc_expl_new(int centerx, int centery, int radius, int force, int playerid, sc_explosion_type type) { /* sc_expl_new Create a new explosion. */ sc_explosion *e; /* A newly created explosion */ /* Make sure explosion has a radius */ if(radius <= 0) return(NULL); /* Allocate memory for a new explosion */ e = (sc_explosion *)malloc(sizeof(sc_explosion)); if(e == NULL) return(NULL); /* Initialise variables */ e->centerx = centerx; e->centery = centery; e->direction = 0; e->angular_width = 0; e->radius = radius; e->force = force; e->playerid = playerid; e->type = type; e->counter = 0; /* By default, no chain on this weapon */ e->chain = NULL; return(e); } sc_explosion *sc_expl_new_with_angle(int centerx, int centery, int radius, int force, double direction, double angular_width, int playerid, sc_explosion_type type) { /* sc_expl_new_with_angle Create a new explosion, oriented at the specified direction (in radians; 0 = right, M_PI/2 = up), and with the specified angular width (radians). If the angular width is 0, then direction is ignored, and normal circular explosions are used. */ sc_explosion *e; /* A newly created explosion */ /* Allocate and initialize the explosion */ e = sc_expl_new(centerx, centery, radius, force, playerid, type); if(e == NULL) return(NULL); /* Setup the angular attributes */ e->direction = direction; e->angular_width = angular_width; /* Return the directed explosion. */ return(e); } sc_explosion *sc_expl_add(sc_explosion **e, sc_explosion *add) { /* sc_expl_add Adds explosion add to the _end_ of e. */ sc_explosion *insert_after; if(e == NULL) return(NULL); insert_after = *e; if(insert_after == NULL) { *e = add; } else { while(insert_after->chain != NULL) insert_after = insert_after->chain; insert_after->chain = add; } return(add); } sc_explosion *sc_expl_index(sc_explosion *e, int index) { /* sc_expl_index */ if(e == NULL || index < 0) return(NULL); while(index > 0 && e != NULL) { e = e->chain; --index; } return(e); } int sc_expl_count(const sc_explosion *e) { /* sc_expl_count */ int count = 0; while(e != NULL) { ++count; e = e->chain; } return(count); } void sc_expl_free(sc_explosion **e) { /* sc_expl_free Releases the explosion at the head of the list, and sets *e to its original chain pointer. */ sc_explosion *del; /* Explosion to be deleted */ /* Sanity checking */ if(e == NULL || *e == NULL) return; /* Get the explosion to be deleted, and reassign *e */ del = *e; *e = del->chain; /* Delete this explosion */ free(del); } void sc_expl_free_chain(sc_explosion **e) { /* sc_expl_free_chain Releases all explosions on this chain, at once. */ /* Release the whole chain */ if(e == NULL) return; while(*e != NULL) sc_expl_free(e); } typedef struct _sc_expl_cache { int cacheid; int eradius; } sc_expl_cache; /*** Lowlevel Screen Updates -- COLUMNS ***/ static inline void _sc_expl_annihilate_fill_column(sc_config *c, sc_land *l, int x, int y1, int y2) { /* sc_expl_annihilate_fill_column Fills a column with land. This fills any clear tiles in column x with GROUND tiles, from y1 up to y2 (y1 < y2) (inclusive of both endpoints). This is an internal function only. */ const int *gradient; /* Sky gradient */ bool dither; /* Enable dithering? */ int *lp; /* Pointer into land structure at (x, y) */ int y; /* Current Y coordinate */ /* Get the sky gradient */ gradient = c->colors->gradindex[SC_GRAD_GROUND]; dither = c->graphics.gfxdither; /* Boundary checks */ if(!sc_land_translate_x(l, &x)) return; if(y1 < 0) y1 = 0; if(y2 >= c->fieldheight) y2 = c->fieldheight - 1; /* Boundary checks have already been performed */ y = y1; lp = SC_LAND_XY(l, x, y); while(y <= y2) { if(SC_LAND_IS_SKY(*lp)) { *lp = SC_LAND_GROUND | sc_color_gradient_index(dither, gradient, y); } /* Was the tile originally sky? */ ++lp; ++y; } } static inline void _sc_expl_annihilate_clear_column(sc_config *c, sc_land *l, int x, int y1, int y2) { /* sc_expl_annihilate_clear_column Clears a column of everything in a column; everything in the column is set to SKY tiles. This clears column x, from y1 up to y2 (y1 < y2) (inclusive of both endpoints). This is an internal function only. */ const int *gradient; /* Sky gradient */ int gradientflag; /* Sky gradient flag */ bool dither; /* Enable dithering? */ int *lp; /* Pointer into land structure at (x, y) */ int y; /* Current Y coordinate */ /* Get the sky gradient */ gradient = sc_land_sky_index(c); gradientflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; /* Boundary checks */ if(!sc_land_translate_x(l, &x)) return; if(y1 < 0) y1 = 0; if(y2 >= c->fieldheight) y2 = c->fieldheight - 1; /* Boundary checks have already been performed */ y = y1; lp = SC_LAND_XY(l, x, y); while(y <= y2) { *lp = gradientflag | sc_color_gradient_index(dither, gradient, y); ++lp; ++y; } } static inline void _sc_expl_annihilate_column(sc_config *c, sc_land *l, int x, int y1, int y2, bool fill) { /* sc_expl_annihilate_clear_column Clears a column to GROUND (if fill == true), or SKY (if fill == false). This clears column x, from y1 up to y2 (y1 < y2). This is an internal function only. */ if(fill) { _sc_expl_annihilate_fill_column(c, l, x, y1, y2); } else { _sc_expl_annihilate_clear_column(c, l, x, y1, y2); } } /*** Lowlevel Screen Updates -- WEDGE code ***/ #define SC_WEDGE_SECTION_TOP (1<<0) #define SC_WEDGE_SECTION_MIDDLE (1<<1) #define SC_WEDGE_SECTION_BOTTOM (1<<2) #define SC_WEDGE_SECTION_UPPER (SC_WEDGE_SECTION_TOP | SC_WEDGE_SECTION_MIDDLE) #define SC_WEDGE_SECTION_LOWER (SC_WEDGE_SECTION_MIDDLE | SC_WEDGE_SECTION_BOTTOM) #define SC_WEDGE_SECTION_ENDS (SC_WEDGE_SECTION_TOP | SC_WEDGE_SECTION_BOTTOM) #define SC_WEDGE_SECTION_ALL (SC_WEDGE_SECTION_UPPER | SC_WEDGE_SECTION_LOWER) #define SC_WEDGE_SECTION_NONE (0) typedef struct _sc_wedge_boundaries { int left_x, right_x; int left_y, right_y; double left_slope, right_slope; bool inside, thirds; int section; } sc_wedge_boundaries; static void _sc_expl_annihilate_half_column(sc_config *c, sc_land *l, int cx, int cy, int dx, int dy, const sc_wedge_boundaries *wedge, int critical_y, bool fill) { #if SC_EXPL_DEBUG_WEDGES printf("expl_annihilate_half_column: dx=%04d, 2 sections, %04d -> %04d -> %04d\n", dx, cy - dy, cy + critical_y, cy + dy); #endif /* SC_EXPL_DEBUG_WEDGES */ /* The middle section is illegal in half_column. */ assert(!(wedge->section & SC_WEDGE_SECTION_MIDDLE)); switch(wedge->section) { case SC_WEDGE_SECTION_ENDS: _sc_expl_annihilate_column(c, l, cx + dx, cy - dy, cy + dy, fill); break; case SC_WEDGE_SECTION_TOP: _sc_expl_annihilate_column(c, l, cx + dx, cy + critical_y, cy + dy, fill); break; case SC_WEDGE_SECTION_BOTTOM: _sc_expl_annihilate_column(c, l, cx + dx, cy - dy, cy + critical_y, fill); break; case SC_WEDGE_SECTION_NONE: #if SC_EXPL_DEBUG_WEDGES printf("expl_annihilate_half_column: draw none (too thin?)\n"); #else assert(false); #endif /* SC_EXPL_DEBUG_WEDGES */ break; } } static void _sc_expl_annihilate_third_column(sc_config *c, sc_land *l, int cx, int cy, int dx, int dy, const sc_wedge_boundaries *wedge, bool fill) { /* Fills in 1, 2, or 3 of the sliced sections. 3 section case only occurs at border cases. */ int ldy = (int)(wedge->left_slope * dx); int rdy = (int)(wedge->right_slope * dx); int min_boundary_y = min(ldy, rdy); int max_boundary_y = max(ldy, rdy); min_boundary_y = max(-dy, min_boundary_y); max_boundary_y = min( dy, max_boundary_y); #if SC_EXPL_DEBUG_WEDGES printf("expl_annihilate_third_column: dx=%04d, 3 sections, %04d -> %04d -> %04d -> %04d\n", dx, cy - dy, cy + min_boundary_y, cy + max_boundary_y, cy + dy); #endif /* SC_EXPL_DEBUG_WEDGES */ switch(wedge->section) { case SC_WEDGE_SECTION_ALL: _sc_expl_annihilate_column(c, l, cx + dx, cy - dy, cy + dy, fill); break; case SC_WEDGE_SECTION_UPPER: _sc_expl_annihilate_column(c, l, cx + dx, cy + min_boundary_y, cy + dy, fill); break; case SC_WEDGE_SECTION_ENDS: _sc_expl_annihilate_column(c, l, cx + dx, cy + max_boundary_y, cy + dy, fill); _sc_expl_annihilate_column(c, l, cx + dx, cy - dy, cy + min_boundary_y, fill); break; case SC_WEDGE_SECTION_TOP: _sc_expl_annihilate_column(c, l, cx + dx, cy + max_boundary_y, cy + dy, fill); break; case SC_WEDGE_SECTION_LOWER: _sc_expl_annihilate_column(c, l, cx + dx, cy - dy, cy + max_boundary_y, fill); break; case SC_WEDGE_SECTION_MIDDLE: _sc_expl_annihilate_column(c, l, cx + dx, cy + min_boundary_y, cy + max_boundary_y, fill); break; case SC_WEDGE_SECTION_BOTTOM: _sc_expl_annihilate_column(c, l, cx + dx, cy - dy, cy + min_boundary_y, fill); break; case SC_WEDGE_SECTION_NONE: #if SC_EXPL_DEBUG_WEDGES printf("expl_annihilate_third_column: draw none (too thin?)\n"); #else assert(false); #endif /* SC_EXPL_DEBUG_WEDGES */ break; } } static void _sc_expl_annihilate_column_cautious(sc_config *c, sc_land *l, int cx, int cy, int dx, int dy, const sc_wedge_boundaries *wedge, bool fill) { if(wedge->thirds) { _sc_expl_annihilate_third_column(c, l, cx, cy, dx, dy, wedge, fill); } else if(dx >= 0) { _sc_expl_annihilate_half_column(c, l, cx, cy, dx, dy, wedge, (int)rint(wedge->right_slope * dx), fill); } else { _sc_expl_annihilate_half_column(c, l, cx, cy, dx, dy, wedge, (int)rint(wedge->left_slope * dx), fill); } } static inline void _sc_expl_annihilate_column_pair(sc_config *c, sc_land *l, int cx, int cy, int dx, int dy, const sc_wedge_boundaries *wedge, bool fill, int min_x, int max_x) { if(-dx >= min_x && -dx <= max_x) { _sc_expl_annihilate_column_cautious(c, l, cx, cy, -dx, dy, wedge, fill); } else if(!wedge->inside) { _sc_expl_annihilate_column(c, l, cx - dx, cy - dy, cy + dy, fill); } if(dx >= min_x && dx <= max_x) { _sc_expl_annihilate_column_cautious(c, l, cx, cy, dx, dy, wedge, fill); } else if(!wedge->inside) { _sc_expl_annihilate_column(c, l, cx + dx, cy - dy, cy + dy, fill); } } static double _sc_expl_clockwise_closest(double angle_1, double angle_2) { /* sc_expl_clockwise_closest Produces angle_1 >= (return value) > angle_1 - 2*pi ^ equality is important. mod(return_value,2*pi)=mod(angle_2,2*pi) */ while(angle_2 > angle_1) { /* too big? */ angle_2 -= 2 * M_PI; } while(angle_2 <= (angle_1 - 2 * M_PI)) { /* too big? */ angle_2 += 2 * M_PI; } return(angle_2); } static bool _sc_expl_pixel_test(int dy, const sc_wedge_boundaries *wedge) { /* sc_expl_pixel_test */ int dx = 0; /* currently this is never called with any other dx */ int left_cross_r = (wedge->left_y * dx - wedge->left_x * dy); int right_cross_r = (wedge->right_y * dx - wedge->right_x * dy); bool is_inside = (left_cross_r > 0) && (right_cross_r < 0); bool border = ((left_cross_r == 0) && (right_cross_r < 0)) || ((left_cross_r > 0) && (right_cross_r == 0)); if(border) { return(true); } if(wedge->inside) { return(is_inside); } else { return(!is_inside); } } /* Jason's explanation of the logic governing the following loop: (The idea is to avoid potential confusion as to why this method is used) The most obvious method is to use a for loop over x (from -r to r) (actually from symetry, just dx=0 to r, and use -dx and dx...) And then clear/fill from -sqrt(r^2 - x^2) to sqrt(r^2 - x^2) Sqrt's are slow and doing something like "while (x*x+y*y>r*r) y--;" would work, that can become slow, especially for extreme values of x. Near the middle of the circle, the for loop would run 0-1 times. Near the outside of the circle, it could run many times. (Of course one could bound it, and claim it isn't that bad...) The alternative approach: The region of y reducing by zero or one "near the middle" is similar to x reducing by zero or one "near the edges"... In fact, they meet at 45 degrees... So, the knowledge of x,y values near the middle can be transposed to get the x,y (y,x) values near the outside... so, start out at dx = 0, dy = r, and move out increasing dx, decreasing dy Bascially, you want to maintain dx*dx + dy*dy = r*r Now when you increase dx, new_dx*new_dx - old_dx*old_dx = new_dx*new_dx - (new_dx - 1)*(new_dx - 1) = 2*new_dx - 1 And when you decrease dy, new_dy*new_dy - old_dy*old_dy = new_dy*new_dy - (new_dy + 1)*(new_dy + 1) =-2*new_dy - 1; So, if rad2 = r*r, then your dx,dy pair approximate rad2... basically dx*dx + dy*dy = rad2_approx. Initially, dx = 0, dy = r, so rad2_approx = rad2. Then you modify dx or dy, and get a new rad2_approx That's how I would do it... when first thinking about it... There's a small problem with that... dy will decrease as soon as dx increases... resulting in a lone dot at all 4 edges. In the code below, rad2major2 = r*r - dx*dx; So then, I would think the comparison would be with dy*dy... Of course, there's a small problem with comparing against dy*dy; you'll end up with lone dots at 0,+/-r and +/-r,0 It looks like the code compares with dy*dy-dy or dy*(dy-1) using the math from before, dy*(dy-1) decreases by 2*new_dy This is a slight variant, on (dy-.5)*(dy-.5)=dy*dy-dy+.25 and will make everything look smoother. Theoretically, (dy-1/2)*(dy-1/2) as a comparison could be supported by the argument that you are rounding to the nearest pixel. Maybe the reasoning for dy*(dy-1) will be shared by the original authors :) There could be finer details, like rounding arguments nears 45 degrees... */ static void _sc_expl_annihilate_wedge(sc_config *c, const sc_explosion *e, int radius, bool fill) { /* sc_expl_annihilate_wedge Clears (if fill == false) or fills (if fill == true) dirt in the explosion specified. This updates the land buffer but it will NOT update the display screen. This function is used for code that is performing wedged explosions. It may be slightly less efficient than annihilate_circular; once I convince myself that this code actually works, I may go ahead and delete annihilate_circular. */ int cx=e->centerx;/* Center X of explosion */ int cy=e->centery;/* Center Y of explosion */ int dx; /* Delta X (distance away from cx) - iterator variable */ int dy; /* Delta Y (distance away from cy) for _edge_ of circle */ int rad2; /* Radius squared */ int rad2major2; /* Radius^2 + the major_distance^2 */ int min2thresh; /* Minimum threshold to avoid redrawing columns where dx>dy */ sc_wedge_boundaries wedge; /* Wedge boundary support */ int min_x, max_x; /* Affected range of dx */ double left_angle; /* Leftmost angle of wedge */ double right_angle; /* Rightmost angle of wedge */ /* Figure out the minimum and maximum angles for the wedge */ right_angle = e->direction - e->angular_width / 2; left_angle = e->direction + e->angular_width / 2; /* By default, assume we are drawing "inside" the wedge, not outside of it. We might change our mind on this once we figure out how wide the arc is... */ wedge.inside = true; /* Coding for detecting a wedge requires < 180 degree separation If > 180 degree seperation, reverse say draw outside the region If < 180 degree seperation, then we're okay. */ if((_sc_expl_clockwise_closest(left_angle, right_angle) - left_angle < -M_PI)) { left_angle = left_angle + right_angle; right_angle = left_angle - right_angle; left_angle = left_angle - right_angle; wedge.inside = false; } /* Make sure nothing is odd here with 360 degrees wrapping to 0 degrees... * Also skip the trig */ if(e->angular_width > M_PI * 2 - 0.00001) { /* We're not using the wedge code in this case */ wedge.inside = false; /* 360, Draw everything! */ wedge.section = SC_WEDGE_SECTION_ALL; wedge.left_x = 0; wedge.right_x = 0; min_x = 0; max_x = 0; wedge.left_y = radius; wedge.right_y = radius; /* left_slope and right_slope are ignored */ } else { wedge.left_x = rint(radius * cos(left_angle)); wedge.left_y = rint(radius * sin(left_angle)); wedge.left_slope = tan(left_angle); wedge.right_x = rint(radius * cos(right_angle)); wedge.right_y = rint(radius * sin(right_angle)); wedge.right_slope = tan(right_angle); min_x = min(wedge.left_x, wedge.right_x); max_x = max(wedge.left_x, wedge.right_x); if(min_x * max_x >= 0) { /* Both wedge boundaries are on the same side... */ wedge.thirds = true; wedge.section = (wedge.inside ? SC_WEDGE_SECTION_MIDDLE : SC_WEDGE_SECTION_TOP | SC_WEDGE_SECTION_BOTTOM); min_x = min(min_x, 0); max_x = max(max_x, 0); } else { /* wedge boundaries on opposite sides */ wedge.thirds = false; wedge.section = (_sc_expl_pixel_test(radius, &wedge) ? SC_WEDGE_SECTION_TOP : SC_WEDGE_SECTION_BOTTOM); } #if SC_EXPL_DEBUG_WEDGES printf("**** New Explosion (expl_annihilate_wedge) ****\n"); printf("center x=%04, y=%04, r=%04\n", cx, cy, radius); printf("left: %03dD right: %03dD, %s\n", (int)(left_angle * 180 / M_PI), (int)(right_angle * 180 / M_PI), wedge.inside ? "inside" : "outside"); printf("dx_min = %04d, dx_max = %04d\n\n", min_x, max_x); #endif /* SC_EXPL_DEBUG_WEDGES */ } /* DX = major axis, DY = minor axis */ dx = 0; /* DX starts at zero (iterator) */ dy = radius; /* DY is one radius away (edge of circle at cx+dx) */ rad2 = radius * radius; /* Calculate Radius Squared */ rad2major2 = rad2; /* Radius^2 + major^2, running total */ min2thresh = rad2 - dy; /* Minimum threshold before need to redraw edges */ /* Should know that, we are incrementing DX every time. However, if we call the transpose method every time as well, then we will be filling parts of the circle multiple times. Hence the min2thresh variable. */ do { /* Column pair is columns at cx-dx and cx+dx */ _sc_expl_annihilate_column_pair(c, c->land, cx, cy, dx, dy, &wedge, fill, min_x, max_x); ++dx; rad2major2 -= dx + dx - 1; if(rad2major2 <= min2thresh) { /* swap dx and dy */ _sc_expl_annihilate_column_pair(c, c->land, cx, cy, dy, dx, &wedge, fill, min_x, max_x); --dy; min2thresh -= dy + dy; } } while(dx <= dy); } /*** Lowlevel Screen Updates -- NON-WEDGE code ***/ static void _sc_expl_annihilate_circular(sc_config *c, const sc_explosion *e, int radius, bool fill) { /* sc_expl_annihilate_circular Clears (if fill == false) or fills (if fill == true) dirt in the explosion specified. This updates the land buffer but it will NOT update the display screen. This function assumes there is no "wedge" being computed. It bypasses pretty much all of the wedge-specific computations as a result. */ int cx=e->centerx;/* Center X of explosion */ int cy=e->centery;/* Center Y of explosion */ int dx; /* Delta X (distance away from cx) - iterator variable */ int dy; /* Delta Y (distance away from cy) for _edge_ of circle */ int rad2; /* Radius squared */ int rad2major2; /* Radius^2 + the major_distance^2 */ int min2thresh; /* Minimum threshold to avoid redrawing columns where dx>dy */ /* DX = major axis, DY = minor axis */ dx = 0; /* DX starts at zero (iterator) */ dy = radius; /* DY is one radius away (edge of circle at cx+dx) */ rad2 = radius * radius; /* Calculate Radius Squared */ rad2major2 = rad2; /* Radius^2 + major^2, running total */ min2thresh = rad2 - dy; /* Minimum threshold before need to redraw edges */ /* Should know that, we are incrementing DX every time. However, if we call the transpose method every time as well, then we will be filling parts of the circle multiple times. Hence the min2thresh variable. */ do { _sc_expl_annihilate_column(c, c->land, cx - dx, cy - dy, cy + dy, fill); _sc_expl_annihilate_column(c, c->land, cx + dx, cy - dy, cy + dy, fill); ++dx; rad2major2 -= dx + dx - 1; if(rad2major2 <= min2thresh) { /* Swap dx and dy */ _sc_expl_annihilate_column(c, c->land, cx - dy, cy - dx, cy + dx, fill); _sc_expl_annihilate_column(c, c->land, cx + dy, cy - dx, cy + dx, fill); --dy; min2thresh -= dy + dy; } } while(dx <= dy); } static void _sc_expl_annihilate(sc_config *c, const sc_explosion *e, int radius, bool fill) { /* sc_expl_annihilate Clears (if fill == false) or fills (if fill == true) dirt in the explosion specified. This updates the land buffer but it will NOT update the display screen. */ /* Dispatch to either wedge code or non-wedge code. */ if(!SC_EXPL_DEBUG_WEDGES && e->angular_width == 0) { _sc_expl_annihilate_circular(c, e, radius, fill); } else { _sc_expl_annihilate_wedge(c, e, radius, fill); } /* Update the land buffer */ sc_window_paint(c->window, e->centerx - radius, e->centery - radius, e->centerx + radius, e->centery + radius, SC_REGENERATE_LAND); } static void _sc_expl_annihilate_clear(sc_config *c, const sc_explosion *e, int radius) { /* sc_expl_annihilate_clear Clears the explosion specified. This updates the land buffer but it will NOT update the display screen. */ _sc_expl_annihilate(c, e, radius, false); } static void _sc_expl_annihilate_fill(sc_config *c, const sc_explosion *e, int radius) { /* sc_expl_annihilate_fill Fills the area specified with land. This regenerates the land buffer but it will NOT update the display screen. */ _sc_expl_annihilate(c, e, radius, true); } /*** Interface for Annihilation (explosion draw) and Clear (explosion undraw) ***/ bool sc_expl_annihilate(sc_config *c, sc_explosion *e) { /* sc_expl_annihilate Annihilate a section of the screen by drawing a huge explosion to it. This function is called to initiate animation of the explosion and update the landmass, indicating the area destroyed by the explosion. If it returns "true", then the caller should call annihilate_continue at some point to continue processing the explosion in an "animated" manner. If it returns "false", then the explosion has been completely dealt with, and you are ready to call annihilate_clear. */ sc_expl_cache *ca; /* Explosion cache (standard explosions) */ sc_spill *sp; /* Spill information (liquid explosions) */ /* Sanity check */ if(c == NULL || e == NULL) return(false); /* Action depends on weapon type */ switch(e->type) { case SC_EXPLOSION_SPIDER: /* if there is an arc to draw, draw it */ if(e->data != NULL) sc_window_draw_arc(c->window, e->data, e->playerid); else fprintf(stderr, "BUG: spider with null leg arc.\n"); /* fall through to explosion drawing */ case SC_EXPLOSION_NORMAL: case SC_EXPLOSION_PLASMA: /* Get a new explosion cache ID, and draw it */ if(!SC_CONFIG_GFX_FAST(c)) { ca = (sc_expl_cache *)malloc(sizeof(sc_expl_cache)); if(ca == NULL) return(false); if(SC_CONFIG_ANIM(c)) ca->eradius = 0; else ca->eradius = e->radius; ca->cacheid = sc_expl_cache_new(c->window, e->radius, e->type); e->cache = ca; return(true); } /* Only executed if not in fast mode */ return(false); case SC_EXPLOSION_NAPALM: /* Retrieve the napalm spill */ sp = (sc_spill *)e->data; if(!SC_CONFIG_GFX_FAST(c) && sp != NULL) { if(SC_CONFIG_ANIM(c)) { sc_window_draw_napalm_frame(c->window, sp->spillx, sp->spilly, min(sp->size, SC_EXPL_LIQUID_STEP)); sp->index = SC_EXPL_LIQUID_STEP; } else { sc_window_draw_napalm_frame(c->window, sp->spillx, sp->spilly, sp->size); sp->index = sp->size + 1; } return(true); } /* Only attempt the draw if spill pointer valid */ return(false); case SC_EXPLOSION_LIQ_DIRT: /* Retrieve the liquid dirt spill */ sp = (sc_spill *)e->data; if(!SC_CONFIG_GFX_FAST(c) && sp != NULL) { if(SC_CONFIG_ANIM(c)) { sc_land_create_dirt(c, c->land, sp->spillx, sp->spilly, min(sp->size, SC_EXPL_LIQUID_STEP)); sp->index = SC_EXPL_LIQUID_STEP; } else { sc_land_create_dirt(c, c->land, sp->spillx, sp->spilly, sp->size); sp->index = sp->size + 1; } return(true); } /* Only attempt the draw if spill pointer valid */ return(false); case SC_EXPLOSION_DIRT: /* Animate a circular explosion that is filling up */ _sc_expl_annihilate_fill(c, e, e->radius); if(!SC_CONFIG_GFX_FAST(c)) { /* Only do slow animation if not in fast mode */ e->idraw = 0; return(true); } else { /* Just update everything at once */ sc_window_paint(c->window, e->centerx - e->radius, e->centery - e->radius, e->centerx + e->radius, e->centery + e->radius, SC_PAINT_EVERYTHING); } /* Only executed if not in fast mode */ break; case SC_EXPLOSION_RIOT: /* Animate a circular explosion that is clearing out */ _sc_expl_annihilate_clear(c, e, e->radius); if(!SC_CONFIG_GFX_FAST(c)) { /* Only do slow animation if not in fast mode */ e->idraw = 0; return(true); } else { /* Just update everything at once */ sc_window_paint(c->window, e->centerx - e->radius, e->centery - e->radius, e->centerx + e->radius, e->centery + e->radius, SC_PAINT_EVERYTHING); } /* Only executed if not in fast mode */ break; } /* End switch on explosion type */ return(false); } bool sc_expl_annihilate_continue(sc_config *c, sc_explosion *e) { /* sc_expl_annihilate_continue Continue to annihilate a section of the screen by drawing a huge explosion to it. This function returns "true" if it needs to be called again to continue. If it returns "false", then the explosion has been completely processed and you may call annihilate_clear. */ sc_expl_cache *ca; /* Explosion cache (standard explosions) */ sc_spill *sp; /* Spill information (liquid explosions) */ /* Sanity check */ if(c == NULL || e == NULL) return(false); /* Action depends on weapon type */ switch(e->type) { case SC_EXPLOSION_SPIDER: /* nothing special to animate spider explosions */ case SC_EXPLOSION_NORMAL: case SC_EXPLOSION_PLASMA: /* Get a new explosion cache ID, and draw it */ ca = e->cache; if(ca != NULL) { ca->eradius += SC_EXPL_EXPLOSION_STEP; if(ca->eradius >= e->radius) ca->eradius = e->radius; sc_expl_cache_draw(c->window, ca->cacheid, e->centerx, e->centery, ca->eradius); if(c->physics->walls == SC_WALL_WRAP) { if(e->centerx + e->radius >= c->fieldwidth) { sc_expl_cache_draw(c->window, ca->cacheid, e->centerx - c->fieldwidth, e->centery, ca->eradius); } else if(e->centerx - e->radius < 0) { sc_expl_cache_draw(c->window, ca->cacheid, e->centerx + c->fieldwidth, e->centery, ca->eradius); } /* Did the explosion wrap off-screen? */ } /* Were boundaries wrap-around? */ /* Done animating? */ if(ca->eradius >= e->radius) { free(ca); return(false); } /* We still need to animate */ return(true); } /* Only executed if not in fast mode */ return(false); case SC_EXPLOSION_NAPALM: /* Construct the napalm spill */ if(SC_CONFIG_NO_ANIM(c)) return(false); sp = (sc_spill *)e->data; if(sp != NULL) { if(sp->count > 0) { sc_window_draw_napalm_final(c->window, sp->spillx, sp->spilly, sp->size); ++sp->count; if(sp->count > SC_EXPL_NAPALM_FLAMES) return(false); } else if(sp->index < sp->size) { sc_window_draw_napalm_frame(c->window, sp->spillx + sp->index, sp->spilly + sp->index, min(sp->size - sp->index, SC_EXPL_LIQUID_STEP)); sp->index += SC_EXPL_LIQUID_STEP; } else { sp->count = 1; } /* Do we still have business to take care of? */ } /* Only attempt the draw if spill pointer valid */ return(true); case SC_EXPLOSION_LIQ_DIRT: /* Construct the liquid dirt spill */ if(SC_CONFIG_NO_ANIM(c)) return(false); sp = (sc_spill *)e->data; if(sp != NULL) { if(sp->index < sp->size) { sc_land_create_dirt(c, c->land, sp->spillx + sp->index, sp->spilly + sp->index, min(sp->size - sp->index, SC_EXPL_LIQUID_STEP)); sp->index += SC_EXPL_LIQUID_STEP; } else { return(false); } /* Do we still have business to take care of? */ } /* Only attempt the draw if spill pointer valid */ return(true); case SC_EXPLOSION_DIRT: case SC_EXPLOSION_RIOT: /* Continue to clear a circular explosion */ e->idraw += SC_EXPL_EXPLOSION_STEP; if(e->idraw >= e->radius) { sc_window_paint(c->window, e->centerx - e->radius, e->centery - e->radius, e->centerx + e->radius, e->centery + e->radius, SC_PAINT_EVERYTHING); return(false); } else { sc_window_paint_circular(c->window, e->centerx, e->centery, e->idraw, SC_PAINT_EVERYTHING); return(true); } break; } /* End switch on explosion type */ return(false); } bool sc_expl_annihilate_clear(sc_config *c, sc_explosion *e) { /* sc_expl_annihilate_clear Clears someone else's explosions. If this function returns "true", then you need to call annihilate_clear_continue to continue processing the clearing of the explosion; if it returns "false", then the explosion is completely done. */ sc_trajectory *tr; sc_spill *sp; /* Spill information (liquid explosions) */ /* Sanity check */ if(c == NULL || e == NULL) return(false); /* Action depends on weapon type */ switch(e->type) { case SC_EXPLOSION_SPIDER: /* if there is an arc to clear, clear it */ if(e->data != NULL) { sc_window_clear_arc(c->window, e->data); tr = (sc_trajectory *)e->data; sc_traj_landfall(c, tr); sc_traj_free(&tr); } /* fall through to explosion clearing */ case SC_EXPLOSION_NORMAL: case SC_EXPLOSION_PLASMA: /* Clear the circular explosion */ _sc_expl_annihilate_clear(c, e, e->radius); if(!SC_CONFIG_GFX_FAST(c)) { /* Only do slow animation if not in fast mode */ e->idraw = 0; return(true); } else { /* Just update everything at once */ sc_window_paint(c->window, e->centerx - e->radius, e->centery - e->radius, e->centerx + e->radius, e->centery + e->radius, SC_PAINT_EVERYTHING); } /* Only executed if not in fast mode */ break; case SC_EXPLOSION_NAPALM: /* Clean up the napalm spill */ sp = (sc_spill *)e->data; if(!SC_CONFIG_GFX_FAST(c)) { sc_window_clear_napalm(c->window, sp->spillx, sp->spilly, sp->size); } sc_spill_free((sc_spill **)&e->data); break; case SC_EXPLOSION_LIQ_DIRT: case SC_EXPLOSION_RIOT: case SC_EXPLOSION_DIRT: /* Nothing to do */ break; } /* End switch on explosion type */ return(false); } bool sc_expl_annihilate_clear_continue(sc_config *c, sc_explosion *e) { /* sc_expl_annihilate_clear_continue Continue to clear someone else's explosions. If this function returns "true", then you need to call annihilate_clear_continue to continue processing the clearing of the explosion; if it returns "false", then the explosion is completely done. */ /* Sanity check */ if(c == NULL || e == NULL) return(false); /* Action depends on weapon type */ switch(e->type) { case SC_EXPLOSION_SPIDER: case SC_EXPLOSION_NORMAL: case SC_EXPLOSION_PLASMA: /* Continue to clear the circular explosion */ e->idraw += SC_EXPL_EXPLOSION_STEP; if(e->idraw >= e->radius) { sc_window_paint(c->window, e->centerx - e->radius, e->centery - e->radius, e->centerx + e->radius, e->centery + e->radius, SC_PAINT_EVERYTHING); return(false); } else { sc_window_paint_circular(c->window, e->centerx, e->centery, e->idraw, SC_PAINT_EVERYTHING); return(true); } break; case SC_EXPLOSION_NAPALM: case SC_EXPLOSION_LIQ_DIRT: case SC_EXPLOSION_DIRT: case SC_EXPLOSION_RIOT: /* Nothing to do */ break; } /* End switch on explosion type */ return(false); } /*** Assessment of Damage Caused by an Explosion ***/ int sc_expl_damage_at_point(const sc_land *l, const sc_explosion *e, int x, int y) { /* sc_expl_damage_at_point Returns the amount of damage (in units comparable to life), done by the specified explosion to an object centered at (x, y). If no damage is done, zero is returned. */ sc_spill *sp; /* Spill data (for napalm damages) */ int distance; /* Distance between explosion center and (x,y) (squared) */ int damage; /* Actual amount of damage done */ int deltax; /* Change in X */ int deltay; /* Change in Y */ int i; /* Iterator */ /* Determine the damaging effect of the weapon */ damage = 0; switch(e->type) { case SC_EXPLOSION_SPIDER: case SC_EXPLOSION_NORMAL: case SC_EXPLOSION_PLASMA: /* Calculate distance */ sc_land_calculate_deltas(l, &deltax, &deltay, x, y, e->centerx, e->centery); distance = SQR(deltax) + SQR(deltay); /* Calculate the overall damage */ damage = rint(e->force * (1 - distance / (double)SQR(e->radius))); break; case SC_EXPLOSION_NAPALM: /* Integrate over all points... */ sp = (sc_spill *)e->data; for(i = 0; i < sp->size; ++i) { sc_land_calculate_deltas(l, &deltax, &deltay, sp->spillx[i], sp->spilly[i], x, y); distance = SQR(deltax) + SQR(deltay); distance = rint(e->force * (1 - distance / (double)SQR(e->radius))); if(distance < 0) distance = 0; damage += distance; } /* Iterate through all points in damage zone */ break; case SC_EXPLOSION_LIQ_DIRT: case SC_EXPLOSION_DIRT: case SC_EXPLOSION_RIOT: /* Dirt balls/riots do no damage to tanks */ break; } /* End switch to select radius */ if(damage < 0) damage = 0; return(damage); } xscorch-0.2.1/sgame/sexplosion.h0000644000175000001440000001011711175116133013547 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sexplosion.h,v 1.7 2009-04-26 17:39:39 jacob Exp $ */ /* xscorch - sexplosion.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched zone explosions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sexplosion_h_included #define __sexplosion_h_included #include /* Forward declarations */ struct _sc_config; struct _sc_land; /* Explosion type characteristics */ typedef enum _sc_explosion_type { SC_EXPLOSION_NORMAL, /* Normal red explosion */ SC_EXPLOSION_SPIDER, /* Funky bomb explosions */ SC_EXPLOSION_PLASMA, /* Plasma-class explosion */ SC_EXPLOSION_NAPALM, /* Napalm ONLY */ SC_EXPLOSION_LIQ_DIRT, /* Liquid dirt */ SC_EXPLOSION_DIRT, /* Flying Dirt clod */ SC_EXPLOSION_RIOT /* Riot bomb deton */ } sc_explosion_type; /* Explosion characteristics */ typedef struct _sc_explosion { int centerx; /* Center X coordinate */ int centery; /* Center Y coordinate */ int radius; /* Radius of explosion */ int force; /* Strength of explosion */ int playerid; /* Which player caused explosion? */ double direction; /* Center of wedge shaped blast (radians, 0 = right, M_PI/2 = up) */ double angular_width; /* Angular width of wedge shaped blast (radians). If 0, the normal circular explosions are used. */ sc_explosion_type type; /* Explosion type */ void *data; /* Associated state data */ int idraw; /* Reserved state data - explosion drawing */ struct _sc_expl_cache *cache; /* Cache for "growing" explosions */ struct _sc_explosion *chain; /* Chain to next explosion */ unsigned long counter; /* Used by state machine to animate */ } sc_explosion; /* Explosion constants */ #define SC_EXPL_NAPALM_FLAMES 16 /* Number of flame anims to draw */ #define SC_EXPL_LIQUID_STEP 32 /* Amt of napalm to draw per step */ #define SC_EXPL_EXPLOSION_STEP 24 /* Stepping on radius of explosion */ #define SC_EXPL_DEFAULT_DIR (M_PI / 2) /* Default direction of explosion */ #define SC_EXPL_DEBUG_WEDGES 0 /* Set to 1 to debug explosion wedges */ /* Explosion creation and freeing */ sc_explosion *sc_expl_new(int centerx, int centery, int radius, int force, int playerid, sc_explosion_type type); sc_explosion *sc_expl_new_with_angle(int centerx, int centery, int radius, int force, double direction, double angular_width, int playerid, sc_explosion_type type); sc_explosion *sc_expl_add(sc_explosion **e, sc_explosion *add); sc_explosion *sc_expl_index(sc_explosion *e, int index); int sc_expl_count(const sc_explosion *e); void sc_expl_free(sc_explosion **e); void sc_expl_free_chain(sc_explosion **e); /* Explosions and related damages */ bool sc_expl_annihilate(struct _sc_config *c, sc_explosion *e); bool sc_expl_annihilate_continue(struct _sc_config *c, sc_explosion *e); bool sc_expl_annihilate_clear(struct _sc_config *c, sc_explosion *e); bool sc_expl_annihilate_clear_continue(struct _sc_config *c, sc_explosion *e); int sc_expl_damage_at_point(const struct _sc_land *l, const sc_explosion *e, int x, int y); sc_explosion *sc_expl_spider(struct _sc_config *c, const sc_explosion *e); #endif /* __sexplosion_h_included */ xscorch-0.2.1/sgame/sgame.c0000644000175000001440000002575311175116133012447 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sgame.c,v 1.17 2009-04-26 17:39:39 jacob Exp $ */ /* xscorch - sgame.c Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched game state machine This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include /* Game state header */ #include /* Config is dereferenced frequently */ #include /* Need to do interest update */ #include /* Need to drop the land after deton */ #include /* Need to do Wind updates */ #include /* Dereferenced in death check, etc. */ #include /* Game state header */ #include /* Need for tracking, return codes */ #include /* We construct weapon chains here */ #include /* We do much drawing from state machine */ #include /* We are responsible for running AI */ #include /* Need a random number generator */ sc_game *sc_game_new(void) { sc_game *g; g = (sc_game *)malloc(sizeof(sc_game)); if(g == NULL) return(NULL); g->musicid = SC_MUSIC_PRELUDE; g->expl_init = NULL; g->expl_draw = NULL; g->expl_clear_init= NULL; g->expl_clear = NULL; g->expl_done = NULL; sc_game_init(g); return(g); } void sc_game_free(sc_game **g) { if(g == NULL || *g == NULL) return; sc_expl_free_chain(&(*g)->expl_init); sc_expl_free_chain(&(*g)->expl_draw); sc_expl_free_chain(&(*g)->expl_clear_init); sc_expl_free_chain(&(*g)->expl_clear); sc_expl_free_chain(&(*g)->expl_done); free(*g); *g = NULL; } inline void sc_game_time(struct timeval *gametime) { gettimeofday(gametime, NULL); } inline void sc_game_reinstate(sc_game *g, unsigned long delay) { #if SC_STATE_TIMER_DEBUG struct timeval curtime; #endif g->timeout.tv_usec += (delay % 1000) * 1000; while(g->timeout.tv_usec >= 1000000) { g->timeout.tv_usec -= 1000000; g->timeout.tv_sec++; } g->timeout.tv_sec += (delay / 1000); #if SC_STATE_TIMER_DEBUG sc_game_time(&curtime); printf("Next state %8x activates at %ld.%06ld (%+5ld; current %ld.%06ld)\n", g->state, g->timeout.tv_sec, g->timeout.tv_usec, delay, curtime.tv_sec, curtime.tv_usec); #endif } inline void sc_game_reinstate_now(sc_config *c, sc_game *g) { sc_game_time(&g->timeout); #if SC_STATE_TIMER_DEBUG printf("Next state %8x activates at %ld.%06ld (now)\n", g->state, g->timeout.tv_sec, g->timeout.tv_usec); #endif sc_state_run(c, g); } inline void sc_game_reinstate_asap(sc_game *g) { sc_game_time(&g->timeout); #if SC_STATE_TIMER_DEBUG printf("Next state %8x activates at %ld.%06ld (asap)\n", g->state, g->timeout.tv_sec, g->timeout.tv_usec); #endif } inline void sc_game_reinstate_allow_now(sc_config *c, sc_game *g, unsigned long delay) { if(delay <= 0) sc_game_reinstate_now(c, g); else sc_game_reinstate(g, delay); } inline void sc_game_set_state(sc_game *g, int state, unsigned long delay) { g->state = state; sc_game_reinstate(g, delay); } inline void sc_game_set_state_now(sc_config *c, sc_game *g, int state) { g->state = state; sc_game_reinstate_now(c, g); } inline void sc_game_set_state_asap(sc_game *g, int state) { /* sc_game_set_state_asap API calls which want to start the state machine up again on next timer should call this, rather than sc_game_set_state_now; otherwise the state machine may run for a long time (processing AI commands) before control returns to the original signal that advanced the state machine in GTK (and effectively blocked other GTK signals). This is subtle: if inventory interface calls now instead of asap, then we will end up returning to an inventory state errantly during player turns. */ g->state = state; sc_game_reinstate_asap(g); } inline void sc_game_set_state_allow_now(sc_config *c, sc_game *g, int state, unsigned long delay) { if(delay <= 0) sc_game_set_state_now(c, g, state); else sc_game_set_state(g, state, delay); } inline void sc_game_sync_timeout(sc_game *g) { sc_game_time(&g->timeout); } void sc_game_mass_kill(sc_config *c, sc_game *g) { int i; for(i = 0; i < c->numplayers; ++i) { /* Since we are about to deallocate everything anyway, we can just set the death flag directly here. */ c->players[i]->dead = true; } sc_game_set_state(g, SC_STATE_ROUND_END, 0); } void sc_game_init(sc_game *g) { g->substate = 0; g->curplayer = 0; sc_game_sync_timeout(g); sc_game_set_state(g, SC_STATE_PRELUDE_BEGIN, 0); sc_expl_free_chain(&g->expl_init); sc_expl_free_chain(&g->expl_draw); sc_expl_free_chain(&g->expl_clear_init); sc_expl_free_chain(&g->expl_clear); sc_expl_free_chain(&g->expl_done); } int sc_game_victor(sc_config *c) { int i; int j; i = c->numplayers - 1; j = 0; while(i >= 0) { if(SC_PLAYER_IS_ALIVE(c->players[i])) ++j; --i; } return(j <= 1); } void sc_game_set_victor(sc_config *c) { int i; i = c->numplayers - 1; while(i >= 0) { if(SC_PLAYER_IS_ALIVE(c->players[i])) sc_player_inc_wins(c, c->players[i]); --i; } } void sc_game_pause(sc_config *c, sc_game *g) { g->state = g->state | SC_STATE_PAUSE_FLAG; sc_status_suspend(c->window); } void sc_game_unpause(sc_config *c, sc_game *g) { g->state = g->state & ~SC_STATE_PAUSE_FLAG; sc_game_sync_timeout(g); sc_status_resume(c->window); } void sc_game_expl_queue_append(sc_explosion **queue, sc_explosion *e) { /* sc_game_expl_queue_append Appends explosion chain in e to queue given. */ sc_expl_add(queue, e); } void sc_game_expl_queue_head_move(sc_explosion **dst, sc_explosion **src) { /* sc_game_expl_queue_head_move Moves the HEAD of src only to the end of dst. */ sc_explosion *e; if(src == NULL || dst == NULL) return; if(*src == NULL) return; e = *src; *src = e->chain; e->chain = NULL; sc_game_expl_queue_append(dst, e); } void sc_game_expl_queue_head_move_prepend(sc_explosion **dst, sc_explosion **src) { /* sc_game_expl_queue_head_move_prepend Moves the HEAD of src only to the beginning of dst. */ sc_explosion *e; if(src == NULL || dst == NULL) return; if(*src == NULL) return; e = *src; *src = e->chain; e->chain = *dst; *dst = e; } void sc_game_expl_queue_move(sc_explosion **dst, sc_explosion **src) { /* sc_game_expl_queue_move Moves the entire queue in src to dst. */ if(src == NULL || dst == NULL) return; sc_game_expl_queue_append(dst, *src); *src = NULL; } void sc_game_expl_queue_reverse(sc_explosion **queue) { /* sc_game_expl_queue_reverse Reverses the items stored in this queue. */ sc_explosion *new = NULL; sc_explosion *cur = NULL; if(queue == NULL) return; while(*queue != NULL) { cur = *queue; *queue = cur->chain; cur->chain = new; new = cur; } *queue = new; } void sc_game_expl_queue_head_free(sc_explosion **queue) { /* sc_game_expl_queue_head_free Releases the top explosion on the queue... */ sc_expl_free(queue); } void sc_game_expl_queue_item_free(sc_explosion **queue, sc_explosion *e) { /* sc_game_expl_queue_item_free Removes the explosion e from within the queue given. */ if(queue == NULL || e == NULL) return; while(*queue != NULL) { if(*queue == e) { /* Remove this item */ sc_game_expl_queue_head_free(queue); return; } queue = &(*queue)->chain; } } void sc_game_expl_queue_item_move(sc_explosion **dst, sc_explosion **src, sc_explosion *e) { /* sc_game_expl_queue_item_move Moves the item indicated in src to the end of the queue in dst. */ if(src == NULL || dst == NULL || e == NULL) return; while(*src != NULL) { if(*src == e) { /* Remove this item */ *src = e->chain; e->chain = NULL; sc_game_expl_queue_head_move(dst, &e); return; } src = &(*src)->chain; } } void sc_game_expl_queue_item_move_prepend(sc_explosion **dst, sc_explosion **src, sc_explosion *e) { /* sc_game_expl_queue_item_move_prepend Moves the item indicated in src to the beginning of the queue in dst. */ if(src == NULL || dst == NULL || e == NULL) return; while(*src != NULL) { if(*src == e) { /* Remove this item */ *src = e->chain; e->chain = NULL; sc_game_expl_queue_head_move_prepend(dst, &e); return; } src = &(*src)->chain; } } bool sc_game_expl_queue_do_runnable(sc_config *c, sc_game *g, sc_explosion *queue, sc_game_run_fn action) { /* sc_game_expl_queue_do_runnable For each item in the queue whose timestamp is at most the current game time, invoke the procedure given exactly once. Action may remove e from the queue but must not take any action that would be destructive to the rest of the queue. */ sc_explosion *cur; bool acted = false; if(c == NULL || g == NULL || action == NULL) return(false); while(queue != NULL) { cur = queue; queue = cur->chain; if(cur->counter == 0) { /* Run this explosion through the action method */ acted = action(c, g, cur) | acted; } } return(acted); } bool sc_game_expl_queue_run_first(sc_config *c, sc_game *g, sc_explosion *queue, sc_game_run_fn action) { /* sc_game_expl_queue_run_first Find the first item in the queue whose timestamp is at most the current game time, invoking the procedure given exactly once on that item. Action may remove e from the queue but must not take any action that would be destructive to the rest of the queue. */ sc_explosion *cur; if(c == NULL || g == NULL || action == NULL) return(false); while(queue != NULL) { cur = queue; queue = cur->chain; if(cur->counter == 0) { /* Run this explosion through the action method */ return(action(c, g, cur)); } } return(false); } void sc_game_expl_queue_postpone(sc_explosion *e, unsigned long delay) { /* sc_game_expl_queue_postpone */ e->counter = delay; } void sc_game_expl_queue_update(sc_explosion *e) { /* sc_game_expl_queue_update */ while(e != NULL) { if(e->counter > 0) --e->counter; e = e->chain; } } xscorch-0.2.1/sgame/sgame.h0000644000175000001440000001047211175116133012444 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sgame.h,v 1.9 2009-04-26 17:39:39 jacob Exp $ */ /* xscorch - sgame.h Copyright(c) 2001,2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched game state header This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sgame_h_included #define __sgame_h_included #include #include /* Forward structures */ struct _sc_explosion; struct _sc_config; typedef struct _sc_game { int curplayer; /* Current player */ /* Current audio tracks */ sc_sound_music musicid; /* Musical Ident */ /* State machine parametres */ struct timeval timeout; /* Time until next state is run */ int state; /* Next state to execute */ /* State flags */ int substate; /* Substate flag (e.g. player number) */ bool activity; /* In interleave: was there activity this round? */ struct _sc_explosion *expl_init; /* Queue holding explosions waiting to start */ struct _sc_explosion *expl_draw; /* Queue holding explosions currently drawing */ struct _sc_explosion *expl_clear_init; /* .. holding explosions waitint to clear */ struct _sc_explosion *expl_clear; /* Queue holding explosions currently clearing */ struct _sc_explosion *expl_done; /* Queue holding explosions that are done */ } sc_game; typedef bool (*sc_game_run_fn)(struct _sc_config *c, sc_game *g, struct _sc_explosion *e); /* General game state and state machine functions */ sc_game *sc_game_new(void); void sc_game_free(sc_game **g); void sc_game_init(sc_game *g); void sc_game_time(struct timeval *gametime); void sc_game_mass_kill(struct _sc_config *c, sc_game *g); void sc_game_set_state(sc_game *g, int state, unsigned long delay); void sc_game_set_state_now(struct _sc_config *c, sc_game *g, int state); void sc_game_set_state_asap(sc_game *g, int state); void sc_game_set_state_allow_now(struct _sc_config *c, sc_game *g, int state, unsigned long delay); void sc_game_reinstate(sc_game *g, unsigned long delay); void sc_game_reinstate_now(struct _sc_config *c, sc_game *g); void sc_game_reinstate_allow_now(struct _sc_config *c, sc_game *g, unsigned long delay); void sc_game_sync_timeout(sc_game *g); void sc_game_pause(struct _sc_config *c, sc_game *g); void sc_game_unpause(struct _sc_config *c, sc_game *g); int sc_game_victor(struct _sc_config *c); void sc_game_set_victor(struct _sc_config *c); /* Explosion queues */ void sc_game_expl_queue_append(struct _sc_explosion **queue, struct _sc_explosion *e); void sc_game_expl_queue_head_move(struct _sc_explosion **dst, struct _sc_explosion **src); void sc_game_expl_queue_head_move_prepend(struct _sc_explosion **dst, struct _sc_explosion **src); void sc_game_expl_queue_move(struct _sc_explosion **dst, struct _sc_explosion **src); void sc_game_expl_queue_reverse(struct _sc_explosion **queue); void sc_game_expl_queue_head_free(struct _sc_explosion **queue); void sc_game_expl_queue_item_free(struct _sc_explosion **queue, struct _sc_explosion *e); void sc_game_expl_queue_item_move(struct _sc_explosion **dst, struct _sc_explosion **src, struct _sc_explosion *e); void sc_game_expl_queue_item_move_prepend(struct _sc_explosion **dst, struct _sc_explosion **src, struct _sc_explosion *e); bool sc_game_expl_queue_do_runnable(struct _sc_config *c, struct _sc_game *g, struct _sc_explosion *queue, sc_game_run_fn f); bool sc_game_expl_queue_run_first(struct _sc_config *c, struct _sc_game *g, struct _sc_explosion *queue, sc_game_run_fn f); void sc_game_expl_queue_postpone(struct _sc_explosion *e, unsigned long delay); void sc_game_expl_queue_update(struct _sc_explosion *e); #endif /* __sgame_h_included? */ xscorch-0.2.1/sgame/shelp.c0000644000175000001440000000605011175116134012454 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/shelp.c,v 1.12 2009-04-26 17:39:40 jacob Exp $ */ /* xscorch - shelp.c Copyright(c) 2001-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched simple help system This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include static void _unmunge_line(char *buf) { char *d = buf; char *s = buf; while(*s != '\0') { if(strequaln(s, "\\-", 2)) { *d = '-'; ++d; ++s; } else if(strequaln(s, "\\f", 2)) { s += 2; } else { *d = *s; ++d; } ++s; } *d = '\0'; } static void _trim_line(char *buf) { bool countedspace = true; char *d = buf; char *s = buf; while(*s != '\0') { if(*s == ' ' || *s == '\t' || *s == '\n') { if(!countedspace) { countedspace = true; *d = ' '; ++d; } } else { countedspace = false; *d = *s; ++d; } ++s; } if(countedspace && d > buf) --d; *d = '\0'; } void sc_help_text(char *res, int size, const char *idphrase) { /* sc_help_text */ char buf[0x1000]; char key[0x1000]; int keysize; bool match; bool done; int offset = 0; /* Sanity checks */ if(res == NULL || size <= 0 || idphrase == NULL) return; /* Prep and size the ID string */ sbprintf(key, sizeof(key), "\\fB%s\\fP", idphrase); keysize = strblenn(key, sizeof(key)); /* Scan help file for the requested text */ match = false; while(!match && sgetline(buf, sizeof(buf), data_xscorch_man, &offset) != NULL) { match = strequaln(buf, key, keysize); } /* Make sure we found something */ if(!match) { sbprintf(res, size, "Cannot find help text for %s.", idphrase); return; } /* Start writing data to the result buffer until we reach a blank line */ done = false; strcopyb(res, idphrase, size); strconcatb(res, ": ", size); while(!done && sgetline(buf, sizeof(buf), data_xscorch_man, &offset) != NULL) { if(*buf == '.' && !strequaln(buf, ".\\\"", 3)) done = true; else { /* Copy this line (unmunged) into the help buffer */ strconcatb(res, buf, size); } } /* We are done! */ _unmunge_line(res); _trim_line(res); } xscorch-0.2.1/sgame/shelp.h0000644000175000001440000000210511175116134012456 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/shelp.h,v 1.3 2009-04-26 17:39:40 jacob Exp $ */ /* xscorch - shelp.h Copyright(c) 2001 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched simple help system This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __shelp_h_included #define __shelp_h_included #include void sc_help_text(char *res, int size, const char *idphrase); #endif /* __shelp_h_included */ xscorch-0.2.1/sgame/shelpdata.c0000644000175000001440000147161611615372006013326 00000000000000#include const char data_xscorch_txt[] = { 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x28, 0x36, 0x29, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x28, 0x36, 0x29, 0x0a, 0x0a, 0x0a, 0x0a, 0x4e, 0x08, 0x4e, 0x41, 0x08, 0x41, 0x4d, 0x08, 0x4d, 0x45, 0x08, 0x45, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x2d, 0x20, 0x41, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x20, 0x67, 0x75, 0x6e, 0x73, 0x2e, 0x0a, 0x0a, 0x53, 0x08, 0x53, 0x59, 0x08, 0x59, 0x4e, 0x08, 0x4e, 0x4f, 0x08, 0x4f, 0x50, 0x08, 0x50, 0x53, 0x08, 0x53, 0x49, 0x08, 0x49, 0x53, 0x08, 0x53, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x08, 0x78, 0x73, 0x08, 0x73, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x63, 0x08, 0x63, 0x68, 0x08, 0x68, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x08, 0x78, 0x73, 0x08, 0x73, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x63, 0x08, 0x63, 0x68, 0x08, 0x68, 0x20, 0x5f, 0x08, 0x5b, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x5d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x08, 0x78, 0x73, 0x08, 0x73, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x63, 0x08, 0x63, 0x68, 0x08, 0x68, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x68, 0x08, 0x68, 0x65, 0x08, 0x65, 0x6c, 0x08, 0x6c, 0x70, 0x08, 0x70, 0x0a, 0x0a, 0x44, 0x08, 0x44, 0x45, 0x08, 0x45, 0x53, 0x08, 0x53, 0x43, 0x08, 0x43, 0x52, 0x08, 0x52, 0x49, 0x08, 0x49, 0x50, 0x08, 0x50, 0x54, 0x08, 0x54, 0x49, 0x08, 0x49, 0x4f, 0x08, 0x4f, 0x4e, 0x08, 0x4e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x58, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x63, 0x20, 0x44, 0x4f, 0x53, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x22, 0x53, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x64, 0x20, 0x45, 0x61, 0x72, 0x74, 0x68, 0x22, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x62, 0x61, 0x73, 0x69, 0x63, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x6f, 0x61, 0x6c, 0x20, 0x69, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x20, 0x67, 0x75, 0x6e, 0x73, 0x20, 0x3a, 0x29, 0x2e, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x20, 0x62, 0x75, 0x79, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x20, 0x62, 0x79, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x75, 0x72, 0x72, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x2e, 0x0a, 0x0a, 0x47, 0x08, 0x47, 0x41, 0x08, 0x41, 0x4d, 0x08, 0x4d, 0x45, 0x08, 0x45, 0x50, 0x08, 0x50, 0x4c, 0x08, 0x4c, 0x41, 0x08, 0x41, 0x59, 0x08, 0x59, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x69, 0x72, 0x73, 0x74, 0x2c, 0x20, 0x66, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x65, 0x61, 0x73, 0x69, 0x65, 0x72, 0x20, 0x20, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6c, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x20, 0x61, 0x72, 0x65, 0x20, 0x20, 0x61, 0x20, 0x20, 0x66, 0x65, 0x77, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x20, 0x20, 0x4f, 0x6e, 0x63, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x76, 0x5f, 0x08, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x4f, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x73, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x73, 0x61, 0x76, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x5f, 0x08, 0x42, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x67, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6e, 0x20, 0x5f, 0x08, 0x47, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x75, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x77, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x72, 0x74, 0x73, 0x3a, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x5f, 0x08, 0x49, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x76, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x79, 0x20, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x42, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x65, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x75, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x68, 0x6f, 0x6f, 0x74, 0x20, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x2e, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x75, 0x79, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x20, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x20, 0x73, 0x65, 0x74, 0x75, 0x70, 0x20, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2c, 0x20, 0x20, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x20, 0x61, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x69, 0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x49, 0x08, 0x49, 0x4e, 0x08, 0x4e, 0x56, 0x08, 0x56, 0x45, 0x08, 0x45, 0x4e, 0x08, 0x4e, 0x54, 0x08, 0x54, 0x4f, 0x08, 0x4f, 0x52, 0x08, 0x52, 0x59, 0x08, 0x59, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x20, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x61, 0x74, 0x3a, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x69, 0x73, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x69, 0x6c, 0x65, 0x73, 0x2c, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x49, 0x43, 0x42, 0x4d, 0x2d, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x77, 0x61, 0x72, 0x68, 0x65, 0x61, 0x64, 0x73, 0x2c, 0x20, 0x6e, 0x61, 0x70, 0x61, 0x6c, 0x6d, 0x2c, 0x20, 0x6c, 0x61, 0x73, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x61, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x65, 0x61, 0x73, 0x69, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x2c, 0x20, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x20, 0x67, 0x75, 0x69, 0x64, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2c, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x66, 0x75, 0x65, 0x6c, 0x2c, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x64, 0x64, 0x73, 0x2d, 0x61, 0x6e, 0x64, 0x2d, 0x65, 0x6e, 0x64, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x72, 0x20, 0x20, 0x73, 0x65, 0x6c, 0x6c, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x75, 0x70, 0x20, 0x74, 0x6f, 0x20, 0x39, 0x39, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x66, 0x65, 0x77, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x20, 0x69, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x20, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x42, 0x61, 0x62, 0x79, 0x20, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6c, 0x65, 0x73, 0x29, 0x20, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x69, 0x63, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x75, 0x79, 0x20, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x20, 0x61, 0x73, 0x20, 0x20, 0x61, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x68, 0x6f, 0x6c, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x20, 0x62, 0x61, 0x73, 0x69, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x75, 0x70, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x20, 0x61, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x27, 0x73, 0x20, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x67, 0x61, 0x69, 0x6e, 0x2c, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6c, 0x65, 0x20, 0x2d, 0x20, 0x68, 0x65, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x6d, 0x61, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x3a, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2c, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x54, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x62, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x20, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x20, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x20, 0x70, 0x61, 0x6e, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x55, 0x5f, 0x08, 0x70, 0x20, 0x5f, 0x08, 0x41, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x77, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5f, 0x08, 0x44, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x77, 0x5f, 0x08, 0x6e, 0x20, 0x5f, 0x08, 0x41, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x77, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2c, 0x20, 0x5f, 0x08, 0x52, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x67, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x74, 0x20, 0x5f, 0x08, 0x41, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x77, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x75, 0x79, 0x20, 0x20, 0x61, 0x20, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x2c, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x4c, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x74, 0x20, 0x5f, 0x08, 0x41, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x77, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x65, 0x6c, 0x6c, 0x20, 0x61, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x65, 0x2c, 0x20, 0x5f, 0x08, 0x62, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x65, 0x20, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x7a, 0x5f, 0x08, 0x65, 0x2f, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6c, 0x20, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x74, 0x20, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x76, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x62, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x64, 0x61, 0x72, 0x6b, 0x65, 0x6e, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x20, 0x68, 0x61, 0x73, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x66, 0x66, 0x6f, 0x72, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x72, 0x20, 0x20, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x73, 0x20, 0x20, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x76, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6c, 0x20, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x0a, 0x57, 0x08, 0x57, 0x45, 0x08, 0x45, 0x41, 0x08, 0x41, 0x50, 0x08, 0x50, 0x4f, 0x08, 0x4f, 0x4e, 0x08, 0x4e, 0x53, 0x08, 0x53, 0x20, 0x4c, 0x08, 0x4c, 0x49, 0x08, 0x49, 0x53, 0x08, 0x53, 0x54, 0x08, 0x54, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x79, 0x20, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x0a, 0x41, 0x08, 0x41, 0x43, 0x08, 0x43, 0x43, 0x08, 0x43, 0x45, 0x08, 0x45, 0x53, 0x08, 0x53, 0x53, 0x08, 0x53, 0x4f, 0x08, 0x4f, 0x52, 0x08, 0x52, 0x49, 0x08, 0x49, 0x45, 0x08, 0x45, 0x53, 0x08, 0x53, 0x20, 0x4c, 0x08, 0x4c, 0x49, 0x08, 0x49, 0x53, 0x08, 0x53, 0x54, 0x08, 0x54, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x79, 0x20, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x0a, 0x42, 0x08, 0x42, 0x41, 0x08, 0x41, 0x54, 0x08, 0x54, 0x54, 0x08, 0x54, 0x4c, 0x08, 0x4c, 0x45, 0x08, 0x45, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x20, 0x69, 0x73, 0x20, 0x73, 0x61, 0x64, 0x6c, 0x79, 0x2c, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x2e, 0x0a, 0x0a, 0x54, 0x08, 0x54, 0x41, 0x08, 0x41, 0x4e, 0x08, 0x4e, 0x4b, 0x08, 0x4b, 0x20, 0x43, 0x08, 0x43, 0x4f, 0x08, 0x4f, 0x4e, 0x08, 0x4e, 0x54, 0x08, 0x54, 0x52, 0x08, 0x52, 0x4f, 0x08, 0x4f, 0x4c, 0x08, 0x4c, 0x53, 0x08, 0x53, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x4c, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x74, 0x2c, 0x20, 0x5f, 0x08, 0x52, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x67, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x74, 0x75, 0x72, 0x72, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x75, 0x72, 0x72, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x35, 0x20, 0x64, 0x65, 0x67, 0x72, 0x65, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x20, 0x66, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x20, 0x20, 0x68, 0x6f, 0x6c, 0x64, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x74, 0x20, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x31, 0x20, 0x64, 0x65, 0x67, 0x72, 0x65, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x55, 0x5f, 0x08, 0x70, 0x2c, 0x20, 0x5f, 0x08, 0x44, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x77, 0x5f, 0x08, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x31, 0x30, 0x30, 0x30, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x32, 0x30, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x66, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x6f, 0x6c, 0x64, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x31, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x54, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x62, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x2b, 0x5f, 0x08, 0x54, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x62, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x42, 0x2c, 0x20, 0x5f, 0x08, 0x62, 0x20, 0x20, 0x20, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x20, 0x61, 0x20, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x35, 0x25, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x6e, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x20, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x20, 0x62, 0x79, 0x20, 0x20, 0x35, 0x25, 0x20, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x63, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x45, 0x2c, 0x20, 0x5f, 0x08, 0x65, 0x20, 0x20, 0x20, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x69, 0x7a, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x46, 0x2c, 0x20, 0x5f, 0x08, 0x66, 0x20, 0x20, 0x20, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x66, 0x75, 0x65, 0x6c, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2c, 0x20, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x75, 0x65, 0x6c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x41, 0x73, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x65, 0x6c, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x4c, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5f, 0x08, 0x52, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x67, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x74, 0x20, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x20, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20, 0x20, 0x6f, 0x72, 0x20, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x6f, 0x76, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x20, 0x75, 0x70, 0x20, 0x61, 0x20, 0x73, 0x74, 0x65, 0x65, 0x70, 0x20, 0x68, 0x69, 0x6c, 0x6c, 0x2e, 0x20, 0x20, 0x49, 0x6d, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x20, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x78, 0x63, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x52, 0x2c, 0x20, 0x5f, 0x08, 0x72, 0x20, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x20, 0x61, 0x20, 0x72, 0x65, 0x64, 0x72, 0x61, 0x77, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x2c, 0x20, 0x5f, 0x08, 0x73, 0x20, 0x20, 0x20, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x20, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x69, 0x7a, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x3a, 0x20, 0x20, 0x5f, 0x08, 0x4d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x67, 0x6e, 0x65, 0x74, 0x69, 0x63, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x5f, 0x08, 0x46, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x2c, 0x20, 0x72, 0x75, 0x6e, 0x2d, 0x6f, 0x66, 0x2d, 0x74, 0x68, 0x65, 0x2d, 0x6d, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x30, 0x5f, 0x08, 0x53, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x54, 0x2c, 0x20, 0x5f, 0x08, 0x74, 0x20, 0x20, 0x20, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x6e, 0x2f, 0x6f, 0x66, 0x66, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x66, 0x75, 0x6c, 0x20, 0x69, 0x66, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x20, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x76, 0x5f, 0x08, 0x65, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x66, 0x69, 0x72, 0x65, 0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x65, 0x71, 0x75, 0x69, 0x70, 0x70, 0x65, 0x64, 0x20, 0x28, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x30, 0x20, 0x2d, 0x20, 0x5f, 0x08, 0x39, 0x20, 0x20, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x5f, 0x08, 0x31, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x31, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5f, 0x08, 0x30, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x45, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x20, 0x20, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x43, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x2b, 0x5f, 0x08, 0x59, 0x20, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x70, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x4d, 0x65, 0x6e, 0x75, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x20, 0x62, 0x65, 0x20, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x73, 0x29, 0x2e, 0x20, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x63, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x79, 0x73, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x6d, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x2c, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x65, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x74, 0x75, 0x72, 0x65, 0x6c, 0x79, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x43, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x2b, 0x5f, 0x08, 0x5a, 0x20, 0x50, 0x61, 0x75, 0x73, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x43, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x2b, 0x5f, 0x08, 0x52, 0x20, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x53, 0x08, 0x53, 0x59, 0x08, 0x59, 0x53, 0x08, 0x53, 0x54, 0x08, 0x54, 0x45, 0x08, 0x45, 0x4d, 0x08, 0x4d, 0x20, 0x4d, 0x08, 0x4d, 0x45, 0x08, 0x45, 0x4e, 0x08, 0x4e, 0x55, 0x08, 0x55, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x20, 0x69, 0x74, 0x20, 0x20, 0x69, 0x73, 0x20, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x20, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x47, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x73, 0x20, 0x5f, 0x08, 0x46, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x74, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x29, 0x2e, 0x20, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x66, 0x65, 0x77, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x08, 0x4d, 0x61, 0x08, 0x61, 0x73, 0x08, 0x73, 0x73, 0x08, 0x73, 0x20, 0x4b, 0x08, 0x4b, 0x69, 0x08, 0x69, 0x6c, 0x08, 0x6c, 0x6c, 0x08, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x69, 0x6c, 0x6c, 0x73, 0x20, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x67, 0x65, 0x74, 0x73, 0x20, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, 0x65, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x69, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x62, 0x65, 0x65, 0x6e, 0x20, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x6f, 0x20, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x20, 0x20, 0x77, 0x68, 0x61, 0x74, 0x73, 0x6f, 0x65, 0x76, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x20, 0x20, 0x61, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x08, 0x45, 0x72, 0x08, 0x72, 0x61, 0x08, 0x61, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x20, 0x53, 0x08, 0x53, 0x6d, 0x08, 0x6d, 0x6f, 0x08, 0x6f, 0x6b, 0x08, 0x6b, 0x65, 0x08, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x5f, 0x08, 0x54, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x65, 0x20, 0x5f, 0x08, 0x50, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6b, 0x79, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x08, 0x52, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x2f, 0x41, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x08, 0x52, 0x65, 0x08, 0x65, 0x73, 0x08, 0x73, 0x69, 0x08, 0x69, 0x67, 0x08, 0x67, 0x6e, 0x08, 0x6e, 0x20, 0x47, 0x08, 0x47, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x20, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x6f, 0x08, 0x6f, 0x75, 0x08, 0x75, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x53, 0x08, 0x53, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x75, 0x08, 0x75, 0x70, 0x08, 0x70, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x61, 0x6b, 0x65, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x20, 0x5f, 0x08, 0x4f, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x73, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x0a, 0x0a, 0x41, 0x08, 0x41, 0x49, 0x08, 0x49, 0x20, 0x50, 0x08, 0x50, 0x4c, 0x08, 0x4c, 0x41, 0x08, 0x41, 0x59, 0x08, 0x59, 0x45, 0x08, 0x45, 0x52, 0x08, 0x52, 0x53, 0x08, 0x53, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x48, 0x08, 0x48, 0x75, 0x08, 0x75, 0x6d, 0x08, 0x6d, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x20, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x65, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x75, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x6d, 0x69, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x72, 0x61, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x61, 0x67, 0x72, 0x65, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x20, 0x20, 0x4b, 0x65, 0x65, 0x70, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x6d, 0x69, 0x6e, 0x64, 0x20, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x77, 0x68, 0x79, 0x20, 0x20, 0x39, 0x20, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x74, 0x61, 0x6e, 0x65, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x2e, 0x2e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x08, 0x4d, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x6f, 0x08, 0x6f, 0x6e, 0x08, 0x6e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x66, 0x69, 0x72, 0x65, 0x73, 0x20, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2e, 0x20, 0x20, 0x4f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x68, 0x61, 0x73, 0x20, 0x20, 0x62, 0x79, 0x20, 0x20, 0x66, 0x61, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x20, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, 0x65, 0x20, 0x20, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x20, 0x20, 0x41, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x60, 0x60, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x20, 0x46, 0x6f, 0x64, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x72, 0x27, 0x27, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x68, 0x08, 0x68, 0x6f, 0x08, 0x6f, 0x6f, 0x08, 0x6f, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x67, 0x6f, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x69, 0x74, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x6f, 0x66, 0x2d, 0x73, 0x69, 0x67, 0x68, 0x74, 0x20, 0x74, 0x6f, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x27, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x72, 0x65, 0x61, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x62, 0x75, 0x79, 0x73, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x73, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x63, 0x6f, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x69, 0x74, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x70, 0x08, 0x70, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x61, 0x08, 0x61, 0x64, 0x08, 0x64, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x41, 0x49, 0x20, 0x20, 0x69, 0x73, 0x20, 0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x53, 0x68, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x61, 0x20, 0x53, 0x70, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x20, 0x62, 0x75, 0x79, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x69, 0x63, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x08, 0x43, 0x68, 0x08, 0x68, 0x6f, 0x08, 0x6f, 0x6f, 0x08, 0x6f, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x73, 0x20, 0x61, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x2e, 0x20, 0x20, 0x4f, 0x6e, 0x63, 0x65, 0x20, 0x63, 0x68, 0x6f, 0x73, 0x65, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x20, 0x20, 0x69, 0x73, 0x20, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x20, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x61, 0x64, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x72, 0x20, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x61, 0x63, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x6f, 0x66, 0x2d, 0x73, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x74, 0x75, 0x6e, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x08, 0x43, 0x61, 0x08, 0x61, 0x6c, 0x08, 0x6c, 0x63, 0x08, 0x63, 0x75, 0x08, 0x75, 0x6c, 0x08, 0x6c, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x41, 0x49, 0x20, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x72, 0x2c, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x61, 0x20, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x67, 0x75, 0x79, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x66, 0x61, 0x69, 0x72, 0x6c, 0x79, 0x20, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x20, 0x66, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x20, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x6e, 0x08, 0x6e, 0x6e, 0x08, 0x6e, 0x69, 0x08, 0x69, 0x68, 0x08, 0x68, 0x69, 0x08, 0x69, 0x6c, 0x08, 0x6c, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x41, 0x49, 0x20, 0x67, 0x6f, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x70, 0x6f, 0x73, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x20, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x73, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x41, 0x49, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, 0x20, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x65, 0x64, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x20, 0x66, 0x65, 0x77, 0x20, 0x41, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x74, 0x65, 0x72, 0x72, 0x61, 0x69, 0x6e, 0x20, 0x20, 0x65, 0x61, 0x73, 0x69, 0x6c, 0x79, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x20, 0x41, 0x49, 0x27, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x20, 0x77, 0x6f, 0x72, 0x72, 0x79, 0x20, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x20, 0x20, 0x74, 0x6f, 0x6f, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x2e, 0x20, 0x20, 0x57, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x64, 0x65, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x76, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x77, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x65, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x79, 0x77, 0x61, 0x79, 0x20, 0x2d, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6e, 0x79, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x08, 0x49, 0x6e, 0x08, 0x6e, 0x73, 0x08, 0x73, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x69, 0x08, 0x69, 0x74, 0x08, 0x74, 0x79, 0x08, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x6f, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x73, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x73, 0x2e, 0x2e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x55, 0x08, 0x55, 0x6e, 0x08, 0x6e, 0x6b, 0x08, 0x6b, 0x6e, 0x08, 0x6e, 0x6f, 0x08, 0x6f, 0x77, 0x08, 0x77, 0x6e, 0x08, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x73, 0x20, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x64, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x41, 0x49, 0x20, 0x77, 0x61, 0x73, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x43, 0x08, 0x43, 0x4f, 0x08, 0x4f, 0x4e, 0x08, 0x4e, 0x46, 0x08, 0x46, 0x49, 0x08, 0x49, 0x47, 0x08, 0x47, 0x55, 0x08, 0x55, 0x52, 0x08, 0x52, 0x41, 0x08, 0x41, 0x54, 0x08, 0x54, 0x49, 0x08, 0x49, 0x4f, 0x08, 0x4f, 0x4e, 0x08, 0x4e, 0x20, 0x4f, 0x08, 0x4f, 0x50, 0x08, 0x50, 0x54, 0x08, 0x54, 0x49, 0x08, 0x49, 0x4f, 0x08, 0x4f, 0x4e, 0x08, 0x4e, 0x53, 0x08, 0x53, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x50, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x79, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x2f, 0x5f, 0x08, 0x52, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x08, 0x4e, 0x75, 0x08, 0x75, 0x6d, 0x08, 0x6d, 0x62, 0x08, 0x62, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x20, 0x6f, 0x08, 0x6f, 0x66, 0x08, 0x66, 0x20, 0x50, 0x08, 0x50, 0x6c, 0x08, 0x6c, 0x61, 0x08, 0x61, 0x79, 0x08, 0x79, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x73, 0x08, 0x73, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x32, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x08, 0x4e, 0x75, 0x08, 0x75, 0x6d, 0x08, 0x6d, 0x62, 0x08, 0x62, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x20, 0x6f, 0x08, 0x6f, 0x66, 0x08, 0x66, 0x20, 0x52, 0x08, 0x52, 0x6f, 0x08, 0x6f, 0x75, 0x08, 0x75, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x73, 0x08, 0x73, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x3e, 0x3d, 0x20, 0x31, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x49, 0x08, 0x49, 0x20, 0x54, 0x08, 0x54, 0x79, 0x08, 0x79, 0x70, 0x08, 0x70, 0x65, 0x08, 0x65, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x20, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x60, 0x60, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x27, 0x27, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x08, 0x50, 0x6c, 0x08, 0x6c, 0x61, 0x08, 0x61, 0x79, 0x08, 0x79, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x20, 0x4e, 0x08, 0x4e, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x20, 0x28, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x69, 0x76, 0x65, 0x20, 0x61, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x6b, 0x08, 0x6b, 0x20, 0x53, 0x08, 0x53, 0x74, 0x08, 0x74, 0x79, 0x08, 0x79, 0x6c, 0x08, 0x6c, 0x65, 0x08, 0x65, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x45, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x08, 0x49, 0x6e, 0x08, 0x6e, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x73, 0x08, 0x73, 0x74, 0x08, 0x74, 0x20, 0x52, 0x08, 0x52, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x2d, 0x30, 0x2e, 0x33, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x20, 0x72, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x70, 0x65, 0x72, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x08, 0x44, 0x79, 0x08, 0x79, 0x6e, 0x08, 0x6e, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x69, 0x08, 0x69, 0x63, 0x08, 0x63, 0x20, 0x49, 0x08, 0x49, 0x6e, 0x08, 0x6e, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x73, 0x08, 0x73, 0x74, 0x08, 0x74, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x20, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x08, 0x49, 0x6e, 0x08, 0x6e, 0x69, 0x08, 0x69, 0x74, 0x08, 0x74, 0x69, 0x08, 0x69, 0x61, 0x08, 0x61, 0x6c, 0x08, 0x6c, 0x20, 0x43, 0x08, 0x43, 0x61, 0x08, 0x61, 0x73, 0x08, 0x73, 0x68, 0x08, 0x68, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x30, 0x2d, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x49, 0x08, 0x49, 0x73, 0x08, 0x73, 0x20, 0x43, 0x08, 0x43, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x20, 0x42, 0x08, 0x42, 0x75, 0x08, 0x75, 0x79, 0x08, 0x79, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x49, 0x08, 0x49, 0x73, 0x08, 0x73, 0x20, 0x42, 0x08, 0x42, 0x75, 0x08, 0x75, 0x79, 0x08, 0x79, 0x20, 0x41, 0x08, 0x41, 0x67, 0x08, 0x67, 0x67, 0x08, 0x67, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x73, 0x08, 0x73, 0x73, 0x08, 0x73, 0x69, 0x08, 0x69, 0x76, 0x08, 0x76, 0x65, 0x08, 0x65, 0x6c, 0x08, 0x6c, 0x79, 0x08, 0x79, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x75, 0x79, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x2e, 0x20, 0x20, 0x20, 0x57, 0x69, 0x74, 0x68, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x75, 0x79, 0x20, 0x62, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x08, 0x46, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x65, 0x08, 0x65, 0x20, 0x4d, 0x08, 0x4d, 0x61, 0x08, 0x61, 0x72, 0x08, 0x72, 0x6b, 0x08, 0x6b, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x2f, 0x41, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x67, 0x08, 0x67, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x20, 0x73, 0x63, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2c, 0x20, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x2c, 0x20, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x72, 0x65, 0x65, 0x64, 0x79, 0x2c, 0x20, 0x20, 0x6f, 0x72, 0x20, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x42, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x63, 0x20, 0x20, 0x20, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x64, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x75, 0x74, 0x20, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x47, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x79, 0x20, 0x20, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x61, 0x69, 0x64, 0x20, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x73, 0x63, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6e, 0x75, 0x73, 0x65, 0x73, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x20, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x20, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x68, 0x08, 0x68, 0x65, 0x08, 0x65, 0x20, 0x4c, 0x08, 0x4c, 0x6f, 0x08, 0x6f, 0x74, 0x08, 0x74, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x79, 0x08, 0x79, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x20, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x61, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x61, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x69, 0x73, 0x20, 0x20, 0x61, 0x20, 0x20, 0x67, 0x72, 0x65, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x61, 0x79, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x41, 0x49, 0x73, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x75, 0x73, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x62, 0x75, 0x79, 0x65, 0x72, 0x73, 0x2e, 0x20, 0x20, 0x50, 0x6c, 0x75, 0x73, 0x20, 0x69, 0x74, 0x27, 0x73, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x67, 0x72, 0x65, 0x61, 0x74, 0x20, 0x66, 0x75, 0x6e, 0x20, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x20, 0x67, 0x65, 0x74, 0x20, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x41, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x2e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x50, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x79, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x69, 0x08, 0x69, 0x72, 0x08, 0x72, 0x20, 0x56, 0x08, 0x56, 0x69, 0x08, 0x69, 0x73, 0x08, 0x73, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x73, 0x08, 0x73, 0x69, 0x08, 0x69, 0x74, 0x08, 0x74, 0x79, 0x08, 0x79, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x2f, 0x41, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x08, 0x47, 0x72, 0x08, 0x72, 0x61, 0x08, 0x61, 0x76, 0x08, 0x76, 0x69, 0x08, 0x69, 0x74, 0x08, 0x74, 0x79, 0x08, 0x79, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x20, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x64, 0x20, 0x28, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x6c, 0x79, 0x20, 0x35, 0x30, 0x20, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x08, 0x47, 0x72, 0x08, 0x72, 0x6f, 0x08, 0x6f, 0x75, 0x08, 0x75, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x44, 0x08, 0x44, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x70, 0x08, 0x70, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x67, 0x08, 0x67, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x64, 0x61, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x08, 0x4d, 0x61, 0x08, 0x61, 0x78, 0x08, 0x78, 0x69, 0x08, 0x69, 0x6d, 0x08, 0x6d, 0x75, 0x08, 0x75, 0x6d, 0x08, 0x6d, 0x20, 0x57, 0x08, 0x57, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x53, 0x08, 0x53, 0x70, 0x08, 0x70, 0x65, 0x08, 0x65, 0x65, 0x08, 0x65, 0x64, 0x08, 0x64, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x20, 0x20, 0x70, 0x65, 0x72, 0x20, 0x20, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x20, 0x20, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x70, 0x65, 0x72, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x28, 0x2d, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x78, 0x2c, 0x20, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x78, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x08, 0x57, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x69, 0x08, 0x69, 0x73, 0x08, 0x73, 0x20, 0x44, 0x08, 0x44, 0x79, 0x08, 0x79, 0x6e, 0x08, 0x6e, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x69, 0x08, 0x69, 0x63, 0x08, 0x63, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x61, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x70, 0x65, 0x72, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x75, 0x08, 0x75, 0x73, 0x08, 0x73, 0x70, 0x08, 0x70, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x44, 0x08, 0x44, 0x69, 0x08, 0x69, 0x72, 0x08, 0x72, 0x74, 0x08, 0x74, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x2f, 0x41, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x6b, 0x08, 0x6b, 0x73, 0x08, 0x73, 0x20, 0x46, 0x08, 0x46, 0x61, 0x08, 0x61, 0x6c, 0x08, 0x6c, 0x6c, 0x08, 0x6c, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x2f, 0x41, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x08, 0x42, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x64, 0x08, 0x64, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x73, 0x08, 0x73, 0x20, 0x45, 0x08, 0x45, 0x78, 0x08, 0x78, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x20, 0x66, 0x61, 0x72, 0x20, 0x20, 0x6f, 0x66, 0x66, 0x2d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6e, 0x6f, 0x20, 0x77, 0x61, 0x6c, 0x6c, 0x73, 0x2e, 0x20, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x20, 0x69, 0x73, 0x20, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x20, 0x64, 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x61, 0x73, 0x20, 0x73, 0x6f, 0x6f, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x69, 0x66, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x62, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x6e, 0x2d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x08, 0x57, 0x61, 0x08, 0x61, 0x6c, 0x08, 0x6c, 0x6c, 0x08, 0x6c, 0x73, 0x08, 0x73, 0x20, 0x41, 0x08, 0x41, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x65, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x68, 0x69, 0x74, 0x20, 0x61, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x60, 0x60, 0x63, 0x6f, 0x6e, 0x63, 0x72, 0x65, 0x74, 0x65, 0x27, 0x27, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x65, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x4e, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x65, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x43, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x65, 0x20, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x72, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x50, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x64, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x61, 0x6c, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x61, 0x74, 0x20, 0x61, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x52, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x62, 0x5f, 0x08, 0x62, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x66, 0x20, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x67, 0x5f, 0x08, 0x79, 0x20, 0x20, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x20, 0x20, 0x6f, 0x66, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x60, 0x60, 0x6b, 0x69, 0x63, 0x6b, 0x27, 0x27, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x57, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x20, 0x54, 0x68, 0x65, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x66, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x20, 0x20, 0x20, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x20, 0x77, 0x72, 0x61, 0x70, 0x20, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x65, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x52, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x61, 0x6c, 0x6c, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x20, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x4c, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x65, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x6b, 0x08, 0x6b, 0x79, 0x08, 0x79, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x73, 0x6b, 0x79, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x48, 0x08, 0x48, 0x6f, 0x08, 0x6f, 0x73, 0x08, 0x73, 0x74, 0x08, 0x74, 0x69, 0x08, 0x69, 0x6c, 0x08, 0x6c, 0x65, 0x08, 0x65, 0x20, 0x45, 0x08, 0x45, 0x6e, 0x08, 0x6e, 0x76, 0x08, 0x76, 0x69, 0x08, 0x69, 0x72, 0x08, 0x72, 0x6f, 0x08, 0x6f, 0x6e, 0x08, 0x6e, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x74, 0x08, 0x74, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x2f, 0x41, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x08, 0x4c, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x47, 0x08, 0x47, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x08, 0x42, 0x75, 0x08, 0x75, 0x6d, 0x08, 0x6d, 0x70, 0x08, 0x70, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x65, 0x08, 0x65, 0x73, 0x08, 0x73, 0x73, 0x08, 0x73, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x6f, 0x69, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x63, 0x61, 0x70, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x57, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x72, 0x08, 0x72, 0x6d, 0x08, 0x6d, 0x73, 0x08, 0x73, 0x20, 0x4c, 0x08, 0x4c, 0x65, 0x08, 0x65, 0x76, 0x08, 0x76, 0x65, 0x08, 0x65, 0x6c, 0x08, 0x6c, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x30, 0x2d, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x61, 0x72, 0x6d, 0x73, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x4f, 0x6e, 0x6c, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x72, 0x6d, 0x73, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2c, 0x20, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x63, 0x69, 0x72, 0x63, 0x75, 0x6d, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x42, 0x08, 0x42, 0x6f, 0x08, 0x6f, 0x6d, 0x08, 0x6d, 0x62, 0x08, 0x62, 0x20, 0x49, 0x08, 0x49, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x6e, 0x08, 0x6e, 0x20, 0x53, 0x08, 0x53, 0x69, 0x08, 0x69, 0x7a, 0x08, 0x7a, 0x65, 0x08, 0x65, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x30, 0x2d, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x6d, 0x62, 0x20, 0x69, 0x63, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6b, 0x79, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x28, 0x69, 0x66, 0x20, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x65, 0x20, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x75, 0x08, 0x75, 0x6e, 0x08, 0x6e, 0x6e, 0x08, 0x6e, 0x65, 0x08, 0x65, 0x6c, 0x08, 0x6c, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x67, 0x08, 0x67, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x20, 0x61, 0x72, 0x65, 0x20, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x20, 0x28, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x75, 0x6e, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x65, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x63, 0x08, 0x63, 0x61, 0x08, 0x61, 0x6c, 0x08, 0x6c, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x67, 0x08, 0x67, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x6f, 0x6e, 0x20, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x72, 0x08, 0x72, 0x61, 0x08, 0x61, 0x63, 0x08, 0x63, 0x65, 0x08, 0x65, 0x20, 0x50, 0x08, 0x50, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x68, 0x08, 0x68, 0x73, 0x08, 0x73, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x74, 0x72, 0x61, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6b, 0x5f, 0x08, 0x65, 0x20, 0x5f, 0x08, 0x54, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x61, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x55, 0x08, 0x55, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x6c, 0x08, 0x6c, 0x65, 0x08, 0x65, 0x73, 0x08, 0x73, 0x73, 0x08, 0x73, 0x20, 0x49, 0x08, 0x49, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x6d, 0x08, 0x6d, 0x73, 0x08, 0x73, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x6f, 0x6d, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x20, 0x61, 0x72, 0x65, 0x20, 0x20, 0x69, 0x72, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20, 0x20, 0x69, 0x66, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x6f, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x47, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x63, 0x08, 0x63, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x20, 0x57, 0x08, 0x57, 0x69, 0x08, 0x69, 0x64, 0x08, 0x64, 0x74, 0x08, 0x74, 0x68, 0x08, 0x68, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x08, 0x53, 0x63, 0x08, 0x63, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x20, 0x48, 0x08, 0x48, 0x65, 0x08, 0x65, 0x69, 0x08, 0x69, 0x67, 0x08, 0x67, 0x68, 0x08, 0x68, 0x74, 0x08, 0x74, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x08, 0x44, 0x69, 0x08, 0x69, 0x74, 0x08, 0x74, 0x68, 0x08, 0x68, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x67, 0x08, 0x67, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6b, 0x79, 0x20, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x74, 0x68, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x6c, 0x79, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x6f, 0x6e, 0x20, 0x31, 0x36, 0x2d, 0x62, 0x69, 0x74, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x61, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x20, 0x69, 0x73, 0x20, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x73, 0x6c, 0x6f, 0x77, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x77, 0x68, 0x61, 0x74, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x6e, 0x08, 0x6e, 0x69, 0x08, 0x69, 0x6d, 0x08, 0x6d, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x69, 0x08, 0x69, 0x6f, 0x08, 0x6f, 0x6e, 0x08, 0x6e, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x79, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6d, 0x20, 0x5f, 0x08, 0x4d, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x75, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x08, 0x47, 0x72, 0x08, 0x72, 0x61, 0x08, 0x61, 0x70, 0x08, 0x70, 0x68, 0x08, 0x68, 0x69, 0x08, 0x69, 0x63, 0x08, 0x63, 0x73, 0x08, 0x73, 0x20, 0x41, 0x08, 0x41, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x20, 0x46, 0x08, 0x46, 0x61, 0x08, 0x61, 0x73, 0x08, 0x73, 0x74, 0x08, 0x74, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x61, 0x73, 0x20, 0x66, 0x61, 0x73, 0x74, 0x20, 0x61, 0x73, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x79, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6d, 0x20, 0x5f, 0x08, 0x4d, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x75, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x08, 0x43, 0x6f, 0x08, 0x6f, 0x6d, 0x08, 0x6d, 0x70, 0x08, 0x70, 0x75, 0x08, 0x75, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x73, 0x08, 0x73, 0x20, 0x41, 0x08, 0x41, 0x72, 0x08, 0x72, 0x65, 0x08, 0x65, 0x20, 0x46, 0x08, 0x46, 0x61, 0x08, 0x61, 0x73, 0x08, 0x73, 0x74, 0x08, 0x74, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x66, 0x61, 0x73, 0x74, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x72, 0x65, 0x20, 0x20, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x79, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x4d, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x75, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x47, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6d, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x79, 0x20, 0x5f, 0x08, 0x4f, 0x5f, 0x08, 0x70, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x08, 0x4d, 0x6f, 0x08, 0x6f, 0x64, 0x08, 0x64, 0x65, 0x08, 0x65, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x69, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x61, 0x74, 0x20, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x20, 0x28, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x79, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x63, 0x5f, 0x08, 0x68, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x73, 0x29, 0x2c, 0x20, 0x20, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x28, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x71, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x61, 0x5f, 0x08, 0x6c, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x65, 0x08, 0x65, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x73, 0x08, 0x73, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x2f, 0x41, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4f, 0x08, 0x4f, 0x72, 0x08, 0x72, 0x64, 0x08, 0x64, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x61, 0x08, 0x61, 0x6c, 0x08, 0x6c, 0x6b, 0x08, 0x6b, 0x20, 0x4d, 0x08, 0x4d, 0x6f, 0x08, 0x6f, 0x64, 0x08, 0x64, 0x65, 0x08, 0x65, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x61, 0x6c, 0x6b, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x61, 0x08, 0x61, 0x6c, 0x08, 0x6c, 0x6b, 0x08, 0x6b, 0x20, 0x50, 0x08, 0x50, 0x72, 0x08, 0x72, 0x6f, 0x08, 0x6f, 0x62, 0x08, 0x62, 0x61, 0x08, 0x61, 0x62, 0x08, 0x62, 0x69, 0x08, 0x69, 0x6c, 0x08, 0x6c, 0x69, 0x08, 0x69, 0x74, 0x08, 0x74, 0x79, 0x08, 0x79, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x69, 0x68, 0x6f, 0x6f, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x08, 0x45, 0x78, 0x08, 0x78, 0x74, 0x08, 0x74, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x65, 0x08, 0x65, 0x64, 0x08, 0x64, 0x20, 0x53, 0x08, 0x53, 0x74, 0x08, 0x74, 0x61, 0x08, 0x61, 0x74, 0x08, 0x74, 0x75, 0x08, 0x75, 0x73, 0x08, 0x73, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x20, 0x62, 0x61, 0x72, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x20, 0x61, 0x6e, 0x20, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x20, 0x72, 0x6f, 0x77, 0x20, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x28, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x73, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x08, 0x54, 0x6f, 0x08, 0x6f, 0x6f, 0x08, 0x6f, 0x6c, 0x08, 0x6c, 0x74, 0x08, 0x74, 0x69, 0x08, 0x69, 0x70, 0x08, 0x70, 0x73, 0x08, 0x73, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x20, 0x41, 0x20, 0x20, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x41, 0x5f, 0x08, 0x49, 0x20, 0x5f, 0x08, 0x43, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x48, 0x08, 0x48, 0x75, 0x08, 0x75, 0x6d, 0x08, 0x6d, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x20, 0x54, 0x08, 0x54, 0x61, 0x08, 0x61, 0x72, 0x08, 0x72, 0x67, 0x08, 0x67, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x20, 0x50, 0x08, 0x50, 0x72, 0x08, 0x72, 0x61, 0x08, 0x61, 0x63, 0x08, 0x63, 0x74, 0x08, 0x74, 0x69, 0x08, 0x69, 0x63, 0x08, 0x63, 0x65, 0x08, 0x65, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x41, 0x49, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x28, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x29, 0x2e, 0x20, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x73, 0x74, 0x20, 0x39, 0x20, 0x20, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x64, 0x61, 0x79, 0x20, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x20, 0x6c, 0x6f, 0x75, 0x73, 0x79, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x6c, 0x08, 0x6c, 0x6c, 0x08, 0x6c, 0x6f, 0x08, 0x6f, 0x77, 0x08, 0x77, 0x20, 0x4f, 0x08, 0x4f, 0x66, 0x08, 0x66, 0x66, 0x08, 0x66, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x20, 0x54, 0x08, 0x54, 0x61, 0x08, 0x61, 0x72, 0x08, 0x72, 0x67, 0x08, 0x67, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x74, 0x08, 0x74, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x67, 0x08, 0x67, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x79, 0x2c, 0x20, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x6e, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x20, 0x28, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x20, 0x68, 0x69, 0x74, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x29, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x75, 0x72, 0x20, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x64, 0x65, 0x6c, 0x69, 0x62, 0x65, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x20, 0x61, 0x69, 0x6d, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x69, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x20, 0x68, 0x61, 0x73, 0x20, 0x72, 0x61, 0x69, 0x73, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x08, 0x41, 0x6c, 0x08, 0x6c, 0x77, 0x08, 0x77, 0x61, 0x08, 0x61, 0x79, 0x08, 0x79, 0x73, 0x08, 0x73, 0x20, 0x4f, 0x08, 0x4f, 0x66, 0x08, 0x66, 0x66, 0x08, 0x66, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x20, 0x69, 0x73, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20, 0x20, 0x69, 0x74, 0x73, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x61, 0x73, 0x20, 0x20, 0x69, 0x66, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x20, 0x68, 0x61, 0x64, 0x20, 0x20, 0x72, 0x61, 0x69, 0x73, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x68, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x61, 0x69, 0x73, 0x65, 0x20, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x20, 0x68, 0x69, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x08, 0x45, 0x6e, 0x08, 0x6e, 0x61, 0x08, 0x61, 0x62, 0x08, 0x62, 0x6c, 0x08, 0x6c, 0x65, 0x08, 0x65, 0x20, 0x53, 0x08, 0x53, 0x63, 0x08, 0x63, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x20, 0x52, 0x08, 0x52, 0x65, 0x08, 0x65, 0x66, 0x08, 0x66, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x65, 0x08, 0x65, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x74, 0x08, 0x74, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x68, 0x61, 0x72, 0x64, 0x65, 0x72, 0x20, 0x41, 0x49, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x20, 0x74, 0x72, 0x61, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x20, 0x62, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x74, 0x72, 0x61, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x20, 0x73, 0x6c, 0x6f, 0x77, 0x20, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x61, 0x20, 0x62, 0x69, 0x74, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x08, 0x4e, 0x6f, 0x08, 0x6f, 0x20, 0x42, 0x08, 0x42, 0x75, 0x08, 0x75, 0x64, 0x08, 0x64, 0x67, 0x08, 0x67, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x20, 0x43, 0x08, 0x43, 0x6f, 0x08, 0x6f, 0x6e, 0x08, 0x6e, 0x73, 0x08, 0x73, 0x74, 0x08, 0x74, 0x72, 0x08, 0x72, 0x61, 0x08, 0x61, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x74, 0x08, 0x74, 0x73, 0x08, 0x73, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x20, 0x63, 0x61, 0x6e, 0x2c, 0x20, 0x20, 0x64, 0x69, 0x73, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x6f, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x6e, 0x5f, 0x08, 0x64, 0x20, 0x5f, 0x08, 0x53, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x74, 0x5f, 0x08, 0x75, 0x5f, 0x08, 0x70, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x08, 0x45, 0x6e, 0x08, 0x6e, 0x61, 0x08, 0x61, 0x62, 0x08, 0x62, 0x6c, 0x08, 0x6c, 0x65, 0x08, 0x65, 0x20, 0x53, 0x08, 0x53, 0x6f, 0x08, 0x6f, 0x75, 0x08, 0x75, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x55, 0x08, 0x55, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x20, 0x48, 0x08, 0x48, 0x51, 0x08, 0x51, 0x20, 0x4d, 0x08, 0x4d, 0x69, 0x08, 0x69, 0x78, 0x08, 0x78, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x6d, 0x69, 0x6b, 0x6d, 0x6f, 0x64, 0x27, 0x73, 0x20, 0x68, 0x69, 0x67, 0x68, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x43, 0x08, 0x43, 0x4f, 0x08, 0x4f, 0x4d, 0x08, 0x4d, 0x4d, 0x08, 0x4d, 0x41, 0x08, 0x41, 0x4e, 0x08, 0x4e, 0x44, 0x08, 0x44, 0x2d, 0x08, 0x2d, 0x4c, 0x08, 0x4c, 0x49, 0x08, 0x49, 0x4e, 0x08, 0x4e, 0x45, 0x08, 0x45, 0x20, 0x4f, 0x08, 0x4f, 0x50, 0x08, 0x50, 0x54, 0x08, 0x54, 0x49, 0x08, 0x49, 0x4f, 0x08, 0x4f, 0x4e, 0x08, 0x4e, 0x53, 0x08, 0x53, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x68, 0x08, 0x68, 0x65, 0x08, 0x65, 0x6c, 0x08, 0x6c, 0x70, 0x08, 0x70, 0x20, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x61, 0x20, 0x62, 0x72, 0x69, 0x65, 0x66, 0x20, 0x73, 0x79, 0x6e, 0x6f, 0x70, 0x73, 0x69, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x69, 0x08, 0x69, 0x6e, 0x08, 0x6e, 0x73, 0x08, 0x73, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x69, 0x08, 0x69, 0x74, 0x08, 0x74, 0x79, 0x08, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x4d, 0x61, 0x78, 0x21, 0x20, 0x20, 0x4f, 0x72, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x69, 0x66, 0x20, 0x69, 0x74, 0x27, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x69, 0x75, 0x73, 0x3f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x79, 0x08, 0x79, 0x69, 0x08, 0x69, 0x65, 0x08, 0x65, 0x6c, 0x08, 0x6c, 0x64, 0x08, 0x64, 0x73, 0x08, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x63, 0x6f, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x67, 0x08, 0x67, 0x65, 0x08, 0x65, 0x6f, 0x08, 0x6f, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x74, 0x08, 0x74, 0x72, 0x08, 0x72, 0x79, 0x08, 0x79, 0x3d, 0x08, 0x3d, 0x5f, 0x08, 0x77, 0x78, 0x08, 0x78, 0x5f, 0x08, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x20, 0x61, 0x6e, 0x20, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x67, 0x65, 0x6f, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x5f, 0x08, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5f, 0x08, 0x68, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x20, 0x55, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x20, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x20, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x20, 0x38, 0x30, 0x30, 0x78, 0x36, 0x30, 0x30, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x61, 0x76, 0x65, 0x20, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x2d, 0x08, 0x2d, 0x67, 0x08, 0x67, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x6e, 0x08, 0x6e, 0x66, 0x08, 0x66, 0x69, 0x08, 0x69, 0x67, 0x08, 0x67, 0x3d, 0x08, 0x3d, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x6f, 0x61, 0x64, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x5f, 0x08, 0x66, 0x5f, 0x08, 0x69, 0x5f, 0x08, 0x6c, 0x5f, 0x08, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x73, 0x08, 0x73, 0x6f, 0x08, 0x6f, 0x75, 0x08, 0x75, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x2d, 0x08, 0x2d, 0x53, 0x08, 0x53, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x6e, 0x08, 0x6e, 0x6f, 0x08, 0x6f, 0x73, 0x08, 0x73, 0x6f, 0x08, 0x6f, 0x75, 0x08, 0x75, 0x6e, 0x08, 0x6e, 0x64, 0x08, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x2d, 0x08, 0x2d, 0x73, 0x08, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x68, 0x08, 0x68, 0x71, 0x08, 0x71, 0x6d, 0x08, 0x6d, 0x69, 0x08, 0x69, 0x78, 0x08, 0x78, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x20, 0x6c, 0x6f, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x50, 0x55, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6f, 0x6e, 0x20, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x6e, 0x08, 0x6e, 0x6f, 0x08, 0x6f, 0x68, 0x08, 0x68, 0x71, 0x08, 0x71, 0x6d, 0x08, 0x6d, 0x69, 0x08, 0x69, 0x78, 0x08, 0x78, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x6e, 0x08, 0x6e, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x20, 0x53, 0x65, 0x74, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x6f, 0x66, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x42, 0x79, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x70, 0x08, 0x70, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x74, 0x08, 0x74, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20, 0x20, 0x69, 0x66, 0x20, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x63, 0x08, 0x63, 0x6c, 0x08, 0x6c, 0x69, 0x08, 0x69, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x74, 0x08, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x76, 0x08, 0x76, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x69, 0x73, 0x20, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x63, 0x08, 0x63, 0x6c, 0x08, 0x6c, 0x69, 0x08, 0x69, 0x65, 0x08, 0x65, 0x6e, 0x08, 0x6e, 0x74, 0x08, 0x74, 0x3d, 0x08, 0x3d, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x76, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x20, 0x69, 0x6e, 0x20, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x5f, 0x08, 0x73, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x5f, 0x08, 0x76, 0x5f, 0x08, 0x65, 0x5f, 0x08, 0x72, 0x20, 0x28, 0x77, 0x68, 0x69, 0x63, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x62, 0x65, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x29, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x6e, 0x08, 0x6e, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x70, 0x08, 0x70, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x74, 0x08, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x2d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x73, 0x08, 0x73, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x76, 0x08, 0x76, 0x65, 0x08, 0x65, 0x72, 0x08, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x61, 0x69, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x2d, 0x08, 0x2d, 0x2d, 0x08, 0x2d, 0x6e, 0x08, 0x6e, 0x61, 0x08, 0x61, 0x6d, 0x08, 0x6d, 0x65, 0x08, 0x65, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x6a, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x0a, 0x0a, 0x4e, 0x08, 0x4e, 0x45, 0x08, 0x45, 0x54, 0x08, 0x54, 0x57, 0x08, 0x57, 0x4f, 0x08, 0x4f, 0x52, 0x08, 0x52, 0x4b, 0x08, 0x4b, 0x20, 0x4d, 0x08, 0x4d, 0x4f, 0x08, 0x4f, 0x44, 0x08, 0x44, 0x45, 0x08, 0x45, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x77, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x46, 0x08, 0x46, 0x49, 0x08, 0x49, 0x4c, 0x08, 0x4c, 0x45, 0x08, 0x45, 0x53, 0x08, 0x53, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7e, 0x08, 0x7e, 0x2f, 0x08, 0x2f, 0x2e, 0x08, 0x2e, 0x78, 0x08, 0x78, 0x73, 0x08, 0x73, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x72, 0x08, 0x72, 0x63, 0x08, 0x63, 0x68, 0x08, 0x68, 0x2f, 0x08, 0x2f, 0x63, 0x08, 0x63, 0x6f, 0x08, 0x6f, 0x6e, 0x08, 0x6e, 0x66, 0x08, 0x66, 0x69, 0x08, 0x69, 0x67, 0x08, 0x67, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x55, 0x73, 0x65, 0x72, 0x27, 0x73, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x08, 0x74, 0x61, 0x08, 0x61, 0x6e, 0x08, 0x6e, 0x6b, 0x08, 0x6b, 0x70, 0x08, 0x70, 0x72, 0x08, 0x72, 0x6f, 0x08, 0x6f, 0x66, 0x08, 0x66, 0x69, 0x08, 0x69, 0x6c, 0x08, 0x6c, 0x65, 0x08, 0x65, 0x73, 0x08, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x2c, 0x20, 0x75, 0x73, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x0a, 0x53, 0x08, 0x53, 0x45, 0x08, 0x45, 0x45, 0x08, 0x45, 0x20, 0x41, 0x08, 0x41, 0x4c, 0x08, 0x4c, 0x53, 0x08, 0x53, 0x4f, 0x08, 0x4f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x67, 0x65, 0x20, 0x20, 0x61, 0x74, 0x20, 0x20, 0x3c, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x3e, 0x2e, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x20, 0x69, 0x73, 0x20, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x41, 0x08, 0x41, 0x55, 0x08, 0x55, 0x54, 0x08, 0x54, 0x48, 0x08, 0x48, 0x4f, 0x08, 0x4f, 0x52, 0x08, 0x52, 0x53, 0x08, 0x53, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x20, 0x77, 0x61, 0x73, 0x20, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x20, 0x3c, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x73, 0x28, 0x61, 0x74, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x32, 0x2e, 0x6f, 0x72, 0x67, 0x3e, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4a, 0x61, 0x63, 0x6f, 0x62, 0x20, 0x4c, 0x75, 0x6e, 0x61, 0x20, 0x4c, 0x75, 0x6e, 0x64, 0x62, 0x65, 0x72, 0x67, 0x20, 0x3c, 0x6a, 0x61, 0x63, 0x6f, 0x62, 0x28, 0x61, 0x74, 0x29, 0x67, 0x6e, 0x69, 0x66, 0x74, 0x79, 0x2e, 0x6e, 0x65, 0x74, 0x3e, 0x2e, 0x20, 0x20, 0x28, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x2d, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x20, 0x20, 0x6f, 0x6e, 0x20, 0x77, 0x65, 0x62, 0x70, 0x61, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x73, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x2e, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x61, 0x67, 0x65, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x20, 0x3c, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x73, 0x28, 0x61, 0x74, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x32, 0x2e, 0x6f, 0x72, 0x67, 0x3e, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x31, 0x2c, 0x32, 0x30, 0x30, 0x30, 0x20, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x2e, 0x0a, 0x0a, 0x0a, 0x0a, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x61, 0x79, 0x20, 0x32, 0x30, 0x30, 0x31, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x28, 0x36, 0x29, 0x0a, 0x00 }; const char data_xscorch_man[] = { 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x24, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x2f, 0x66, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2f, 0x63, 0x76, 0x73, 0x2f, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2f, 0x64, 0x6f, 0x63, 0x2f, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2e, 0x36, 0x2c, 0x76, 0x20, 0x31, 0x2e, 0x32, 0x31, 0x20, 0x32, 0x30, 0x31, 0x31, 0x2d, 0x30, 0x38, 0x2d, 0x30, 0x31, 0x20, 0x30, 0x30, 0x3a, 0x33, 0x31, 0x3a, 0x34, 0x36, 0x20, 0x6a, 0x61, 0x63, 0x6f, 0x62, 0x20, 0x45, 0x78, 0x70, 0x20, 0x24, 0x0a, 0x2e, 0x5c, 0x22, 0x0a, 0x2e, 0x5c, 0x22, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x4f, 0x6e, 0x63, 0x65, 0x20, 0x75, 0x70, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x73, 0x20, 0x61, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x49, 0x74, 0x20, 0x68, 0x61, 0x64, 0x20, 0x61, 0x20, 0x6e, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x54, 0x68, 0x61, 0x74, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x75, 0x69, 0x74, 0x69, 0x76, 0x65, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x41, 0x6e, 0x64, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x0a, 0x2e, 0x5c, 0x22, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x0a, 0x2e, 0x5c, 0x22, 0x0a, 0x2e, 0x54, 0x48, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x36, 0x20, 0x22, 0x4d, 0x61, 0x79, 0x20, 0x32, 0x30, 0x30, 0x31, 0x22, 0x20, 0x22, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x22, 0x20, 0x5c, 0x22, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x0a, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x5c, 0x2d, 0x20, 0x41, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x20, 0x67, 0x75, 0x6e, 0x73, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x53, 0x59, 0x4e, 0x4f, 0x50, 0x53, 0x49, 0x53, 0x0a, 0x2e, 0x42, 0x20, 0x22, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x22, 0x0a, 0x2e, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x22, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x22, 0x0a, 0x2e, 0x49, 0x20, 0x22, 0x5b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5d, 0x22, 0x0a, 0x2e, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x68, 0x65, 0x6c, 0x70, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x44, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x0a, 0x58, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x63, 0x20, 0x44, 0x4f, 0x53, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x22, 0x53, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x64, 0x0a, 0x45, 0x61, 0x72, 0x74, 0x68, 0x22, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x62, 0x61, 0x73, 0x69, 0x63, 0x20, 0x67, 0x6f, 0x61, 0x6c, 0x20, 0x69, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x0a, 0x6f, 0x76, 0x65, 0x72, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x20, 0x67, 0x75, 0x6e, 0x73, 0x20, 0x3a, 0x29, 0x2e, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x62, 0x75, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x65, 0x6d, 0x79, 0x20, 0x62, 0x79, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x74, 0x75, 0x72, 0x72, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x0a, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x47, 0x41, 0x4d, 0x45, 0x50, 0x4c, 0x41, 0x59, 0x0a, 0x46, 0x69, 0x72, 0x73, 0x74, 0x2c, 0x20, 0x66, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x61, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x61, 0x73, 0x69, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x68, 0x61, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x0a, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x2e, 0x20, 0x20, 0x4d, 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x61, 0x6c, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x0a, 0x66, 0x65, 0x77, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5c, 0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x4f, 0x6e, 0x63, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x0a, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x61, 0x76, 0x65, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x61, 0x76, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x5c, 0x66, 0x49, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x20, 0x47, 0x61, 0x6d, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x0a, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x75, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x76, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x70, 0x61, 0x72, 0x74, 0x73, 0x3a, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x5c, 0x66, 0x49, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x75, 0x79, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x68, 0x6f, 0x6f, 0x74, 0x20, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x0a, 0x68, 0x65, 0x6c, 0x70, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x2e, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x0a, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x75, 0x79, 0x2e, 0x0a, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x20, 0x70, 0x68, 0x61, 0x73, 0x65, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x73, 0x65, 0x74, 0x75, 0x70, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2c, 0x20, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x20, 0x61, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x2c, 0x0a, 0x61, 0x69, 0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x0a, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x49, 0x4e, 0x56, 0x45, 0x4e, 0x54, 0x4f, 0x52, 0x59, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x0a, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x61, 0x74, 0x3a, 0x0a, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6c, 0x65, 0x73, 0x2c, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x49, 0x43, 0x42, 0x4d, 0x5c, 0x2d, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x77, 0x61, 0x72, 0x68, 0x65, 0x61, 0x64, 0x73, 0x2c, 0x0a, 0x6e, 0x61, 0x70, 0x61, 0x6c, 0x6d, 0x2c, 0x20, 0x6c, 0x61, 0x73, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x0a, 0x67, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x65, 0x61, 0x73, 0x69, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x0a, 0x6f, 0x66, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x67, 0x75, 0x69, 0x64, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2c, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x66, 0x75, 0x65, 0x6c, 0x2c, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x0a, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6f, 0x64, 0x64, 0x73, 0x5c, 0x2d, 0x61, 0x6e, 0x64, 0x5c, 0x2d, 0x65, 0x6e, 0x64, 0x73, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x41, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x0a, 0x6f, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x6c, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x0a, 0x6d, 0x61, 0x79, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x75, 0x70, 0x20, 0x74, 0x6f, 0x20, 0x39, 0x39, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x66, 0x65, 0x77, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x0a, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x42, 0x61, 0x62, 0x79, 0x20, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6c, 0x65, 0x73, 0x29, 0x20, 0x5c, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x69, 0x63, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x0a, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x75, 0x79, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x61, 0x73, 0x0a, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x0a, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x63, 0x61, 0x6e, 0x0a, 0x68, 0x6f, 0x6c, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x0a, 0x61, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x20, 0x62, 0x61, 0x73, 0x69, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x75, 0x70, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x27, 0x73, 0x0a, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x41, 0x67, 0x61, 0x69, 0x6e, 0x2c, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x61, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x73, 0x61, 0x6c, 0x65, 0x20, 0x5c, 0x2d, 0x20, 0x68, 0x65, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x6d, 0x61, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x3a, 0x29, 0x0a, 0x2e, 0x50, 0x0a, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2c, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x73, 0x0a, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2c, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a, 0x61, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x54, 0x61, 0x62, 0x5c, 0x66, 0x50, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x0a, 0x70, 0x61, 0x6e, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x5c, 0x66, 0x49, 0x55, 0x70, 0x20, 0x41, 0x72, 0x72, 0x6f, 0x77, 0x5c, 0x66, 0x50, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5c, 0x66, 0x49, 0x44, 0x6f, 0x77, 0x6e, 0x20, 0x41, 0x72, 0x72, 0x6f, 0x77, 0x5c, 0x66, 0x50, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x0a, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x52, 0x69, 0x67, 0x68, 0x74, 0x20, 0x41, 0x72, 0x72, 0x6f, 0x77, 0x5c, 0x66, 0x50, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x75, 0x79, 0x20, 0x61, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5c, 0x66, 0x49, 0x4c, 0x65, 0x66, 0x74, 0x20, 0x41, 0x72, 0x72, 0x6f, 0x77, 0x5c, 0x66, 0x50, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x65, 0x6c, 0x6c, 0x0a, 0x61, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2c, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x6e, 0x61, 0x6d, 0x65, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x5c, 0x66, 0x50, 0x2f, 0x5c, 0x66, 0x49, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x5c, 0x66, 0x49, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x62, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x64, 0x61, 0x72, 0x6b, 0x65, 0x6e, 0x65, 0x64, 0x2e, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6d, 0x61, 0x78, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x79, 0x0a, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x66, 0x66, 0x6f, 0x72, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x72, 0x0a, 0x5c, 0x66, 0x49, 0x61, 0x72, 0x6d, 0x73, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5c, 0x66, 0x50, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x0a, 0x62, 0x65, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x0a, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x0a, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x57, 0x45, 0x41, 0x50, 0x4f, 0x4e, 0x53, 0x20, 0x4c, 0x49, 0x53, 0x54, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x79, 0x20, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x4f, 0x52, 0x49, 0x45, 0x53, 0x20, 0x4c, 0x49, 0x53, 0x54, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x79, 0x20, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x42, 0x41, 0x54, 0x54, 0x4c, 0x45, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x20, 0x69, 0x73, 0x20, 0x73, 0x61, 0x64, 0x6c, 0x79, 0x2c, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x54, 0x41, 0x4e, 0x4b, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x4f, 0x4c, 0x53, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x72, 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x20, 0x68, 0x6f, 0x72, 0x72, 0x65, 0x6e, 0x64, 0x6f, 0x75, 0x73, 0x0a, 0x2e, 0x5c, 0x22, 0x20, 0x20, 0x49, 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x68, 0x61, 0x72, 0x0a, 0x2e, 0x5c, 0x22, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x4c, 0x65, 0x66, 0x74, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x52, 0x69, 0x67, 0x68, 0x74, 0x5c, 0x66, 0x50, 0x0a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x75, 0x72, 0x72, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x75, 0x72, 0x72, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x35, 0x20, 0x64, 0x65, 0x67, 0x72, 0x65, 0x65, 0x73, 0x2e, 0x0a, 0x46, 0x6f, 0x72, 0x20, 0x66, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x20, 0x68, 0x6f, 0x6c, 0x64, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x68, 0x69, 0x66, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x31, 0x20, 0x64, 0x65, 0x67, 0x72, 0x65, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x55, 0x70, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x44, 0x6f, 0x77, 0x6e, 0x5c, 0x66, 0x50, 0x0a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x31, 0x30, 0x30, 0x30, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x0a, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x32, 0x30, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x66, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x20, 0x68, 0x6f, 0x6c, 0x64, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x68, 0x69, 0x66, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x0a, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x31, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x54, 0x61, 0x62, 0x5c, 0x66, 0x50, 0x0a, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x53, 0x68, 0x69, 0x66, 0x74, 0x2b, 0x54, 0x61, 0x62, 0x5c, 0x66, 0x50, 0x0a, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x42, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x62, 0x5c, 0x66, 0x50, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x35, 0x25, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x64, 0x6f, 0x6e, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x74, 0x61, 0x6e, 0x6b, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x66, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x35, 0x25, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x64, 0x2e, 0x0a, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x69, 0x73, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x63, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x45, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x65, 0x5c, 0x66, 0x50, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x69, 0x7a, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x46, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x66, 0x5c, 0x66, 0x50, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x66, 0x75, 0x65, 0x6c, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x0a, 0x66, 0x75, 0x65, 0x6c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x41, 0x73, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x66, 0x75, 0x65, 0x6c, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x4c, 0x65, 0x66, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x5c, 0x66, 0x49, 0x52, 0x69, 0x67, 0x68, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x72, 0x65, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x2c, 0x0a, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x20, 0x75, 0x70, 0x20, 0x61, 0x20, 0x73, 0x74, 0x65, 0x65, 0x70, 0x20, 0x68, 0x69, 0x6c, 0x6c, 0x2e, 0x20, 0x20, 0x49, 0x6d, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x0a, 0x65, 0x78, 0x63, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x52, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x72, 0x5c, 0x66, 0x50, 0x0a, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x20, 0x61, 0x20, 0x72, 0x65, 0x64, 0x72, 0x61, 0x77, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x53, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x73, 0x5c, 0x66, 0x50, 0x0a, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x69, 0x7a, 0x65, 0x2e, 0x20, 0x20, 0x53, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x3a, 0x20, 0x20, 0x5c, 0x66, 0x49, 0x4d, 0x5c, 0x66, 0x50, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x67, 0x6e, 0x65, 0x74, 0x69, 0x63, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x46, 0x5c, 0x66, 0x50, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x0a, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x5c, 0x66, 0x50, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x2c, 0x20, 0x72, 0x75, 0x6e, 0x2d, 0x6f, 0x66, 0x2d, 0x74, 0x68, 0x65, 0x2d, 0x6d, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x0a, 0x61, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x30, 0x53, 0x5c, 0x66, 0x50, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x54, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x74, 0x5c, 0x66, 0x50, 0x0a, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x6e, 0x2f, 0x6f, 0x66, 0x66, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x66, 0x75, 0x6c, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x5c, 0x66, 0x49, 0x68, 0x61, 0x76, 0x65, 0x5c, 0x66, 0x50, 0x0a, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x66, 0x69, 0x72, 0x65, 0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x65, 0x71, 0x75, 0x69, 0x70, 0x70, 0x65, 0x64, 0x20, 0x28, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x29, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x30, 0x5c, 0x66, 0x50, 0x20, 0x5c, 0x2d, 0x20, 0x5c, 0x66, 0x49, 0x39, 0x5c, 0x66, 0x50, 0x0a, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x5c, 0x66, 0x49, 0x31, 0x5c, 0x66, 0x50, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x31, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5c, 0x66, 0x49, 0x30, 0x5c, 0x66, 0x50, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x20, 0x20, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x43, 0x74, 0x72, 0x6c, 0x2b, 0x59, 0x5c, 0x66, 0x50, 0x0a, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x70, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x4d, 0x65, 0x6e, 0x75, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x73, 0x29, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x63, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x2c, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x65, 0x6d, 0x61, 0x74, 0x75, 0x72, 0x65, 0x6c, 0x79, 0x2e, 0x20, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x43, 0x74, 0x72, 0x6c, 0x2b, 0x5a, 0x5c, 0x66, 0x50, 0x0a, 0x50, 0x61, 0x75, 0x73, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x43, 0x74, 0x72, 0x6c, 0x2b, 0x52, 0x5c, 0x66, 0x50, 0x0a, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x0a, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x20, 0x4d, 0x45, 0x4e, 0x55, 0x0a, 0x2e, 0x50, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x0a, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x46, 0x61, 0x73, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x29, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x0a, 0x66, 0x65, 0x77, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4d, 0x61, 0x73, 0x73, 0x20, 0x4b, 0x69, 0x6c, 0x6c, 0x5c, 0x66, 0x50, 0x0a, 0x4b, 0x69, 0x6c, 0x6c, 0x73, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x67, 0x65, 0x74, 0x73, 0x20, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x69, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x62, 0x65, 0x65, 0x6e, 0x20, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x20, 0x77, 0x68, 0x61, 0x74, 0x73, 0x6f, 0x65, 0x76, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x45, 0x72, 0x61, 0x73, 0x65, 0x20, 0x53, 0x6d, 0x6f, 0x6b, 0x65, 0x5c, 0x66, 0x50, 0x0a, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x54, 0x72, 0x61, 0x63, 0x65, 0x20, 0x50, 0x61, 0x74, 0x68, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6b, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x52, 0x65, 0x74, 0x72, 0x65, 0x61, 0x74, 0x5c, 0x66, 0x50, 0x0a, 0x4e, 0x2f, 0x41, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x47, 0x61, 0x6d, 0x65, 0x5c, 0x66, 0x50, 0x0a, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x53, 0x65, 0x74, 0x75, 0x70, 0x5c, 0x66, 0x50, 0x0a, 0x54, 0x61, 0x6b, 0x65, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x41, 0x49, 0x20, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x65, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x75, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x6d, 0x69, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x72, 0x61, 0x74, 0x68, 0x65, 0x72, 0x20, 0x64, 0x69, 0x73, 0x61, 0x67, 0x72, 0x65, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x20, 0x20, 0x4b, 0x65, 0x65, 0x70, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x6d, 0x69, 0x6e, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x77, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x68, 0x79, 0x20, 0x39, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x0a, 0x74, 0x6f, 0x20, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x74, 0x61, 0x6e, 0x65, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x2e, 0x2e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x4d, 0x6f, 0x72, 0x6f, 0x6e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x66, 0x69, 0x72, 0x65, 0x73, 0x20, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2e, 0x20, 0x20, 0x4f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x68, 0x61, 0x73, 0x20, 0x62, 0x79, 0x20, 0x66, 0x61, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, 0x65, 0x0a, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x20, 0x20, 0x41, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x60, 0x60, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x20, 0x46, 0x6f, 0x64, 0x64, 0x65, 0x72, 0x27, 0x27, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x53, 0x68, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x67, 0x6f, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x69, 0x74, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x5c, 0x2d, 0x6f, 0x66, 0x5c, 0x2d, 0x73, 0x69, 0x67, 0x68, 0x74, 0x20, 0x74, 0x6f, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x27, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x20, 0x67, 0x72, 0x65, 0x61, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x62, 0x75, 0x79, 0x73, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x73, 0x74, 0x20, 0x65, 0x63, 0x6f, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x74, 0x20, 0x0a, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x53, 0x70, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x69, 0x73, 0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53, 0x68, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x61, 0x20, 0x53, 0x70, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x20, 0x62, 0x75, 0x79, 0x73, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x69, 0x63, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x72, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x73, 0x20, 0x61, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x2e, 0x20, 0x20, 0x4f, 0x6e, 0x63, 0x65, 0x20, 0x63, 0x68, 0x6f, 0x73, 0x65, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x61, 0x64, 0x2c, 0x20, 0x6f, 0x72, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x72, 0x20, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x61, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x5c, 0x2d, 0x6f, 0x66, 0x5c, 0x2d, 0x73, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x0a, 0x62, 0x75, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x74, 0x75, 0x6e, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x69, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x72, 0x2c, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x61, 0x20, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x67, 0x75, 0x79, 0x73, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x66, 0x61, 0x69, 0x72, 0x6c, 0x79, 0x20, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x66, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x74, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x41, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x67, 0x6f, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x0a, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x65, 0x64, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x66, 0x65, 0x77, 0x20, 0x41, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x72, 0x61, 0x69, 0x6e, 0x20, 0x65, 0x61, 0x73, 0x69, 0x6c, 0x79, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x77, 0x6f, 0x72, 0x72, 0x79, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x0a, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x6f, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x2e, 0x20, 0x20, 0x57, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x64, 0x65, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x77, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x65, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x79, 0x77, 0x61, 0x79, 0x20, 0x5c, 0x2d, 0x0a, 0x62, 0x75, 0x74, 0x20, 0x6e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6e, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x49, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x74, 0x79, 0x0a, 0x4e, 0x6f, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x73, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x49, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x73, 0x2e, 0x2e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x73, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x64, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x0a, 0x41, 0x49, 0x20, 0x77, 0x61, 0x73, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x20, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x0a, 0x5c, 0x66, 0x49, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x2f, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x32, 0x5c, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x3e, 0x3d, 0x20, 0x31, 0x29, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x49, 0x20, 0x54, 0x79, 0x70, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x20, 0x20, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x60, 0x60, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x27, 0x27, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x49, 0x27, 0x73, 0x0a, 0x61, 0x72, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x0a, 0x47, 0x69, 0x76, 0x65, 0x20, 0x61, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x61, 0x6e, 0x6b, 0x20, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x45, 0x63, 0x6f, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x20, 0x52, 0x61, 0x74, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x5c, 0x2d, 0x30, 0x2e, 0x33, 0x30, 0x29, 0x0a, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x20, 0x72, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x70, 0x65, 0x72, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x20, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x20, 0x43, 0x61, 0x73, 0x68, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x30, 0x5c, 0x2d, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x29, 0x0a, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x49, 0x73, 0x20, 0x43, 0x61, 0x6e, 0x20, 0x42, 0x75, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x20, 0x20, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x49, 0x73, 0x20, 0x42, 0x75, 0x79, 0x20, 0x41, 0x67, 0x67, 0x72, 0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x75, 0x79, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x2e, 0x20, 0x20, 0x57, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x0a, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x75, 0x79, 0x20, 0x62, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x46, 0x72, 0x65, 0x65, 0x20, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x4e, 0x2f, 0x41, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x53, 0x63, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x73, 0x63, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2c, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x2c, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x2c, 0x20, 0x47, 0x72, 0x65, 0x65, 0x64, 0x79, 0x2c, 0x0a, 0x6f, 0x72, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x0a, 0x2e, 0x50, 0x44, 0x20, 0x30, 0x0a, 0x2e, 0x52, 0x53, 0x20, 0x2b, 0x31, 0x32, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x39, 0x0a, 0x5c, 0x66, 0x49, 0x42, 0x61, 0x73, 0x69, 0x63, 0x5c, 0x66, 0x50, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x39, 0x0a, 0x5c, 0x66, 0x49, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5c, 0x66, 0x50, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, 0x72, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x39, 0x0a, 0x5c, 0x66, 0x49, 0x47, 0x72, 0x65, 0x65, 0x64, 0x79, 0x5c, 0x66, 0x50, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x61, 0x69, 0x64, 0x20, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x73, 0x63, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x62, 0x6f, 0x6e, 0x75, 0x73, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x0a, 0x2e, 0x52, 0x45, 0x0a, 0x2e, 0x50, 0x44, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x68, 0x65, 0x20, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x20, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x0a, 0x65, 0x61, 0x63, 0x68, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x61, 0x20, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x66, 0x72, 0x65, 0x65, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x61, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x67, 0x72, 0x65, 0x61, 0x74, 0x20, 0x77, 0x61, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, 0x0a, 0x6c, 0x69, 0x66, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x41, 0x49, 0x73, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x75, 0x73, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x62, 0x75, 0x79, 0x65, 0x72, 0x73, 0x2e, 0x20, 0x20, 0x50, 0x6c, 0x75, 0x73, 0x20, 0x69, 0x74, 0x27, 0x73, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x67, 0x72, 0x65, 0x61, 0x74, 0x0a, 0x66, 0x75, 0x6e, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x67, 0x65, 0x74, 0x20, 0x61, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x41, 0x6e, 0x6e, 0x69, 0x68, 0x69, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x2e, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x73, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x69, 0x72, 0x20, 0x56, 0x69, 0x73, 0x63, 0x6f, 0x73, 0x69, 0x74, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x0a, 0x4e, 0x2f, 0x41, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x47, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x5c, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x20, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x64, 0x20, 0x28, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x20, 0x0a, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x6c, 0x79, 0x20, 0x35, 0x30, 0x20, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x47, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x44, 0x61, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x5c, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x64, 0x61, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x20, 0x53, 0x70, 0x65, 0x65, 0x64, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2c, 0x20, 0x30, 0x5c, 0x2d, 0x31, 0x30, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x20, 0x70, 0x65, 0x72, 0x20, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x20, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x70, 0x65, 0x72, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x20, 0x74, 0x6f, 0x0a, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x28, 0x2d, 0x5c, 0x66, 0x49, 0x6d, 0x61, 0x78, 0x5c, 0x66, 0x50, 0x2c, 0x20, 0x5c, 0x66, 0x49, 0x6d, 0x61, 0x78, 0x5c, 0x66, 0x50, 0x29, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x57, 0x69, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x61, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x70, 0x65, 0x72, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x53, 0x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x20, 0x44, 0x69, 0x72, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x4e, 0x2f, 0x41, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x61, 0x6e, 0x6b, 0x73, 0x20, 0x46, 0x61, 0x6c, 0x6c, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x4e, 0x2f, 0x41, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x42, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x29, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x66, 0x61, 0x72, 0x20, 0x6f, 0x66, 0x66, 0x5c, 0x2d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x2c, 0x0a, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6e, 0x6f, 0x20, 0x77, 0x61, 0x6c, 0x6c, 0x73, 0x2e, 0x20, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x73, 0x0a, 0x7a, 0x65, 0x72, 0x6f, 0x2c, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x64, 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x61, 0x73, 0x20, 0x73, 0x6f, 0x6f, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x0a, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x69, 0x66, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x68, 0x61, 0x76, 0x65, 0x0a, 0x62, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x20, 0x6f, 0x6e, 0x5c, 0x2d, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x57, 0x61, 0x6c, 0x6c, 0x73, 0x20, 0x41, 0x72, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x65, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x68, 0x69, 0x74, 0x20, 0x61, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x2c, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x60, 0x60, 0x63, 0x6f, 0x6e, 0x63, 0x72, 0x65, 0x74, 0x65, 0x27, 0x27, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x0a, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x65, 0x3a, 0x0a, 0x2e, 0x50, 0x44, 0x20, 0x30, 0x0a, 0x2e, 0x52, 0x53, 0x20, 0x2b, 0x31, 0x32, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x31, 0x31, 0x0a, 0x5c, 0x66, 0x49, 0x4e, 0x6f, 0x6e, 0x65, 0x5c, 0x66, 0x50, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x31, 0x31, 0x0a, 0x5c, 0x66, 0x49, 0x43, 0x6f, 0x6e, 0x63, 0x72, 0x65, 0x74, 0x65, 0x5c, 0x66, 0x50, 0x0a, 0x41, 0x6c, 0x6c, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x31, 0x31, 0x0a, 0x5c, 0x66, 0x49, 0x50, 0x61, 0x64, 0x64, 0x65, 0x64, 0x5c, 0x66, 0x50, 0x0a, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x61, 0x6c, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x0a, 0x61, 0x74, 0x20, 0x61, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x31, 0x31, 0x0a, 0x5c, 0x66, 0x49, 0x52, 0x75, 0x62, 0x62, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x0a, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x66, 0x20, 0x61, 0x74, 0x20, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x0a, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x31, 0x31, 0x0a, 0x5c, 0x66, 0x49, 0x53, 0x70, 0x72, 0x69, 0x6e, 0x67, 0x79, 0x5c, 0x66, 0x50, 0x0a, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x66, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x0a, 0x60, 0x60, 0x6b, 0x69, 0x63, 0x6b, 0x27, 0x27, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x31, 0x31, 0x0a, 0x5c, 0x66, 0x49, 0x57, 0x72, 0x61, 0x70, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5c, 0x66, 0x50, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x63, 0x65, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x66, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x0a, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x20, 0x20, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x77, 0x72, 0x61, 0x70, 0x20, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x0a, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x65, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x20, 0x31, 0x31, 0x0a, 0x5c, 0x66, 0x49, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x5c, 0x66, 0x50, 0x0a, 0x4f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x61, 0x6c, 0x6c, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2e, 0x0a, 0x2e, 0x52, 0x45, 0x0a, 0x2e, 0x50, 0x44, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x4c, 0x61, 0x6e, 0x64, 0x73, 0x63, 0x61, 0x70, 0x65, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x53, 0x6b, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x73, 0x6b, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x48, 0x6f, 0x73, 0x74, 0x69, 0x6c, 0x65, 0x20, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x4e, 0x2f, 0x41, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4c, 0x61, 0x6e, 0x64, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x42, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x6f, 0x69, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x63, 0x61, 0x70, 0x65, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x57, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x72, 0x6d, 0x73, 0x20, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x30, 0x5c, 0x2d, 0x34, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x61, 0x72, 0x6d, 0x73, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x4f, 0x6e, 0x6c, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x72, 0x6d, 0x73, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2c, 0x0a, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x63, 0x69, 0x72, 0x63, 0x75, 0x6d, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x42, 0x6f, 0x6d, 0x62, 0x20, 0x49, 0x63, 0x6f, 0x6e, 0x20, 0x53, 0x69, 0x7a, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2c, 0x20, 0x30, 0x5c, 0x2d, 0x34, 0x29, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x6d, 0x62, 0x20, 0x69, 0x63, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x0a, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6b, 0x79, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x28, 0x69, 0x66, 0x20, 0x5c, 0x66, 0x49, 0x74, 0x72, 0x61, 0x63, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x29, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x69, 0x6e, 0x67, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x75, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x61, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x20, 0x28, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x0a, 0x6c, 0x61, 0x6e, 0x64, 0x29, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x0a, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x76, 0x65, 0x72, 0x79, 0x0a, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x72, 0x61, 0x63, 0x65, 0x20, 0x50, 0x61, 0x74, 0x68, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x74, 0x72, 0x61, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x66, 0x66, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x6d, 0x6f, 0x6b, 0x65, 0x20, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x61, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x55, 0x73, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, 0x72, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x66, 0x20, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6e, 0x6f, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x57, 0x69, 0x64, 0x74, 0x68, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x29, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x29, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x44, 0x69, 0x74, 0x68, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6b, 0x79, 0x20, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x74, 0x68, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x69, 0x73, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x6c, 0x79, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x6f, 0x6e, 0x20, 0x31, 0x36, 0x5c, 0x2d, 0x62, 0x69, 0x74, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x0a, 0x76, 0x65, 0x72, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x73, 0x6c, 0x6f, 0x77, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x0a, 0x73, 0x6f, 0x6d, 0x65, 0x77, 0x68, 0x61, 0x74, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x4d, 0x65, 0x6e, 0x75, 0x5c, 0x66, 0x50, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x41, 0x72, 0x65, 0x20, 0x46, 0x61, 0x73, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x61, 0x73, 0x20, 0x66, 0x61, 0x73, 0x74, 0x20, 0x61, 0x73, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x4d, 0x65, 0x6e, 0x75, 0x5c, 0x66, 0x50, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x73, 0x20, 0x41, 0x72, 0x65, 0x20, 0x46, 0x61, 0x73, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x66, 0x61, 0x73, 0x74, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x5c, 0x66, 0x49, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x4d, 0x65, 0x6e, 0x75, 0x5c, 0x66, 0x50, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x47, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4d, 0x6f, 0x64, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x69, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x61, 0x74, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x28, 0x5c, 0x66, 0x49, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x6f, 0x75, 0x73, 0x5c, 0x66, 0x50, 0x29, 0x2c, 0x20, 0x6f, 0x72, 0x0a, 0x77, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x28, 0x5c, 0x66, 0x49, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5c, 0x66, 0x50, 0x29, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x4e, 0x2f, 0x41, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x61, 0x6c, 0x6b, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x0a, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x61, 0x6c, 0x6b, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x61, 0x6c, 0x6b, 0x20, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x29, 0x0a, 0x44, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x69, 0x68, 0x6f, 0x6f, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x62, 0x61, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x72, 0x6f, 0x77, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x20, 0x28, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x73, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x20, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x29, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x54, 0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x41, 0x20, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x41, 0x49, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x41, 0x49, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x28, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x41, 0x49, 0x27, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x66, 0x69, 0x72, 0x65, 0x20, 0x61, 0x74, 0x20, 0x20, 0x20, 0x0a, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x29, 0x2e, 0x20, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x73, 0x74, 0x20, 0x39, 0x20, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x0a, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x64, 0x61, 0x79, 0x20, 0x70, 0x72, 0x65, 0x74, 0x74, 0x79, 0x20, 0x6c, 0x6f, 0x75, 0x73, 0x79, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x74, 0x73, 0x20, 0x61, 0x0a, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x6e, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x0a, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x28, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x73, 0x20, 0x68, 0x69, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x64, 0x6f, 0x0a, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x74, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x29, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x75, 0x72, 0x20, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x64, 0x65, 0x6c, 0x69, 0x62, 0x65, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x61, 0x69, 0x6d, 0x20, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x20, 0x68, 0x61, 0x73, 0x20, 0x72, 0x61, 0x69, 0x73, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x41, 0x49, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20, 0x69, 0x74, 0x73, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x68, 0x61, 0x64, 0x0a, 0x72, 0x61, 0x69, 0x73, 0x65, 0x64, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x68, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x0a, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x61, 0x69, 0x73, 0x65, 0x20, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x20, 0x68, 0x69, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x63, 0x61, 0x6e, 0x20, 0x52, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x68, 0x61, 0x72, 0x64, 0x65, 0x72, 0x20, 0x41, 0x49, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x74, 0x72, 0x61, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x0a, 0x62, 0x79, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x72, 0x61, 0x6a, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x20, 0x0a, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x72, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x73, 0x6c, 0x6f, 0x77, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x70, 0x6c, 0x61, 0x79, 0x0a, 0x61, 0x20, 0x62, 0x69, 0x74, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x49, 0x73, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x4e, 0x6f, 0x20, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x41, 0x49, 0x27, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x61, 0x73, 0x0a, 0x74, 0x68, 0x65, 0x79, 0x20, 0x63, 0x61, 0x6e, 0x2c, 0x20, 0x64, 0x69, 0x73, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x0a, 0x2e, 0x50, 0x0a, 0x5c, 0x66, 0x49, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x53, 0x65, 0x74, 0x75, 0x70, 0x5c, 0x66, 0x50, 0x3a, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x5c, 0x66, 0x42, 0x55, 0x73, 0x65, 0x20, 0x48, 0x51, 0x20, 0x4d, 0x69, 0x78, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x20, 0x28, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x29, 0x0a, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x6d, 0x69, 0x6b, 0x6d, 0x6f, 0x64, 0x27, 0x73, 0x20, 0x68, 0x69, 0x67, 0x68, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x2d, 0x4c, 0x49, 0x4e, 0x45, 0x20, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x68, 0x65, 0x6c, 0x70, 0x0a, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x61, 0x20, 0x62, 0x72, 0x69, 0x65, 0x66, 0x20, 0x73, 0x79, 0x6e, 0x6f, 0x70, 0x73, 0x69, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x69, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x74, 0x79, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x4d, 0x61, 0x78, 0x21, 0x20, 0x20, 0x4f, 0x72, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x69, 0x66, 0x20, 0x69, 0x74, 0x27, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x69, 0x75, 0x73, 0x3f, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x0a, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x63, 0x6f, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x67, 0x65, 0x6f, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x3d, 0x5c, 0x66, 0x49, 0x77, 0x5c, 0x66, 0x50, 0x78, 0x5c, 0x66, 0x49, 0x68, 0x5c, 0x66, 0x50, 0x0a, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x67, 0x65, 0x6f, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x0a, 0x5c, 0x66, 0x49, 0x77, 0x5c, 0x66, 0x50, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x5c, 0x66, 0x49, 0x68, 0x5c, 0x66, 0x50, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x20, 0x55, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x38, 0x30, 0x30, 0x78, 0x36, 0x30, 0x30, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x77, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x67, 0x5c, 0x66, 0x50, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3d, 0x5c, 0x66, 0x49, 0x66, 0x69, 0x6c, 0x65, 0x5c, 0x66, 0x50, 0x0a, 0x4c, 0x6f, 0x61, 0x64, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x5c, 0x66, 0x49, 0x66, 0x69, 0x6c, 0x65, 0x5c, 0x66, 0x50, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x53, 0x5c, 0x66, 0x50, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x6e, 0x6f, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x73, 0x5c, 0x66, 0x50, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x68, 0x71, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x0a, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x20, 0x6c, 0x6f, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x50, 0x55, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6f, 0x6e, 0x20, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x6e, 0x6f, 0x68, 0x71, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x0a, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6d, 0x69, 0x78, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x0a, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x42, 0x79, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x70, 0x6f, 0x72, 0x74, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x5c, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x6f, 0x72, 0x0a, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x5c, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x0a, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3d, 0x5c, 0x66, 0x49, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x0a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x69, 0x6e, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x5c, 0x66, 0x49, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x66, 0x50, 0x0a, 0x28, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x62, 0x65, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x29, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x5c, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x5c, 0x2d, 0x70, 0x6f, 0x72, 0x74, 0x5c, 0x66, 0x50, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x5c, 0x2d, 0x5c, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x0a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x61, 0x69, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x5c, 0x66, 0x42, 0x5c, 0x2d, 0x5c, 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x5c, 0x66, 0x50, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x6a, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x0a, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x20, 0x4d, 0x4f, 0x44, 0x45, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x77, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x53, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x7e, 0x2f, 0x2e, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x27, 0x73, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2e, 0x0a, 0x2e, 0x54, 0x50, 0x0a, 0x2e, 0x42, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x0a, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x6e, 0x6b, 0x73, 0x2c, 0x20, 0x75, 0x73, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x53, 0x45, 0x45, 0x20, 0x41, 0x4c, 0x53, 0x4f, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x67, 0x65, 0x20, 0x61, 0x74, 0x20, 0x3c, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x3e, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x0a, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2e, 0x53, 0x48, 0x20, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x53, 0x0a, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x63, 0x68, 0x20, 0x77, 0x61, 0x73, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x20, 0x3c, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x73, 0x28, 0x61, 0x74, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x32, 0x2e, 0x6f, 0x72, 0x67, 0x3e, 0x20, 0x0a, 0x61, 0x6e, 0x64, 0x20, 0x4a, 0x61, 0x63, 0x6f, 0x62, 0x20, 0x4c, 0x75, 0x6e, 0x61, 0x20, 0x4c, 0x75, 0x6e, 0x64, 0x62, 0x65, 0x72, 0x67, 0x20, 0x3c, 0x6a, 0x61, 0x63, 0x6f, 0x62, 0x28, 0x61, 0x74, 0x29, 0x67, 0x6e, 0x69, 0x66, 0x74, 0x79, 0x2e, 0x6e, 0x65, 0x74, 0x3e, 0x2e, 0x20, 0x20, 0x0a, 0x28, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x65, 0x2d, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x77, 0x65, 0x62, 0x70, 0x61, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x73, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x2e, 0x29, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x2e, 0x50, 0x50, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x20, 0x70, 0x61, 0x67, 0x65, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x20, 0x3c, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x73, 0x28, 0x61, 0x74, 0x29, 0x63, 0x68, 0x61, 0x6f, 0x73, 0x32, 0x2e, 0x6f, 0x72, 0x67, 0x3e, 0x2e, 0x0a, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x31, 0x2c, 0x32, 0x30, 0x30, 0x30, 0x20, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x20, 0x44, 0x61, 0x76, 0x69, 0x64, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x2e, 0x0a, 0x00 }; const char data_copying_txt[] = { 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x4c, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x0a, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2c, 0x20, 0x4a, 0x75, 0x6e, 0x65, 0x20, 0x31, 0x39, 0x39, 0x31, 0x0a, 0x0a, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x43, 0x29, 0x20, 0x31, 0x39, 0x38, 0x39, 0x2c, 0x20, 0x31, 0x39, 0x39, 0x31, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x35, 0x31, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x6c, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x2c, 0x20, 0x46, 0x69, 0x66, 0x74, 0x68, 0x20, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x2c, 0x20, 0x42, 0x6f, 0x73, 0x74, 0x6f, 0x6e, 0x2c, 0x20, 0x4d, 0x41, 0x20, 0x20, 0x30, 0x32, 0x31, 0x31, 0x30, 0x2d, 0x31, 0x33, 0x30, 0x31, 0x20, 0x20, 0x55, 0x53, 0x41, 0x0a, 0x20, 0x45, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x69, 0x73, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x72, 0x62, 0x61, 0x74, 0x69, 0x6d, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x0a, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x50, 0x72, 0x65, 0x61, 0x6d, 0x62, 0x6c, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x73, 0x74, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x61, 0x77, 0x61, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x74, 0x2e, 0x20, 0x20, 0x42, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x73, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x0a, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x72, 0x65, 0x65, 0x0a, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2d, 0x2d, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x73, 0x75, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x69, 0x74, 0x73, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x0a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0a, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x27, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x77, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x0a, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x2e, 0x20, 0x20, 0x28, 0x53, 0x6f, 0x6d, 0x65, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x20, 0x62, 0x79, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x29, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x0a, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x2c, 0x20, 0x74, 0x6f, 0x6f, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x20, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2c, 0x20, 0x77, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2c, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x70, 0x72, 0x69, 0x63, 0x65, 0x2e, 0x20, 0x20, 0x4f, 0x75, 0x72, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x73, 0x75, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x28, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x73, 0x68, 0x29, 0x2c, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x67, 0x65, 0x74, 0x20, 0x69, 0x74, 0x0a, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x0a, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x3b, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x54, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2c, 0x20, 0x77, 0x65, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x0a, 0x61, 0x6e, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x6e, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x73, 0x6b, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x0a, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x20, 0x69, 0x74, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x67, 0x72, 0x61, 0x74, 0x69, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x66, 0x65, 0x65, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x67, 0x69, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x73, 0x75, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x79, 0x2c, 0x20, 0x74, 0x6f, 0x6f, 0x2c, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x67, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x20, 0x20, 0x41, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x0a, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x57, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x73, 0x74, 0x65, 0x70, 0x73, 0x3a, 0x20, 0x28, 0x31, 0x29, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x28, 0x32, 0x29, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x2c, 0x0a, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x41, 0x6c, 0x73, 0x6f, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x27, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x72, 0x73, 0x2c, 0x20, 0x77, 0x65, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x63, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x0a, 0x74, 0x68, 0x61, 0x74, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x0a, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x6f, 0x6e, 0x65, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x2c, 0x20, 0x77, 0x65, 0x0a, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x74, 0x73, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x2c, 0x20, 0x73, 0x6f, 0x0a, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x27, 0x20, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x72, 0x65, 0x61, 0x74, 0x65, 0x6e, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x62, 0x79, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0a, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x20, 0x77, 0x69, 0x73, 0x68, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x66, 0x72, 0x65, 0x65, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x6f, 0x62, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x65, 0x74, 0x61, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x54, 0x6f, 0x20, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x20, 0x77, 0x65, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x69, 0x74, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x27, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x0c, 0x0a, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x4c, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x0a, 0x20, 0x20, 0x20, 0x54, 0x45, 0x52, 0x4d, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x0a, 0x0a, 0x20, 0x20, 0x30, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x0a, 0x61, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x73, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x0a, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x22, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x22, 0x2c, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x22, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x22, 0x0a, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6c, 0x61, 0x77, 0x3a, 0x0a, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x61, 0x79, 0x2c, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x2c, 0x0a, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x76, 0x65, 0x72, 0x62, 0x61, 0x74, 0x69, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x20, 0x28, 0x48, 0x65, 0x72, 0x65, 0x69, 0x6e, 0x61, 0x66, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x20, 0x22, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x29, 0x20, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x22, 0x79, 0x6f, 0x75, 0x22, 0x2e, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x20, 0x69, 0x74, 0x73, 0x20, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x61, 0x63, 0x74, 0x20, 0x6f, 0x66, 0x0a, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x0a, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x69, 0x66, 0x20, 0x69, 0x74, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x28, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x68, 0x61, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x65, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x62, 0x79, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x29, 0x2e, 0x0a, 0x57, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x31, 0x2e, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x72, 0x62, 0x61, 0x74, 0x69, 0x6d, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x27, 0x73, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x61, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x69, 0x74, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x70, 0x69, 0x63, 0x75, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x20, 0x6f, 0x6e, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x3b, 0x20, 0x6b, 0x65, 0x65, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x3b, 0x0a, 0x61, 0x6e, 0x64, 0x20, 0x67, 0x69, 0x76, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a, 0x61, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, 0x0a, 0x0a, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x20, 0x61, 0x20, 0x66, 0x65, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x61, 0x63, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x66, 0x65, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x32, 0x2e, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x75, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x0a, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x6d, 0x65, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x29, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x72, 0x72, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x6e, 0x65, 0x6e, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x29, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2c, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x6f, 0x66, 0x2c, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x74, 0x20, 0x6e, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x69, 0x72, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x29, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x61, 0x64, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x75, 0x6e, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x69, 0x74, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x75, 0x63, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x77, 0x61, 0x79, 0x2c, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x2c, 0x20, 0x73, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x29, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x65, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x6f, 0x20, 0x76, 0x69, 0x65, 0x77, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x28, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x74, 0x73, 0x65, 0x6c, 0x66, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x29, 0x0a, 0x0c, 0x0a, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2c, 0x0a, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x62, 0x6c, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x20, 0x69, 0x6e, 0x0a, 0x74, 0x68, 0x65, 0x6d, 0x73, 0x65, 0x6c, 0x76, 0x65, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x74, 0x73, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x0a, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x61, 0x73, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2e, 0x20, 0x20, 0x42, 0x75, 0x74, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x73, 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x0a, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x77, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x65, 0x73, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x75, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x77, 0x72, 0x6f, 0x74, 0x65, 0x20, 0x69, 0x74, 0x2e, 0x0a, 0x0a, 0x54, 0x68, 0x75, 0x73, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x0a, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x62, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x3b, 0x20, 0x72, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x6f, 0x0a, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6f, 0x72, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, 0x0a, 0x0a, 0x49, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x6d, 0x65, 0x72, 0x65, 0x20, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x29, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x0a, 0x61, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x33, 0x2e, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x74, 0x2c, 0x0a, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x29, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x0a, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x32, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x64, 0x6f, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x29, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2d, 0x72, 0x65, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x32, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x61, 0x72, 0x69, 0x6c, 0x79, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3b, 0x20, 0x6f, 0x72, 0x2c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x29, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x74, 0x68, 0x72, 0x65, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x79, 0x65, 0x61, 0x72, 0x73, 0x2c, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x69, 0x76, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x74, 0x68, 0x69, 0x72, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x79, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x20, 0x6e, 0x6f, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2d, 0x72, 0x65, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x32, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x61, 0x72, 0x69, 0x6c, 0x79, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3b, 0x20, 0x6f, 0x72, 0x2c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x29, 0x20, 0x41, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x20, 0x20, 0x28, 0x54, 0x68, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x6e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x73, 0x75, 0x63, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x72, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x53, 0x75, 0x62, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x29, 0x0a, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x74, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x2c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x0a, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x2c, 0x20, 0x70, 0x6c, 0x75, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2c, 0x20, 0x70, 0x6c, 0x75, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x20, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x20, 0x61, 0x73, 0x20, 0x61, 0x0a, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x0a, 0x61, 0x6e, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x0a, 0x66, 0x6f, 0x72, 0x6d, 0x29, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x28, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x20, 0x6f, 0x6e, 0x29, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6f, 0x6e, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x72, 0x75, 0x6e, 0x73, 0x2c, 0x20, 0x75, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x0a, 0x69, 0x74, 0x73, 0x65, 0x6c, 0x66, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x0a, 0x49, 0x66, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x62, 0x79, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x20, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x73, 0x0a, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x74, 0x68, 0x69, 0x72, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x0a, 0x0c, 0x0a, 0x20, 0x20, 0x34, 0x2e, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x2c, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x2c, 0x20, 0x73, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x0a, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x61, 0x73, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x2c, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x2c, 0x20, 0x73, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2c, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x6f, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x73, 0x75, 0x63, 0x68, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x35, 0x2e, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x74, 0x2e, 0x20, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x20, 0x6e, 0x6f, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x20, 0x6f, 0x72, 0x0a, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x70, 0x72, 0x6f, 0x68, 0x69, 0x62, 0x69, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x6c, 0x61, 0x77, 0x20, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x2c, 0x20, 0x62, 0x79, 0x0a, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x29, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x6f, 0x20, 0x73, 0x6f, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x61, 0x6c, 0x6c, 0x20, 0x69, 0x74, 0x73, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6f, 0x72, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x74, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x36, 0x2e, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x29, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x2c, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, 0x0a, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x66, 0x75, 0x72, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x27, 0x20, 0x65, 0x78, 0x65, 0x72, 0x63, 0x69, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x68, 0x65, 0x72, 0x65, 0x69, 0x6e, 0x2e, 0x0a, 0x59, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x69, 0x72, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x37, 0x2e, 0x20, 0x49, 0x66, 0x2c, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x75, 0x72, 0x74, 0x20, 0x6a, 0x75, 0x64, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x0a, 0x69, 0x6e, 0x66, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x20, 0x28, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x29, 0x2c, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x28, 0x77, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x63, 0x6f, 0x75, 0x72, 0x74, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2c, 0x20, 0x61, 0x67, 0x72, 0x65, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x29, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x64, 0x69, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x65, 0x78, 0x63, 0x75, 0x73, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x0a, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x73, 0x6f, 0x20, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x79, 0x20, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x74, 0x61, 0x6e, 0x65, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x62, 0x6c, 0x69, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x62, 0x6c, 0x69, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x61, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x61, 0x20, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x20, 0x72, 0x6f, 0x79, 0x61, 0x6c, 0x74, 0x79, 0x2d, 0x66, 0x72, 0x65, 0x65, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x62, 0x79, 0x0a, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x79, 0x6f, 0x75, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x77, 0x61, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x79, 0x20, 0x62, 0x6f, 0x74, 0x68, 0x20, 0x69, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x74, 0x6f, 0x0a, 0x72, 0x65, 0x66, 0x72, 0x61, 0x69, 0x6e, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, 0x0a, 0x0a, 0x49, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x68, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x75, 0x6e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x0a, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x63, 0x69, 0x72, 0x63, 0x75, 0x6d, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x63, 0x69, 0x72, 0x63, 0x75, 0x6d, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x0a, 0x0a, 0x49, 0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x64, 0x75, 0x63, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x66, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x73, 0x75, 0x63, 0x68, 0x20, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x3b, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x0a, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x70, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x4d, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6d, 0x61, 0x64, 0x65, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x6f, 0x75, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x64, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x0a, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x3b, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x75, 0x70, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x2f, 0x64, 0x6f, 0x6e, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x63, 0x69, 0x64, 0x65, 0x20, 0x69, 0x66, 0x20, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x68, 0x65, 0x20, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x0a, 0x74, 0x6f, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x2e, 0x0a, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x6f, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x6c, 0x79, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x65, 0x76, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x0a, 0x62, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0c, 0x0a, 0x20, 0x20, 0x38, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x0a, 0x63, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x20, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x70, 0x61, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x79, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x77, 0x68, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x64, 0x64, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x20, 0x67, 0x65, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x0a, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6d, 0x6f, 0x6e, 0x67, 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x68, 0x75, 0x73, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x63, 0x61, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x69, 0x66, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x39, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x20, 0x72, 0x65, 0x76, 0x69, 0x73, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x53, 0x75, 0x63, 0x68, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x62, 0x65, 0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x70, 0x69, 0x72, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, 0x0a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x65, 0x72, 0x6e, 0x73, 0x2e, 0x0a, 0x0a, 0x45, 0x61, 0x63, 0x68, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x64, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x0a, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x61, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, 0x61, 0x6e, 0x79, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x0a, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x61, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x0a, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x76, 0x65, 0x72, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0a, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x31, 0x30, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x73, 0x68, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x65, 0x20, 0x70, 0x61, 0x72, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x66, 0x72, 0x65, 0x65, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x20, 0x77, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x0a, 0x74, 0x6f, 0x20, 0x61, 0x73, 0x6b, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x0a, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x20, 0x77, 0x65, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x0a, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x20, 0x20, 0x4f, 0x75, 0x72, 0x20, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x67, 0x75, 0x69, 0x64, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x67, 0x6f, 0x61, 0x6c, 0x73, 0x0a, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x6f, 0x75, 0x72, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x6c, 0x79, 0x2e, 0x0a, 0x0a, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x4f, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59, 0x0a, 0x0a, 0x20, 0x20, 0x31, 0x31, 0x2e, 0x20, 0x42, 0x45, 0x43, 0x41, 0x55, 0x53, 0x45, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x49, 0x53, 0x20, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x44, 0x20, 0x46, 0x52, 0x45, 0x45, 0x20, 0x4f, 0x46, 0x20, 0x43, 0x48, 0x41, 0x52, 0x47, 0x45, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x4e, 0x4f, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59, 0x0a, 0x46, 0x4f, 0x52, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x2c, 0x20, 0x54, 0x4f, 0x20, 0x54, 0x48, 0x45, 0x20, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x54, 0x20, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x20, 0x42, 0x59, 0x20, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x4c, 0x41, 0x57, 0x2e, 0x20, 0x20, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x20, 0x57, 0x48, 0x45, 0x4e, 0x0a, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x20, 0x53, 0x54, 0x41, 0x54, 0x45, 0x44, 0x20, 0x49, 0x4e, 0x20, 0x57, 0x52, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x2f, 0x4f, 0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x45, 0x53, 0x0a, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x57, 0x49, 0x54, 0x48, 0x4f, 0x55, 0x54, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x4b, 0x49, 0x4e, 0x44, 0x2c, 0x20, 0x45, 0x49, 0x54, 0x48, 0x45, 0x52, 0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x45, 0x44, 0x0a, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x0a, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20, 0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x2e, 0x20, 0x20, 0x54, 0x48, 0x45, 0x20, 0x45, 0x4e, 0x54, 0x49, 0x52, 0x45, 0x20, 0x52, 0x49, 0x53, 0x4b, 0x20, 0x41, 0x53, 0x0a, 0x54, 0x4f, 0x20, 0x54, 0x48, 0x45, 0x20, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x50, 0x45, 0x52, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x4e, 0x43, 0x45, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x49, 0x53, 0x20, 0x57, 0x49, 0x54, 0x48, 0x20, 0x59, 0x4f, 0x55, 0x2e, 0x20, 0x20, 0x53, 0x48, 0x4f, 0x55, 0x4c, 0x44, 0x20, 0x54, 0x48, 0x45, 0x0a, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x20, 0x44, 0x45, 0x46, 0x45, 0x43, 0x54, 0x49, 0x56, 0x45, 0x2c, 0x20, 0x59, 0x4f, 0x55, 0x20, 0x41, 0x53, 0x53, 0x55, 0x4d, 0x45, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x53, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x41, 0x4c, 0x4c, 0x20, 0x4e, 0x45, 0x43, 0x45, 0x53, 0x53, 0x41, 0x52, 0x59, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x49, 0x4e, 0x47, 0x2c, 0x0a, 0x52, 0x45, 0x50, 0x41, 0x49, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x31, 0x32, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x55, 0x4e, 0x4c, 0x45, 0x53, 0x53, 0x20, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x20, 0x42, 0x59, 0x20, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x4c, 0x41, 0x57, 0x20, 0x4f, 0x52, 0x20, 0x41, 0x47, 0x52, 0x45, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x20, 0x49, 0x4e, 0x20, 0x57, 0x52, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x0a, 0x57, 0x49, 0x4c, 0x4c, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x20, 0x50, 0x41, 0x52, 0x54, 0x59, 0x20, 0x57, 0x48, 0x4f, 0x20, 0x4d, 0x41, 0x59, 0x20, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x2f, 0x4f, 0x52, 0x0a, 0x52, 0x45, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x41, 0x53, 0x20, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x20, 0x41, 0x42, 0x4f, 0x56, 0x45, 0x2c, 0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x54, 0x4f, 0x20, 0x59, 0x4f, 0x55, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x2c, 0x0a, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x4c, 0x2c, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47, 0x0a, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4e, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x54, 0x4f, 0x20, 0x55, 0x53, 0x45, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x28, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x0a, 0x54, 0x4f, 0x20, 0x4c, 0x4f, 0x53, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x4f, 0x52, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x42, 0x45, 0x49, 0x4e, 0x47, 0x20, 0x52, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x45, 0x44, 0x20, 0x49, 0x4e, 0x41, 0x43, 0x43, 0x55, 0x52, 0x41, 0x54, 0x45, 0x20, 0x4f, 0x52, 0x20, 0x4c, 0x4f, 0x53, 0x53, 0x45, 0x53, 0x20, 0x53, 0x55, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x44, 0x20, 0x42, 0x59, 0x0a, 0x59, 0x4f, 0x55, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x48, 0x49, 0x52, 0x44, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x41, 0x20, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x54, 0x4f, 0x20, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x45, 0x20, 0x57, 0x49, 0x54, 0x48, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x0a, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x53, 0x29, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x48, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x20, 0x50, 0x41, 0x52, 0x54, 0x59, 0x20, 0x48, 0x41, 0x53, 0x20, 0x42, 0x45, 0x45, 0x4e, 0x20, 0x41, 0x44, 0x56, 0x49, 0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x0a, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x2e, 0x0a, 0x0a, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x4e, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x45, 0x52, 0x4d, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x0a, 0x0c, 0x0a, 0x09, 0x20, 0x20, 0x20, 0x20, 0x48, 0x6f, 0x77, 0x20, 0x74, 0x6f, 0x20, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x59, 0x6f, 0x75, 0x72, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x0a, 0x0a, 0x20, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x20, 0x61, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0x74, 0x0a, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x73, 0x74, 0x20, 0x77, 0x61, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x69, 0x74, 0x0a, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x54, 0x6f, 0x20, 0x64, 0x6f, 0x20, 0x73, 0x6f, 0x2c, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x20, 0x69, 0x73, 0x20, 0x73, 0x61, 0x66, 0x65, 0x73, 0x74, 0x0a, 0x74, 0x6f, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x73, 0x74, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x0a, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x3b, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x22, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20, 0x69, 0x73, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x6f, 0x6e, 0x65, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x69, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x27, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x62, 0x72, 0x69, 0x65, 0x66, 0x20, 0x69, 0x64, 0x65, 0x61, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x2e, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x43, 0x29, 0x20, 0x3c, 0x79, 0x65, 0x61, 0x72, 0x3e, 0x20, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x3e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x3b, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x69, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x2f, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x74, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x61, 0x73, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x20, 0x62, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x20, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x75, 0x74, 0x20, 0x57, 0x49, 0x54, 0x48, 0x4f, 0x55, 0x54, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59, 0x3b, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x20, 0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54, 0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x6f, 0x72, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20, 0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x2e, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x3b, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x2c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x72, 0x65, 0x65, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x2c, 0x20, 0x35, 0x31, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x6c, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x2c, 0x20, 0x46, 0x69, 0x66, 0x74, 0x68, 0x20, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x2c, 0x20, 0x42, 0x6f, 0x73, 0x74, 0x6f, 0x6e, 0x2c, 0x20, 0x4d, 0x41, 0x20, 0x20, 0x30, 0x32, 0x31, 0x31, 0x30, 0x2d, 0x31, 0x33, 0x30, 0x31, 0x20, 0x20, 0x55, 0x53, 0x41, 0x0a, 0x0a, 0x0a, 0x41, 0x6c, 0x73, 0x6f, 0x20, 0x61, 0x64, 0x64, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x62, 0x79, 0x20, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x6f, 0x6e, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x61, 0x70, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x0a, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2c, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x69, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x61, 0x20, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x69, 0x74, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x47, 0x6e, 0x6f, 0x6d, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x36, 0x39, 0x2c, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x43, 0x29, 0x20, 0x79, 0x65, 0x61, 0x72, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x47, 0x6e, 0x6f, 0x6d, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x41, 0x42, 0x53, 0x4f, 0x4c, 0x55, 0x54, 0x45, 0x4c, 0x59, 0x20, 0x4e, 0x4f, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59, 0x3b, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x77, 0x27, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x61, 0x72, 0x65, 0x20, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x69, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x63, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x63, 0x27, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x0a, 0x0a, 0x54, 0x68, 0x65, 0x20, 0x68, 0x79, 0x70, 0x6f, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x77, 0x27, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x63, 0x27, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x20, 0x20, 0x4f, 0x66, 0x20, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6d, 0x61, 0x79, 0x0a, 0x62, 0x65, 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x77, 0x27, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x60, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x63, 0x27, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x62, 0x65, 0x0a, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x2d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x6e, 0x75, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2d, 0x2d, 0x77, 0x68, 0x61, 0x74, 0x65, 0x76, 0x65, 0x72, 0x20, 0x73, 0x75, 0x69, 0x74, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, 0x0a, 0x0a, 0x59, 0x6f, 0x75, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x65, 0x6d, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x20, 0x28, 0x69, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x0a, 0x73, 0x63, 0x68, 0x6f, 0x6f, 0x6c, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x2c, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x61, 0x20, 0x22, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x22, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2c, 0x20, 0x69, 0x66, 0x0a, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x48, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3b, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x59, 0x6f, 0x79, 0x6f, 0x64, 0x79, 0x6e, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x2c, 0x20, 0x68, 0x65, 0x72, 0x65, 0x62, 0x79, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x0a, 0x20, 0x20, 0x60, 0x47, 0x6e, 0x6f, 0x6d, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x27, 0x20, 0x28, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x73, 0x20, 0x70, 0x61, 0x73, 0x73, 0x65, 0x73, 0x20, 0x61, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x29, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x62, 0x79, 0x20, 0x4a, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x48, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x54, 0x79, 0x20, 0x43, 0x6f, 0x6f, 0x6e, 0x3e, 0x2c, 0x20, 0x31, 0x20, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x20, 0x31, 0x39, 0x38, 0x39, 0x0a, 0x20, 0x20, 0x54, 0x79, 0x20, 0x43, 0x6f, 0x6f, 0x6e, 0x2c, 0x20, 0x50, 0x72, 0x65, 0x73, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x56, 0x69, 0x63, 0x65, 0x0a, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x65, 0x74, 0x61, 0x72, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x75, 0x62, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x20, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2c, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x20, 0x69, 0x74, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x65, 0x74, 0x61, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x6f, 0x2c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x4e, 0x55, 0x20, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x0a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x00 }; xscorch-0.2.1/sgame/shelpdata.h0000644000175000001440000000220511175116134013311 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/shelpdata.h,v 1.4 2009-04-26 17:39:40 jacob Exp $ */ /* xscorch - shelpdata.h Copyright(c) 2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched simple help system This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __shelpdata_h_included #define __shelpdata_h_included #include extern const char data_xscorch_txt[]; extern const char data_xscorch_man[]; extern const char data_copying_txt[]; #endif /* __shelp_h_included */ xscorch-0.2.1/sgame/sinfo.c0000644000175000001440000000210611175116134012455 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sinfo.c,v 1.6 2009-04-26 17:39:40 jacob Exp $ */ /* xscorch - sinfo.c Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched information This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include void sc_info(void) { printf("XScorch version " VERSION "\n" SC_COPYRIGHT_NOTICE "See the Help menu for the license and a list of contributors.\n"); } xscorch-0.2.1/sgame/sinfo.h0000644000175000001440000000334411206357510012467 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sinfo.h,v 1.10 2009-05-24 23:59:04 jacob Exp $ */ /* xscorch - sinfo.h Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched information header This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sinfo_h_included #define __sinfo_h_included #include /* Copyright notice -- Principle maintainers of this program. */ #define SC_COPYRIGHT_NOTICE \ "Copyright(c) 2000-2004 Justin David Smith\n"\ "Copyright(c) 2000-2009 Jacob Luna Lundberg\n"\ "Licensed under the GNU General Public License, version 2\n"\ /* Contributors notice -- Add your name to the contributors list if you make changes that you have copyrighted. */ #define SC_CONTRIBUTORS_NOTICE \ "Matti Hänninen - land generation, (c)2000\n"\ "Jason House - shielding, economy file, etc, (c)2003\n"\ "Jake Post - plasma fractals, debugging, (c)2000-2003\n"\ "Nickolai Zeldovich - random player locations, (c)2000\n"\ void sc_info(void); #endif /* __sinfo_h_included */ xscorch-0.2.1/sgame/sinventory.c0000644000175000001440000002314711615366345013601 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sinventory.c,v 1.20 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sinventory.c Copyright(c) 2001,2000 Justin David Smith Copyright(c) 2001 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched Player inventory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include static int _sc_inventory_quantity(int current, int bundlesize) { /* sc_inventory_quantity Determine the number of items the user can purchase of this item. */ if(current + bundlesize <= SC_INVENTORY_MAX_ITEMS) { /* User can buy an entire bundle. */ return(bundlesize); } else { /* User can only purchase part of the bundle. */ return(SC_INVENTORY_MAX_ITEMS - current); } /* Did we break a bundle? */ } static int _sc_inventory_purchase_price(const sc_inventory_info *info, int quantity) { /* sc_inventory_purchase_price Price required to purchase this item. */ int unitprice; /* Cost of a single item. */ if(quantity < info->bundle) { /* Bundle was split up; implement a markup. */ unitprice = info->price / info->bundle; return(unitprice * quantity * SC_ECONOMY_SPLIT_MARKUP); } else { /* Bundle not split; return full price. */ return(info->price); } } static int _sc_inventory_sale_price(const sc_inventory_info *info, int quantity) { /* sc_inventory_sale_price Price required to sell this item. */ int unitprice; /* Cost of a single item. */ if(quantity < info->bundle) { /* Bundle is partial. */ unitprice = info->price / info->bundle; return(unitprice * quantity * SC_ECONOMY_SELL_MARKUP); } else { /* Bundle complete; still markdown a bit */ return(info->price * SC_ECONOMY_SELL_MARKUP); } } bool sc_inventory_can_buy_weapon(const sc_player *p, const sc_weapon_info *info, int budget) { /* sc_inventory_can_buy_weapon Determine if this player can buy the specified weapon. Returns true if the purchase can be made. Budget is the amount of money allocated for the purchase, or may be -1 (player's total resources will be allowed into the calculation). */ int count; /* Number of weapons to buy */ int cost; /* Total cost to buy */ /* Does the weapon exist? */ if(info == NULL) return(false); /* Are we maxed out on inventory? */ count = _sc_inventory_quantity(info->inventories[p->index], info->bundle); if(count == 0) return(false); /* Can we afford the weapon? */ cost = _sc_inventory_purchase_price((sc_inventory_info *)info, count); if(cost > p->money) return(false); /* Is the weapon within our budget? */ if(budget >= 0 && cost > budget) return(false); /* We can make this purchase. */ return(true); } bool sc_inventory_buy_weapon(sc_player *p, sc_weapon_info *info) { /* sc_inventory_buy_weapon Buys the specified weapon. Returns true if the purchase was successful. */ int count; /* Number of weapons to buy */ int cost; /* Total cost to buy */ /* Can we buy this weapon? */ if(!sc_inventory_can_buy_weapon(p, info, SC_INVENTORY_INFINITE)) return(false); /* Get weapon purchase information.. */ count = _sc_inventory_quantity(info->inventories[p->index], info->bundle); cost = _sc_inventory_purchase_price((sc_inventory_info *)info, count); /* Make the purchase */ info->inventories[p->index] += count; p->money -= cost; /* Return success. */ return(true); } bool sc_inventory_can_buy_accessory(const sc_player *p, const sc_accessory_info *info, int budget) { /* sc_inventory_can_buy_accessory Determine if this player can buy the specified accessory. Returns true if the purchase can be made. Budget is the amount of money allocated for the purchase, or may be -1 (player's total resources will be allowed into the calculation). */ int count; /* Number of accessories to buy */ int cost; /* Total cost to buy */ /* Does the accessory exist? */ if(info == NULL) return(false); /* Is the accessory a one-time buy we already own? */ if(SC_ACCESSORY_IS_PERMANENT(info) && info->inventories[p->index] > 0) return(false); /* Are we maxed out on inventory? */ count = _sc_inventory_quantity(info->inventories[p->index], info->bundle); if(count == 0) return(false); /* Can we afford the accessory? */ cost = _sc_inventory_purchase_price((sc_inventory_info *)info, count); if(cost > p->money) return(false); /* Is the accessory in our budget? */ if(budget >= 0 && cost > budget) return(false); /* We can make this purchase. */ return(true); } bool sc_inventory_buy_accessory(sc_player *p, sc_accessory_info *info) { /* sc_inventory_buy_accessory Buys the specified accessory. Returns true if the purchase was successful. */ int count; /* Number of accessories to buy */ int cost; /* Total cost to buy */ /* Can we buy this accessory? */ if(!sc_inventory_can_buy_accessory(p, info, SC_INVENTORY_INFINITE)) return(false); /* Get accessory purchase information.. */ count = _sc_inventory_quantity(info->inventories[p->index], info->bundle); cost = _sc_inventory_purchase_price((sc_inventory_info *)info, count); /* Make the purchase */ info->inventories[p->index] += count; p->money -= cost; /* Add any attributes granted by the accessory. */ p->ac_state |= info->state; /* Return success. */ return(true); } bool sc_inventory_can_sell_weapon(const sc_player *p, const sc_weapon_info *info) { /* sc_inventory_can_sell_weapon Determine if this player can sell the specified weapon. Returns true if the sale can be made. */ /* Does the weapon exist? */ if(info == NULL) return(false); /* Are we min'd out on inventory? */ if(info->inventories[p->index] <= 0) return(false); /* Is the weapon infinite? */ if(SC_WEAPON_IS_INFINITE(info)) return(false); /* We can make this transaction. */ return(true); } bool sc_inventory_sell_weapon(sc_player *p, sc_weapon_info *info) { /* sc_inventory_sell_weapon Sells the specified weapon. Returns true if the transaction was successful. */ int count; /* Number of weapons to buy */ int cost; /* Total cost to buy */ /* Can we sell this weapon? */ if(!sc_inventory_can_sell_weapon(p, info)) return(false); /* Get weapon sale information.. */ count = info->inventories[p->index]; if(count > info->bundle) count = info->bundle; cost = _sc_inventory_sale_price((sc_inventory_info *)info, count); /* Sell the item */ info->inventories[p->index] -= count; p->money += cost; /* Return success. */ return(true); } bool sc_inventory_can_sell_accessory(const sc_player *p, const sc_accessory_info *info) { /* sc_inventory_can_sell_accessory Determine if this player can sell the specified accessory. Returns true if the sale can be made. */ /* Does the accessory exist? */ if(info == NULL) return(false); /* Are we min'd out on inventory? */ if(info->inventories[p->index] <= 0) return(false); /* Is the accessory infinite? */ if(SC_ACCESSORY_IS_INFINITE(info)) return(false); /* We can make this transaction. */ return(true); } bool sc_inventory_sell_accessory(sc_player *p, sc_accessory_info *info) { /* sc_inventory_sell_accessory Sells the specified accessory. Returns true if the transaction was successful. */ int count; /* Number of accessories to buy */ int cost; /* Total cost to buy */ /* Can we sell this accessory? */ if(!sc_inventory_can_sell_accessory(p, info)) return(false); /* Get accessory sale information.. */ count = info->inventories[p->index]; if(count > info->bundle) count = info->bundle; cost = _sc_inventory_sale_price((sc_inventory_info *)info, count); /* TEMP HACK - This strips benefit unconditionally, and if another accessory also grants it, too bad. Fix it! - JL NOTE - Thinking on this more, what will likely need to be done is loop though the accessories and look for any others that grant any of the same bits and then re- grant those bits in the state int. hmm - JL */ /* Remove any attributes granted by the accessory. */ p->ac_state &= ~info->state; /* Sell the item */ info->inventories[p->index] -= count; p->money += cost; /* Return success. */ return(true); } bool sc_inventory_award_weapon(sc_weapon_info *info, int player) { /* sc_inventory_award_weapon Give a player what he can take of a weapon for free. */ int quantity; if(info == NULL) return(false); /* Find out how many to award. */ quantity = _sc_inventory_quantity(info->inventories[player], info->bundle); if(quantity <= 0) return(false); /* Make the award. */ info->inventories[player] += quantity; return(true); } xscorch-0.2.1/sgame/sinventory.h0000644000175000001440000000605311615366345013603 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sinventory.h,v 1.22 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sinventory.h Copyright(c) 2000 Justin David Smith Copyright(c) 2001 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched player inventory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sinventory_h_included #define __sinventory_h_included #include #include #include /* Forward structures */ struct _sc_player; struct _sc_config; /* Maximum number of items allowed */ #define SC_INVENTORY_MAX_ITEMS 99 #define SC_INVENTORY_INFINITE -1 /* String buffering constants. */ #define SC_INVENTORY_MAX_NAME_LEN 20 #define SC_INVENTORY_MAX_DESC_LEN 80 /* Inventory hashing */ #define SC_INVENTORY_HASH_BITS 10 /* Must be smaller than bits in int */ #define SC_INVENTORY_HASH_SIZE (1 << SC_INVENTORY_HASH_BITS) /* duh ... */ /* Other inventory information */ #define SC_INVENTORY_CHEAPO_FACTOR 1000 /* Free stuff must be worthless, right? */ /* TEMP -- Can/should we get rid of this? -JL -- Inventory information */ typedef struct _sc_inventory_info { /* DO NOT CHANGE the order */ int ident; /* Item identifier (uniq. within item class) */ int armslevel; /* Arms level for this item */ int price; /* Cost of this items, per bundle */ int bundle; /* Number of items in a bundle */ } sc_inventory_info; /* Inventory queries */ bool sc_inventory_can_buy_weapon(const struct _sc_player *p, const sc_weapon_info *info, int budget); bool sc_inventory_can_buy_accessory(const struct _sc_player *p, const sc_accessory_info *info, int budget); bool sc_inventory_can_sell_weapon(const struct _sc_player *p, const sc_weapon_info *info); bool sc_inventory_can_sell_accessory(const struct _sc_player *p, const sc_accessory_info *info); /* Inventory purchases */ bool sc_inventory_buy_weapon(struct _sc_player *p, sc_weapon_info *info); bool sc_inventory_buy_accessory(struct _sc_player *p, sc_accessory_info *info); bool sc_inventory_sell_weapon(struct _sc_player *p, sc_weapon_info *info); bool sc_inventory_sell_accessory(struct _sc_player *p, sc_accessory_info *info); bool sc_inventory_award_weapon(sc_weapon_info *info, int player); #endif /* __sinventory_h_included */ xscorch-0.2.1/sgame/sland.c0000644000175000001440000013113211615317377012455 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sland.c,v 1.16 2011-07-31 18:29:19 jacob Exp $ */ /* xscorch - sland.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched Player land generation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include sc_land *sc_land_new(int width, int height, int flags) { /* sc_land_new Setup a new landscape. This function allocates a new land structure and initialises it with the flags and size given. This function does not attempt to initialise the land; you must call sc_land_generate() yourself to create the land. This function returns NULL if an error occurred. */ sc_land *l; /* The newly allocated landscape, on success. */ /* Allocate land pointer */ l = (sc_land *)malloc(sizeof(sc_land)); if(l == NULL) return(NULL); /* Setup the screens */ l->screen = NULL; if(!sc_land_setup(l, width, height, flags)) { free(l); return(NULL); } /* Setup default land generation options */ l->sky = SC_SKY_NIGHT; l->hostileenv = false; l->bumpiness = SC_LAND_BUMPINESS_DEF; l->generator = SC_LAND_GEN_TRADITIONAL; /* Return the land structure */ return(l); } bool sc_land_setup(sc_land *l, int width, int height, int flags) { /* sc_land_setup Changes the size and flags of the land structure. This function returns true on success, or false if something went wrong. It should be assumed that the screen is uninitialised after this call. */ /* Assert the params given are valid */ if(l == NULL || width <= 0 || height <= 0) return(false); /* Setup the new landscape */ l->width = width; l->height = height; l->flags = flags; l->screen = (int *)realloc(l->screen, width * height * sizeof(int)); /* Make sure the new screen is valid. */ return(l->screen != NULL); } void sc_land_free(sc_land **l) { /* sc_land_free Release a landscape structure, and the associated screens. */ if(l == NULL || *l == NULL) return; free((*l)->screen); free(*l); *l = NULL; } bool sc_land_generate(const sc_config *c, sc_land *l) { /* sc_land_generate Generate a new landscape. The land is generated based on definitions in the configuration structure given, and is created using the profile generators. If true is returned, then the land has been successfully generated. If false is returned, the screen is still uninitialised. */ /* Land profile variables */ double unit_x; /* Column's x-coordinate within unit interval */ /* Other variables */ const int *gnd; /* Ground indices for gradient */ const int *sky; /* Sky indices for gradient */ int skyflag; /* Sky type flag */ int *lpointer; /* Pointer into the screen. */ int nearly_there; /* Current land height minus zero to two pixels */ double height; /* Current land height (Y) */ bool dither; /* Enable dithering? */ int fheight; /* Land height */ int width; /* Land width */ int x; /* Current column */ int y; /* Iterator down column */ /* Sanity checks */ if(c == NULL || l == NULL) return(false); /* Initialise landscapes */ /* JS: This must be called whenever land is generated, because it generates random data. Random tables will be out-of-sync if this is called before network setup!!! */ sc_lscape_init(); /* Setup random sky if needed */ if(l->sky == SC_SKY_RANDOM) l->realsky = game_lrand(SC_SKY_RANDOM); else l->realsky = l->sky; /* Setup ground and sky */ gnd = c->colors->gradindex[SC_GRAD_GROUND]; sky = sc_land_sky_index(c); skyflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; /* Create a profile for the landscape */ sc_lscape_setup(c, l); /* Okay, here we go ... */ fheight = l->height; width = l->width; x = width; lpointer = SC_LAND_ORIGIN(l); while(x > 0) { /* current column's x-coordinate within the unit interval and evaluate the profile function at that point. */ unit_x = (double)x / width; height = sc_lscape_eval(unit_x) * c->maxheight; nearly_there = (int)height - 2; /* Sanity checks */ if(nearly_there > fheight) nearly_there = fheight; if(height > fheight) height = fheight; /* Start at the base of the hill, and fill in ground until we reach height. The remaining part of the column should be filled in with the current sky. */ y = 0; while(y < nearly_there) { *lpointer = SC_LAND_GROUND | sc_color_gradient_index(dither, gnd, y); ++lpointer; ++y; } /* MH: Draw a thin rind in slightly different colour */ while(y < height) { *lpointer = SC_LAND_GROUND | sc_color_gradient_index(dither, gnd, 0); ++lpointer; ++y; } /* Creating ground.. */ while(y < fheight) { *lpointer = skyflag | sc_color_gradient_index(dither, sky, y); ++lpointer; ++y; } /* Creating sky.. */ /* Next column */ --x; } /* Iterating through each column */ return(true); } int sc_land_flags(const sc_config *c) { /* sc_land_flags Return the land flags appropriate for the physics model given. */ sc_physics_walls walls; if(c == NULL) return(SC_LAND_DEFAULTS); walls = c->physics->walls; if(walls == SC_WALL_RANDOM) walls = game_lrand(SC_WALL_RANDOM); switch(c->physics->walls) { case SC_WALL_NONE: return(SC_LAND_DEFAULTS); case SC_WALL_WRAP: return(SC_LAND_WRAP_X); default: return(SC_LAND_WALL_X | SC_LAND_CEILING); } /* End switch */ } static inline bool _sc_land_translate_x(const sc_land *l, int *x) { /* _sc_land_translate_x Translates the X coordinate indicated. This will translate, taking into consideration the wall types. It will return true if the coordinate could be translated to a "proper" value (or if the coordinate was off-screen on an unbounded boundary), caution the coordinate may NOT necessarily be in-bounds. The function returns false if the coordinate could not be translated (coordinate was inside a wall), in which case X is set to the nearest valid X coordinate. */ /* TEMP NOTE - The above documentation is INCORRECT. The weapon WILL be in-bounds if the returned value is true. If the coordinate is off- screen, false will be returned. This needs audited and updated docs. */ /* NOTE: changes to this code should also be made to the double code! */ if(l->flags & SC_LAND_WRAP_X) { /* X boundaries wrap-around */ while(*x >= l->width) *x -= l->width; while(*x < 0) *x += l->width; return(true); } else if(l->flags & SC_LAND_WALL_X) { /* X boundaries are solid walls */ if(*x >= l->width) { *x = l->width - 1; return(false); } else if(*x < 0) { *x = 0; return(false); } /* Is coordinate out-of-bounds? */ return(true); } else { /* No boundaries at all. */ if(*x >= l->width) return(false); if(*x < 0) return(false); return(true); } /* What is X boundary? */ } static inline bool _sc_land_translate_x_d(const sc_land *l, double *x) { /* _sc_land_translate_x_d This function is identical to above, but uses doubles. */ /* NOTE: changes to this code should also be made to the int code! */ if(l->flags & SC_LAND_WRAP_X) { /* X boundaries wrap-around */ while(*x >= l->width) *x -= l->width; while(*x < 0) *x += l->width; return(true); } else if(l->flags & SC_LAND_WALL_X) { /* X boundaries are solid walls */ if(*x >= l->width) { *x = l->width - 1; return(false); } else if(*x < 0) { *x = 0; return(false); } /* Is coordinate out-of-bounds? */ return(true); } else { /* No boundaries at all. */ if(*x >= l->width) return(false); if(*x < 0) return(false); return(true); } /* What is X boundary? */ } bool sc_land_translate_x(const sc_land *l, int *x) { /* sc_land_translate_x Public interface to above, with sanity checks. */ if(l == NULL || x == NULL) return(false); return(_sc_land_translate_x(l, x)); } bool sc_land_translate_x_d(const sc_land *l, double *x) { /* sc_land_translate_x_d Public interface to above, with sanity checks. */ if(l == NULL || x == NULL) return(false); return(_sc_land_translate_x_d(l, x)); } static inline bool _sc_land_translate_y(const sc_land *l, int *y) { /* _sc_land_translate_y Translates the Y coordinate indicated. This will translate, taking into consideration the wall types. It will return true if the coordinate could be translated to a "proper" value (or if the coordinate was off-screen on an unbounded boundary), caution the coordinate may NOT necessarily be in-bounds. The function returns false if the coordinate could not be translated (coordinate was inside a wall), in which case X is set to the nearest valid Y coordinate. */ /* TEMP NOTE - The above documentation is INCORRECT. The weapon WILL be in-bounds if the returned value is true. If the coordinate is off- screen, false will be returned. This needs audited and updated docs. */ /* NOTE: changes to this code should also be made to the double code! */ if(l->flags & SC_LAND_CEILING) { /* Land has a ceiling */ if(*y >= l->height) { *y = l->height - 1; return(false); } else if(*y < 0) { *y = 0; return(false); } /* Is Y invalid? */ return(true); } else { /* Open skies */ if(*y < 0) { *y = 0; return(false); } else if(*y >= l->height) { return(false); } /* Is Y invalid? */ return(true); } /* End of switch */ } static inline bool _sc_land_translate_y_d(const sc_land *l, double *y) { /* _sc_land_translate_y_d This function is identical to above, but uses doubles. */ /* NOTE: changes to this code should also be made to the int code! */ if(l->flags & SC_LAND_CEILING) { /* Land has a ceiling */ if(*y >= l->height) { *y = l->height - 1; return(false); } else if(*y < 0) { *y = 0; return(false); } /* Is Y invalid? */ return(true); } else { /* Open skies */ if(*y < 0) { *y = 0; return(false); } else if(*y >= l->height) { return(false); } /* Is Y invalid? */ return(true); } /* End of switch */ } bool sc_land_translate_y(const sc_land *l, int *y) { /* sc_land_translate_y Public interface to above, with sanity checks. */ if(l == NULL || y == NULL) return(false); return(_sc_land_translate_y(l, y)); } bool sc_land_translate_y_d(const sc_land *l, double *y) { /* sc_land_translate_y_d Public interface to above, with sanity checks. */ if(l == NULL || y == NULL) return(false); return(_sc_land_translate_y_d(l, y)); } bool sc_land_translate_xy(const sc_land *l, int *x, int *y) { /* sc_land_translate_xy Translate an x/y coordinate. */ return(sc_land_translate_x(l, x) && sc_land_translate_y(l, y)); } bool sc_land_translate_xy_d(const sc_land *l, double *x, double *y) { /* sc_land_translate_xy_d Translate an x/y coordinate. */ return(sc_land_translate_x_d(l, x) && sc_land_translate_y_d(l, y)); } bool sc_land_overlap_x(const sc_land *l, int *x1, int *x2) { /* _sc_land_overlap_x Determines if the X range described by [x1, x2] would overlap a wrapping boundary. This function behaves rather oddly; usually the center of the interval was a valid real coordinate, and x1, x2 are obtained by calculating some fixed offset from that valid real coordinate. If an overlap on a boundary is detected, then the interval is modified to indicate the interval that was `wrapped', i.e. the interval part that was excluded because it was not in the valid real range. False is returned if the boundaries aren't wrapping, or if no translation is required (x1, x2 are in the valid range for real coordinates. This function may have odd semantics if at least one of the coordinates was not anchored in the valid real range. The semantics should probably be documented better than this. This is primarily used to determine the range of update for drawing functions, where the semantics are odd but understood. CAUTION: the interval must not be wider than the screen. CAUTION: at least part of the interval must be valid real coords. You probably only want to give this function intervals that have been through the sc_land_translate_x_range() function, first!!! */ /* Sanity check */ if(l == NULL || x1 == NULL || x2 == NULL) return(false); if(l->flags & SC_LAND_WRAP_X) { /* X boundaries wrap-around */ if(*x1 < 0) { /* Wrap on -x side, return interval part that was truncated because it wrapped to the right-hand-side */ *x1 += l->width; *x2 = l->width - 1; return(true); } else if(*x2 >= l->width) { /* Wrap on +x side, return interval part that was truncated because it wrapped to the left-hand-side */ *x2 -= l->width; *x1 = 0; return(true); } } return(false); } bool sc_land_translate_x_range(const sc_land *l, int *x1, int *x2) { /* _sc_land_translate_x_range Translates a range of virtual X coordinates s.t. at least part of the range is in the real coordinate space. On bounded rooms, the interval will be truncated to the part that is inside the bound, true is returned if the result is nonempty. On wraparound rooms, the interval is adjusted so that at least part of it is in the real coordinate range -- in this case, you will need to run sc_land_overlap_x() to see if part of the interval is truncated by the wrapping boundary (and get that part translated). True is again, returned if the resulting interval is non- empty. The interval is considered empty if x1 > x2. */ /* Sanity check */ if(l == NULL || x1 == NULL || x2 == NULL) return(false); /* Interval is empty if x1 > x2. */ if(*x1 > *x2) return(false); if(l->flags & SC_LAND_WRAP_X) { /* X boundaries wrap-around */ while(*x1 >= l->width) { /* Adjust so x2 is in real */ *x2 -= l->width; *x1 -= l->width; } while(*x2 < 0) { /* Adjust so x1 is in real */ *x1 += l->width; *x2 += l->width; } /* Return success */ return(true); } else { /* Bounded; truncate as needed */ if(*x2 >= l->width) *x2 = l->width - 1; if(*x1 >= l->width) return(false); if(*x2 < 0) return(false); if(*x1 < 0) *x1 = 0; return(true); } } bool sc_land_calculate_deltas(const sc_land *l, int *deltax, int *deltay, int x1, int y1, int x2, int y2) { /* sc_land_calculate_deltas Calculates the short-path deltaX, deltaY between two virtual coordinates, taking boundaries into effect. This fixes issues with delta calculation that arise when wrapping boundaries are used. In all other cases, the delta calculated is the expected delta after the coordinates are translated to real coordinates (so the screen delta, in effect). Returns false if the translations failed for some reason. If x2 > x1, then dx will be positive. CAUTION: This function does NOT concern itself with points that are out-of-bounds, this is to allow explosions centered off the screen to work properly. As a result, if translation fails, then success still occurs! */ /* NOTE: changes to this code should also be made to the double code. */ int dx; /* Normal DX */ int dy; /* Normal DY */ int d2x; /* Alternate DX */ /* Sanity check */ if(l == NULL) return(false); /* translate the coordinates */ _sc_land_translate_x(l, &x1); _sc_land_translate_x(l, &x2); _sc_land_translate_y(l, &y1); _sc_land_translate_y(l, &y2); /* Calculate the `normal' deltas */ dx = x2 - x1; dy = y2 - y1; /* If land is wrapping, then calculate an alternate */ if(l->flags & SC_LAND_WRAP_X) { d2x = dx + l->width; if(abs(d2x) < abs(dx)) dx = d2x; } /* Set pointers and return success. */ if(deltax != NULL) *deltax = dx; if(deltay != NULL) *deltay = dy; return(true); } bool sc_land_calculate_deltas_d(const sc_land *l, double *deltax, double *deltay, double x1, double y1, double x2, double y2) { /* sc_land_calculate_deltas_d Same as above, but uses double values. */ /* NOTE: changes to this code should also be made to the double code. */ double dx; /* Normal DX */ double dy; /* Normal DY */ double d2x; /* Alternate DX */ /* Sanity check */ if(l == NULL) return(false); /* translate the coordinates */ _sc_land_translate_x_d(l, &x1); _sc_land_translate_x_d(l, &x2); _sc_land_translate_y_d(l, &y1); _sc_land_translate_y_d(l, &y2); /* Calculate the `normal' deltas */ dx = x2 - x1; dy = y2 - y1; /* If land is wrapping, then calculate an alternate */ if(l->flags & SC_LAND_WRAP_X) { d2x = dx + l->width; if(fabs(d2x) < fabs(dx)) dx = d2x; } /* Set pointers and return success. */ if(deltax != NULL) *deltax = dx; if(deltay != NULL) *deltay = dy; return(true); } static inline int _sc_land_height(const sc_land *l, int x, int y0) { /* sc_land_height This is an internal function that assumes x, y0 are real coordiantes. This function will return a maximum of y0; if you want to scan the entire range, give the screen height for y0. */ const int *lp; /* Pointer into land structure. */ /* Get the land pointer for this column. */ lp = SC_LAND_XY(l, x, y0); while(y0 > 0) { if(!SC_LAND_IS_SKY(*lp)) return(y0 + 1); --lp; --y0; } /* End translation valid? */ /* No land here; we hit the ground. */ return(0); } int sc_land_height(const sc_land *l, int x, int y0) { /* sc_land_height This function returns the height of the land in virtual column x. The height of the lowest non-land pixel will be returned by this function. This function only considers land below and at the height y0, so the range of return values is from 0 to y0 + 1. To check the height of an entire column, give the screen height for y0. Caution: y0 is a height, not a virtual coordinate. */ /* Sanity check */ if(l == NULL) return(0); /* Make sure the height is properly bounded. */ if(y0 >= l->height) y0 = l->height - 1; /* translate the X coordinate to a real coordinate. */ if(!_sc_land_translate_x(l, &x)) return(0); return(_sc_land_height(l, x, y0)); } int sc_land_height_around(const sc_land *l, int x, int y0, int w) { /* sc_land_height_around This function returns the maximum land height (see sc_land_height), for virtual x coordinates in the interval [x - w, x + w]. */ int height; /* Maximum height of land found */ int ch; /* Height of current column */ int cx; /* Current X coordinate (translated) */ int x1; /* First virtual X to check */ int x2; /* Last virtual X to check */ /* Sanity check */ if(l == NULL) return(0); /* Calculate the virtual interval */ x1 = x - w; x2 = x + w; /* Make sure the maximum height is bounded */ if(y0 >= l->height) y0 = l->height - 1; /* Start searching... */ height = 0; for(x = x1; x <= x2; ++x) { /* Attempt to translate X to a real coordinate */ cx = x; if(_sc_land_translate_x(l, &cx)) { /* Check the height for this column */ ch = _sc_land_height(l, cx, y0); if(ch > height) height = ch; } /* End translation valid? */ } /* End loop through interval */ /* Return the maximum height found. */ return(height); } int sc_land_min_height_around(const sc_land *l, int x, int y0, int w) { /* sc_land_min_height_around Returns the MINIMUM height around an interval. Similar to the above function in approach. */ int height; /* Maximum height of land found */ int ch; /* Height of current column */ int cx; /* Current X coordinate (translated) */ int x1; /* First virtual X to check */ int x2; /* Last virtual X to check */ /* Sanity check */ if(l == NULL) return(0); /* Calculate the virtual interval */ x1 = x - w; x2 = x + w; /* Make sure the maximum height is bounded */ if(y0 >= l->height) y0 = l->height - 1; /* Start searching... */ height = 0; for(x = x1; x <= x2; ++x) { /* Attempt to translate X to a real coordinate */ cx = x; if(_sc_land_translate_x(l, &cx)) { /* Check the height for this column */ ch = _sc_land_height(l, cx, y0); if(ch < height) height = ch; } /* End translation valid? */ } /* End loop through interval */ /* Return the minimum height found. */ return(height); } int sc_land_avg_height_around(const sc_land *l, int x, int y0, int w) { /* sc_land_avg_height_around Returns the average height of the land over a virtual interval. Similar to the previous two functions in approach. */ int count; /* Number of heights found */ int sum; /* Sum of heights found */ int cx; /* Current X coordinate (translated) */ int x1; /* First virtual X to check */ int x2; /* Last virtual X to check */ /* Sanity check */ if(l == NULL) return(0); /* Calculate the virtual interval */ x1 = x - w; x2 = x + w; /* Make sure the maximum height is bounded */ if(y0 >= l->height) y0 = l->height - 1; /* Start searching... */ sum = 0; count = 0; for(x = x1; x <= x2; ++x) { /* Attempt to translate X to a real coordinate */ cx = x; if(_sc_land_translate_x(l, &cx)) { /* Add the height for this column */ sum += _sc_land_height(l, cx, y0); ++count; } /* End translation valid? */ } /* End loop through interval */ /* Return the average of heights found. */ return(sum / count); } static inline void _sc_land_level(const sc_config *c, sc_land *l, int x, int ht) { /* sc_land_level Internal function to level a column of land to the specified height. Caution, X is a real coordinate in this funciton, no sanity checks run. */ const int *gnd; /* Ground indices for gradient */ const int *sky; /* Sky indices for gradient */ int skyflag; /* Sky type flag */ bool dither; /* Enable dithering? */ int *lp; /* Iterate through land */ int height; /* Current height */ /* Set the current height to screen height */ height = l->height - 1; /* Obtain the gradients we will be using */ gnd = c->colors->gradindex[SC_GRAD_GROUND]; sky = sc_land_sky_index(c); skyflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; /* Start at the top, clear everything above and including ht. */ lp = SC_LAND_XY(l, x, height); while(height >= ht) { if(!SC_LAND_IS_SKY(*lp)) *lp = skyflag | sc_color_gradient_index(dither, sky, height); --lp; --height; } /* Clear to sky */ /* Continue, this time filling everything below with ground. */ while(height >= 0) { if(!SC_LAND_IS_GROUND(*lp)) *lp = SC_LAND_GROUND | sc_color_gradient_index(dither, gnd, height); --lp; --height; } /* Clear to ground. */ } void sc_land_level_around(const sc_config *c, sc_land *l, int x, int w, int ht) { /* sc_land_level_around This function levels the land to a uniform height, ht. This function levels the virtual interval [x - w, x + w], inclusive. No values are returned, this function silently exits on failure. This function is useful for leveling a platform to place a tank on. */ int cx; /* Translated current X coordinate. */ int x1; /* Left virtual X coordiante */ int x2; /* Right virtual X coordinate */ /* Sanity checks */ if(c == NULL || l == NULL) return; /* Calculate the left, right bounds of the interval */ x1 = x - w; x2 = x + w; /* Level the columns in the interval. */ cx = 0; for(x = x1; cx <= x2; ++x) { cx = x; if(_sc_land_translate_x(l, &cx)) { /* Coordinate translated, level it. */ _sc_land_level(c, l, cx, ht); } /* End translation valid? */ } /* End interval loop */ } static inline bool _sc_land_passable_opponent(const sc_config *c, const sc_player *p, int x, int y) { /* sc_land_passable_opponent Returns true if the land at virtual (x, y) is passable, considering only p's land profile. This is an internal function with no sanity checks. */ int radius; /* Radius of player profile */ int width; /* Total width of player profile */ int dx; /* Delta x from player to x */ int dy; /* Delta y from player to y */ /* Determine width of profile */ radius = p->tank->radius; width = radius + radius + 1; /* Calculate deltas */ if(!sc_land_calculate_deltas(c->land, &dx, &dy, x, y, p->x, p->y)) return(false); dx = radius + dx; dy = radius - dy; /* If delta is in profile, check if profile is opaque or not. */ if(dx >= 0 && dx < width && dy >= 0 && dy <= radius) { if(*(p->tank->data + dx + width * dy) != SC_TANK_PROFILE_CLEAR) { /* Not passable */ return(false); } /* Check profile data */ } /* Check if in profile bounding box */ /* Pixel is passable. */ return(true); } static inline bool _sc_land_passable_point(const sc_config *c, const sc_player *p, int x, int y) { /* sc_land_passable_point Returns true if the virtual point (x, y) is passable, considering the land and player profiles. If p is non-NULL, that player's profile will be excluded when considering profiles. Otherwise, all profiles are considered. This is an internal function that does not check sanity. */ int i; /* Iterator */ /* Check player profiles */ for(i = 0; i < c->numplayers; ++i) { /* Make sure player is live, and not == p */ if(c->players[i] != p && SC_PLAYER_IS_ALIVE(c->players[i])) { /* Check if player profile obscures this point */ if(!_sc_land_passable_opponent(c, c->players[i], x, y)) return(false); } /* Checking player */ } /* Loop through all players */ /* Check land to make sure it is clear */ if(!sc_land_translate_xy(c->land, &x, &y)) return(false); if(!SC_LAND_IS_SKY(*SC_LAND_XY(c->land, x, y))) return(false); /* Point is passable. */ return(true); } bool sc_land_passable_point(const sc_config *c, const sc_player *p, int x, int y) { /* sc_land_passable_point Same as above, but with sanity checks. */ if(c == NULL) return(false); return(_sc_land_passable_point(c, p, x, y)); } static int _sc_land_support_shift_right(const sc_config *c, const sc_land *l, int x, int y, int r, int s) { /* sc_land_support_shift_right Returns the offset the tank may shift to the RIGHT if it is not properly supported in that direction. The tank is at coordinates (x,y+1) with a base radius of r. If the tank is sufficiently supported to the RIGHT, then 0 is returned. (x, y) may be virtual coordinates. */ int sx; /* Start X -- first X index/coord which is clear below */ int fx; /* Final X -- last X coord which must be clear to slide */ int cx; /* Current X index/coordinate */ /* Make sure Y translates properly. */ if(!_sc_land_translate_y(l, &y)) return(0); /* Check where the "edge" of the land is -- hopefully it is within the first SC_TANK_MIN_SHELF_SIZE pixels of the left edge; if not, then the tank cannot slide down. */ cx = 0; /* 0 is leftmost edge of tank, advancing right */ sx = 0; /* Set to one past the left edge (0=no land below) */ while(cx < s - 1) { /* If translation fails, we assume the tank is supported. */ if(!_sc_land_passable_point(c, NULL, x - r + cx, y)) sx = cx + 1; ++cx; } /* Scan for edge of land */ /* CX is now an actual X coordinate, starting at the first suspected clear tile from the left edge. Calculate the final X coordinate which must be clear for the tank to slide. */ cx = sx + x - r; fx = x + sx + r + 1; /* Make sure everything between (x-r+sx) and fx is clear below */ while(cx <= fx) { /* If translation fails, assume tank cannot be moved. */ if(!_sc_land_passable_point(c, NULL, cx, y)) return(0); ++cx; } /* Everything was clear; tank may shift over sx pixels to the right */ return(sx); } static int _sc_land_support_shift_left(const sc_config *c, const sc_land *l, int x, int y, int r, int s) { /* sc_land_support_shift_left Returns the offset the tank may shift to the LEFT if it is not properly supported in that direction. The tank is at coordinates (x,y+1) with a base radius of r. If the tank is sufficiently supported to the left, then 0 is returned. (x, y) may be virtual coordinates. */ int sx; /* Start X -- first X index/coord which is clear below */ int fx; /* Final X -- last X coord which must be clear to slide */ int cx; /* Current X index/coordinate */ /* Make sure Y translates properly. */ if(!_sc_land_translate_y(l, &y)) return(0); /* Check where the "edge" of the land is -- hopefully it is within the first SC_TANK_MIN_SHELF_SIZE pixels of the left edge; if not, then the tank cannot slide down. */ cx = 0; /* 0 is rightmost edge of tank, advancing to the left */ sx = 0; /* Set to one before the right edge (0=no land below) */ while(cx < s - 1) { /* If translation fails, assume tank is supported. */ if(!_sc_land_passable_point(c, NULL, x + r - cx, y)) sx = cx + 1; ++cx; } /* CX is now an actual X coordinate, starting at the first suspected clear tile from the right edge, and decrementing down to FX. */ cx = x + r - sx; fx = x - sx - r - 1; /* Make sure everything between fx and (x+r-sx) is clear below */ while(cx >= fx) { /* If translation fails, assume tank cannot be moved. */ if(!_sc_land_passable_point(c, NULL, cx, y)) return(0); --cx; } /* Everything was clear; tank may shift over sx pixels to the right */ return(sx); } int sc_land_support(const sc_config *c, const sc_land *l, int x, int y, int r, int s) { /* sc_land_support Returns the offset the tank may be shifted over if it is not properly supported on one side. The tank is at coordinates (x,y) with a base radius of r. If the tank is sufficiently supported on both sides, then 0 is returned. Otherwise, a positive value implies the tank will slide down the slope to the right, and a negative value implies that the tank will slide down the slope to the left. */ int delta; /* Distance to slide over */ /* If already on the floor, the tank cannot slide any further */ if(l == NULL || --y < 0) return(0); /* Check if the tank can slide in either direction */ delta = _sc_land_support_shift_right(c, l, x, y, r, s); if(delta != 0) return(delta);/* Slide to the right */ delta = _sc_land_support_shift_left(c, l, x, y, r, s); if(delta != 0) return(-delta);/* Slide to the left */ /* Tank is sufficiently supported. */ return(0); } static bool _sc_land_drop_column(const sc_config *c, sc_land *l, int x) { /* sc_land_drop_column Drop the land in the current column, x. This is an internal function will no sanity checking; caution, X may be a virtual coordinate. */ const int *sky; /* Sky indices for gradient */ int height; /* Land height */ int skyflag; /* Sky type flag */ int maxdropallow; /* maximum drop allowed */ int maxdrop; /* Distance the land is being dropped */ bool dither; /* Enable land dithering? */ int *lpdown; /* Pointer to lower position; "falling to" */ int *lpup; /* Pointer to upper position; "falling from" */ int miny; /* Minimum height that needs to be redrawn */ int maxy; /* Maximum height that needs to be redrawn */ int dy; /* Amount of land that has actually fallen */ int y; /* Current Y coordinate */ /* Make sure X coordinate is valid */ if(!_sc_land_translate_x(l, &x)) return(false); /* Get and cache the sky attributes */ sky = sc_land_sky_index(c); skyflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; /* Set initial Y coodinate and pointers */ y = 0; height = l->height; maxdrop = 0; lpup = SC_LAND_XY(l, x, 0); /* Track down the screen until we find a cell that is not ground. */ while(y < height && SC_LAND_IS_GROUND(*lpup)) { ++lpup; ++y; } lpdown = lpup; /* This is the point where land will fall _to_ */ miny = y; /* Minimum coordinate that will need redrawing */ maxy = y; /* Assume this is also the maximum coordinate. */ /* Scan up until we find ground; note, that if everything from here on is sky, then there is actually no land to drop. */ while(y < height && !SC_LAND_IS_GROUND(*lpup)) { ++lpup; ++y; } /* If Y coordinate is out of range, then nothing to be done. */ if(y >= height) return(false); /* Determine if we attempted to drop too far */ maxdrop = lpup - lpdown; if(SC_CONFIG_NO_ANIM(c)) maxdropallow = c->fieldheight; else maxdropallow = SC_LAND_MAX_DROP_PER_CYCLE; if(maxdrop >= maxdropallow) { lpdown = lpup - maxdropallow; miny = y - maxdrop; } /* Start letting the land fall... */ dy = SC_LAND_MAX_AMOUNT; while(y < height && dy >= 0) { if(SC_LAND_IS_GROUND(*lpup)) { *lpdown = *lpup; *lpup = skyflag | sc_color_gradient_index(dither, sky, y); maxy = y; } ++lpdown; ++lpup; --dy; ++y; } /* Repaint the range */ sc_window_paint(c->window, x, miny, x, maxy, SC_REGENERATE_LAND | SC_PAINT_EVERYTHING); return(maxdrop >= maxdropallow || y < height); } bool sc_land_drop_zone(const sc_config *c, sc_land *l, int x1, int x2) { /* sc_land_drop Drop the land in the columns x1 to x2 (inclusive). If land still needs to be dropped after this call, then nonzero is returned. X is a virtual coordinate. */ bool needrecurse; /* Nonzero if we need to recurse */ int cx; /* Current column we are operating on */ /* Sanity check. */ if(c == NULL || l == NULL) return(false); needrecurse = false; for(cx = x1; cx <= x2; ++cx) { /* CX may be virtual when given to drop_column. */ needrecurse = _sc_land_drop_column(c, l, cx) || needrecurse; } /* End interval loop */ /* Will user need to call this method again? */ return(needrecurse); } bool sc_land_drop(const sc_config *c, sc_land *l, int x, int w) { /* sc_land_drop Drop the land in the columns x-w to x+w. If land still needs to be dropped after this call, then nonzero is returned. X is a virtual coordinate. */ return(sc_land_drop_zone(c, l, x - w, x + w)); } bool sc_land_line_of_sight(const sc_config *c, const sc_land *l, int x1, int y1, int x2, int y2) { /* sc_land_line_of_sight Returns nonzero if (x1,y1) can see (x2,y2). This function will take wrapping boundaries and solid walls into account, if they are available. x1, y1, x2, y2 are all virtual coordinates. */ double x; /* Current X coordinate */ double y; /* Current Y coordinate */ double stepx; /* Step X, per iteration */ double stepy; /* Step Y, per iteration */ int numsteps; /* Total number of iterations */ int deltax; /* Total change in X */ int deltay; /* Total change in Y */ int cx; /* Current X (rounded) */ int cy; /* Current Y (rounded) */ /* Sanity checks */ if(c == NULL || l == NULL) return(false); /* Determine the distance between points */ deltax = x2 - x1; deltay = y2 - y1; /* If (x1,y1) == (x2,y2), nothing to do! */ if(deltax == 0 && deltay == 0) return(true); /* Which axis is the major axis? The major axis will determine the total number of steps we will need to take. */ if(abs(deltax) > abs(deltay)) { /* X axis is the major axis. */ numsteps = abs(deltax); } else { /* Y axis is the major axis. */ numsteps = abs(deltay); } /* Which axis is major? */ /* Start at (x1,y1). Setup stepping in each direction. */ x = x1; y = y1; stepx = (double)deltax / numsteps; stepy = (double)deltay / numsteps; /* Iterate! If this iteration completes, then we have a direct line of sight between (x1,y1) and (x2,y2). */ while(numsteps > 0) { /* Round current coordinates to nearest integer. */ cx = rint(x); cy = rint(y); /* Translate the X, Y coordinates */ if(_sc_land_translate_x(l, &cx) && _sc_land_translate_y(l, &cy)) { /* If we passed the ground, we're going through solid. */ if(cy < 0) return(false); if(!SC_LAND_IS_SKY(*SC_LAND_XY(l, cx, cy))) { return(false); } } /* Translation valid? */ /* Advance to the next coordinate to be checked. */ x += stepx; y += stepy; --numsteps; } /* WE have a direct line-of-sight! */ return(true); } void sc_land_clear_smoke(const sc_config *c, sc_land *l) { /* sc_land_clear_smoke Clears the smoke off the land given. */ const int *sky; /* Sky indices for gradient */ int skyflag; /* Sky type flag */ int dither; /* Dither flags */ int height; /* Land height */ int width; /* Land width */ int *lp; /* Land pointer */ int x; /* Current real X */ int y; /* Current real Y */ /* Sanity check */ if(c == NULL || l == NULL) return; /* Obtain dithering information */ sky = sc_land_sky_index(c); skyflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; /* Cache height and width locally, for efficiency */ height = l->height; width = l->width; /* Scan through all land, replacing smoke with sky */ for(x = 0; x < width; ++x) { lp = SC_LAND_XY(l, x, 0); for(y = 0; y < height; ++lp, ++y) { if(SC_LAND_IS_SMOKE(*lp)) *lp = skyflag | sc_color_gradient_index(dither, sky, y); } /* Iterating thru Y */ } /* Iterating thru X */ /* Redraw the playfield */ sc_window_paint(c->window, 0, 0, l->width, l->height, SC_REGENERATE_LAND | SC_PAINT_EVERYTHING); } void sc_land_create_dirt(const sc_config *c, sc_land *l, const int *xlist, const int *ylist, int size) { /* sc_land_create_dirt This function creates dirt at each of the virtual coordinates in the lists of coordinates given. xlist and ylist are list of (x, y) virtual coordinate pairs, and size indicates the size of the lists. */ bool dither; /* Dither flag */ const int *gnd; /* Ground gradient */ int boundx1 = c->fieldwidth; /* Bound that was altered X1 */ int boundy1 = c->fieldheight; /* Bound that was altered Y1 */ int boundx2 = 0; /* Bound that was altered X2 */ int boundy2 = 0; /* Bound that was altered Y2 */ int x; /* Current translated X */ int y; /* Current translated Y */ /* Sanity checks */ if(c == NULL || l == NULL || xlist == NULL || ylist == NULL) return; /* Obtain dither information */ dither = c->graphics.gfxdither; gnd = c->colors->gradindex[SC_GRAD_GROUND]; /* Scan through the list of coordinates */ while(size > 0) { /* translate this coordinate */ x = *xlist; y = *ylist; if(_sc_land_translate_x(l, &x) && _sc_land_translate_y(l, &y)) { /* Create dirt at this coordinate */ *SC_LAND_XY(l, x, y) = SC_LAND_GROUND | sc_color_gradient_index(dither, gnd, y); /* Update the real bounding box */ if(x < boundx1) boundx1 = x; if(x > boundx2) boundx2 = x; if(y < boundy1) boundy1 = y; if(y > boundy2) boundy2 = y; } /* translation valid? */ ++xlist; ++ylist; --size; } /* loop through list */ /* Repaint the affected region */ sc_window_paint(c->window, boundx1, boundy1, boundx2, boundy2, SC_REGENERATE_LAND | SC_PAINT_EVERYTHING); } void sc_land_clear_profile(const sc_config *c, sc_land *l, const sc_player *p) { /* sc_land_clear_profile This function is a sanity check used by players, to make certain there is sky behind their profile. */ const unsigned char *data; /* Profile data */ const int *sky; /* Sky indices for gradient */ int skyflag; /* Sky type flag */ int dither; /* Dither flags */ int radius; /* profile radius */ int width; /* profile width */ int tx; /* Translated X */ int ty; /* Translated Y */ int x; /* Current offset X */ int y; /* Current offset Y */ /* Sanity check */ if(c == NULL || l == NULL || p == NULL) return; /* Obtain dithering information */ sky = sc_land_sky_index(c); skyflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; /* Cache height and width locally, for efficiency */ radius = p->tank->radius; width = radius + radius + 1; /* Scan through all land, replacing profile points with sky */ data = p->tank->data; for(y = radius; y >= 0; --y) { for(x = 0; x < width; ++x, ++data) { if(*data != SC_TANK_PROFILE_CLEAR) { tx = p->x + x - radius; ty = p->y + y; if(_sc_land_translate_x(l, &tx) && _sc_land_translate_y(l, &ty)) { *SC_LAND_XY(l, tx, ty) = skyflag | sc_color_gradient_index(dither, sky, ty); } /* Translation ok */ } /* Point is in profile */ } /* Loop X */ } /* Loop Y */ } const int *sc_land_sky_index(const sc_config *c) { /* sc_land_sky_index Returns the list of sky gradient indices for the sky selected by the user. Do not attempt to modify this array directly. NULL is returned if an error occurred. */ /* Sanity check */ if(c == NULL) return(NULL); /* Lookup the sky type. */ switch(c->land->realsky) { case SC_SKY_NIGHT: return(c->colors->gradindex[SC_GRAD_NIGHT_SKY]); case SC_SKY_FIRE: return(c->colors->gradindex[SC_GRAD_FIRE_SKY]); case SC_SKY_RANDOM: return(NULL); } /* End switch */ return(NULL); } int sc_land_sky_flag(const sc_config *c) { /* sc_land_sky_flag Returns the sky flags for the sky selected by the user. */ /* Sanity check */ if(c == NULL) return(0); /* Lookup the sky flags */ switch(c->land->realsky) { case SC_SKY_NIGHT: return(SC_LAND_NIGHT_SKY); case SC_SKY_FIRE: return(SC_LAND_FIRE_SKY); case SC_SKY_RANDOM: return(0); } /* End switch */ return(0); } /*** List of skies ***/ static const char *_sc_land_sky_names[] = { "Night", "Fire", "Random Sky", NULL }; static const unsigned int _sc_land_sky_types[] = { SC_SKY_NIGHT, SC_SKY_FIRE, SC_SKY_RANDOM, 0 }; const char **sc_land_sky_names(void) { return(_sc_land_sky_names); } const unsigned int *sc_land_sky_types(void) { return(_sc_land_sky_types); } /*** List of land generators ***/ static const char *_sc_land_generator_names[] = { "None", "Canyon", "Double Mountain", "Hillside", "Mountain", "Plains", "Traditional", "Valley", "Random Generator", NULL }; static const unsigned int _sc_land_generator_types[] = { SC_LAND_GEN_NONE, SC_LAND_GEN_CANYON, SC_LAND_GEN_DOUBLE_MOUNTAIN, SC_LAND_GEN_HILLSIDE, SC_LAND_GEN_MOUNTAIN, SC_LAND_GEN_PLAINS, SC_LAND_GEN_TRADITIONAL, SC_LAND_GEN_VALLEY, SC_LAND_GEN_RANDOM, 0 }; const char **sc_land_generator_names(void) { return(_sc_land_generator_names); } const unsigned int *sc_land_generator_types(void) { return(_sc_land_generator_types); } xscorch-0.2.1/sgame/sland.h0000644000175000001440000001717311175116135012460 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sland.h,v 1.7 2009-04-26 17:39:41 jacob Exp $ */ /* xscorch - sland.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched Player land generation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sland_h_included #define __sland_h_included /* Includes */ #include /* Forward declarations */ struct _sc_config; struct _sc_player; /* Maximum drop amounts */ #define SC_LAND_MAX_AMOUNT 48 /* Maximum amount of ground to drop */ #define SC_LAND_MAX_DROP_PER_CYCLE 48 /* Maximum distance to drop, /cycle */ /* Maximum values */ #define SC_LAND_WIND_MAX 1.00 /* Maximum allowed wind speed */ #define SC_LAND_BUMPINESS_MAX 100.0 /* Maximum bumpiness allowed */ #define SC_LAND_SLOPE_MAX 100.0 /* Maximum slope allowed */ /* Default landscape values */ #define SC_LAND_SMOOTHNESS_DEF 90 /* Probability land remains smooth (percent) */ #define SC_LAND_BUMPINESS_DEF 50 /* Default bumpiness */ #define SC_LAND_SLOPE_DEF 5.0 /* Default maximum slope */ /* Land manipulation masks */ #define SC_LAND_COLOR_MASK 0x0000ff #define SC_LAND_TYPE_MASK 0xffff00 /* Land types */ #define SC_LAND_NIGHT_SKY 0x000100 #define SC_LAND_FIRE_SKY 0x000200 #define SC_LAND_GROUND 0x010000 #define SC_LAND_OBJECT 0x020000 #define SC_LAND_SMOKE 0x100000 #define SC_LAND_BURNT 0x200000 /* Land macros */ #define SC_LAND_GET_COLOR(x) ((x) & SC_LAND_COLOR_MASK) #define SC_LAND_GET_TYPE(x) ((x) & SC_LAND_TYPE_MASK) #define SC_LAND_IS_SKY(x) (SC_LAND_GET_TYPE(x) & (SC_LAND_NIGHT_SKY | SC_LAND_FIRE_SKY | SC_LAND_SMOKE)) #define SC_LAND_IS_GROUND(x) (SC_LAND_GET_TYPE(x) & SC_LAND_GROUND) #define SC_LAND_IS_OBJECT(x) (SC_LAND_GET_TYPE(x) & SC_LAND_OBJECT) #define SC_LAND_IS_SMOKE(x) (SC_LAND_GET_TYPE(x) & SC_LAND_SMOKE) #define SC_LAND_IS_BURNT(x) (SC_LAND_GET_TYPE(x) & SC_LAND_BURNT) /* Landscape sky types */ typedef enum _sc_land_sky { SC_SKY_NIGHT, SC_SKY_FIRE, SC_SKY_RANDOM, } sc_land_sky; /* Landscape generators */ typedef enum _sc_land_generator { SC_LAND_GEN_NONE, SC_LAND_GEN_CANYON, SC_LAND_GEN_DOUBLE_MOUNTAIN, SC_LAND_GEN_HILLSIDE, SC_LAND_GEN_MOUNTAIN, SC_LAND_GEN_PLAINS, SC_LAND_GEN_TRADITIONAL, SC_LAND_GEN_VALLEY, SC_LAND_GEN_RANDOM } sc_land_generator; /* Land flags */ #define SC_LAND_DEFAULTS 0x0000 /* Equivalent to no walls */ #define SC_LAND_WRAP_X 0x0001 /* If set, X boundaries wrap */ #define SC_LAND_WALL_X 0x0002 /* If set, X boundaries are solid */ #define SC_LAND_CEILING 0x0100 /* If set, there is a ceiling */ /* Land data structure */ typedef struct _sc_land { /* Land width and height */ /* WARNING: the master variables are in sc_config */ int width; /* Land width (pixels) */ int height; /* Land height (pixels) */ int flags; /* Land boundary flags */ /* General land options */ sc_land_generator generator; /* Current land profile generator */ sc_land_sky sky; /* Current sky type */ sc_land_sky realsky; /* Current sky (- random) */ bool hostileenv; /* Nonzero if enable hostile environments */ double bumpiness; /* Bumpiness of land (max dY) */ /*** WARNING The screen structure is organised differently than libmtx uses! Columns are contiguous in memory. Insane? Hell yes. Pretty much all of the 1-D loops in the game will be iterating along a vertical vector -- this is for optimization purposes (an inc is cheaper than adding a variable). If in doubt (and ESPECIALLY if not in a tight loop), use the macros provided ***/ /*** Origin of the screen is lower-left ***/ int *screen; } sc_land; /* Accessors for land */ #define SC_LAND_XY_TO_I(l,x,y) ((x) * (l)->height + (y)) #define SC_LAND_I_TO_X(l,i) ((i) / (l)->height) #define SC_LAND_I_TO_Y(l,i) ((i) % (l)->height) #define SC_LAND_ORIGIN(l) ((l)->screen) #define SC_LAND_XY(l,x,y) (SC_LAND_ORIGIN(l) + SC_LAND_XY_TO_I((l), (x), (y))) /* Create and generate land */ sc_land *sc_land_new(int width, int height, int flags); bool sc_land_setup(sc_land *l, int width, int height, int flags); int sc_land_flags(const struct _sc_config *c); bool sc_land_generate(const struct _sc_config *c, sc_land *l); void sc_land_free(sc_land **l); /* Land Height calculations */ int sc_land_height(const sc_land *l, int x, int y0); int sc_land_height_around(const sc_land *l, int x, int y0, int w); int sc_land_min_height_around(const sc_land *l, int x, int y0, int w); int sc_land_avg_height_around(const sc_land *l, int x, int y0, int w); /* Land drill & fill operations */ void sc_land_level_around(const struct _sc_config *c, sc_land *l, int x, int w, int ht); /* Check the land support for a tank; return 0 if tank is properly supported. */ int sc_land_support(const struct _sc_config *c, const sc_land *l, int x, int y, int r, int s); /* Drop the land in a gravity field */ bool sc_land_drop(const struct _sc_config *c, sc_land *l, int cx, int w); bool sc_land_drop_zone(const struct _sc_config *c, sc_land *l, int x1, int x2); /* Sky cleaning */ void sc_land_clear_smoke(const struct _sc_config *c, sc_land *l); /* Line-of-sight and trajectory functions */ bool sc_land_line_of_sight(const struct _sc_config *c, const sc_land *l, int x1, int y1, int x2, int y2); /* Coordinate validation */ bool sc_land_translate_x(const sc_land *l, int *x); bool sc_land_translate_y(const sc_land *l, int *y); bool sc_land_translate_xy(const sc_land *l, int *x, int *y); bool sc_land_translate_x_range(const sc_land *l, int *x1, int *x2); bool sc_land_overlap_x(const sc_land *l, int *x1, int *x2); bool sc_land_calculate_deltas(const sc_land *l, int *dx, int *dy, int x1, int y1, int x2, int y2); /* Coordinate validation - double versions */ bool sc_land_translate_x_d(const sc_land *l, double *x); bool sc_land_translate_y_d(const sc_land *l, double *y); bool sc_land_translate_xy_d(const sc_land *l, double *x, double *y); bool sc_land_calculate_deltas_d(const sc_land *l, double *dx, double *dy, double x1, double y1, double x2, double y2); /* Misc */ const int *sc_land_sky_index(const struct _sc_config *c); int sc_land_sky_flag(const struct _sc_config *c); void sc_land_create_dirt(const struct _sc_config *c, sc_land *l, const int *xlist, const int *ylist, int size); bool sc_land_passable_point(const struct _sc_config *c, const struct _sc_player *p, int x, int y); void sc_land_clear_profile(const struct _sc_config *c, sc_land *l, const struct _sc_player *p); /* Names and games ... */ const char **sc_land_sky_names(void); const unsigned int *sc_land_sky_types(void); const char **sc_land_generator_names(void); const unsigned int *sc_land_generator_types(void); #endif /* __sland_h_included */ xscorch-0.2.1/sgame/slscape.c0000644000175000001440000002375211175116135013004 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/slscape.c,v 1.6 2009-04-26 17:39:41 jacob Exp $ */ /* slscape.c Copyright (C) 2000 Matti Hänninen e-mail: matti@mvillage.u-net.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along along with this program; if not, write to The Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include /* Internal definition(s) */ #define SC_LSCAPE_RANDOM_PARAMETERS 16 /* Internal variables */ static double sc_lscape_screen_w; /* Screen width and height in pixels */ static double sc_lscape_screen_h; static double sc_lscape_bump_height; /* Bump height (not in pixels) */ static double sc_lscape_bump_freq; /* Number of bumps in the unit interval */ static long int ri[SC_LSCAPE_RANDOM_PARAMETERS]; /* Random (integer) parameters */ static double rd[SC_LSCAPE_RANDOM_PARAMETERS]; /* Random (real) parameters */ /* Function declarations */ static double _sc_lscape_eval_none(double x); static double _sc_lscape_eval_canyon(double x); static double _sc_lscape_eval_hillside(double x); static double _sc_lscape_eval_mountain(double x); static double _sc_lscape_eval_plains(double x); static double _sc_lscape_eval_traditional(double x); static double _sc_lscape_eval_valley(double x); static double _sc_lscape_eval_none(__libj_unused double x) { /* _sc_lscape_eval_none Evaluates a null profile. */ return(0); } static double _sc_lscape_eval_canyon(double x) { /* _sc_lscape_eval_canyon Evaluates the ``canyon'' profile function at point x. */ double y; double delta; /* Coerse the domain into the unit interval */ x = sc_tools_clamp(0.0, 1.0, x); delta = 1.0 - (0.2 + 2.0 * sc_lscape_bump_height); y = sc_tools_smoothstep(-0.25, 0.25, sc_tools_pnoise_periodic(ri[0], 7, 7.0 * x + rd[0])) * delta; y += sc_tools_pnoise_periodic(ri[1], 7, 7.0 * x + rd[1]) * 0.1; y += sc_tools_rnoise_periodic(ri[2], (int)sc_lscape_bump_freq, sc_lscape_bump_freq * x + rd[2]) * sc_lscape_bump_height; y += sc_lscape_bump_height + 0.1; y = sc_tools_clamp(0.0, 1.0, y); return(y); } static double _sc_lscape_eval_hillside(double x) { /* _sc_lscape_eval_hillside Evaluates the ``hillside'' profile function at point x. */ double alpha; double beta; double y; /* Coerse the domain into the unit interval */ x = sc_tools_clamp(0.0, 1.0, x); /* Figure out coefficients */ alpha = rd[0] > 0.5 ? 0.1 + sc_lscape_bump_height : 0.9 - sc_lscape_bump_height; beta = 1 - 2.0 * alpha; /* Compute height along the line */ y = alpha + beta * x; /* Add some randomness */ y += sc_tools_pnoise(ri[0], 7.0 * x + rd[0]) * 0.1; y += sc_tools_rnoise(ri[1], sc_lscape_bump_freq * x + rd[1]) * sc_lscape_bump_height; /* Coerse the range into the unit iterval (paranoid) */ y = sc_tools_clamp(0.0, 1.0, y); return(y); } static double _sc_lscape_eval_mountain(double x) { /* _sc_lscape_eval_mountain Evaluates the ``mountain'' profile function at point x */ double alpha; double gamma; double y; /* Coerse the domain into the unit interval */ x = sc_tools_clamp(0.0, 1.0, x); /* Compute the quadratic */ alpha = 4.0 * (2.0 * sc_lscape_bump_height - 0.8); gamma = 0.1 + sc_lscape_bump_height; y = alpha * x * x - alpha * x + gamma; /* Add some randomness */ y += sc_tools_pnoise_periodic(ri[0], 7, 7.0 * x + rd[0]) * 0.1; y += sc_tools_rnoise_periodic(ri[1], (int)sc_lscape_bump_freq, sc_lscape_bump_freq * x + rd[1]) * sc_lscape_bump_height; /* Coerse the range into the unit iterval (paranoid) */ y = sc_tools_clamp(0.0, 1.0, y); return(y); } static double _sc_lscape_eval_plains(double x) { /* _sc_lscape_eval_plains Evaluates the ``plains'' profile function at point x. */ double y; /* Coerse the domain into the unit interval */ x = sc_tools_clamp(0.0, 1.0, x); y = sc_tools_pnoise_periodic(ri[0], 7, 7.0 * x + rd[0]); y = (y + 1.0) / 10.0 + 0.3; y += sc_tools_rnoise_periodic(ri[1], (int)sc_lscape_bump_freq, sc_lscape_bump_freq * x + rd[1]) * sc_lscape_bump_height; /* Coerse the range into the unit iterval (paranoid) */ y = sc_tools_clamp(0.0, 1.0, y); return(y); } static double _sc_lscape_eval_traditional(double x) { /* _sc_lscape_eval_traditional Evaluates the ``traditional'' profile function at point x. */ double y; /* Coerse the domain into the unit interval */ x = sc_tools_clamp(0.0, 1.0, x); y = sc_tools_pnoise_periodic(ri[0], 7, 7.0 * x + rd[0]) * 2.5; y += sc_tools_pnoise_periodic(ri[1], 17, 17.0 * x + rd[1]); y = (1.0 - sc_lscape_bump_height) * y / 3.5; y += sc_tools_pnoise_periodic(ri[2], (int)sc_lscape_bump_freq, sc_lscape_bump_freq * x + rd[2]) * sc_lscape_bump_height; y = (y + 1.0) / 2.0; /* Coerse the range into the unit iterval (paranoid) */ y = sc_tools_clamp(0.0, 1.0, y); return(y); } static double _sc_lscape_eval_valley(double x) { /* _sc_lscape_eval_valley Evaluates the ``valley'' profile function at point x. */ double alpha; double gamma; double y; /* Coerse the domain into the unit interval */ x = sc_tools_clamp(0.0, 1.0, x); /* Compute the quadratic */ alpha = 4.0 * (0.8 - 2.0 * sc_lscape_bump_height); gamma = 0.9 - sc_lscape_bump_height; y = alpha * x * x - alpha * x + gamma; /* Add some randomness */ y += sc_tools_pnoise_periodic(ri[0], 7, 7.0 * x + rd[0]) * 0.1; y += sc_tools_rnoise_periodic(ri[1], (int)sc_lscape_bump_freq, sc_lscape_bump_freq * x + rd[1]) * sc_lscape_bump_height; /* Coerse the range into the unit iterval (paranoid) */ y = sc_tools_clamp(0.0, 1.0, y); return(y); } void sc_lscape_init(void) { /* sc_lscape_init Initializes lscape module for use. This function must be called before calling any other functions of the module. */ /* Initialize landscape tools */ sc_tools_init(); /* Set some arbitrary defaults */ _sc_lscape_eval = _sc_lscape_eval_traditional; sc_lscape_screen_w = 768.0; sc_lscape_screen_h = 512.0; sc_lscape_bump_height = 0.0; } void sc_lscape_explicit_setup(int w, int h, double b, sc_lscape_generator g) { /* sc_lscape_explicit_setup Performs all the stuff that needs to be done before generating a new landscape. */ int i; /* Set screen dimensions */ sc_lscape_screen_w = w; sc_lscape_screen_h = h; /* Compute bump height */ sc_lscape_bump_height = (double)SC_LSCAPE_BUMP_HEIGHT_IN_PIXELS / (2.0 * (double)h) * b; /* Draw random parameters */ for(i = 0; i < SC_LSCAPE_RANDOM_PARAMETERS; i++) { ri[i] = (long int)game_rand(); rd[i] = (double)game_rand() / (double)GAME_RAND_MAX; } /* Choose the landscape profile function */ switch(g) { case SC_LSCAPE_GENERATOR_NONE: _sc_lscape_eval = _sc_lscape_eval_none; break; case SC_LSCAPE_GENERATOR_CANYON: _sc_lscape_eval = _sc_lscape_eval_canyon; break; case SC_LSCAPE_GENERATOR_DOUBLE_MOUNTAIN : _sc_lscape_eval = _sc_lscape_eval_mountain; break; case SC_LSCAPE_GENERATOR_HILLSIDE : _sc_lscape_eval = _sc_lscape_eval_hillside; break; case SC_LSCAPE_GENERATOR_MOUNTAIN : _sc_lscape_eval = _sc_lscape_eval_mountain; break; case SC_LSCAPE_GENERATOR_PLAINS : _sc_lscape_eval = _sc_lscape_eval_plains; break; case SC_LSCAPE_GENERATOR_TRADITIONAL : _sc_lscape_eval = _sc_lscape_eval_traditional; break; case SC_LSCAPE_GENERATOR_VALLEY : _sc_lscape_eval = _sc_lscape_eval_valley; break; } } void sc_lscape_setup(const struct _sc_config *c, const struct _sc_land *l) { /* sc_lscape_setup Front-end to sc_lscape_explicit_setup. Note: the internals of this function are bound to change quite a bit. */ int i; sc_land_generator gen; if(l != NULL) { /* Choose the lanscape profile function */ gen = l->generator; if(gen == SC_LAND_GEN_RANDOM) gen = game_lrand(SC_LAND_GEN_RANDOM); switch(gen) { case SC_LAND_GEN_NONE : _sc_lscape_eval = _sc_lscape_eval_none; break; case SC_LAND_GEN_CANYON : _sc_lscape_eval = _sc_lscape_eval_canyon; break; case SC_LAND_GEN_DOUBLE_MOUNTAIN : _sc_lscape_eval = _sc_lscape_eval_mountain; break; case SC_LAND_GEN_HILLSIDE : _sc_lscape_eval = _sc_lscape_eval_hillside; break; case SC_LAND_GEN_MOUNTAIN : _sc_lscape_eval = _sc_lscape_eval_mountain; break; case SC_LAND_GEN_PLAINS : _sc_lscape_eval = _sc_lscape_eval_plains; break; case SC_LAND_GEN_RANDOM : case SC_LAND_GEN_TRADITIONAL : _sc_lscape_eval = _sc_lscape_eval_traditional; break; case SC_LAND_GEN_VALLEY : _sc_lscape_eval = _sc_lscape_eval_valley; break; } /* Get screen dimensions */ sc_lscape_screen_w = c->fieldwidth; sc_lscape_screen_h = c->maxheight; /* Compute sc_lscape_bump_height */ sc_lscape_bump_height = SC_LSCAPE_BUMP_HEIGHT_IN_PIXELS / (2.0 * sc_lscape_screen_h) * sc_tools_clamp(0.0, 1.0, l->bumpiness / 100.0); sc_lscape_bump_freq = floor(sc_lscape_screen_w / SC_LSCAPE_BUMP_WIDTH_IN_PIXELS); /* Draw new random parameters */ for(i = 0; i < SC_LSCAPE_RANDOM_PARAMETERS; i++) { ri[i] = game_rand(); rd[i] = (double)game_rand() / (double)GAME_RAND_MAX; } } } /* slscape.c ends */ xscorch-0.2.1/sgame/slscape.h0000644000175000001440000000372011175116135013002 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/slscape.h,v 1.3 2009-04-26 17:39:41 jacob Exp $ */ /* slscape.h Copyright (C) 2000 Matti Hänninen e-mail: matti@mvillage.u-net.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along along with this program; if not, write to The Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __slscape_h_included #define __slscape_h_included /* Our includes */ #include /* Some fixed landscape parameters */ #define SC_LSCAPE_BUMP_HEIGHT_IN_PIXELS 30.0 #define SC_LSCAPE_BUMP_WIDTH_IN_PIXELS 5.0 /* Forward definitions */ struct _sc_config; struct _sc_land; /* Landscape generator types */ typedef enum _sc_lscape_generator { SC_LSCAPE_GENERATOR_NONE, SC_LSCAPE_GENERATOR_CANYON, SC_LSCAPE_GENERATOR_DOUBLE_MOUNTAIN, SC_LSCAPE_GENERATOR_HILLSIDE, SC_LSCAPE_GENERATOR_MOUNTAIN, SC_LSCAPE_GENERATOR_PLAINS, SC_LSCAPE_GENERATOR_TRADITIONAL, SC_LSCAPE_GENERATOR_VALLEY } sc_lscape_generator; /* Initialization and setting things up for each round */ void sc_lscape_init(void); void sc_lscape_explicit_setup(int w, int h, double b, sc_lscape_generator g); void sc_lscape_setup(const struct _sc_config *c, const struct _sc_land *l); /* Interface to the profile evaluating function */ #define sc_lscape_eval(x) ((*_sc_lscape_eval)(x)) double (*_sc_lscape_eval)(double x); #endif /* __slscape_h_included */ /* slscape.h ends */ xscorch-0.2.1/sgame/slscapetools.c0000644000175000001440000002037711175116135014065 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/slscapetools.c,v 1.4 2009-04-26 17:39:41 jacob Exp $ */ /*-------------------------------------------------------------------- * * slscapetools.c * Copyright (C) 2000 Matti Hänninen * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to * * The Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * */ #include #include #include #include /*==================================================================== * I n t e r n a l d e f i n i t i o n s a n d m a c r o s */ #define SC_TOOLS_RANDTABLE_SIZE 4096 #define SC_TOOLS_LOOKUP_SIZE 4096 /*==================================================================== * I n t e r n a l v a r i a b l e s */ static double r_table[SC_TOOLS_RANDTABLE_SIZE]; static double p_table[SC_TOOLS_RANDTABLE_SIZE]; static double p1_mult_lookup[SC_TOOLS_LOOKUP_SIZE]; static double p2_mult_lookup[SC_TOOLS_LOOKUP_SIZE]; static double r1_mult_lookup[SC_TOOLS_LOOKUP_SIZE]; static double r2_mult_lookup[SC_TOOLS_LOOKUP_SIZE]; /*==================================================================== * I n t e r n a l f u n c t i o n s */ /*-------------------------------------------------------------------- * _sc_tools_hermite(p1, p2, r1, r2, t) * * Description: * Evaluates the Hermite blending function at time t given end * points p1 and p2 and corresponding tangents r1 and r2. */ double _sc_tools_hermite(double p1, double p2, double r1, double r2, double t) { long int i = (long int)(t * (SC_TOOLS_LOOKUP_SIZE - 1.0)); return p1 * p1_mult_lookup[i] + p2 * p2_mult_lookup[i] + r1 * r1_mult_lookup[i] + r2 * r2_mult_lookup[i]; } /*-------------------------------------------------------------------- * _sc_tools_phermite(p1, p2, t) * * Description: * Evaluates the Hermite blending function at time t given end * points p1 and p2 and assuming that corresponding tangents both * are equal to zero. */ double _sc_tools_phermite(double p1, double p2, double t) { long int i = (long int)(t * (SC_TOOLS_LOOKUP_SIZE - 1.0)); return p1 * p1_mult_lookup[i] + p2 * p2_mult_lookup[i]; } /*-------------------------------------------------------------------- * _sc_tools_rhermite(r1, r2, t) * * Description: * Evaluates the Hermite blending functions at time t given * tangents r1 and r2 corresponding to end points p1 and p2, * respectively, and assuming that the end points are both * equal to zero. */ double _sc_tools_rhermite(double r1, double r2, double t) { long int i = (long int)(t * (SC_TOOLS_LOOKUP_SIZE - 1.0)); return r1 * r1_mult_lookup[i] + r2 * r2_mult_lookup[i]; } /*==================================================================== * F u n c t i o n s */ /*-------------------------------------------------------------------- * sc_tools_init() * * Description: * Initializes the module. This function must be called before * calling any other functions in this module. */ void sc_tools_init(void) { long int i; double t; double t_squared; double t_cubed; #ifdef SC_TOOLS_DEBUG printf("sc_tools_init: Computing random points and tangents ..\n"); #endif /* SC_TOOLS_DEBUG */ /* Compute tables for random points and tangents */ for ( i = 0; i < SC_TOOLS_RANDTABLE_SIZE; i++ ) { p_table[i] = 2.0 * (double)game_rand() / (double)GAME_RAND_MAX - 1.0; r_table[i] = 8.0 * (double)game_rand() / (double)GAME_RAND_MAX - 4.0; } #ifdef SC_TOOLS_DEBUG printf("sc_tools_init: Computing look-up tables for Hermite blending function ..\n", i); #endif /* SC_TOOLS_DEBUG */ /* Compute look-up tables for the multipliers of p1, p2, t1, and t2 * in the Hermite blending function */ for ( i = 0; i < SC_TOOLS_LOOKUP_SIZE; i++ ) { t = i / (SC_TOOLS_LOOKUP_SIZE - 1.0); t_squared = t * t; t_cubed = t * t_squared; p1_mult_lookup[i] = 2.0 * t_cubed - 3.0 * t_squared + 1; p2_mult_lookup[i] = -2.0 * t_cubed + 3.0 * t_squared; r1_mult_lookup[i] = t_cubed - 2.0 * t_squared + t; r2_mult_lookup[i] = t_cubed - t_squared; } } /*-------------------------------------------------------------------- * sc_tools_pnoise(offset, x) * * Description: * Evaluates a continuous noise function at point x. */ double sc_tools_pnoise(long int offset, double x) { long int i_lower; long int i_upper; double t; t = x - floor(x); i_lower = ((long int)x + offset) % SC_TOOLS_RANDTABLE_SIZE; i_upper = (i_lower + 1) % SC_TOOLS_RANDTABLE_SIZE; return _sc_tools_phermite(p_table[i_lower], p_table[i_upper], t); } /*-------------------------------------------------------------------- * sc_tools_pnoise_periodic(offset, period, x) * * Description: * Evaluates a periodical continuous noise function at point x. */ double sc_tools_pnoise_periodic(long int offset, long int period, double x) { long int i_lower; long int i_upper; double t; t = x - floor(x); i_lower = (long int)x % period; i_upper = (i_lower + 1) % period; i_lower = (i_lower + offset) % SC_TOOLS_RANDTABLE_SIZE; i_upper = (i_upper + offset) % SC_TOOLS_RANDTABLE_SIZE; return _sc_tools_phermite(p_table[i_lower], p_table[i_upper], t); } /*-------------------------------------------------------------------- * sc_tools_rnoise(offset, x) * * Description: * Evaluates a continuous noise function at point x. */ double sc_tools_rnoise(long int offset, double x) { long int i_lower; long int i_upper; double t; t = x - floor(x); i_lower = ((long int)x + offset) % SC_TOOLS_RANDTABLE_SIZE; i_upper = (i_lower + 1) % SC_TOOLS_RANDTABLE_SIZE; return _sc_tools_rhermite(r_table[i_lower], r_table[i_upper], t); } /*-------------------------------------------------------------------- * sc_tools_rnoise_periodic(offset, period, x) * * Description: * Evaluates a periodical continuous noise function at point x. */ double sc_tools_rnoise_periodic(long int offset, long int period, double x) { long int i_lower; long int i_upper; double t; t = x - floor(x); i_lower = (long int)x % period; i_upper = (i_lower + 1) % period; i_lower = (i_lower + offset) % SC_TOOLS_RANDTABLE_SIZE; i_upper = (i_upper + offset) % SC_TOOLS_RANDTABLE_SIZE; return _sc_tools_rhermite(r_table[i_lower], r_table[i_upper], t); } /*-------------------------------------------------------------------- * sc_tools_clamp(a, b, x) * * Description: * Crops the value of x if it falls outside the interval defined * by a and b. */ double sc_tools_clamp(double a, double b, double x) { if ( x > a && x > b ) return a > b ? a : b; if ( x < a && x < b ) return a < b ? a : b; return x; } /*-------------------------------------------------------------------- * sc_tools_mod(a, x) * * Description: * Returns the (real) modulus a of x. */ double sc_tools_mod(double a, double x) { double b = x / a; return (b - floor(b)) * a; } /*-------------------------------------------------------------------- * sc_tools_step(a, x) * * Description: * Returns zero for all x below a and unity otherwise. */ double sc_tools_step(double a, double x) { return (double)(x > a); } /*-------------------------------------------------------------------- * sc_tools_smoothstep(a, b, x) * * Description: * Returns zero for all x below a and b and unity for all x above * a and b. For intermediate values returns a ``smooth'' * interpolation from zero to unity. */ double sc_tools_smoothstep(double a, double b, double x) { if ( x > a && x > b ) return 1.0; if ( x < a && x < b ) return 0.0; return _sc_tools_phermite(0.0, 1.0, (x - a) / (b - a)); } /* slscapetools.c ends */ xscorch-0.2.1/sgame/slscapetools.h0000644000175000001440000000343411175116135014065 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/slscapetools.h,v 1.4 2009-04-26 17:39:41 jacob Exp $ */ /*-------------------------------------------------------------------- * * slscapetools.h * Copyright (C) 2000 Matti Hänninen * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to * * The Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * */ #ifndef SLSCAPETOOLS_H #define SLSCAPETOOLS_H #include /* #define SC_TOOLS_DEBUG */ /*-------------------------------------------------------------------- * F u n c t i o n d e c l a r a t i o n s */ /* Module initialization */ void sc_tools_init(void); /* Continuous noise functions */ double sc_tools_pnoise(long int offset, double x); double sc_tools_pnoise_periodic(long int offset, long int period, double x); double sc_tools_rnoise(long int offset, double x); double sc_tools_rnoise_periodic(long int offset, long int period, double x); /* Very handy functions */ double sc_tools_clamp(double a, double b, double x); double sc_tools_mod(double a, double x); double sc_tools_step(double a, double x); double sc_tools_smoothstep(double a, double b, double x); #endif /* SLSCAPETOOLS_H */ /* slscapetools.h ends */ xscorch-0.2.1/sgame/soptions.c0000644000175000001440000002454711175116135013233 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/soptions.c,v 1.21 2009-04-26 17:39:41 jacob Exp $ */ /* xscorch - soptions.c Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched option processing Blame waif for the egg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #define SC_OPTION_BUFFER 0x100 #define SC_OPTION_CONFIG_FILE 0x1001 #define SC_OPTION_INSANITY 0x1002 #define SC_OPTION_YIELDS 0x1003 #define SC_OPTION_HQMIXER 0x1004 #define SC_OPTION_NO_HQMIXER 0x1005 #define SC_OPTION_NAME 0x2001 #define SC_OPTION_PORT 0x2002 #define SC_OPTION_SERVER 0x2003 #define SC_OPTION_CLIENT 0x2004 /* These variables are provided by either getopt.c OR glibc, depending on where we are getting getopt from... */ extern int opterr; extern int optind; extern int optopt; static struct option _sc_long_options[] = { { "config", 1, 0, SC_OPTION_CONFIG_FILE }, { "geometry", 1, 0, 'g' }, { "help", 0, 0, 'h' }, { "insanity", 0, 0, SC_OPTION_INSANITY }, { "yields", 0, 0, SC_OPTION_YIELDS }, { "sound", 0, 0, 'S' }, { "nosound", 0, 0, 's' }, { "hqmixer", 0, 0, SC_OPTION_HQMIXER }, { "nohqmixer", 0, 0, SC_OPTION_NO_HQMIXER }, #if USE_NETWORK { "name", 1, 0, SC_OPTION_NAME }, { "port", 1, 0, SC_OPTION_PORT }, { "server", 0, 0, SC_OPTION_SERVER }, { "client", 1, 0, SC_OPTION_CLIENT }, #endif /* Network? */ { NULL, 0, 0, 0 } }; static bool _sc_options_x_y(char *arg, int *x, int *y) { char *p = arg; /* nothing following -g */ if(p == NULL) return(false); while(*p != '\0' && *p != 'x' && *p != 'X') ++p; if(*p == '\0') return(false); *p = '\0'; *x = atoi(arg); *y = atoi(p + 1); return(true); } int sc_options_usage(const char *progname) { printf("Usage: %s [options]\n\n", progname); printf("--config=file Load an alternate config file\n"); printf("--geometry=nxm, -g Set geometry to width n, height m\n"); printf("--help, -h Display this help\n"); printf("--insanity If you have to ask ...\n"); printf("--yields Display weapon yields\n"); printf("--sound, -S Enable music and sound effects\n"); printf("--nosound, -s Disable music and sound effects\n"); printf("--hqmixer Enable use of high-quality mixer\n"); printf("--nohqmixer Disable use of high-quality mixer\n"); #if USE_NETWORK printf("--name=playername Player name to use in network connection\n"); printf("--port=number Network port to use (client or server)\n"); printf("--client=servername Connect as a client to specified server\n"); printf("--server Start a new server\n"); #endif /* Network? */ printf("\n"); return(1); } int sc_options_parse(sc_config *c, int argc, char **argv) { #if USE_NETWORK char name[SC_OPTION_BUFFER]; char server[SC_OPTION_BUFFER]; bool isserver = false; bool isclient = false; int port; #endif /* Net? */ int ch; char digest[16]; /* Waif's Hidden Easter Egg =) */ unsigned char whee[16] = { 0x0f, 0x6f, 0xfd, 0xa3, 0xc9, 0xc9, 0xce, 0x15, 0xf2, 0x79, 0xb7, 0x88, 0xb4, 0x86, 0xe9, 0xca }; /* Justin's response to Waif's Hidden Easter Egg :) */ unsigned char wheee[16] = { 0x22, 0x47, 0x0e, 0x3a, 0x15, 0x8a, 0x76, 0x86, 0xe1, 0xf7, 0x5c, 0xd9, 0xb8, 0x14, 0x52, 0x3a }; /* Set network default options */ #if USE_NETWORK strcopyb(name, getenv("USER"), sizeof(name)); strcopyb(server, SC_NET_DEFAULT_SERVER, sizeof(name)); port = SC_NET_DEFAULT_PORT; #endif /* Net? */ /* Set up getopt. We turn off the "unknown option" warning for the sake of hidden options. We keep track of the option parsing so we can look hidden options and print a warning if they're really missing options. */ opterr = optind = optopt = 0; while(EOF != (ch = getopt_long(argc, argv, "g:sSh", _sc_long_options, NULL))) switch(ch) { case SC_OPTION_CONFIG_FILE: /* New config file to parse in! */ reg_set_name(c->cfreg, optarg); if(!sc_config_file_load(c)) { fprintf(stderr, "Failed to load alternate configuration file \"%s\".\n", optarg); } break; case SC_OPTION_INSANITY: /* If you are reading this, then umm... wow. */ /* You'll find no help here, why do you want to know? */ /* This is where mechanical excellence, one-thousand four-hundred horsepower pays off. */ fprintf(stderr, "Warning: The insanity subsystem is enabled.\n\n"); fprintf(stderr, " Life... Dreams... Hope...\n"); fprintf(stderr, " Where'd they come from...\n"); fprintf(stderr, " And where are they headed?\n"); fprintf(stderr, " These things... I am going to destroy!\n"); fprintf(stderr, " -- Kefka, Fourth Tier, Final Fantasy VI\n\n"); c->insanity = true; break; case SC_OPTION_YIELDS: sc_weapon_print_yields(c->weapons); return(1); case 'g': if(_sc_options_x_y(optarg, &c->fieldwidth, &c->fieldheight)) { if(c->fieldwidth < SC_MIN_FIELD_WIDTH || c->fieldwidth > SC_MAX_FIELD_WIDTH) { fprintf(stderr, "--geometry, width given, %d, out of range [%d, %d]\n", c->fieldwidth, SC_MIN_FIELD_WIDTH, SC_MAX_FIELD_WIDTH); return(1); } else if(c->fieldheight < SC_MIN_FIELD_HEIGHT || c->fieldheight > SC_MAX_FIELD_HEIGHT) { fprintf(stderr, "--geometry, height given, %d, out of range [%d, %d]\n", c->fieldheight, SC_MIN_FIELD_HEIGHT, SC_MAX_FIELD_HEIGHT); return(1); } if(c->fieldheight < c->maxheight) { c->maxheight = c->fieldheight - 32; } sc_land_setup(c->land, c->fieldwidth, c->fieldheight, sc_land_flags(c)); } else { fprintf(stderr, "--geometry requires an option of form x, e.g. \"640x480\"\n"); return(1); } break; case 'h': return(sc_options_usage(argv[0])); case 'S': c->enablesound = true; break; case 's': c->enablesound = false; break; case SC_OPTION_HQMIXER: c->usehqmixer = true; break; case SC_OPTION_NO_HQMIXER: c->usehqmixer = false; break; #if USE_NETWORK case SC_OPTION_NAME: strcopyb(name, optarg, sizeof(name)); break; case SC_OPTION_PORT: port = atoi(optarg); break; case SC_OPTION_SERVER: isserver = true; break; case SC_OPTION_CLIENT: isclient = true; strcopyb(server, optarg, sizeof(server)); break; #endif /* Network? */ case '?': /* Unknown option. Hidden? */ if(0 == optopt) { /* Unknown, starts with -- */ md5_buffer(argv[optind - 1] + 2, strlenn(argv[optind - 1]) - 2, (void *)digest); if(!memcmp((void *)whee, (void *)digest, 16)) { printf("WHEE! You've found Waif's Hidden Easter Egg!\n"); printf(" ...which is still in progress =/\n\n"); printf("JDS: I *finally* figured out what this bloody encrypted string is.\n"); printf(" Could it be, perhaps, that Waif is dropping a subtle hint here?\n\n"); printf("JDS: So, since you found this, I'll give a little story. A long time\n" " ago, YEARS ago probably, I figured out what this option was. If\n" " you're reading this from the console output then you obviously\n" " know what it is too. Anywho, at some point the code broke and\n" " the check was negated, allowing almost any option to \"match\"\n" " except for the correct one.\n\n" " Well, one day I tried \"--version\" and triggered the egg due to\n" " the bug. My above comment was in response to triggering that\n" " bug, and thinking that waif was perhaps dropping a hint for a new\n" " option we needed to support. I am clearly mistaken :) Still, it\n" " makes for an odd story.\n\n" " At any rate, my response to waif's option is the next line down :)\n"); break; } if(!memcmp((void *)wheee, (void *)digest, 16)) { printf("Wow, you found Justin's response to waif's egg! Impressive...\n\n"); break; } /* really unknown */ fprintf(stderr, "%s: unrecognized option `%s'\n", argv[0], argv[optind-1]); } else { /* really unknown, single - type option */ fprintf(stderr, "%s: unrecognized option `%c'\n", argv[0], optopt); } /* FALLTHROUGH OK */ case ':': default: return(sc_options_usage(argv[0])); } /* Running a server or client connection? */ #if USE_NETWORK if(isserver) { c->server = sc_net_server_new(c, port); if(c->server != NULL) isclient = true; } if(isclient) { c->client = sc_net_client_new(name, server, port); } #endif /* Network? */ return(0); } xscorch-0.2.1/sgame/soptions.h0000644000175000001440000000223711175116135013230 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/soptions.h,v 1.4 2009-04-26 17:39:41 jacob Exp $ */ /* xscorch - soptions.h Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched option processing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __soptions_h_included #define __soptions_h_included #include struct _sc_config; int sc_options_usage(const char *progname); int sc_options_parse(struct _sc_config *c, int argc, char **argv); #endif /* __soptions_h_included */ xscorch-0.2.1/sgame/sphoenix.c0000644000175000001440000004307111615366345013214 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sphoenix.c,v 1.31 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sphoenix.c Copyright(c) 2000-2003 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched phoenix type weapons calls This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static sc_phoenix_result _sc_phoenix_chain(__libj_unused int locate, const sc_config *c, sc_weapon **wp, sc_explosion **e) { /* _sc_phoenix_chain Split a missile with detonation on land and bounce a child if it has any */ double dx, dy; int ph_type, ph_count; sc_explosion *expl; sc_weapon_info *ph_i; sc_weapon *ph_wp; /* What shall we reincarnate as? */ ph_type = SC_PHOENIX_CHILD_TYPE((*wp)->weaponinfo); ph_count = SC_WEAPON_CHILD_COUNT(*wp); /* Allow the final child to detonate on its own. */ if(ph_count >= SC_PHOENIX_CHILD_COUNT((*wp)->weaponinfo)) return(SC_PHOENIX_NO_ACTION); /* Return subsurface weapons to the playing field. */ sc_land_translate_y_d(c->land, &(*wp)->tr->cury); if((*wp)->tr->cury <= 0) (*wp)->tr->cury = 1; /* Insert the next phoenix-like frog (replacing the current weapon). */ ph_i = sc_weapon_lookup(c->weapons, ph_type, SC_WEAPON_LIMIT_NONE); ph_wp = sc_weapon_new(c, (*wp)->weaponinfo, (*wp)->tr->curx, (*wp)->tr->cury, sc_traj_get_velocity_x((*wp)->tr), sc_traj_get_velocity_y((*wp)->tr), (*wp)->triggered, (*wp)->playerid); ph_wp->state |= SC_WEAPON_STATE_DEFER; ph_wp->chain = (*wp)->chain; (*wp)->chain = ph_wp; /* Scale and modify values of the new frog. */ ph_wp->exp_res = (*wp)->exp_res * SC_PHOENIX_INCREASE_FACTOR; dx = fabs(sc_traj_get_velocity_x((*wp)->tr)) * ph_wp->exp_res; dy = fabs(sc_traj_get_velocity_y((*wp)->tr)) * ph_wp->exp_res; /* Bounding by acceptable values. */ if(dy < SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MIN_FROG_POWER) dy = SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MIN_FROG_POWER; if(dx < SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MIN_FROG_POWER) dx = SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MIN_FROG_POWER; if(dy > SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MAX_FROG_POWER) dy = SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MAX_FROG_POWER; if(dx > SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MAX_FROG_POWER) dx = SC_PHYSICS_VELOCITY_SCL * SC_PHOENIX_MAX_FROG_POWER; /* Restore sign of X axis (Y axis must be positive). */ if(sc_traj_get_velocity_x((*wp)->tr) < 0) dx *= -1; /* Finalize the new trajectory. */ sc_traj_set_velocity(ph_wp->tr, dx, dy); /* This is the a run-time child count. */ ph_wp->children = ++ph_count; /* We want the old warhead detonated now. */ expl = sc_weapon_get_explosion(c, *wp, (*wp)->tr->curx, (*wp)->tr->cury, SC_EXPL_DEFAULT_DIR); if(expl == NULL) return(SC_PHOENIX_FAILURE); expl->radius = c->weapons->scaling * (*wp)->exp_res * ph_i->radius; expl->force = ph_i->force; sc_expl_add(e, expl); return(SC_PHOENIX_DETONATE); } static sc_phoenix_result _sc_phoenix_spider(__libj_unused int locate, const sc_config *c, sc_weapon **wp, sc_explosion **e) { /* _sc_phoenix_spider Split a missile with detonation on land and give random destinations */ int i, j, ph_type, ph_count, expl_count, leg_radius, leg_force, scatter; sc_explosion *cure; /* for CURrent Explosion ;) */ sc_weapon_info *ph_i; double srcx; double srcy; /* What shall we reincarnate as? */ ph_type = SC_PHOENIX_CHILD_TYPE((*wp)->weaponinfo); ph_count = SC_PHOENIX_CHILD_COUNT((*wp)->weaponinfo); ph_i = sc_weapon_lookup(c->weapons, ph_type, SC_WEAPON_LIMIT_NONE); /* Random number of explosions based on no less than half of child count. */ expl_count = ph_count / 2 + game_lrand(ph_count / 2); leg_radius = ph_i->radius; leg_force = ph_i->force; /* Radius of blast. */ scatter = SC_PHOENIX_SCATTER((*wp)->weaponinfo) * (*wp)->exp_res * (*wp)->weaponinfo->radius * SC_PHOENIX_SPIDER_POWER; /* First the old weapon explodes (we hope)... */ if(!sc_expl_add(e, sc_weapon_get_explosion(c, *wp, (*wp)->tr->curx, (*wp)->tr->cury, SC_EXPL_DEFAULT_DIR))) goto failure; /* Start loop on number of spider legs (child explosions). */ for(i = 0; i < expl_count; i++) { /* Create a new explosion. */ cure = sc_weapon_get_explosion(c, *wp, 0, 0, SC_EXPL_DEFAULT_DIR); if(cure == NULL) goto failure; cure->radius = c->weapons->scaling * (*wp)->exp_res * leg_radius; cure->force = leg_force; cure->type = SC_EXPLOSION_SPIDER; /* Pick a random x within blast radius. The wall rules and location validation are performed in the low-level land manipulation and trajectory functions now. Also, we make sure to bail out if we try many legs and they all fail validity. In this case, we will simply make (at least) one fewer child explosion(s). */ for(j = 0; j < SC_PHOENIX_SPIDER_MAX_LEG_ATTEMPTS; ++j) { /* Select what we hope is a reasonable center. */ cure->centerx = (*wp)->tr->curx - scatter + game_lrand(2 * scatter); /* Locate the y location corresponding to our x. */ cure->centery = sc_land_height(c->land, cure->centerx, c->fieldheight); /* Valid spider leg found? */ if(cure->centery <= (*wp)->tr->cury + SC_PHOENIX_SPIDER_ARC) { /* Create arc. */ srcx = (*wp)->tr->curx; srcy = sc_land_height(c->land, srcx, c->fieldheight); if((*wp)->tr->cury > srcy) srcy = (*wp)->tr->cury; cure->data = sc_traj_new_dest_height(c, c->players[(*wp)->playerid], SC_TRAJ_IGNORE_WIND | SC_TRAJ_IGNORE_VISC | SC_TRAJ_TERMINUS, srcx, srcy, cure->centerx - srcx, cure->centery - srcy, SC_PHOENIX_SPIDER_ARC); /* Add explosion to explosion chain. */ sc_expl_add(e, cure); /* Avoid free(cure) when we've added it to e. */ cure = NULL; break; } } /* maximum leg attempts */ /* If we utterly failed to create this leg, free its explosion. */ if(cure != NULL) sc_expl_free(&cure); } /* expl_count */ /* We have detonated the initial weapon and (hopefully) some children. */ return(SC_PHOENIX_DETONATE); failure: if(cure != NULL) sc_expl_free(&cure); return(SC_PHOENIX_FAILURE); } static sc_phoenix_result _sc_phoenix_scatter(__libj_unused int locate, const sc_config *c, sc_weapon **wp, __libj_unused sc_explosion **e) { /* _sc_phoenix_scatter Scatter a missile without detonation */ float xscatter, yscatter; sc_weapon *ph_wp, *chain; sc_weapon_info *ph_i; double velx; double vely; int ph_type; int ph_count; /* What shall we reincarnate as? */ ph_type = SC_PHOENIX_CHILD_TYPE((*wp)->weaponinfo); ph_count = SC_PHOENIX_CHILD_COUNT((*wp)->weaponinfo); /* Set some more variables. */ ph_i = sc_weapon_lookup(c->weapons, ph_type, SC_WEAPON_LIMIT_NONE); chain = (*wp)->chain; ph_wp = *wp; /* Set us up to scatter the missiles. Conceptually, this should be thought of as if the old weapon was actually a chain of new weapons linked together. This function just sets off explosions at all of the linkeages, starting first with the middle one(s), so that the outer weapons are given the largest velocity boosts (in opposing directions) and the center weapon, if there are an odd number, retains the old velocity. This behavior is fairly consistant with the behavior of the original Scorched Earth. */ velx = sc_traj_get_velocity_x((*wp)->tr); vely = sc_traj_get_velocity_y((*wp)->tr); if(ph_count > 1) { if(velx == 0 && vely == 0) { /* Avoid divide by zero. */ xscatter = SC_PHOENIX_SCATTER_SCALE * SC_PHOENIX_SCATTER((*wp)->weaponinfo); yscatter = 0; } else { /* Find the x and y portions of the scatter. */ xscatter = SC_PHOENIX_SCATTER_SCALE * SC_PHOENIX_SCATTER((*wp)->weaponinfo) * velx / DIST(velx, vely); yscatter = SC_PHOENIX_SCATTER_SCALE * SC_PHOENIX_SCATTER((*wp)->weaponinfo) * vely / DIST(velx, vely); } velx -= 0.5 * xscatter; vely -= 0.5 * yscatter; xscatter /= ph_count; yscatter /= ph_count; } else { xscatter = 0; yscatter = 0; } /* The weapons have monotonically differential velocities. */ for(; ph_count > 0; --ph_count) { velx += xscatter; vely += yscatter; ph_wp->chain = sc_weapon_new(c, ph_i, (*wp)->tr->curx, (*wp)->tr->cury, velx, vely, (*wp)->triggered, (*wp)->playerid); ph_wp = ph_wp->chain; } ph_wp->chain = chain; /* sc_phoenix_scatter never detonates weapons; they just sizzle. This is not a mandate; it's really more of a cosmetic thing. It would be odd to have them exploding in mid air... */ return(SC_PHOENIX_SIZZLE); } static sc_phoenix_result _sc_phoenix_convert(__libj_unused int locate, const sc_config *c, sc_weapon **wp, sc_explosion **e) { /* sc_phoenix_convert * Convert a weapon to a new trajectory handler */ sc_phoenix_result result = SC_PHOENIX_NO_ACTION; int ph_type; int ph_count; int flags; /* We'll need the weapon flags. */ flags = SC_WEAPON_TRAJ_FLAGS(c, *wp); /* Maybe convert rollers. */ if(SC_WEAPON_IS_ROLLER(*wp)) { /* Skip the conversion if it's already been done. */ if(SC_TRAJ_IS_ROLLING((*wp)->tr)) { result = SC_PHOENIX_NO_ACTION; goto out; } /* Convert the trajectory to the new type. */ if(!sc_trajectory_convert(c, (*wp)->tr, flags, SC_TRAJ_ROLLER)) { /* Manually detonate the failed conversion. */ if(sc_expl_add(e, sc_weapon_get_explosion(c, *wp, (*wp)->tr->curx, (*wp)->tr->cury, SC_EXPL_DEFAULT_DIR))) result = SC_PHOENIX_DETONATE; else result = SC_PHOENIX_FAILURE; goto out; } /* We must ask the tracking code to reset itself. */ result = SC_PHOENIX_RESET; } /* Maybe convert diggers. */ if(SC_WEAPON_IS_DIGGER(*wp)) { /* Skip the conversion if it's already been done. */ if(SC_TRAJ_IS_DIGGING((*wp)->tr)) { result = SC_PHOENIX_NO_ACTION; goto out; } /* Convert the trajectory to the new type. */ if(!sc_trajectory_convert(c, (*wp)->tr, flags, SC_TRAJ_DIGGER)) { /* Manually detonate the failed conversion. */ if(sc_expl_add(e, sc_weapon_get_explosion(c, *wp, (*wp)->tr->curx, (*wp)->tr->cury, SC_EXPL_DEFAULT_DIR))) result = SC_PHOENIX_DETONATE; else result = SC_PHOENIX_FAILURE; goto out; } /* We must ask the tracking code to reset itself. */ result = SC_PHOENIX_RESET; } out: return(result); } static sc_phoenix_result _sc_phoenix_detonate(int locate, const sc_config *c, sc_weapon **wp, sc_explosion **e) { /* sc_phoenix_detonate * Detonate a weapon in place, immediately */ double direction; /* DETONATE is a special phoenix type; we do not require children... */ /* What direction should wedged blasts spread in? */ if(locate == SC_PHOENIX_AT_TANK) direction = c->players[(*wp)->playerid]->turret * M_PI / 180.0; else direction = SC_EXPL_DEFAULT_DIR; /* Take whatever we've got and blow it sky high! */ if(sc_expl_add(e, sc_weapon_get_explosion(c, *wp, (*wp)->tr->curx, (*wp)->tr->cury, direction))) return(SC_PHOENIX_DETONATE); else return(SC_PHOENIX_FAILURE); } sc_phoenix_result sc_phoenix(int locate, const sc_config *c, sc_weapon **wp, sc_explosion **e) { /* sc_phoenix_result Check if a weapon is phoenix class and if so call the requested action on it. It is important to *NOTE* that when these subfunctions return, the original wp pointer is left intact. It MUST BE DELETED by the calling function if the return value is either SC_PHOENIX_DETONATE or SC_PHOENIX_SIZZLE. In certain cases like spider explosions, detonations will be created by the subfunctions. It is up to the caller to verify that the weapon is intended to be modified at the phoenix location it is calling from. */ sc_phoenix_result result = SC_PHOENIX_NO_ACTION; /* Run the appropriate phoenix function(s); NOTE that although this is not an either/or operation, strange things may happen if you take advantage of this fact. We simply haven't tested what will occur. */ if(SC_PHOENIX_IS_DETONATE((*wp)->weaponinfo)) { result = _sc_phoenix_detonate(locate, c, wp, e); if(result == SC_PHOENIX_DETONATE || result == SC_PHOENIX_FAILURE) goto out; } if(SC_PHOENIX_CHILD_TYPE((*wp)->weaponinfo) <= 0 || SC_PHOENIX_CHILD_COUNT((*wp)->weaponinfo) <= 0) { /* All of the remaining operations require children... */ goto out; } if(SC_PHOENIX_IS_CONVERT((*wp)->weaponinfo)) { result = _sc_phoenix_convert(locate, c, wp, e); if(result == SC_PHOENIX_RESET || result == SC_PHOENIX_FAILURE) goto out; } if(SC_PHOENIX_IS_CHAIN((*wp)->weaponinfo)) { result = _sc_phoenix_chain(locate, c, wp, e); if(result == SC_PHOENIX_DETONATE || result == SC_PHOENIX_FAILURE) goto out; } if(SC_PHOENIX_IS_SPIDER((*wp)->weaponinfo)) { result = _sc_phoenix_spider(locate, c, wp, e); if(result == SC_PHOENIX_DETONATE || result == SC_PHOENIX_FAILURE) goto out; } if(SC_PHOENIX_IS_SCATTER((*wp)->weaponinfo)) { result = _sc_phoenix_scatter(locate, c, wp, e); if(result == SC_PHOENIX_DETONATE || result == SC_PHOENIX_FAILURE) goto out; } out: return(result); } /* An slink list of slcache structs is used to detect circular weapon definitions. */ typedef struct _slcache {int id; struct _slcache *next;} slcache; static int _sc_phoenix_safe_verify(const sc_weapon_config *wc, const sc_weapon_info *info, slcache *cache, slcache *prev) { /* sc_phoenix_verify Recursively scan the weapon's info structure and check for fatal errors. */ const sc_weapon_info *child; slcache *temp = cache; slcache current; int count = 1; int level = 0; /* Create cache entry for this level. */ prev->next = ¤t; current.id = SC_WEAPON_TYPE(info); current.next = NULL; /* DETONATE types aren't *really* phoenix weapons, per se... */ if(SC_WEAPON_IS_PHOENIX(info) && !SC_PHOENIX_IS_DETONATE(info)) { /* Find out what we're expecting as a child. */ child = sc_weapon_lookup(wc, SC_PHOENIX_CHILD_TYPE(info), SC_WEAPON_LIMIT_NONE); /* A non-extant child will really throw a sabo into the machinery. */ if(child == NULL) return(0); /* If we are our own child then we're staring at the face of infinity... */ if(SC_WEAPON_TYPE(info) == SC_WEAPON_TYPE(child)) return(0); /* Scan the weapon's ancestors for loop conditions. */ while(temp != prev->next) { /* If the current weapon is among its ancestors, kill it. */ if(SC_WEAPON_TYPE(info) == temp->id) return(0); temp = temp->next; } /* Find out what the levels under our child are. */ level = _sc_phoenix_safe_verify(wc, child, cache, ¤t); /* If our child is invalid, then we are. */ if(level == 0) return(0); /* Add up the potential levels under each type we have. */ if(SC_PHOENIX_IS_CHAIN(info)) count += level; if(SC_PHOENIX_IS_SPIDER(info)) count += level; if(SC_PHOENIX_IS_SCATTER(info)) count += level; } /* A non-phoenix or DETONATE weapon is by definition acceptable. Besides, that's the stopping condition... */ /* Release this level of the cache. */ prev->next = NULL; /* Return count of this and sub levels. */ return(count); } int sc_phoenix_verify(const sc_weapon_config *wc, const sc_weapon_info *info) { /* sc_phoenix_verify Verify the validity of a phoenix weapon. Return non-zero if it is a valid phoenix weapon. Specifically, return the number of levels of children defined by the weapon. This is a bit expensive; don't call it too often. */ /* Create the temporary cache head. */ slcache cache; cache.id = -1; cache.next = NULL; /* Scan the weapon. */ return(_sc_phoenix_safe_verify(wc, info, &cache, &cache)); } /* Phoenix flag information for saddconf.c */ static const char *_sc_phoenix_flags_bit_names[] = { "at_rand", "at_tank", "at_apex", "at_land", "chain", "spider", "scatter", "convert", "detonate", NULL }; static const unsigned int _sc_phoenix_flags_bit_items[] = { SC_PHOENIX_AT_RAND, SC_PHOENIX_AT_TANK, SC_PHOENIX_AT_APEX, SC_PHOENIX_AT_LAND, SC_PHOENIX_TYPE_CHAIN, SC_PHOENIX_TYPE_SPIDER, SC_PHOENIX_TYPE_SCATTER, SC_PHOENIX_TYPE_CONVERT, SC_PHOENIX_TYPE_DETONATE, 0 }; const char **sc_phoenix_flags_bit_names(void) { return(_sc_phoenix_flags_bit_names); } const unsigned int *sc_phoenix_flags_bit_items(void) { return(_sc_phoenix_flags_bit_items); } xscorch-0.2.1/sgame/sphoenix.h0000644000175000001440000001705011615366345013217 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sphoenix.h,v 1.16 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sphoenix.h Copyright(c) 2000-2003 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched phoenix type weapons calls This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sphoenix_h_included #define __sphoenix_h_included /* Includes */ #include /* Type definitions */ struct _sc_config; struct _sc_weapon; struct _sc_explosion; struct _sc_weapon_info; struct _sc_weapon_config; /* How likely is a RAND phoenix to modify at any given timestep? */ #define SC_PHOENIX_PROB_AT_RAND 0.01 /* Default explosion chain size increase. */ #define SC_PHOENIX_INCREASE_FACTOR 0.85 /* The bounds on bounce power for FROG phoenix weapons. They're not exactly real power. To convert them do: sqrt(2 * x^2) */ #define SC_PHOENIX_MIN_FROG_POWER 70 #define SC_PHOENIX_MAX_FROG_POWER 350 /* Scatter yield *= (this + scatter) / this. */ #define SC_PHOENIX_YIELD_SCATTER_SCALE 10.0 /* This scale can be used to increase or decrease the force of the separation between parts of a phoenix type weapon like a mirv or a leap-frog. The weapon definition itself will give a relative scatter rate between 0 and 15 velocity units inclusive. This number will be multiplied by the SC_PHOENIX_SCATTER_SCALE in order to get the actual velocity scale. With the current physics, I do not recommend setting this above 2. Also, the scatter in the weapon definition is best if less than 8. */ #define SC_PHOENIX_SCATTER_SCALE 1 /* These are the modifiers for spider explosion generation. o ARC is how many pixels high to make the drawn trajectories of spider explosions. This should eventually be scaled by the screen size setting. o POWER is a multiplier that can be used to modify the scatter distance. o MAX_LEG_ATTEMPTS limits the attempts to find an acceptable arc for each spider leg. The main purpose of this is to ensure loop termination. */ #define SC_PHOENIX_SPIDER_ARC 128.0 #define SC_PHOENIX_SPIDER_POWER 0.25 #define SC_PHOENIX_SPIDER_MAX_LEG_ATTEMPTS 100 /* NOTE that modifications to the following two sections must be reflected in the functions at the bottom of sphoenix.c. Also they may require some changes to saddconf.c, and perhaps to the weapons.def file as well. */ /* Phoenix location classes. These describe locations where phoenix weapons may change their composition. The current options are: o RAND causes the weapon to be modified at a random point in its flight arc. The modification is not guaranteed; that is, the weapon may detonate unmodified instead. This is used in Black Market MIRVs. o TANK means the weapon is modified as it is created. This is for things like a "triple tank" that shoots three bullets at once. o APEX means the weapon is modified at the peak of its trajectory. This is used for MIRVs and Death's Heads. o LAND means that the weapon will be modified when it lands, prior to normal detonation. This is used for weapons like the Funky Bomb and Leap Frog. A note on Evil Weapon Design is that a weapon may utilize more than one of these tactics if it's done right... */ #define SC_PHOENIX_AT_RAND 0x0100 /* Maybe modify weapon at random location */ #define SC_PHOENIX_AT_TANK 0x0200 /* Modify weapon when fired */ #define SC_PHOENIX_AT_APEX 0x0400 /* Modify weapon at the apex of its flight */ #define SC_PHOENIX_AT_LAND 0x0800 /* Modify weapon when it lands */ #define SC_PHOENIX_IS_AT_RAND(i) ((i)->ph_fl & SC_PHOENIX_AT_RAND) #define SC_PHOENIX_IS_AT_TANK(i) ((i)->ph_fl & SC_PHOENIX_AT_TANK) #define SC_PHOENIX_IS_AT_APEX(i) ((i)->ph_fl & SC_PHOENIX_AT_APEX) #define SC_PHOENIX_IS_AT_LAND(i) ((i)->ph_fl & SC_PHOENIX_AT_LAND) /* Phoenix weapon action functions. These specify the function that will be used to modify a weapon when it reaches its modification location(s). o CHAIN is used to make weapons that "bounce" and get progressively smaller or larger depending on the value of SC_PHOENIX_INCREASE_FACTOR (sweapon.h). o SPIDER explosions create instant explosions in nearby locations. This will be influenced by the yield defined for the spider weapon itself. o SCATTER takes a single weapon and splits it into one or more child weapons. The children are scattered depending on SC_PHOENIX_SCATTER_SCALE (above). o CONVERT modifies the weapon's tracking method, effectively converting the weapon to a new ``type'' of weapon. The new tracking method *must not* detect phoenix events in the same location as the old did. o DETONATE will cause the weapon to detonate immediately. */ #define SC_PHOENIX_TYPE_CHAIN 0x0001 #define SC_PHOENIX_TYPE_SPIDER 0x0002 #define SC_PHOENIX_TYPE_SCATTER 0x0004 #define SC_PHOENIX_TYPE_CONVERT 0x0008 #define SC_PHOENIX_TYPE_DETONATE 0x0010 #define SC_PHOENIX_IS_CHAIN(i) ((i)->ph_fl & SC_PHOENIX_TYPE_CHAIN) #define SC_PHOENIX_IS_SPIDER(i) ((i)->ph_fl & SC_PHOENIX_TYPE_SPIDER) #define SC_PHOENIX_IS_SCATTER(i) ((i)->ph_fl & SC_PHOENIX_TYPE_SCATTER) #define SC_PHOENIX_IS_CONVERT(i) ((i)->ph_fl & SC_PHOENIX_TYPE_CONVERT) #define SC_PHOENIX_IS_DETONATE(i) ((i)->ph_fl & SC_PHOENIX_TYPE_DETONATE) /* Constants pertaining to phoenix integers */ #define SC_PHOENIX_LOCATION 0xff00 #define SC_PHOENIX_TYPE 0x00ff /* Macros for generic phoenix weapon info */ #define SC_PHOENIX_CHILD_COUNT(i) ((i)->children) #define SC_PHOENIX_CHILD_TYPE(i) ((i)->ph_ch) #define SC_PHOENIX_SCATTER(i) ((i)->scatter) #define SC_WEAPON_IS_PHOENIX(i) ((i)->ph_fl) /* Return values for status checking */ typedef enum _sc_phoenix_result { SC_PHOENIX_NO_ACTION = 0, /* No action was taken */ SC_PHOENIX_FAILURE, /* We try to leave the weapon unmodified */ SC_PHOENIX_SIZZLE, /* The weapon effectively sizzled; no explosion */ SC_PHOENIX_DETONATE, /* The weapon exploded and was replaced by children */ SC_PHOENIX_RESET /* The tracking was changed and should be reset */ } sc_phoenix_result; /* sc_phoenix(), which is a unified interface to the different phoenix functions and locations. */ sc_phoenix_result sc_phoenix(int locate, const struct _sc_config *c, struct _sc_weapon **wp, struct _sc_explosion **e); /* sc_phoenix_verify() scans a phoenix weapon definition and returns non-zero if the definition is valid. Specifically, it returns the number of levels of children that are involved in the phoenix definition. */ int sc_phoenix_verify(const struct _sc_weapon_config *wc, const struct _sc_weapon_info *info); /* Phoenix flag information for saddconf.c */ const char **sc_phoenix_flags_bit_names(void); const unsigned int *sc_phoenix_flags_bit_items(void); #endif /* __sphoenix_h_included */ xscorch-0.2.1/sgame/sphysics.c0000644000175000001440000023347711615364352013233 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sphysics.c,v 1.70 2011-07-31 23:44:42 jacob Exp $ */ /* xscorch - sphysics.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2011 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched physics This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include /* WARNING You are about to be treated with some rather unpleasant code. I suggest turning back. Now would be a good time. */ /* DESIGN PHILOSOPHY If you're not going to listen to reason, then you might as well listen to this instead. Excerpt from README for CS47 Homework #9, 1999, by Justin David Smith. Perhaps you will recognize the original reference: Imagine. It's Australia. You're flying a military helicopter low to the ground. To the left, you see a herd of kangaroos. You avoid them, knowing that they will give away your position. But one of their herd spies you flying overhead. Within seconds, the herd has dispersed to strategic locations nearby. Seconds later, a round of Stinger missiles are incoming. Seconds later, you are toast. We have only ourselves to blame for such a predicament. After all, we all advocate code re-use. Good object-oriented programming promotes code re-use. And at some point, when the code was being written for kangaroos, some lazy programmer decided it would be a great idea to inherit from another class that had already been written -- so what if that other class was Human_Military_Infantry? It's all the same really, just replace an icon and presto! You have a kangaroo. Makes sense in a twisted sort of way. It's reassuring to know that the programmer that brought about your demise was only carrying out the principle of code re-use. Or maybe this is just a testament to why I should not write documentation on little to no sleep. I always wondered how the man page to the feather command came about; now I think I know ... */ /* ACCOUNTING FOR VISCOSITY rho Consider the force equation for viscosity in Y direction, noting that viscosity will always act opposite to gravity. We will also require initial conditions, i.e. y(0) = y0 and y'(0) = vy. rho has units of N m/sec; define nu = rho / m, which has units of sec/m. F = -m G + rho dy/dt G d^2y/dt^2 = -G + nu G dy/dt d^2y/dt^2 - nu G dy/dt = -G y(t) = [ (e^(G nu t) - 1) (nu vy - 1) + G nu (nu y0 + t) ]/(G nu^2) Observe that this equation only holds if nu != 0. In the case where nu == 0, we reduce to our original equations above. TRAJECTORIES BASED ON STARTING ANGLE THE BASIC CASE: NO WIND ------------------------- We start by considering a simple case. Assume we have one force G, acting downward. Then if we want to determine the angle a, and velocity, v, needed to reach (x, y), we can use standard Ph1a knowledge to solve: x = vx t y = vy t - 1/2 G t^2 If we assume a, and solve for v: x = vx t --> t = x / vx y = x vy/vx - 1/2 G x^2/vx^2 y = x tan a - 1/2 G x^2/(v^2 cos^2 a) y - x tan a = -1/2 G x^2/(v^2 cos^2 a) v^2 = 1/2 G x^2/cos^2 a * 1/(x tan a - y) Observe we can only have a valid trajectory if (x tan a) > y. Also, we can't have cos a == 0, which means a cannot be vertical. In the case where a is vertical: 1) x == 0, y > 0: then power is governed by max height: dy/dt = 0 = v - G t t = v/G y = v^2/G - 1/2 v^2/G v = sqrt(2 G y) 2) y < 0: Can choose a minimal power to reach the destination. However, this "minimal power" causes a trajectory which includes us in its path. This scenario is not desirable. 3) If x != 0, then we cannot reach the target at all. EXTENDED CASE: CONSIDERING WIND --------------------------------- Assume we have two orthogonal forces, G (acting downward) and W (toward +x). Then, if we want to determine the angle a, and velocity v, required to reach coordinates (x,y), we can use the two force equations to determine: x = vx t + 1/2 W t^2 y = vy t - 1/2 G t^2 We can solve for v using the first equation: v = (x - 1/2 W t^2) / (t cos a) y = v sin a t - 1/2 G t^2 = (x - 1/2 W t^2) tan a - 1/2 G t^2 y - x tan a = -1/2 t^2 (W tan a + G) t^2 = 2(x tan a - y) / (W tan a + G) = 2(x sin a - y cos a) / (W sin a + G cos a) Therefore, we can find v in terms of a (note, the angle parameter will be a free (independent) variable). Observe that, we must have a valid (nonzero) flight time for the solution to be valid. The special cases are: 1) Wsin(a) + Gcos(a) == 0 -- weapon will hit source eventually. We can transform this into the equivalent special case for gravity by rotating (90-a) degrees clockwise. Then we can run the "vertical" special cases, from above, noting that: x' = x cos(90-a) - y sin(90-a) [ sin(90-a) = cos(a) y' = x sin(90-a) + y cos(90-a) cos(90-a) = sin(a) ] 2) t^2 <= 0: Treat this as an impossible case. 3) cos a == 0: If this occurs, then t^2 = 2 x/W. Treat as impossible for the time being, I'm not sure how to deal with this case. REDUCING CASE IF W == 0 ------------------------ If W == 0, then observe that flight time and velocity reduce to: t^2 = 2(x sin a - y cos a) / (G cos a) = 2(x tan a - y) / G v^2 = x^2 / (t cos a)^2 = 1/2 G x^2/cos^2 a * 1/(x tan a - y) Which is the case predicted above, without considering wind. Also observe that the special cases properly reduce to the special cases without considering wind. Therefore, we conclude we can use the more general mechanism to solve trajectories. TRAJECTORIES BASED ON PARABOLA HEIGHT THE BASIC CASE: NO WIND ------------------------- We start by considering a simple case. From the previous analysis, we know the following formulas hold if (x tan a) > y, and cos a != 0: x = vx t y = vy t - 1/2 G t^2 v^2 = 1/2 G x^2/cos^2 a * 1/(x tan a - y) We also have a requirement on the height, h, of the parabola: dy/dt = 0 = vy - G th --> th = vy / G h = vy th - 1/2 G th^2 = vy^2 / G - 1/2 G vy^2 / g^2 = 1/2 vy^2 / G vy^2 = 2 G h v^2 sin^2 a = 2 G h We can combine the two equations to solve for a, as follows: (1/2 G x^2/cos^2 a * 1/(x tan a - y)) sin^2 a = 2 G h 1/2 G x^2 tan^2 a = 2 G h (x tan a - y) x^2 tan^2 a = 4 h (x tan a - y) <-- A = tan a x^2 A^2 - 4 h x A + 4 h y = 0 A = (4 h x -+ sqrt(16 h^2 x^2 - 16 x^2 h y)) / (2 x^2) = 1/x (2 h -+ 2 sqrt(h^2 - h y)) Note the implied restriction that h > y, which makes sense. Perhaps more interesting is the -+ -- which one do we choose? Well, I posit that we want to choose "+". When y==0, this equation suggests a positive angle, and an angle of zero as the two solutions -- inspection quickly reveals that an angle of zero can only work with infinite power. We conclude that we should choose the positive branch. a = arctan( 2 (h + sqrt(h^2 - h y)) / x ) The power can now be determined through the usual mechanism. EXTENDED CASE: CONSIDERING WIND --------------------------------- This case is damn near impossible to calculate. For the time being, it is NOT SUPPORTED. (I've tried it by hand, and mathematica can't solve the equation either. Sorry.) WHAT TIMESTEP REACHES A DESTINATION? ------------------------------------- Consider reaching the destination (x0, y0) (with the source at (0, 0)). Ignoring wind, the time that reaches the destination is governed by the equations: x0 = vx t0 y0 = vy t0 - 1/2 G t0^2 Both equations must be satisfied, therefore: 1/2 G t0^2 - vy t0 + y0 = 0 t0 = (vy -+ sqrt(vy^2 - 4 * 1/2 G * y0)) / G = 1/G (vy -+ sqrt(vy^2 - 2 G y0)) We generally assume the apex was already reached, therefore t0 = 2 vy/G + 2/G * sqrt(vy^2 - 2 G y0) */ /*** Basic Physics ***/ /* Calculation of the default gravity and velocity scaling, which allow a weapon at maximum power to cross the playing field in a reasonable amount of time: Given: T = maximum flight time (seconds) (T=5s) P = maximum power (e.g., P=1000) w = playing field width (pixels) (e.g., w=800) h = playing field height (pixels) (e.g. h=600) C = cycle time (currently C=50ms/step) Calculate: a = optimal angle for crossing playing field S = velocity scaling factor (pixels/power_unit) g = gravity (pixels/step/step) Let: T' = T / C (maximum number of steps) v = P * S (velocity, pixels/step) v cos(a) = w / T' (these follow from Ph1a) h = (v sin(a)) T'/2 - g T'^2/8 0 = -g T'/2 + (v sin(a)) v sin(a) = g T'/2 So: h = g T'^2/8 (we can determine g!) g = 8 h / T'^2 (units of pixel/step/step) Now... tan(a) = (T' / w) (g T'/2) = (T' / w) (8 h / T'^2) (T'/2) = 4 h / w a = arctan(4 h / w) Once we have the optimal angle, we have v: v = w / (T' cos(a)) The equations are: g = 8 h C^2 / T^2 S = w C / (T P cos(a)) */ sc_physics *sc_physics_new(void) { /* sc_physics_new Create a new physics parametre structure. */ sc_physics *ph; /* New structure */ /* Allocate memory for the parametre structure */ ph = (sc_physics *)malloc(sizeof(sc_physics)); if(ph == NULL) return(NULL); /* Initialise the various parametres */ ph->airviscosity = 0; ph->gravity = SC_PHYSICS_GRAVITY_DEF; ph->damping = SC_TRAJ_TUNNEL_DAMPING; ph->maxwind = SC_PHYSICS_WIND_DEF; ph->suspenddirt = 0; ph->tanksfall = 100; ph->dynamicwind = true; ph->bordersextend = SC_PHYSICS_BORDERS_DEF; ph->walls = SC_WALL_WRAP; /* Return the new structure */ return(ph); } void sc_physics_free(sc_physics **ph) { /* sc_physics_free Release the physics parametre structure. */ if(ph == NULL || *ph == NULL) return; free(*ph); *ph = NULL; } void sc_physics_init_game(sc_physics *ph) { /* sc_physics_init_game There's nothing to do these days on game init. */ assert(ph != NULL); } void sc_physics_init_round(sc_physics *ph) { /* sc_physics_init_round Initialize a round. This usually involves setting up the default wind. */ assert(ph != NULL); ph->curwind = (game_drand() * 2 - 1) * ph->maxwind; } void sc_physics_update_wind(sc_physics *ph) { /* sc_physics_update_wind Update the wind; this is done only if the wind is dynamic. Note that a delta is applied to the wind, to keep it from literally jumping from anywhere, to anywhere. */ assert(ph != NULL); if(ph->dynamicwind) do { /* Update the wind, making sure to stay within the valid range. */ if(ph->curwind < -ph->maxwind) { ph->curwind += game_drand() * ph->maxwind * SC_PHYSICS_DELTA_WIND_MAX; } else if(ph->curwind > ph->maxwind) { ph->curwind -= game_drand() * ph->maxwind * SC_PHYSICS_DELTA_WIND_MAX; } else { ph->curwind += (game_drand() * 2 - 1) * ph->maxwind * SC_PHYSICS_DELTA_WIND_MAX * 2; } } while(ph->curwind < -ph->maxwind || ph->curwind > ph->maxwind); } /*** Trajectory Code ***/ static inline void _sc_traj_reset(sc_trajectory *tr) { /* _sc_traj_reset Resets a trajectory. This erases any "victim" information, used by the AI code to figure out who the trajectory eventually hit. This also clears the timestep and sets all XY coordinates to the center of the trajectory. This function updates the "tracked" parameters, but preserves the params that indicate the physical model (initial position, initial velocity, etc). */ assert(tr != NULL); tr->victim = -1; tr->timestep = 0; tr->curx = tr->oldx = tr->lastx = tr->ctrx; tr->cury = tr->oldy = tr->lastx = tr->ctry; tr->dir = 0; } void sc_traj_reinitialize(sc_trajectory *tr) { /* sc_traj_reinitialize Reinitialize a trajectory. This sets the physics model parametres to their initial i* values. This also resets all "tracked" parametres such as the victim, current timestep, and current XY coordinates. */ assert(tr != NULL); tr->ctrx = tr->_ictrx; tr->ctry = tr->_ictry; tr->velx = tr->_ivelx; tr->vely = tr->_ively; tr->accx = tr->_iaccx; tr->accy = tr->_iaccy; _sc_traj_reset(tr); } static inline double _sc_traj_height(double vely, double gravity) { /* sc_traj_height Calculates height attained by this trajectory, dictated by equations: dy/dt = 0 = vy - G t vy = G t t = vy/G y = vy t - 1/2 G t^2 = vy^2 / (2 G) */ /* Calculate velocity squared, and factor in the current gravity. */ return(0.5 * SQR(vely) / gravity); } static inline void _sc_traj_copy_init_params(sc_trajectory *tr) { /* sc_traj_copy_init_params Copies the parametres for the initial control equation. */ tr->_ictrx = tr->ctrx; tr->_ictry = tr->ctry; tr->_ivelx = tr->velx; tr->_ively = tr->vely; tr->_iaccx = tr->accx; tr->_iaccy = tr->accy; } static inline sc_trajectory *_sc_traj_new(const sc_config *c, const sc_player *p, sc_trajectory_type type, int flags, double centerx, double centery) { /* sc_traj_new Create a new trajectory structure with "reasonable" defaults. Note that "reasonable" is defined by the person who wrote most of this file, namely Me, Justin, the programmer of DHOOM. You would be very well justified to question my idea of "reasonable" at this stage. The trajectory is initialized with the centerx,centery coordinates as its starting position. It will use the config structure to setup initial acceleration; velocity is cleared. The flags can default to SC_TRAJ_DEFAULT. */ sc_trajectory *tr; /* Storage location for trajectory */ assert(c != NULL); assert(p != NULL); /* Attempt to allocate the memory */ tr = (sc_trajectory *)malloc(sizeof(sc_trajectory)); if(tr == NULL) return(NULL); /* Configure the type */ tr->type = type; /* Initialise origin coordinate */ tr->ctrx = centerx; tr->ctry = centery; /* Initialise velocity */ tr->velx = 0; tr->vely = 0; /* Initialise accelerations */ tr->accx = (flags & SC_TRAJ_IGNORE_WIND) ? 0 : c->physics->curwind; tr->accy = c->physics->gravity; tr->oaccx = tr->accx; tr->oaccy = tr->accy; /* Initialise "current" state */ _sc_traj_reset(tr); /* Set terminus step */ tr->stopstep = (flags & SC_TRAJ_BRIEF ? SC_TRAJ_TIMEOUT / 3 : SC_TRAJ_TIMEOUT); /* Clear out landfall params */ tr->landfall_x1 = c->fieldwidth; tr->landfall_x2 = 0; /* Make the player assignment */ tr->player = p; /* Victim setup */ tr->victim = -1; /* Return the new structure */ return(tr); } sc_trajectory *sc_traj_new_velocities(const sc_config *c, const sc_player *p, int flags, double centerx, double centery, double velx, double vely) { /* sc_traj_new_velocities Create a new trajectory with the given initial velocity, broken up into X and Y components. Accelerations are inherited from the config structure. This builds a FLIGHT trajectory. */ sc_trajectory *tr; /* Storage for the new trajectory */ assert(c != NULL); assert(p != NULL); /* Create the trajectory */ tr = _sc_traj_new(c, p, SC_TRAJ_FLIGHT, flags, centerx, centery); if(tr == NULL) return(NULL); /* Calculate initial velocity */ tr->velx = velx; tr->vely = vely; /* Copy init state over */ _sc_traj_copy_init_params(tr); /* Return the trajectory */ return(tr); } sc_trajectory *sc_traj_new_power_angle(const sc_config *c, const sc_player *p, int flags, double centerx, double centery, double power, double angle) { /* sc_traj_new_power_angle Create a new trajectory with the given power (initial velocity) and angle. WARNING, the power value must already be scaled to "proper" units before it is passed to this function! The angle is a standard angle in degrees, with 0==right, 90==up. This builds a FLIGHT trajectory. */ sc_trajectory *tr; /* Storage for the new trajectory */ assert(c != NULL); assert(p != NULL); /* Create the trajectory */ tr = _sc_traj_new(c, p, SC_TRAJ_FLIGHT, flags, centerx, centery); if(tr == NULL) return(NULL); /* Calculate initial velocity */ tr->velx = power * cos(angle * M_PI / 180); tr->vely = power * sin(angle * M_PI / 180); /* Copy init state over */ _sc_traj_copy_init_params(tr); /* Return the trajectory */ return(tr); } /* Forward declarations for processing roller and digger trajectories. */ static void _sc_traj_roller_fallthrough(const sc_config *c, sc_trajectory *tr, int flags); static bool _sc_traj_digger_reselect_dir(const sc_config *c, sc_trajectory *tr, int flags); bool sc_trajectory_convert(const sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_type type) { /* sc_trajectory_convert Convert from one trajectory type to another. Not all possible conversions are supported right now. This is generally used when a warhead in flight that contains a roller/digger impacts; the trajectory must be converted from flight mode to roller/digger as appropriate... The original trajectory is given in tr; the type to convert *to* is given in type. The physics of the original trajectory will be converted over in tr itself. If the conversion is illegal, this function returns false. */ int height; /* Height of land */ double slope; /* Slope of nearby land */ assert(c != NULL); if(tr == NULL) return(false); /* Figure out what conversion is occurring */ switch(tr->type) { case SC_TRAJ_FLIGHT: /* Originally a flying weapon */ switch(type) { case SC_TRAJ_FLIGHT: tr->ctrx = tr->curx; tr->ctry = tr->cury; break; case SC_TRAJ_ROLLER: /* Note that tr->lastx, tr->lasty indicate the last coordinate that was NOT an impact. We should start the rolling from there, since tr->curx, tr->cury reflect the actual point of impact. */ /* Also fail the conversion if we've hit a tank. */ if(tr->victim >= 0) { return(false); } /* Update the static data based on current dynamic info */ tr->type = SC_TRAJ_ROLLER; tr->ctrx = tr->lastx; tr->ctry = tr->lasty; /* Find the rough slope of the local land. */ slope = sc_land_height(c->land, tr->ctrx - 1, tr->lasty + 1) - sc_land_height(c->land, tr->ctrx + 1, tr->lasty + 1); slope /= 2.0; /* If the weapon velocity and the slope oppose, reverse it. */ if(tr->velx != 0 && slope / tr->velx > 0) { tr->velx = -tr->velx; } /* When rolling, we don't keep track of vely. */ tr->vely = 0; /* Reinitialise the weapon */ _sc_traj_reset(tr); _sc_traj_roller_fallthrough(c, tr, flags); break; case SC_TRAJ_DIGGER: /* Update the static data based on current dynamic info */ tr->type = SC_TRAJ_DIGGER; tr->ctrx = tr->curx; tr->ctry = tr->cury; height = sc_land_height(c->land, tr->ctrx, c->land->height); if(height > tr->ctry) tr->ctry = height; tr->vely = 0; /* Reinitialise the weapon */ _sc_traj_reset(tr); _sc_traj_digger_reselect_dir(c, tr, flags); break; } /* End of flight->? case */ break; case SC_TRAJ_ROLLER: /* Rollers cannot convert. */ fprintf(stderr, "sc_trajectory_convert: Illegal conversion ignored.\n"); return(false); case SC_TRAJ_DIGGER: /* Diggers cannot convert. */ fprintf(stderr, "sc_trajectory_convert: Illegal conversion ignored.\n"); return(false); } /* At this point, do sc_traj_run as if nothing ever happened... */ return(true); } void sc_traj_landfall(sc_config *c, const sc_trajectory *tr) { /* sc_traj_landfall Process landfall as a result of trajectory tr. This is called at the end of tr's life usually, when we determine just what effect it had on the land it passed through. Since trajectories do not generally do much damage to the land, we process all landfall and player falls at once; this code is not animated. */ assert(tr != NULL && c != NULL); if(tr->landfall_x1 <= tr->landfall_x2) { while(sc_land_drop_zone(c, c->land, tr->landfall_x1, tr->landfall_x2)) /* Just loop */; while(sc_player_drop_all(c)) /* Just loop */; } } void sc_traj_free(sc_trajectory **tr) { /* sc_traj_free Releases a trajectory. */ if(tr == NULL || *tr == NULL) return; free(*tr); *tr = NULL; } static double _sc_traj_power(double gravity, double wind, __libj_unused double visc, double deltax, double deltay, double angle) { /* sc_traj_power Calculates power required for a trajectory to the specified coordinates, using a given angle, taking into account gravity and wind. We assume the current player is at coordinates (0, 0). Gravity value is always positive, and oriented downward. Wind value is positive if the wind is directed to the right (+x direction). This function returns a value less than zero if the trajectory could not be computed along the given angle. */ double flighttime;/* Total flying time to reach destination */ double flttime2; /* Square of time required to reach target */ double WSin_GCos; /* (W sin a + G cos a) */ double velocity; /* Real velocity rqd to reach (dx,dy) */ double sina; /* Sine of angle */ double cosa; /* Cosine of angle */ double xprime; /* Transformed X coordinate */ double yprime; /* Transformed Y coordinate */ /* Calculate the relevant sines and cosines. */ sina = sin(angle * M_PI / 180); cosa = cos(angle * M_PI / 180); /* Check if weapon will hit source eventually. */ WSin_GCos = wind * sina + gravity * cosa; if(WSin_GCos == 0) { /* Transform so coords are in a vertical forcing field. */ xprime = deltax * sina - deltay * cosa; yprime = deltax * cosa + deltay * sina; if(xprime != 0 || yprime <= 0) return(-1); return(sqrt(2 * WSin_GCos * yprime)); } /* Are we firing on 1 dimension? */ if(cosa == 0) { /* We don't know how to deal with this case. */ return(-1); } /* Calculate the flying time. */ flttime2 = 2 * (deltax * sina - deltay * cosa); flttime2 = flttime2 / WSin_GCos; if(flttime2 <= 0) { /* Flight time is impossible. */ return(-1); } /* Is flight time valid? */ flighttime = sqrt(flttime2); /* Calculate the real velocity. */ velocity = (deltax - 0.5 * wind * flttime2); velocity = velocity / (flighttime * cosa); /* Sanity check; velocity cannot be negative. */ if(velocity < 0) { return(-1); } /* Return the power value */ return(velocity); } sc_trajectory *sc_traj_new_dest_angle(const sc_config *c, const sc_player *p, int flags, double centerx, double centery, double deltax, double deltay, double angle, double maxpower) { /* sc_traj_new_dest_angle Create a new trajectory with the given power (initial velocity) and angle. The destination coordinate is specified as a delta, i.e. it is specified _relative_ to the center coordinate. The angle is is it was with new_power_angle(). */ sc_trajectory *tr; /* Storage for the new trajectory */ double height; /* Maximum height of arc */ double power; /* Calculated power rating */ double wind; /* Wind value to use */ double visc; /* Viscosity to use */ /* We must have a valid config */ if(c == NULL) return(NULL); /* Create the trajectory */ tr = _sc_traj_new(c, p, SC_TRAJ_FLIGHT, flags, centerx, centery); if(tr == NULL) return(NULL); /* Get wind and viscosity ratings */ wind = (flags & SC_TRAJ_IGNORE_WIND) ? 0 : c->physics->curwind; visc = (flags & SC_TRAJ_IGNORE_VISC) ? 0 : c->physics->airviscosity; /* Calculate an expected power rating */ power = _sc_traj_power(c->physics->gravity, wind, visc, deltax, deltay, angle); if((power < 0 || power > maxpower) && !(flags & SC_TRAJ_RESTRICTIVE)) { /* If wrapping walls, then we can try two more trajectories */ if(c->physics->walls == SC_WALL_WRAP) { power = _sc_traj_power(c->physics->gravity, wind, visc, deltax + c->fieldwidth, deltay, angle); if(power < 0 || power > maxpower) { power = _sc_traj_power(c->physics->gravity, wind, visc, deltax - c->fieldwidth, deltay, angle); } /* Tried a third trajectory */ } /* Do we have wrapping boundaries? */ } /* Can we try other trajectories? */ /* Was the power rating valid? */ if(power < 0 || power > maxpower) { /* Trajectory cannot be computed */ free(tr); return(NULL); } /* Calculate initial velocity */ tr->velx = power * cos(angle * M_PI / 180); tr->vely = power * sin(angle * M_PI / 180); /* Make sure we won't hit the upper boundary */ if(c->physics->walls != SC_WALL_NONE && c->physics->walls != SC_WALL_WRAP) { height = sc_traj_height(tr) + tr->ctry + SC_TRAJ_THRESHOLD; if(height >= c->fieldheight) { /* Weapon would have hit the ceiling. Invalid. */ free(tr); return(NULL); } /* Did we hit ceiling? */ } /* Do we have boundaries? */ /* Copy init state over */ _sc_traj_copy_init_params(tr); /* Return the trajectory */ return(tr); } static double _sc_traj_angle(__libj_unused double gravity, __libj_unused double wind, __libj_unused double visc, double deltax, double deltay, double height) { /* sc_traj_angle Calculates angle required for a trajectory to the specified coordinates, while attaining a given maximum height, taking into account gravity. WARNING, this function is unable to consider the contribution from wind. We assume the current player is at coordinates (0, 0). Gravity value is always positive, and oriented downward. Wind value is positive if the wind is directed to the right (+x direction). This function returns a value less than zero if the trajectory could not be computed that would reach the given height. */ double yslope; /* Calculation for y-slope */ double angle; /* Expected firing angle */ /* Calculate value in the inner sqrt */ yslope = height * (height - deltay); if(yslope < 0) { /* Height is less than target Y */ return(-1); } /* Calculate the remainder of the Y slope */ yslope = 2 * (height + sqrt(yslope)); /* Calculate target angle */ angle = atan2(yslope, deltax) * 180 / M_PI; if(angle < 0) angle += 360; /* Return the angle (if it is valid) */ if(angle > 180) return(-1); return(angle); } static double _sc_traj_timesteps(const sc_trajectory *tr, double y0) { /* sc_traj_timesteps Estimate the number of timesteps to reach coordinate y0, given the y velocity and acceleration defined in the trajectory. Returns -1 if y0 is unattainable. */ double root; /* Calculation for sqrt() part */ double time; /* Timestep this occurs at */ assert(tr != NULL); /* Calculate value in the inner sqrt */ root = SQR(tr->vely) - 2 * tr->accy * y0; if(root < 0) { return(-1); } /* Calculate the timesteps */ time = 1 / tr->accy * (tr->vely + sqrt(root)); return(time); } sc_trajectory *sc_traj_new_dest_height(const sc_config *c, const sc_player *p, int flags, double centerx, double centery, double deltax, double deltay, double height) { /* sc_traj_new_dest_height Create a new trajectory with the given power (initial velocity) and angle. The destination coordinate is specified as a delta, i.e. it is specified _relative_ to the center coordinate. The height is specified relative to center coordinate, and we must have height > deltay. */ sc_trajectory *tr; /* Storage for the new trajectory */ double angle; /* Calculated angle to fire at */ double power; /* Calculated power rating */ double wind; /* Wind value to use */ double visc; /* Viscosity to use */ /* We must have a valid config */ if(c == NULL) return(NULL); /* Try to get wind and viscosity models */ wind = (flags & SC_TRAJ_IGNORE_WIND) ? 0 : c->physics->curwind; visc = (flags & SC_TRAJ_IGNORE_VISC) ? 0 : c->physics->airviscosity; /* Create the trajectory */ tr = _sc_traj_new(c, p, SC_TRAJ_FLIGHT, flags, centerx, centery); if(tr == NULL) return(NULL); /* Calculate an expected firing angle */ angle = _sc_traj_angle(c->physics->gravity, wind, visc, deltax, deltay, height); if(angle < 0) { /* Trajectory cannot be computed */ free(tr); return(NULL); } /* Calculate an expected power rating */ power = _sc_traj_power(c->physics->gravity, wind, visc, deltax, deltay, angle); if(power < 0) { /* Trajectory cannot be computed */ free(tr); return(NULL); } /* Calculate initial velocity */ tr->velx = power * cos(angle * M_PI / 180); tr->vely = power * sin(angle * M_PI / 180); /* Must we terminate at destination? */ if(flags & SC_TRAJ_TERMINUS) { tr->stopstep = _sc_traj_timesteps(tr, deltay); } /* Copy init state over */ _sc_traj_copy_init_params(tr); /* Return the trajectory */ return(tr); } /*** Trajectory calculations ***/ /* This structure is used to store current tracking progress. */ typedef struct _sc_trajectory_data { double stepx; /* Velocity X, per iteration (not in "std" units) */ double stepy; /* Velocity Y, per iteration (not in "std" units) */ } sc_trajectory_data; /*** Detect if we PASSED anything (boundaries) ***/ static inline sc_trajectory_result _sc_traj_pass_wall_none(const sc_config *c, const sc_trajectory *tr) { /* sc_traj_pass_wall_none Boundary case for no walls. */ int extend; /* How far do the borders extend? */ assert(c != NULL && tr != NULL); /* How far do the borders extend? */ extend = c->physics->bordersextend; /* Check if we hit the ground. */ if(rint(tr->cury) < 0) { return(SC_TRAJ_IMPACT_GROUND); } /* Weapon should no longer be tracked if we go too far away. */ if(tr->curx < -extend || tr->curx > c->fieldwidth + extend) { return(SC_TRAJ_SIZZLE); } /* Nothing interesting occurred */ return(SC_TRAJ_CONTINUE); } static inline sc_trajectory_result _sc_traj_pass_wall_wrap(const sc_config *c, sc_trajectory *tr) { /* sc_traj_pass_wall_wrap Boundary case for horizontal wrapping. */ assert(c != NULL && tr != NULL); /* Check if we hit the ground or went too high */ if(rint(tr->cury) < 0) { return(SC_TRAJ_IMPACT_GROUND); } /* Implement weapon wrapping on horizontal boundaries */ while(rint(tr->curx) >= c->fieldwidth) { tr->curx -= c->fieldwidth; tr->ctrx -= c->fieldwidth; } /* Adjusting X coordinate */ while(rint(tr->curx) < 0) { tr->curx += c->fieldwidth; tr->ctrx += c->fieldwidth; } /* Adjusting Y coordinate */ /* Not much occurred ... */ return(SC_TRAJ_CONTINUE); } static inline sc_trajectory_result _sc_traj_pass_wall_concrete(const sc_config *c, const sc_trajectory *tr) { /* sc_traj_pass_wall_concrete Boundary case for a good ol' solid concrete box. */ assert(c != NULL && tr != NULL); /* Check if we hit anything. */ if(rint(tr->curx) < 0 || rint(tr->curx) >= c->fieldwidth) { return(SC_TRAJ_IMPACT_WALL); } if(rint(tr->cury) >= c->fieldheight) { return(SC_TRAJ_IMPACT_WALL); } if(rint(tr->cury) < 0) { return(SC_TRAJ_IMPACT_GROUND); } /* Not much occurred ... */ return(SC_TRAJ_CONTINUE); } static inline sc_trajectory_result _sc_traj_pass_wall_elastic(const sc_config *c, sc_trajectory *tr, sc_trajectory_data *t, double elasticity) { /* sc_traj_pass_wall_elastic Boundary case for elastic walls, with elasticity given (values < 1, wall absorbs some velocity, > 1, wall adds more velocity). */ assert(c != NULL && tr != NULL && t != NULL); assert(elasticity > 0); /* Check if we hit sidewalls. */ if(rint(tr->curx) < 0) { tr->curx = 0; tr->ctrx = tr->curx; tr->ctry = tr->cury; tr->velx = -sc_traj_get_velocity_x(tr) * elasticity; tr->vely = sc_traj_get_velocity_y(tr); tr->stopstep -= tr->timestep; tr->timestep = 0; tr->finalstep = 0; t->stepx = fabs(t->stepx) * elasticity; t->stepy *= elasticity; } else if(rint(tr->curx) >= c->fieldwidth) { tr->curx = c->fieldwidth - 1; tr->ctrx = tr->curx; tr->ctry = tr->cury; tr->velx = -sc_traj_get_velocity_x(tr) * elasticity; tr->vely = sc_traj_get_velocity_y(tr); tr->stopstep -= tr->timestep; tr->timestep = 0; tr->finalstep = 0; t->stepx = -fabs(t->stepx) * elasticity; t->stepy *= elasticity; } /* Check if we hit ground or ceiling. */ if(rint(tr->cury) < 0) { /* Rollers need to feel solid earth under their feet (otherwise infinite loop). */ if(tr->type == SC_TRAJ_ROLLER) return(SC_TRAJ_IMPACT_GROUND); tr->cury = 0; tr->ctry = tr->cury; tr->ctrx = tr->curx; tr->vely = -sc_traj_get_velocity_y(tr) * elasticity; tr->velx = sc_traj_get_velocity_x(tr); tr->stopstep -= tr->timestep; tr->timestep = 0; tr->finalstep = 0; t->stepy = fabs(t->stepy) * elasticity; t->stepx *= elasticity; } else if(rint(tr->cury) >= c->fieldheight) { tr->cury = c->fieldheight - 1; tr->ctry = tr->cury; tr->ctrx = tr->curx; tr->vely = -sc_traj_get_velocity_y(tr) * elasticity; tr->velx = sc_traj_get_velocity_x(tr); tr->stopstep -= tr->timestep; tr->timestep = 0; tr->finalstep = 0; t->stepy = -fabs(t->stepy) * elasticity; t->stepx *= elasticity; } /* Not much occurred ... */ return(SC_TRAJ_CONTINUE); } static sc_trajectory_result _sc_traj_pass_wall(const sc_config *c, sc_trajectory *tr, sc_trajectory_data *t) { /* sc_traj_pass_wall Determine whether we hit a wall with the weapon at (t). Action depends on the wall type. This function may choose to detonate here. Returns NO_ACTION if the weapon status hasn't changed lately. */ assert(c != NULL && tr != NULL && t != NULL); switch(c->physics->walls) { case SC_WALL_NONE: case SC_WALL_RANDOM: return(_sc_traj_pass_wall_none(c, tr)); case SC_WALL_WRAP: return(_sc_traj_pass_wall_wrap(c, tr)); case SC_WALL_CONCRETE: return(_sc_traj_pass_wall_concrete(c, tr)); case SC_WALL_PADDED: return(_sc_traj_pass_wall_elastic(c, tr, t, SC_PHYSICS_ELASTIC_PADDED)); case SC_WALL_RUBBER: return(_sc_traj_pass_wall_elastic(c, tr, t, SC_PHYSICS_ELASTIC_RUBBER)); case SC_WALL_SPRING: return(_sc_traj_pass_wall_elastic(c, tr, t, SC_PHYSICS_ELASTIC_SPRING)); } return(SC_TRAJ_CONTINUE); } static sc_trajectory_result _sc_traj_pass_shield(const sc_config *c, sc_trajectory *tr, int flags, const sc_trajectory_data *t) { /* sc_traj_pass_shield Determine whether we are passing through a tank's shields with the weapon at (t). The weapon might explode, or it might sizzle, or it might pass right on through... */ const sc_player *p; /* Player structure */ int i; /* Index thru players */ assert(c != NULL && tr != NULL && t != NULL); /* Iterate through list of players */ for(i = c->numplayers - 1; i >= 0; --i) { p = c->players[i]; if(SC_PLAYER_IS_ALIVE(p) && sc_shield_would_impact(c, tr->player, p, flags, tr->lastx, tr->lasty, tr->curx, tr->cury)) { /* Weapon hit the shield */ tr->victim = i; return(SC_TRAJ_IMPACT_SHIELD); } /* Player was shielded and wasn't dead. Bummer. :) */ } /* Loop through players */ /* No tanks were hit */ return(SC_TRAJ_CONTINUE); } static inline sc_trajectory_result _sc_traj_pass(const sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_data *t) { /* sc_traj_pass Returns results if weapon passed through a non-pixel boundary. It might be modified as needed to contain new trajectory information. NOTE: These functions must be idempotent! */ sc_trajectory_result result;/* Result from sc_traj_hit_tank. */ assert(c != NULL && tr != NULL && t != NULL); /* Check for horizontal/vertical wall boundaries */ result = _sc_traj_pass_wall(c, tr, t); if(result != SC_TRAJ_CONTINUE) return(result); /* Check if we hit a tank's shields */ if(!(flags & SC_TRAJ_IGNORE_TANK)) { result = _sc_traj_pass_shield(c, tr, flags, t); if(result != SC_TRAJ_CONTINUE) return(result); } /* We hit nothing at this coordinate */ return(SC_TRAJ_CONTINUE); } /*** Detect if we HIT anything (impact) ***/ static sc_trajectory_result _sc_traj_hit_tank(const sc_config *c, sc_trajectory *tr) { /* sc_traj_hit_tank Determine whether we hit a tank with the weapon at (t). The weapon might explode, or it might pass right on through... */ const sc_player *p; /* Player structure */ int tx, ty; /* Weapon current X, Y */ int i; /* Index thru players */ assert(c != NULL && tr != NULL); /* Determine current weapon position */ tx = rint(tr->curx); ty = rint(tr->cury); /* Iterate through list of players */ for(i = c->numplayers - 1; i >= 0; --i) { p = c->players[i]; /* We use !p->dead here because missiles should still hit the tank until it is actually removed from the playing field... */ if(!p->dead && sc_player_would_impact(c, p, tx, ty)) { /* Weapon hit the tank itself */ tr->victim = i; return(SC_TRAJ_IMPACT_TANK); } /* Hit a tank that was still around */ } /* Loop through players */ /* No tanks were hit */ return(SC_TRAJ_CONTINUE); } static sc_trajectory_result _sc_traj_hit_land(const sc_config *c, sc_trajectory *tr, int flags) { /* sc_traj_hit_ground Returns SC_TRAJ_IMPACT_LAND if the weapon hit the ground. Otherwise, the value SC_TRAJ_CONTINUE will be returned. On detonation, use the current coordinates of (t) to determine center of the explosion. */ int tx; /* current X coordinate of weapon */ int ty; /* current Y coordinate of weapon */ double velx; /* revisionist X velocity of weapon */ double vely; /* revisionist Y velocity of weapon */ int *lp; /* Pointer into land structure */ assert(c != NULL && tr != NULL); /* Determine current weapon coordinates */ tx = rint(tr->curx); ty = rint(tr->cury); /* Is weapon currently on the screen? */ if(sc_land_translate_xy(c->land, &tx, &ty)) { lp = SC_LAND_XY(c->land, tx, ty); if(!SC_LAND_IS_SKY(*lp)) { /* WE HAVE IMPACTED. Either we do not allow tunneling, in which case the weapon must impact. Or we do allow some degree of tunneling, in which case if the weapon allows tunnelling and we do not have contact triggers, then... well... sucks for the player... */ /* TEMP - One fix for our chronic roller problems is to disallow tunneling here for all but flying weapons. I am quite happy doing this to rollers but what will it do to groundhogs? -JTL */ if((flags & SC_TRAJ_TUNNELING) && (SC_TRAJ_IS_FLYING(tr))) { /* Update stepping for this interpolation pass */ /* Actually, we CANNOT update velocities during interpolation. All parameters are already in the context of the next interp vertex so we can at best revise the course at that point, and hope that is sufficient. */ /* Update current real velocity of weapon */ velx = sc_traj_get_velocity_x(tr) * c->physics->damping; vely = sc_traj_get_velocity_y(tr) * c->physics->damping; if(SQR(velx) + SQR(vely) >= SQR(SC_TRAJ_TUNNEL_MIN_VEL)) { /* Still moving fast enough not to detonate */ /* NOTE - We used to revise only if TRAJ_IS_FLYING... */ sc_traj_revise_velocity(tr, velx, vely); sc_traj_revise_acceleration(tr, 0, 0); return(SC_TRAJ_CONTINUE); } } /* Not tunnelling, or no longer able to tunnel. Abort. */ return(SC_TRAJ_IMPACT_LAND); } } /* If weapon currently on the screen? */ /* Still not much to do ... */ /* Be sure to restore any old accelerations since we're in sky */ if(SC_TRAJ_IS_FLYING(tr)) sc_traj_restore_acceleration(tr); return(SC_TRAJ_CONTINUE); } static inline sc_trajectory_result _sc_traj_hit(const sc_config *c, sc_trajectory *tr, int flags, const sc_trajectory_data *t) { /* sc_traj_hit Returns results if weapon tried to occupy the same pixel as something. It might be modified as needed to contain new trajectory information. NOTE: These functions do not have to be idempotent. */ sc_trajectory_result result;/* Result from sc_traj_hit_tank. */ assert(c != NULL && tr != NULL && t != NULL); /* Check if we hit a tank itself. */ if(!(flags & SC_TRAJ_IGNORE_TANK)) { result = _sc_traj_hit_tank(c, tr); if(result != SC_TRAJ_CONTINUE) return(result); } /* Check if we hit something that is not passable. */ if(!(flags & SC_TRAJ_IGNORE_LAND)) { result = _sc_traj_hit_land(c, tr, flags); if(result != SC_TRAJ_CONTINUE) return(result); } /* We hit nothing at this coordinate */ return(SC_TRAJ_CONTINUE); } static inline sc_trajectory_result _sc_traj_pass_or_hit(const sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_data *t) { /* sc_traj_pass_or_hit Returns the result of either pass-through or impact codes. This function is NOT idempotent; do not use it in flight code or other code where you cannot safely call hit() more than once on the same screen pixel. */ sc_trajectory_result result;/* Result of pass/hit functions */ result = _sc_traj_pass(c, tr, flags, t); if(result == SC_TRAJ_CONTINUE) { result = _sc_traj_hit(c, tr, flags, t); } return(result); } /*** Step Between Successive Interpolation Points ***/ static sc_trajectory_result _sc_traj_traverse_path(sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data) { /* sc_traj_traverse_path This function follows a weapon, from source (x,y) to its (intended) destination of (x+vx,y+vy). Compensations in velocity are automatically made if the weapon bounces off a wall, etc, until weapon has travelled for the proper amount of time. On return, *wp will contain a new position (or detonation position) and a velocity. Note that this function WILL track subpixel movements, so that shield boundary detection etc. work properly. */ sc_trajectory_result result;/* Tracking result for this function */ sc_trajectory_data t; /* Data for tracking (passed to subfunctions) */ int deltax; /* Change in X, round up to nearest int */ int deltay; /* Change in Y, round up to nearest int */ int numsteps; /* Number of steps to take */ int iterator; /* Iterator variable */ assert(c != NULL && tr != NULL); /* ENTERING THIS FUNCTION: tr->curx, tr->cury reflect the interpolation point we are trying to reach. If we have a smooth flight, the weapon will effectively be at this interpolation point at the end of the function. tr->oldx, tr->oldy reflect the interpolation point we were at when we entered this function. This is the point we are moving away from. tr->lastx, tr->lasty reflect the last coordinate (rounded to the nearest pixel) that was actually TESTED for an impact or boundary crossing. For determining if we have already checked a pixel for impact (and possibly already cleared it), we use lastx,y. Also, to determine if the weapon just crossed a shield boundary, we rely on lastx,y. DURING THIS FUNCTION: tr->curx, tr->cury are updated to reflect the coordinate that is currently being tested. When action is called, curx,y will reflect the current weapon position, not the intended final destination. If the weapon impacts before it reaches the control point, then curx,y will reflect the point of impact. tr->lastx, tr->lasty are maintained to always reflect the last coordinate that was actually tested. */ /* Populate data in t, with initial position and "real" velocity */ t.stepx = tr->curx - tr->oldx; t.stepy = tr->cury - tr->oldy; tr->curx = tr->oldx; tr->cury = tr->oldy; /* Determine the distance travelled along X and Y (round up, so worst case scenario we double-check a discrete point, as opposed to accidentally skipping discrete points). */ deltax = ceil(fabs(t.stepx)); deltay = ceil(fabs(t.stepy)); /* WARNING: We can ONLY abort if there was NO step whatsoever. If we tracked subpixel movement (e.g. the initial and final coordinates round to the same pixel), we must still go through all the motions, otherwise we might pass through boundaries without realizing it... */ /* Sanity check; if we're not moving, then abort. */ if(deltax == 0 && deltay == 0) return(SC_TRAJ_CONTINUE); /* Which axis changes more? Label that axis the "primary" axis, which will determine the number of steps we need to take. */ if(deltax > deltay) { /* Primary traversal axis is X */ numsteps = deltax; } else { /* Primary traversal axis is Y */ numsteps = deltay; } /* Which axis is the primary axis? */ /* Calculate new trajectory "velocities", which are the distance to travel in one iterative step. The step velocities are therefore not in the same units as the normal velocities. */ t.stepx /= numsteps; t.stepy /= numsteps; /* Track along points, approximating a line from (x,y) to (curx,cury) -- note, that this line might change if the weapon is deflected from its original course. */ result = SC_TRAJ_CONTINUE; iterator = numsteps; while(iterator > 0 && result == SC_TRAJ_CONTINUE) { /* Make sure curx, cury are up-to-date. If anything bails here, then they will reflect the point of impact (point of contention). The old behaviour was inconsistent about what curx,y would reflect; for hit() it would reflect the last "safe" coordinate, but for the action handler it'd reflect the point of impact. */ /* Check if we passed through any boundaries. Note that _sc_traj_pass is allowed to modify the trajectory, in the case where we pass an elastic wall boundary. We must always perform the boundary-pass check. */ result = _sc_traj_pass(c, tr, flags, &t); if(result == SC_TRAJ_CONTINUE && !(rint(tr->lastx) == rint(tr->curx) && rint(tr->lasty) == rint(tr->cury))) { /* Check if we hit anything. None of these calls modify the trajectory, so we don't need to reassign any data here. Note that _sc_traj_hit is NOT idempotent; as a result, we must call it at most once per pixel, hence the long test to make sure we are not actually in the same pixel. */ result = _sc_traj_hit(c, tr, flags, &t); } /* Well, what happened with the impact tests? */ if(result == SC_TRAJ_CONTINUE) { /* Weapon did not hit something; continue ... */ if(action != NULL) { result = action(c, tr, data); } /* Is user using an action function? */ if(result == SC_TRAJ_CONTINUE) { /* If we're here, then everyone signalled all-clear. */ tr->lastx = tr->curx; tr->lasty = tr->cury; tr->curx += t.stepx; tr->cury += t.stepy; } } /* Did we hit something? */ --iterator; /* Next please */ } /* While we are still following along the path... */ /* Weapon will contain the last coordinates that were tracked. This means if it exploded, it will contain the coordinates of the explosion. Otherwise, its velocity and position will be the new values (before gravity is considered). */ /* Return our status. */ return(result); } static void _sc_traj_roller_setup(sc_trajectory *tr, sc_trajectory_data *t, double startx, double starty, double deltax, double deltay) { /* sc_traj_roller_setup Setup a trajectory to attempt a roll in the indicated direction relative to startx, starty. */ assert(tr != NULL && t != NULL); tr->curx = startx + deltax; tr->cury = starty + deltay; t->stepx = deltax; t->stepy = deltay; } static void _sc_traj_roller_restore(sc_trajectory *tr, double startx, double starty) { /* sc_traj_roller_restore Restore the trajectory's position. */ assert(tr != NULL); tr->curx = startx; tr->cury = starty; } static bool _sc_traj_roller_clear(const sc_config *c, sc_trajectory *tr, int flags, double deltax, double deltay) { /* sc_traj_roller_clear This takes a trajectory, and plants it at (curx + deltax), (cury + deltay). It then checks to see if the trajectory impacts anything at the specified location. If NOT, then this function returns true, indicating that the specified position is clear. This function will restore the trajectory's original position regardless of return value; the trajectory is effectively constant. */ sc_trajectory_data t; /* Trajectory steps */ double origx; /* Original X position */ double origy; /* Original Y position */ /* Sanity checks */ assert(c != NULL && tr != NULL); /* Save the original X position */ origx = tr->curx; origy = tr->cury; /* Setup the temporary trajectory and step data */ _sc_traj_roller_setup(tr, &t, origx, origy, deltax, deltay); /* Check for impact in the specified location. */ if(!SC_TRAJ_IS_IMPACT(_sc_traj_pass_or_hit(c, tr, flags, &t))) { /* We didn't hit! */ _sc_traj_roller_restore(tr, origx, origy); return(true); } else { /* We impacted something; specified location is not clear */ _sc_traj_roller_restore(tr, origx, origy); return(false); } } static void _sc_traj_roller_fallthrough(const sc_config *c, sc_trajectory *tr, int flags) { /* sc_traj_roller_fallthrough If falling, then we are allowed to reverse direction once we land. We don't care about impact type here, because we assume when this is called we've already checked for candidate detonations. This function will adjust the velocity vector to indicate a direction reversal, if applicable. At the end, the trajectory remains in the same location it was in on entry. */ /* Sanity checks */ assert(c != NULL && tr != NULL); if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller fallthru %8p at %16g %16g land is %4d\n", (void *)tr, tr->curx, tr->cury, sc_land_height(c->land, rint(tr->curx), c->land->height)); } /* First, attempt a downward motion */ if(_sc_traj_roller_clear(c, tr, flags, 0, -1)) { if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller fallthru %8p descent available\n", (void *)tr); } return; } /* That didn't work. Follow the current velocity. */ if(_sc_traj_roller_clear(c, tr, flags, SGN(tr->velx), 0)) { if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller fallthru %8p momentum continuing in direction %+d available\n", (void *)tr, SGN(tr->velx)); } return; } /* Neither did that, hmmm. Well, let's reverse. */ if(_sc_traj_roller_clear(c, tr, flags, -SGN(tr->velx), 0)) { /* We should reverse direction now. */ if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller fallthru %8p momentum reversing direction to %+d available\n", (void *)tr, -SGN(tr->velx)); } /* TEMP - This needs attention. If we still have roller problems, look here first. warning can velx sign change by calling pass_or_hit? -JDS warning looks like it to me (via pass_wall_elastic); is this a problem? -JTL */ tr->velx = -tr->velx; return; } /* Nothing worked; return to original position */ if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller fallthru %8p nothing suitable found\n", (void *)tr); } } static sc_trajectory_result _sc_traj_traverse_roller(sc_config *c, sc_trajectory *tr, int flags, double distance, sc_trajectory_action action, void *data) { /* sc_traj_traverse_roller This function follows a roller, from source (x,y) to its (intended) destination units away. If the roller is not supported from below, then well, it falls. Otherwise, if the roller has a clear passage to the right/left then it will continue rolling merrily along in a horizontal fashion. If it cannot continue rolling (wall obstruct, hit a tank or other ground) then it detonates. On return, *tr will contain a new position (or the detonation position). */ sc_trajectory_result result;/* Tracking result for this function */ sc_trajectory_data t; /* Data for tracking (passed to subfunctions) */ double origx; /* Saved value for X position */ double origy; /* Saved value for Y position */ double step; /* Current step size. */ /* Sanity checks */ assert(c != NULL && tr != NULL); assert(distance >= 0); /* Loop until we run out of distance to travel. */ result = SC_TRAJ_CONTINUE; while(distance > 0 && result == SC_TRAJ_CONTINUE) { /* Setup the trajectory stepping */ step = (distance >= 1 ? 1 : distance); t.stepx = step * SGN(tr->velx); t.stepy = 0; /* Save the current coordinates for later, when we start to experiment how we can move from this current position. */ origx = tr->curx; origy = tr->cury; if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller traverse %8p at %16g %16g land is %4d velocity is %+g\n", (void *)tr, origx, origy, sc_land_height(c->land, rint(origx), c->land->height), tr->velx); printf("roller traverse %8p la %16g %16g\n", (void *)tr, tr->lastx, tr->lasty); } /* Find out if we impacted. The type of this initial impact will determine whether we detonate or roll up an incline. */ result = _sc_traj_pass_or_hit(c, tr, flags, &t); if(result == SC_TRAJ_CONTINUE) { /* This is the easy case; we were able to continue rolling laterally with no difficulties. */ /* Check for a sign reversal, e.g. from rebound on walls. */ if(SGN(t.stepx) != SGN(tr->velx)) { tr->velx = -tr->velx; } /* Weapon did not hit something; continue ... */ if(action != NULL) { result = action(c, tr, data); } /* Is user using an action function? */ if(result == SC_TRAJ_CONTINUE) { /* Attempt to move; if we are not supported, then fall. Otherwise, roll to right/left depending on the sign of the velocity term. */ /* Set lastx, lasty now that we are certain we're moving */ tr->lastx = origx; tr->lasty = origy; _sc_traj_roller_setup(tr, &t, origx, origy, 0, -step); if(!SC_TRAJ_IS_IMPACT(_sc_traj_pass_or_hit(c, tr, flags, &t))) { /* Falling; we already modified the position, so we can leave the curx, cury alone. */ if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller traverse %8p roller is currently falling at Y %+g\n", (void *)tr, -step); } tr->velx += SC_TRAJ_ROLLER_FALL * SGN(tr->velx); _sc_traj_roller_fallthrough(c, tr, flags); } else { /* Not falling; roll in respective direction. We need to restore curx, cury. Note that the NEXT iteration will check to see if this destination was an impact. */ if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller traverse %8p roller proceeds in X %+g\n", (void *)tr, SGN(tr->velx) * step); } _sc_traj_roller_restore(tr, origx + SGN(tr->velx) * step, origy); } /* Which direction? */ } /* Still going? */ } /* Did we hit something? */ if(result == SC_TRAJ_IMPACT_LAND) { /* The *current* position has impacted land. We may attempt to incline by a small amount here. */ _sc_traj_roller_setup(tr, &t, origx, origy, 0, 1); if(fabs(tr->velx) > SC_TRAJ_ROLLER_GAIN && !SC_TRAJ_IS_IMPACT(_sc_traj_pass_or_hit(c, tr, flags, &t))) { /* Salvation for the little weapon! */ /* Set lastx, lasty now that we are certain we're moving */ tr->lastx = origx; tr->lasty = origy; if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller traverse %8p roller ascended to Y %+d\n", (void *)tr, 1); } tr->velx -= SC_TRAJ_ROLLER_GAIN * SGN(tr->velx); result = SC_TRAJ_CONTINUE; } else { /* Desperation */ _sc_traj_roller_setup(tr, &t, origx, origy, 0, 2); if(fabs(tr->velx) > 2 * SC_TRAJ_ROLLER_GAIN && !SC_TRAJ_IS_IMPACT(_sc_traj_pass_or_hit(c, tr, flags, &t))) { /* We can still salvage! */ /* Set lastx, lasty now that we are certain we're moving */ tr->lastx = origx; tr->lasty = origy; if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller traverse %8p roller ascended to Y %+d\n", (void *)tr, 2); } tr->velx += -2 * SC_TRAJ_ROLLER_GAIN * SGN(tr->velx); result = SC_TRAJ_CONTINUE; } else { /* Cannot recover; not enough velocity. */ if(SC_PHYSICS_DEBUG_ROLLER) { printf("roller traverse %8p roller tried to ascend, but failed.\n", (void *)tr); } _sc_traj_roller_restore(tr, origx, origy); } } } /* Could we recover from an impact? */ /* Next... */ --distance; } /* Loop */ /* Return our status. */ return(result); } static void _sc_traj_digger_get_direction(const sc_config *c, sc_trajectory *tr, sc_trajectory_data *t, int dir) { /* sc_traj_digger_direction_clear Figure out a new direction based on delta. */ assert(c != NULL && tr != NULL && t != NULL); if(dir < 0) dir += 4; switch((tr->dir + dir) % 4) { case 0: t->stepx = 0; t->stepy = -1; break; case 1: t->stepx = -1; t->stepy = 0; break; case 2: t->stepx = 0; t->stepy = 1; break; default: t->stepx = 1; t->stepy = 0; break; } tr->curx += t->stepx; tr->cury += t->stepy; } static bool _sc_traj_digger_direction_clear(const sc_config *c, sc_trajectory *tr, int flags, int dir) { /* sc_traj_digger_direction_clear Check if the specified delta direction is clear or not. */ sc_trajectory_data t; int result; assert(c != NULL && tr != NULL); /* Get data on our new chosen direction */ _sc_traj_digger_get_direction(c, tr, &t, dir); result = _sc_traj_hit(c, tr, flags, &t); /* Special case for 1-pixel wide gaps */ if(result == SC_TRAJ_CONTINUE) { tr->curx += t.stepx; tr->cury += t.stepy; result = _sc_traj_hit(c, tr, flags, &t); } /* Special case... */ /* Check if we (eventuall) impact land next */ if(result != SC_TRAJ_IMPACT_LAND) return(false); tr->dir = (tr->dir + dir) % 4; return(true); } static bool _sc_traj_digger_reselect_dir(const sc_config *c, sc_trajectory *tr, int flags) { /* sc_traj_digger_reselect_dir Attempt to find a new direction to dig into. */ int dir; assert(c != NULL && tr != NULL); dir = game_lrand(2) * 2 - 1; if(_sc_traj_digger_direction_clear(c, tr, flags, dir)) return(true); if(_sc_traj_digger_direction_clear(c, tr, flags, -dir)) return(true); if(_sc_traj_digger_direction_clear(c, tr, flags, 2)) return(true); if(_sc_traj_digger_direction_clear(c, tr, flags, 0)) return(true); return(false); } static sc_trajectory_result _sc_traj_traverse_digger(sc_config *c, sc_trajectory *tr, int flags, double distance, sc_trajectory_action action, void *data) { /* sc_traj_traverse_digger This function follows a digger, from source (x,y) to some destination after units of movement. The digger moves around clearing land and randomly changing direction. If it leaves the dirt for any reason, it fizzles. */ /* TEMP: Digger code is probably broken. It was never really completed. */ const int *gradient; /* Sky gradient */ int gradientflag; /* Sky gradient flag */ bool dither; /* Enable dithering? */ sc_trajectory_result result;/* Tracking result for this function */ sc_trajectory_data t; /* Data for tracking (passed to subfunctions) */ double step; /* Current step. */ assert(c != NULL && tr != NULL); /* Get the sky gradient */ gradient = sc_land_sky_index(c); gradientflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; result = SC_TRAJ_CONTINUE; while(distance > 0 && result == SC_TRAJ_CONTINUE) { /* Setup the trajectory stepping */ step = (distance >= 1 ? 1 : distance); /* Check if we hit anything */ _sc_traj_digger_get_direction(c, tr, &t, 0); result = _sc_traj_hit(c, tr, flags, &t); switch(result) { case SC_TRAJ_IMPACT_LAND: /* We're okay. */ result = SC_TRAJ_CONTINUE; /* Call the tracking function. */ if(action != NULL) { result = action(c, tr, data); } /* Is user using an action function? */ if(result == SC_TRAJ_CONTINUE) { if(game_lrand(100) < SC_TRAJ_DIGGER_PROB) { /* Randomly change directions */ _sc_traj_digger_reselect_dir(c, tr, flags); } } break; case SC_TRAJ_IMPACT_TANK: case SC_TRAJ_IMPACT_SHIELD: /* Death to the tank! */ break; case SC_TRAJ_IMPACT_WALL: case SC_TRAJ_IMPACT_GROUND: case SC_TRAJ_CONTINUE: case SC_TRAJ_SIZZLE: /* We're dead. */ result = SC_TRAJ_SIZZLE; break; } /* Next... */ --distance; } /* Loop */ /* Return our status. */ return(result); } static sc_trajectory_result _sc_traj_step_flight(sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data) { /* sc_traj_step_flight */ sc_trajectory_result result; /* Result of this function */ double locx, locy; /* Location buffers */ double velx, vely; /* Velocity buffers */ assert(c != NULL && tr != NULL); while(tr->timestep <= tr->finalstep) { tr->oldx = tr->curx; tr->oldy = tr->cury; tr->curx = sc_traj_get_current_x(tr); tr->cury = sc_traj_get_current_y(tr); result = _sc_traj_traverse_path(c, tr, flags, action, data); /* This test turns a shield impact into a rebound for force shields */ if(result == SC_TRAJ_IMPACT_SHIELD && !(flags & SC_TRAJ_HIT_SHIELDS)) { /* We want the real location of the weapon, not the interpolated one here. */ locx = tr->curx; locy = tr->cury; /* The real velocities of the weapon would be nice but aren't known... */ velx = sc_traj_get_velocity_x(tr); vely = sc_traj_get_velocity_y(tr); /* Ask the shield if it will be rebounding this missile. */ if(sc_shield_get_reflection(c, c->players[tr->victim], flags, &locx, &locy, &velx, &vely)) { sc_traj_new_control_equation(tr, locx, locy, velx, vely); result = SC_TRAJ_CONTINUE; tr->curx = locx; tr->cury = locy; tr->victim = -1; } } if(result != SC_TRAJ_CONTINUE) return(result); if(tr->timestep < tr->finalstep) { tr->timestep = min(tr->timestep + SC_TRAJ_TIME_STEPS_PER_SUBSTEP, tr->finalstep); } else { tr->timestep += SC_TRAJ_TIME_STEPS_PER_SUBSTEP; } /* Perform actions normally done at the interpolation vertices here */ if(!(flags & SC_TRAJ_IGNORE_TANK)) { /* Perform magnetic shield deflection. */ velx = sc_traj_get_velocity_x(tr); vely = sc_traj_get_velocity_y(tr); if(sc_shield_get_deflection(c, tr->player, flags, sc_traj_get_current_x(tr), sc_traj_get_current_y(tr), &velx, &vely)) sc_traj_revise_velocity(tr, velx, vely); } } return(SC_TRAJ_CONTINUE); } static sc_trajectory_result _sc_traj_step_roller(sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data) { /* sc_traj_step_roller */ sc_trajectory_result result; /* Result of this function */ double distance; /* Distance travelling. */ assert(c != NULL && tr != NULL); while(tr->timestep <= tr->finalstep) { tr->oldx = tr->curx; tr->oldy = tr->cury; distance = fabs(tr->velx); result = _sc_traj_traverse_roller(c, tr, flags, distance, action, data); if(result != SC_TRAJ_CONTINUE) return(result); if(tr->timestep < tr->finalstep) { tr->timestep = min(tr->timestep + SC_TRAJ_TIME_STEPS_PER_SUBSTEP, tr->finalstep); } else { tr->timestep += SC_TRAJ_TIME_STEPS_PER_SUBSTEP; } } return(SC_TRAJ_CONTINUE); } static sc_trajectory_result _sc_traj_step_digger(sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data) { /* sc_traj_step_digger */ sc_trajectory_result result; /* Result of this function */ double distance; /* Distance travelling. */ assert(c != NULL && tr != NULL); while(tr->timestep <= tr->finalstep) { tr->oldx = tr->curx; tr->oldy = tr->cury; distance = fabs(tr->timestep * tr->velx); result = _sc_traj_traverse_digger(c, tr, flags, distance, action, data); if(result != SC_TRAJ_CONTINUE) return(result); if(tr->timestep < tr->finalstep) { tr->timestep = min(tr->timestep + SC_TRAJ_TIME_STEPS_PER_SUBSTEP, tr->finalstep); } else { tr->timestep += SC_TRAJ_TIME_STEPS_PER_SUBSTEP; } } return(SC_TRAJ_CONTINUE); } sc_trajectory_result sc_traj_step(sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data) { /* sc_traj_step Run one step of a trajectory. Used for code that intends to actually animate the trajectory. Only one timestep is run. */ sc_trajectory_result result; /* Result of this function */ assert(c != NULL); if(tr == NULL) { return(SC_TRAJ_SIZZLE); } if(tr->timestep >= tr->stopstep) { /* Weapon timed out */ return(SC_TRAJ_SIZZLE); } tr->finalstep = min(tr->timestep + SC_TRAJ_TIME_STEP, tr->stopstep); result = SC_TRAJ_SIZZLE; switch(tr->type) { case SC_TRAJ_FLIGHT: result = _sc_traj_step_flight(c, tr, flags, action, data); break; case SC_TRAJ_ROLLER: result = _sc_traj_step_roller(c, tr, flags, action, data); break; case SC_TRAJ_DIGGER: result = _sc_traj_step_digger(c, tr, flags, action, data); break; } if(result != SC_TRAJ_CONTINUE && !(flags & SC_TRAJ_NO_MODIFY)) { sc_ai_trajectory_terminus(c, tr); } return(result); } sc_trajectory_result sc_traj_run(sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data) { /* sc_traj_run Runs an entire trajectory to completion. Useful for simulations. */ sc_trajectory_result result; /* Result of this function */ do { result = sc_traj_step(c, tr, flags, action, data); } while(result == SC_TRAJ_CONTINUE); return(result); } void sc_traj_revise_velocity(sc_trajectory *tr, double nvelx, double nvely) { /* sc_traj_revise_velocity Call this function when you want to revise the course of the weapon already in flight. Assumptions: we want to maintain current position but revise the current velocity. We do NOT want to revise the time step value for this trajectory. We MAY revise the initial velocity and initial position. Let cx = current X, a = acceleration (const), t = timestep (const), v1 represent revised init velocity, x1 represent revised init pos. Then to attain a new velocity nv, we want cx = x1 + v1 t + a t^2 / 2 nv = v1 + a t This system gives us the solution v1 = nv - a t x1 = cx - nv t + a t^2 / 2 This function should be called instead of set_velocity once the weapon has been launched (and has a nonzero timestep). DO NOT MODIFY THE VELOCITY DIRECTLY or you will get very inconsistent tracking results. Be careful when doing this inside a linear interpolation (a call to sc_traj_traverse_path()) -- make sure stepx, stepy for the interpolation are somehow revised as well so we do not stray too far from the path. */ double curx; double cury; /* Sanity checks */ assert(tr != NULL); if(tr->type != SC_TRAJ_FLIGHT) { fprintf(stderr, "WARNING: does not make sense to set velocity of non-airborn trajectories!\n"); return; } /* Rewrite initial equation parametres */ curx = sc_traj_get_current_x(tr); /* These functions depend */ cury = sc_traj_get_current_y(tr); /* on the old parametres */ tr->velx = nvelx - tr->timestep * tr->accx; tr->vely = nvely + tr->timestep * tr->accy; tr->ctrx = curx - tr->timestep * (tr->velx + 0.5 * tr->timestep * tr->accx); tr->ctry = cury - tr->timestep * (tr->vely - 0.5 * tr->timestep * tr->accy); } void sc_traj_set_velocity(sc_trajectory *tr, double velx, double vely) { /* sc_traj_set_velocity */ sc_traj_revise_velocity(tr, velx, vely); } void sc_traj_revise_acceleration(sc_trajectory *tr, double naccx, double naccy) { /* sc_traj_revise_acceleration Call this function when you want to revise the course of the weapon already in flight via its acceleration terms. Assumptions: we want to maintain current position but revise the constant acceleration terms. We do NOT want to revise the time step value for this trajectory. We MAY revise the initial velocity and initial position. Let cx = current X, na = new acceleration term, t = timestep (const), and let cv = current velocity. Then to attain a new const acceleration term na, we want cx = x1 + v1 t + na t^2 / 2 cv = v1 + na t This system gives us the solution v1 = cv - na t x1 = cx - v1 t - na t^2 / 2 This function should be called instead of modifying acceleration terms directly, for FLIGHT weapons. */ double curx; double cury; double velx; double vely; /* Sanity checks */ assert(tr != NULL); if(tr->type != SC_TRAJ_FLIGHT) { fprintf(stderr, "WARNING: does not make sense to set acceleration of non-airborn trajectories!\n"); return; } /* Rewrite initial equation parametres */ curx = sc_traj_get_current_x(tr); /* These functions depend */ cury = sc_traj_get_current_y(tr); /* on the old parametres */ velx = sc_traj_get_velocity_x(tr); vely = sc_traj_get_velocity_y(tr); tr->velx = velx - tr->timestep * naccx; tr->vely = vely + tr->timestep * naccy; tr->ctrx = curx - tr->timestep * (tr->velx + 0.5 * tr->timestep * naccx); tr->ctry = cury - tr->timestep * (tr->vely - 0.5 * tr->timestep * naccy); tr->accx = naccx; tr->accy = naccy; /* This does not revise original accelerations */ } void sc_traj_restore_acceleration(sc_trajectory *tr) { /* sc_traj_restore_acceleration Restores acceleration to the parametres it was at initially (when the weapon was first launched). This is useful, FE, if you want to apply short-term bursts of thrust, or want to travel through a mountain :) */ sc_traj_revise_acceleration(tr, tr->oaccx, tr->oaccy); } void sc_traj_new_control_equation(sc_trajectory *tr, double ctrx, double ctry, double velx, double vely) { /* sc_traj_new_control_equation Writes a new control equation, while PRESERVING timestep it will recenter so at the current timestep, the weapon would be at the position and with the velocity indicated. ONLY use this function at an interpolation vertex !! The current REAL position and desired new velocity are passed in. Current acceleration and timestep will be preserved. This algorithm models the revise_acceleration algorithm. */ /* Sanity checks */ assert(tr != NULL); if(tr->type != SC_TRAJ_FLIGHT) { fprintf(stderr, "WARNING: does not make sense to set acceleration of non-airborn trajectories!\n"); return; } /* Rewrite initial equation parametres */ tr->velx = velx - tr->timestep * tr->accx; tr->vely = vely + tr->timestep * tr->accy; tr->ctrx = ctrx - tr->timestep * (tr->velx + 0.5 * tr->timestep * tr->accx); tr->ctry = ctry - tr->timestep * (tr->vely - 0.5 * tr->timestep * tr->accy); } double sc_traj_get_velocity_x(const sc_trajectory *tr) { /* sc_traj_get_velocity_x dx/dt = velx + accx t */ if(tr == NULL) return(0); return(tr->velx + tr->accx * tr->timestep); } double sc_traj_get_velocity_y(const sc_trajectory *tr) { /* sc_traj_get_velocity_y dy/dt = vely - accy t */ if(tr == NULL) return(0); return(tr->vely - tr->accy * tr->timestep); } double sc_traj_get_current_x(const sc_trajectory *tr) { /* sc_traj_get_current_x x = ctrx + velx t + 0.5 accx t^2 */ if(tr == NULL) return(0); return(tr->ctrx + tr->timestep * (tr->velx + 0.5 * tr->timestep * tr->accx)); } double sc_traj_get_current_y(const sc_trajectory *tr) { /* sc_traj_get_current_y y = ctry + vely t - 0.5 accy t^2 */ if(tr == NULL) return(0); return(tr->ctry + tr->timestep * (tr->vely - 0.5 * tr->timestep * tr->accy)); } double sc_traj_height(const sc_trajectory *tr) { /* sc_ai_trajectory_height Calculates height attained by this trajectory. dy/dt = 0 = vy - G t vy = G t --> t = vy/G y = vy t - 1/2 G t^2 = vy^2 / (2 G) */ double vy2; /* Velocity of Y, squared. */ /* Calculate velocity squared, and factor in the current gravity. */ vy2 = SQR(tr->vely); return(0.5 * vy2 / tr->accy); } /*** Parametre Names ***/ static const char *_sc_physics_wall_names[] = { "None", "Concrete", "Padded", "Rubber", "Springy", "Wraparound", "Random", NULL }; static const unsigned int _sc_physics_wall_types[] = { SC_WALL_NONE, SC_WALL_CONCRETE, SC_WALL_PADDED, SC_WALL_RUBBER, SC_WALL_SPRING, SC_WALL_WRAP, SC_WALL_RANDOM, 0 }; const char **sc_physics_wall_names(void) { return(_sc_physics_wall_names); } const unsigned int *sc_physics_wall_types(void) { return(_sc_physics_wall_types); } xscorch-0.2.1/sgame/sphysics.h0000644000175000001440000003365711206420752013227 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sphysics.h,v 1.30 2009-05-25 04:43:22 jacob Exp $ */ /* xscorch - sphysics.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched physics This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sphysics_h_included #define __sphysics_h_included #include /* Debugging control */ #define SC_PHYSICS_DEBUG_ROLLER 1 /* Set to 1 to debug rollers */ /* Forward structure definitions */ struct _sc_config; struct _sc_player; /* Physics definitions (see below for gravity, velocity calculations) */ #define SC_PHYSICS_BORDERS_DEF 2500 /* Default dist to simulate */ #define SC_PHYSICS_BORDERS_MAX 10000 /* Max dist to simulate fm screen */ #define SC_PHYSICS_GRAVITY_DEF 0.500 /* Default gravity */ #define SC_PHYSICS_GRAVITY_MAX 10.0 /* Maximum gravity */ #define SC_PHYSICS_VELOCITY_SCL 0.027 /* Velocity scaling */ #define SC_PHYSICS_VISCOUS_DEF 0 /* Default air viscosity */ #define SC_PHYSICS_VISCOUS_MAX 0.200 /* Maximum air viscosity */ #define SC_PHYSICS_WIND_DEF 0.05 /* Default max wind */ #define SC_PHYSICS_WIND_MAX 10.0 /* Maximum wind vel. (pix/step) */ #define SC_PHYSICS_DELTA_WIND_MAX 0.2 /* Maximum change (% of max wind) */ /* Wall effects */ typedef enum _sc_physics_walls { SC_WALL_CONCRETE, /* Solid, all dirs (weapons hitting will explode) */ SC_WALL_PADDED, /* Shots reflected, but some energy is absorbed */ SC_WALL_RUBBER, /* Shots reflected */ SC_WALL_SPRING, /* Shots reflected, but with an additional "kick" */ SC_WALL_WRAP, /* Boundaries wrap horizonally; top is open */ SC_WALL_NONE, /* Weapons go off screen horiz; top is open */ SC_WALL_RANDOM /* Walls are selected at random */ } sc_physics_walls; /* Elasticity of certain walls */ #define SC_PHYSICS_ELASTIC_PADDED 0.5 /* Some velocity lost */ #define SC_PHYSICS_ELASTIC_RUBBER 1.0 /* All velocity is reflected */ #define SC_PHYSICS_ELASTIC_SPRING 1.5 /* Give weapon a little kick */ /* Trajectory type */ typedef enum _sc_trajectory_type { SC_TRAJ_FLIGHT, /* Trajectory is airborne, and following physics */ SC_TRAJ_ROLLER, /* Trajectory is rolling on the ground somewhere */ SC_TRAJ_DIGGER /* Trajectory is deliberately tunnelling in soil */ } sc_trajectory_type; /* Identify what flight mode a trajectory is in. */ #define SC_TRAJ_IS_FLYING(tr) ((tr)->type == SC_TRAJ_FLIGHT) #define SC_TRAJ_IS_ROLLING(tr) ((tr)->type == SC_TRAJ_ROLLER) #define SC_TRAJ_IS_DIGGING(tr) ((tr)->type == SC_TRAJ_DIGGER) /* Rollers use these values in energy/hill calculations. ROLLER_FALL is an additive gain in the speed of the roller when it falls down. ROLLER_GAIN determines how much momentum is *lost* if the roller is forced to ascend. */ #define SC_TRAJ_ROLLER_FALL 0.5 /* Added to momentum on fall */ #define SC_TRAJ_ROLLER_GAIN 1.3 /* Removed from mom. on ascent */ /* A physical parabola. The impact cases usually result in detonation of the associated weapon, but may imply reflection or other special processing in certain cases --- e.g. rollers will attempt to roll uphill on receiving IMPACT_LAND, instead of detonating. When a function returns an IMPACT code, usually the curx,cury position reflects the point of impact, and the lastx,lasty position reflects the last position that was "clear". */ typedef enum _sc_trajectory_result { SC_TRAJ_CONTINUE, /* The trajectory has not terminated. */ SC_TRAJ_IMPACT_TANK, /* The trajectory impacted a tank */ SC_TRAJ_IMPACT_LAND, /* The trajectory impacted land */ SC_TRAJ_IMPACT_WALL, /* The trajectory hit a vertical wall or ceiling */ SC_TRAJ_IMPACT_GROUND, /* The trajectory hit the ground */ SC_TRAJ_IMPACT_SHIELD, /* The trajectory hit a shield */ SC_TRAJ_SIZZLE /* Timed out/faded without a detonate */ } sc_trajectory_result; #define SC_TRAJ_IS_IMPACT(n) ((n) == SC_TRAJ_IMPACT_TANK || \ (n) == SC_TRAJ_IMPACT_LAND || \ (n) == SC_TRAJ_IMPACT_WALL || \ (n) == SC_TRAJ_IMPACT_GROUND || \ (n) == SC_TRAJ_IMPACT_SHIELD) /* WARNING: You must be aware of the "standard" units in these calculations. Timesteps are _timesteps_... they are not seconds. Location is in pixel units. The trajectory routines will do no unit conversion; you must call them with the standard units! */ /* Note: ROLLERS store ground-tangential velocity in velx and leave vely 0. ROLLERS do not maintain an acceleration term and are immune to the effects of air viscosity. */ typedef struct _sc_trajectory { /* Type flag */ sc_trajectory_type type; /* What type of trajectory is it? */ /* Internal params -- DO NOT EDIT directly. These parametres control the trajectory for flight-based models. The current intended position is projected using these constants which define the trajectory. */ /* cur_x = ctr_x + vel_x t + 1/2 acc_x t^2 */ /* cur_y = ctr_y + vel_y t + 1/2 acc_y t^2 */ double ctrx; /* Center X coordinate */ double ctry; /* Center Y coordinate */ double accx; /* Acceleration X */ double accy; /* Acceleration Y */ double velx; /* Initial velocity of X */ double vely; /* Initial velocity of Y */ /* Current state values -- DO NOT EDIT directly. If victim is negative, then the trajectory has not directly impacted with a particular player; if the trajectory has impacted with someone, then victim is set to the appropriate player ID. */ int victim; /* Victim in trajectory path */ double timestep; /* Current timestep */ double stopstep; /* Step we "timeout" at */ double finalstep; /* Stop timestep for this step */ double curx; /* Current X coordinate */ double cury; /* Current Y coordinate */ double lastx; /* X coordinate, prev PIXEL */ double lasty; /* Y coordinate, prev PIXEL */ double oldx; /* X coordinate, prev step */ double oldy; /* Y coordinate, prev step */ double oaccx; /* Acceleration X (originally) */ double oaccy; /* Acceleration Y (originally) */ int dir; /* Current direction (diggers) */ /* The following parametres are used to recover the original control equation in event of a reinitialize call, for flight-based trajectories. */ double _ictrx; /* Center X coordinate */ double _ictry; /* Center Y coordinate */ double _iaccx; /* Acceleration X */ double _iaccy; /* Acceleration Y */ double _ivelx; /* Initial velocity of X */ double _ively; /* Initial velocity of Y */ /* The following two values control landfall for a trajectory (when the trajectory has erased some land). This is used to determine what sections of screen may need to be redrawn. */ int landfall_x1; int landfall_x2; /* Who owns the trajectory (if anyone, else NULL)? */ const struct _sc_player *player; } sc_trajectory; /* Action hook for the path tracing function */ typedef sc_trajectory_result (*sc_trajectory_action)(struct _sc_config *c, sc_trajectory *tr, void *data); /* Trajectory modelling constants */ #define SC_TRAJ_TIME_STEP 1.0 /* Take this many timesteps per step */ #define SC_TRAJ_TIME_SUBSTEP 16 /* Take this many substeps per step */ #define SC_TRAJ_TIMEOUT 240 /* Number of timesteps before timeout */ #define SC_TRAJ_THRESHOLD 16 /* Threshold in certain estimation code. */ #define SC_TRAJ_TUNNEL_DAMPING 0.8 /* Damping for tunneling weapons */ #define SC_TRAJ_DAMPING_MAX 1.0 /* Maximum legal value for damping (duh) */ #define SC_TRAJ_TUNNEL_MIN_VEL 0.5 /* Min velocity to tunnel - pixel/timeslice */ #define SC_TRAJ_DIGGER_PROB 15 /* Prob. that digger direction will change */ /* Trajectory modelling flags */ #define SC_TRAJ_DEFAULTS 0 /* Defaults in trajectory computation */ #define SC_TRAJ_HIT_SHIELDS (1 << 0) /* Must hit any shields we impact */ #define SC_TRAJ_IGNORE_WIND (1 << 1) /* Ignore wind in trajectory computation */ #define SC_TRAJ_IGNORE_VISC (1 << 2) /* Ignore viscosity in computations */ #define SC_TRAJ_RESTRICTIVE (1 << 3) /* Restrict calculated traj to screen */ #define SC_TRAJ_TERMINUS (1 << 4) /* Weapon must halt at specified dest */ #define SC_TRAJ_TUNNELING (1 << 5) /* Weapon is tunneling if set. */ #define SC_TRAJ_NO_MODIFY (1 << 6) /* Do not modify player or config data */ #define SC_TRAJ_BRIEF (1 << 7) /* Run at lower max timestep */ /* These modifiers are specific to stepping */ #define SC_TRAJ_IGNORE_TANK (1 << 8) /* Ignore tanks in stepping */ #define SC_TRAJ_IGNORE_LAND (1 << 9) /* Ignore land in stepping */ /* Low-level trajectory timestep size */ #define SC_TRAJ_TIME_STEPS_PER_SUBSTEP (SC_TRAJ_TIME_STEP / SC_TRAJ_TIME_SUBSTEP) /* Physics configuration */ typedef struct _sc_physics { double airviscosity; /* Air viscosity (0==projectiles not slowed) */ double gravity; /* Gravity field (pixels/step/step) */ int suspenddirt; /* Probability that dirt remains suspended */ int tanksfall; /* Nonzero if tanks should fall */ int bordersextend; /* Distance out borders extend (simulation) */ double damping; /* Ground damping (for tunnelling) */ double maxwind; /* Maximum wind force */ double curwind; /* Current wind force */ bool dynamicwind; /* Wind is dynamic? */ sc_physics_walls walls; /* Effect of walls */ } sc_physics; /* Physics modelling -- basic */ sc_physics *sc_physics_new(void); void sc_physics_free(sc_physics **ph); void sc_physics_init_game(sc_physics *ph); void sc_physics_init_round(sc_physics *ph); void sc_physics_update_wind(sc_physics *ph); /* Trajectory setup - flight */ sc_trajectory *sc_traj_new_velocities( const struct _sc_config *c, const struct _sc_player *p, int flags, double cx, double cy, double velx, double vely); sc_trajectory *sc_traj_new_power_angle(const struct _sc_config *c, const struct _sc_player *p, int flags, double cx, double cy, double power, double angle); sc_trajectory *sc_traj_new_dest_angle( const struct _sc_config *c, const struct _sc_player *p, int flags, double cx, double cy, double deltax, double deltay, double angle, double maxpower); sc_trajectory *sc_traj_new_dest_height(const struct _sc_config *c, const struct _sc_player *p, int flags, double cx, double cy, double deltax, double deltay, double height); void sc_traj_landfall(struct _sc_config *c, const sc_trajectory *tr); void sc_traj_free(sc_trajectory **tr); /* Conversion between traj types? */ bool sc_trajectory_convert(const struct _sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_type type); /* Trajectory calculations */ void sc_traj_reinitialize(sc_trajectory *tr); sc_trajectory_result sc_traj_step(struct _sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data); sc_trajectory_result sc_traj_run( struct _sc_config *c, sc_trajectory *tr, int flags, sc_trajectory_action action, void *data); void sc_traj_set_velocity(sc_trajectory *tr, double velx, double vely); void sc_traj_revise_velocity(sc_trajectory *tr, double velx, double vely); void sc_traj_revise_acceleration(sc_trajectory *tr, double accx, double accy); void sc_traj_restore_acceleration(sc_trajectory *tr); void sc_traj_new_control_equation(sc_trajectory *tr, double ctrx, double ctry, double velx, double vely); double sc_traj_get_velocity_x(const sc_trajectory *tr); double sc_traj_get_velocity_y(const sc_trajectory *tr); double sc_traj_get_current_x(const sc_trajectory *tr); double sc_traj_get_current_y(const sc_trajectory *tr); double sc_traj_height(const sc_trajectory *tr); /* Named parametres */ const char **sc_physics_wall_names(void); const unsigned int *sc_physics_wall_types(void); #endif /* __sphysics_h_included */ xscorch-0.2.1/sgame/splayer.c0000644000175000001440000011101111615366345013024 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/splayer.c,v 1.49 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - splayer.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched Player information This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void sc_player_init_game(const sc_config *c, sc_player *p) { /* sc_player_init_game Game initialization for this player */ /* Initialise the player's currency and inventory */ p->money = c->economics->initialcash; /* No wins (yet) */ p->numwins = 0; p->kills = 0; p->suicides = 0; p->ac_state = 0; p->turret = 0; p->power = 0; /* Set player arms level */ p->armslevel = c->weapons->armslevel; /* Initialise AI */ sc_ai_init_game(c, p); } void sc_player_init_round(sc_config *c, sc_player *p) { /* sc_player_init_round Called once for each player at the beginning of any round. */ /* Determine the tank's position on the field */ p->field_index = game_lrand(c->numplayers); while(c->field_position[p->field_index] >= 0) { p->field_index = (p->field_index + 1) % c->numplayers; } c->field_position[p->field_index] = p->index; /* Initialise player X, Y coordinates -- we may need to modify the land a bit so the tank is initially on flat ground. */ p->x = rint((p->field_index + 1) * c->fieldwidth / (c->numplayers + 1.0)); p->y = sc_land_avg_height_around(c->land, p->x, c->fieldheight, p->tank->radius); sc_land_level_around(c, c->land, p->x, p->tank->radius, p->y); /* Setup player turret and initial power */ p->turret = game_lrand(181); p->power = SC_PLAYER_MAX_POWER / 5; /* Set initial life status Scale from game life units to this tank's life units. */ p->life = SC_PLAYER_MAX_LIFE * p->tank->hardness; p->dead = false; p->armed = false; p->killedby = -1; /* Setup fuel level */ p->fuel = 0; /* Clear contact triggers */ p->contacttriggers = false; /* Load weapons and accessories */ p->selweapon = SC_WEAPON_DEFAULT(c->weapons); p->selshield = SC_ACCESSORY_DEFAULT(c->accessories); sc_weapon_free_chain(&p->weapons); sc_shield_free(&p->shield); /* Money is as it was at beginning of the round */ p->oldmoney = p->money; /* Initialise AI */ sc_ai_init_round(c, p); } void sc_player_init_turn(const sc_config *c, sc_player *p) { /* sc_player_init_turn Called for the player at the beginning of their turn. */ int life; /* Clear any land that got stuck on our profile (sanity check) */ /* This sanity check must not be removed, as it is the only thing protecting tanks from dirt bombs that might PERMANENTLY lock the tank into position, as a consequence. */ sc_land_clear_profile(c, c->land, p); /* make sure we aren't occupying someone else's space */ if(!sc_player_passable(c, p, p->x, p->y)) { fprintf(stderr, "warning: Player %d is LOCKED, cannot resolve ** This is a bug **\n", p->index); fprintf(stderr, "warning: ** If there are any levitating tanks, well, this is the cause.\n"); } /* levitation check */ /* make sure tanks aren't levitating */ if(sc_player_passable(c, p, p->x, p->y - 1)) { fprintf(stderr, "warning: Player %d is LEVITATING, cannot resolve ** This is a bug **\n", p->index); fprintf(stderr, "warning: ** If there are any levitating tanks, well, this is the cause.\n"); } /* levitation check */ if(sc_land_support(c, c->land, p->x, p->y, p->tank->radius, p->tank->shelfsize) != 0) { fprintf(stderr, "warning: Player %d is UNSTABLE, cannot resolve ** This is a bug **\n", p->index); fprintf(stderr, "warning: ** If there are any levitating tanks, well, this is the cause.\n"); } /* levitation check */ /* Check tank damage; update firepower if needed */ life = INT_ROUND_DIV(p->life, p->tank->hardness); if(p->power > life) p->power = life; if(p->power < 0) p->power = 0; /* Update shields for the new turn. */ sc_shield_init_turn(p); } sc_player *sc_player_new(int index, const sc_tank_profile *tank) { /* sc_player_new Create a new player */ sc_player *p; /* Allocate player */ p = (sc_player *)malloc(sizeof(sc_player)); if(p == NULL) return(NULL); /* Initialize player name and ID number */ sbprintf(p->name, sizeof(p->name), "Player %d", index + 1); p->name[SC_PLAYER_NAME_LENGTH - 1] = '\0'; p->index = index; p->aitype = SC_AI_HUMAN; p->tank = tank; /* No weapons or accessories, by default */ p->armed = false; p->weapons = NULL; p->shield = NULL; p->turret = 0; p->power = 0; /* Setup AI state */ p->ai = sc_ai_new(); return(p); } void sc_player_free(sc_player **p) { /* sc_player_free Remove a player from the game */ if(p == NULL || *p == NULL) return; sc_weapon_free_chain(&(*p)->weapons); sc_shield_free(&(*p)->shield); sc_ai_free(&(*p)->ai); free(*p); *p = NULL; } void sc_player_advance_power(const sc_config *c, sc_player *p, int delta) { /* sc_player_advance_power Modifies power output by the delta given. */ int life; /* Sanity checks */ if(c == NULL || p == NULL) return; /* Figure out current life */ life = INT_ROUND_DIV(p->life, p->tank->hardness); /* Update power */ p->power += delta; if(p->power > SC_PLAYER_MAX_POWER) p->power = SC_PLAYER_MAX_POWER; if(p->power > life) p->power = life; if(p->power < 0) p->power = 0; /* Update state */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } void sc_player_advance_turret(const sc_config *c, sc_player *p, int delta) { /* sc_player_advance_turret Adjusts turret angle by the delta given. */ /* Sanity checks */ if(c == NULL || p == NULL) return; /* Update turret angle */ p->turret += delta; while(p->turret > 180) p->turret -= 180; while(p->turret < 0) p->turret += 180; /* Update state */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } void sc_player_advance_weapon(const sc_config *c, sc_player *p, int delta) { /* sc_player_advance_weapon Jump weapons forward (negative: jump back by so many weapons). */ sc_weapon_info *info; /* Sanity checks */ if(c == NULL || p == NULL) return; info = p->selweapon; if(info == NULL) { fprintf(stderr, "warning: player %i has selected invalid weapon, aborting search\n", p->index); return; } /* Cycle through the weapons */ do { if(delta > 0) info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_FORWARD); else info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL | SC_WEAPON_SCAN_REVERSE); if(info == NULL) { fprintf(stderr, "warning: player %i has no weapons (at all!), aborting search\n", p->index); break; } sc_player_set_weapon(c, p, info); } while(info->inventories[p->index] <= 0); /* Update state */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } void sc_player_advance_shield(const sc_config *c, sc_player *p, int flags) { /* sc_player_advance_shield Jump to the next available shield. */ sc_accessory_info *info; bool sawone = false; /* Sanity checks */ if(c == NULL || p == NULL) return; info = p->selshield; if(info == NULL) { fprintf(stderr, "warning: player %i has selected invalid shield, aborting search\n", p->index); return; } /* Always advance, unless CHECK_CUR is set */ if(!(flags & SC_PLAYER_SHIELD_CHECK_CUR)) { /* If we're not on a shield, try to find one. */ if(!SC_ACCESSORY_IS_SHIELD(info)) { info = sc_shield_find_best(c, p); } else { info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL); } } /* Cycle through the shields */ while(info != NULL && (!sawone || info->ident != p->selshield->ident) && (!SC_ACCESSORY_IS_SHIELD(info) || info->inventories[p->index] <= 0)) { info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL); sawone = true; } /* Were we successful? */ if(info == NULL || !SC_ACCESSORY_IS_SHIELD(info) || info->inventories[p->index] <= 0) { /* No shields left; fall back to the default */ info = SC_ACCESSORY_DEFAULT(c->accessories); if(info == NULL) { fprintf(stderr, "warning: no default accessory found! aborting...\n"); return; } } /* Found a shield which we have in stock! */ sc_player_set_shield(c, p, info); #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } void sc_player_set_power(const sc_config *c, sc_player *p, int power) { /* sc_player_set_power */ int life; /* Sanity checks */ if(c == NULL || p == NULL) return; /* Figure out current life */ life = INT_ROUND_DIV(p->life, p->tank->hardness); /* Update power; return if no change */ if(power < 0) power = 0; if(power > SC_PLAYER_MAX_POWER) power = SC_PLAYER_MAX_POWER; if(power > life) power = life; if(p->power == power) return; p->power = power; /* Update state */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } void sc_player_set_turret(const sc_config *c, sc_player *p, int turret) { /* sc_player_set_turret */ /* Sanity checks */ if(c == NULL || p == NULL) return; /* Update turret angle; return if no change */ while(turret < 0) turret += 180; while(turret > 180) turret -= 180; if(p->turret == turret) return; p->turret = turret; /* Update state */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } void sc_player_set_weapon(const sc_config *c, sc_player *p, sc_weapon_info *info) { /* sc_player_set_weapon */ /* Sanity checks */ if(c == NULL || p == NULL || info == NULL) return; /* Make sure index is sane, and player has that weapon */ if(info->inventories[p->index] <= 0) return; p->selweapon = info; /* Update state */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } void sc_player_set_shield(const sc_config *c, sc_player *p, sc_accessory_info *info) { /* sc_player_set_shield */ /* Sanity checks */ if(c == NULL || p == NULL || info == NULL) return; /* Make sure info is a shield, and player has that shield */ if(info->inventories[p->index] > 0 && SC_ACCESSORY_IS_SHIELD(info)) p->selshield = info; else return; /* Update state */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif sc_status_update(c->window, p); } bool sc_player_activate_shield(const sc_config *c, sc_player *p) { /* sc_player_activate_shield Activates the currently selected player shield. If unable to activate, then false is returned. Any existing shield will be destroyed, even if fully powered; so use with caution. The player shield will also be advanced if necessary. */ sc_accessory_info *info; /* Sanity check */ if(c == NULL || p == NULL) return(false); /* Verify this is a shield */ info = p->selshield; if(!SC_ACCESSORY_IS_SHIELD(info) || info->inventories[p->index] <= 0) return(false); /* Activate this shield, perhaps destroying any old shielding */ sc_shield_free(&p->shield); p->shield = sc_shield_new(info); /* Update state */ #if USE_NETWORK sc_net_client_send_shields(c, c->client, p->index); #endif /* Update inventory - Must happen AFTER send_shields! */ --info->inventories[p->index]; sc_player_advance_shield(c, p, SC_PLAYER_SHIELD_CHECK_CUR); sc_status_update(c->window, p); return(true); } bool sc_player_activate_best_shield(const sc_config *c, sc_player *p) { /* sc_player_activate_best_shield Activates the best player shield available. If unable to activate, then false is returned. Any existing shield will be destroyed, even if fully powered; so use with caution. */ /* Find the best shields available */ sc_accessory_info *info = sc_shield_find_best(c, p); /* If successful, activate them! */ if(info != NULL) { sc_player_set_shield(c, p, info); return(sc_player_activate_shield(c, p)); } /* Failure */ return(false); } bool sc_player_activate_auto_shield(const sc_config *c, sc_player *p) { /* sc_player_activate_auto_shield Activate a shield via Auto Defense, on the fly, if we can. */ /* Sanity check */ if(c == NULL || p == NULL) return(false); /* Check for auto defense capability. */ if(!(p->ac_state & SC_ACCESSORY_STATE_AUTO_DEF)) return(false); /* Try to activate the currently selected shield. */ if(sc_player_activate_shield(c, p)) return(true); /* Otherwise try and activate the best shield available. */ return(sc_player_activate_best_shield(c, p)); } bool sc_player_activate_battery(const sc_config *c, sc_player *p) { /* sc_player_activate_battery Activates a player battery, if any are available. This will allow the player to partially recharge their tank. */ int count; /* Iterator variable */ int maxlife; /* Max life, scaled to hardness */ sc_accessory_info *info; /* Sanity check */ if(c == NULL || p == NULL) return(false); maxlife = SC_PLAYER_MAX_LIFE * p->tank->hardness; if(p->life >= maxlife) return(false); /* No recharge needed */ /* Search for batteries in the inventory */ count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL); for(; count > 0; --count) { if(SC_ACCESSORY_IS_BATTERY(info) && info->inventories[p->index] > 0) { /* Activate this battery */ --info->inventories[p->index]; p->life += SC_BATTERY_RECHARGE_PERCT * maxlife / 100; if(p->life > maxlife) p->life = maxlife; /* Update state */ #if USE_NETWORK sc_net_client_send_battery(c, c->client, p->index); #endif sc_status_update(c->window, p); return(true); } info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL); } /* Failure, sorry */ return(false); } int sc_player_battery_count(const sc_config *c, const sc_player *p) { /* sc_player_battery_count Determine the number of batteries in the player's inventory. */ int count; /* Iterator variable */ sc_accessory_info *info; /* Sanity check */ if(c == NULL || p == NULL) return(false); /* Search a battery in inventory */ count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL); for(; count > 0; --count) { if(SC_ACCESSORY_IS_BATTERY(info) && info->inventories[p->index] > 0) { return(info->inventories[p->index]); } info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL); } /* Failure, sorry */ return(0); } void sc_player_set_contact_triggers(const sc_config *c, sc_player *p, bool flag) { /* sc_player_set_contact_triggers Toggles the contact-trigger flag automagically. Won't toggle it unless the player has contact triggers. */ /* Sanity check */ assert(c != NULL); assert(p != NULL); /* Update the flag */ if(flag && (p->ac_state & SC_ACCESSORY_STATE_TRIGGER)) { p->contacttriggers = true; } else { p->contacttriggers = false; } /* Make sure player flags are transmitted over network */ #if USE_NETWORK sc_net_client_send_flags(c, c->client, p->index); #endif /* Update status window. */ sc_status_update(c->window, p); } void sc_player_toggle_contact_triggers(const sc_config *c, sc_player *p) { /* sc_player_toggle_contact_triggers Toggle the "use contact triggers" flag for this player. */ assert(p != NULL); sc_player_set_contact_triggers(c, p, !p->contacttriggers); } bool sc_player_use_contact_trigger(const sc_config *c, sc_player *p) { /* sc_player_use_contact_trigger Try to use a contact trigger. If successful, return true. */ sc_accessory_info *info, *cons = NULL, *perm = NULL; int count, totrig = 0; /* Sanity check */ if(c == NULL || p == NULL) return(false); /* Are they enabled? */ if(!p->contacttriggers) return(false); /* Check to see if we have any contact triggers to use. */ count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL); for(; count > 0; --count) { /* Make sure the damn thing is a batch-o-contact-triggers */ if(SC_ACCESSORY_IS_TRIGGER(info) && info->inventories[p->index] > 0) { ++totrig; if(SC_ACCESSORY_IS_CONSUMABLE(info)) cons = info; if(SC_ACCESSORY_IS_PERMANENT(info)) perm = info; } info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL); } /* Use permanent triggers if possible; otherwise try consumable ones. */ if(perm != NULL) { /* Make use of permanent (distance?) trigger. */ return(true); } else if(cons != NULL) { /* Consume a consumable (mechanical?) trigger. */ --cons->inventories[p->index]; if(totrig <= 1 && info->inventories[p->index] <= 0) { p->ac_state &= ~SC_ACCESSORY_STATE_TRIGGER; sc_player_set_contact_triggers(c, p, false); } return(true); } else { /* Failure; sorry. */ return(false); } } int sc_player_contact_trigger_count(const sc_config *c, const sc_player *p) { /* sc_player_contact_trigger_count Return the number of contact triggers in this player's inventory. */ sc_accessory_info *info, *cons = NULL, *perm = NULL; int count; /* Sanity check */ if(c == NULL || p == NULL) return(false); /* Check to see if we have any contact triggers to use. */ count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL); for(; count > 0; --count) { /* Make sure the damn thing is a batch-o-contact-triggers */ if(SC_ACCESSORY_IS_TRIGGER(info) && info->inventories[p->index] > 0) { if(SC_ACCESSORY_IS_CONSUMABLE(info)) cons = info; if(SC_ACCESSORY_IS_PERMANENT(info)) perm = info; } info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL); } /* Use permanent triggers if possible; otherwise try consumable ones. */ if(perm != NULL) { /* Make use of permanent (distance?) trigger. */ return(perm->inventories[p->index]); } else if(cons != NULL) { /* Consume a consumable (mechanical?) trigger. */ return(cons->inventories[p->index]); } else { /* Failure; sorry. */ return(0); } } void sc_player_set_position(const sc_config *c, sc_player *p, int x, int y) { /* sc_player_set_position The coordinate (x, y) indicates the new player position, in virtual coordinates. This function always succeeds and performs no sanity checks (i.e. to make sure player can actually OCCUPY said position) */ /* Sanity checks */ if(c == NULL || p == NULL) return; /* Make sure tank has actually moved */ if(p->x == x && p->y == y) return; /* Update tank position on screen */ sc_window_undraw_tank(c->window, p); p->x = x; p->y = y; sc_window_draw_tank(c->window, p); /* Transmit state by network */ #if USE_NETWORK sc_net_client_send_orders(c, c->client, p->index); #endif /* Network? */ } void sc_player_inc_wins(sc_config *c, sc_player *p) { /* sc_player_inc_wins */ ++p->numwins; p->money += c->economics->survivalbonus; } void sc_player_died(sc_config *c, sc_player *p) { /* sc_player_died */ p->dead = true; p->money -= c->economics->deathloss; } static bool _sc_player_drop(sc_config *c, sc_player *p, int falldist) { /* sc_player_drop Drop current player; return nonzero if still falling */ int deltax; int dropdist; if(falldist <= 0) return(true); if(SC_CONFIG_NO_ANIM(c)) dropdist = c->fieldheight; else dropdist = falldist; /* Note: this function needs to use the dead flag; if the player is technically lifeless but the tank has not been removed from the playfield yet, then the tank should still take a plunge. */ if(!p->dead) { /* Get maximum height of land around and just below the tank */ falldist = 0; while(falldist < dropdist && sc_player_passable(c, p, p->x, p->y - 1)) { /* Still falling vertically down */ if(falldist == 0) sc_window_undraw_tank(c->window, p); ++falldist; --p->y; } /* Falling tank vertically down */ if(falldist > 0) { sc_window_draw_tank(c->window, p); _sc_player_drop(c, p, dropdist - falldist); /* Assume need recurse, a tank may have been using us for support */ return(true); } /* Haven't landed yet */ /* We've landed */ /* Might be sliding on the slope at this point */ deltax = sc_land_support(c, c->land, p->x, p->y, p->tank->radius, p->tank->shelfsize); if(deltax != 0 && sc_player_passable(c, p, p->x + deltax, p->y - 1)) { /* We slid to one side (deltax > 0, slide right) */ sc_window_undraw_tank(c->window, p); p->x += deltax; --p->y; sc_window_draw_tank(c->window, p); falldist = dropdist - 4 * abs(deltax); _sc_player_drop(c, p, falldist); /* Assume need recurse, a tank may have been using us for support */ return(true); } /* Tank slid on a steep slope */ } /* Tank isn't dead */ /* Tank has settled onto the ground */ return(false); } bool sc_player_drop_all(sc_config *c) { /* sc_player_drop_all Drop all players */ bool needsrecurse; int i; needsrecurse = 0; i = c->numplayers - 1; while(i >= 0) { /* Make sure _sc_player_drop is FIRST, so short-circuiting does not kill the function call (which has side effects). */ needsrecurse = _sc_player_drop(c, c->players[i], SC_TANK_MAX_DROP_PER_CYCLE) || needsrecurse; --i; } return(needsrecurse); } static void _sc_player_damage(sc_config *c, sc_player *p, const sc_explosion *e) { /* sc_player_damage */ int damage; /* If player is already dead, then there's nothing to do */ if(!SC_PLAYER_IS_ALIVE(p)) return; /* How much damage was taken? */ damage = sc_expl_damage_at_point(c->land, e, p->x, p->y); if(damage <= 0) return; /* Check if the shields absorbed the explosion for us. */ damage = sc_shield_absorb_explosion(p, e, damage); if(damage <= 0) return; /* Take any remaining damage ourselves */ p->life -= damage * SC_TANK_NORMAL_HARDNESS; /* Revive shields if necessary (and if auto-defense enabled) */ if(SC_PLAYER_IS_ALIVE(p)) { sc_player_activate_auto_shield(c, p); } /* Tank took a direct or partial hit. Damn. */ p->money -= c->economics->damageloss; if(!SC_PLAYER_IS_ALIVE(p)) { p->life = 0; /* We died */ p->killedby = e->playerid; /* Who killed us? */ if(e->playerid == p->index) { /* It was a suicide */ ++c->players[e->playerid]->suicides; p->money -= c->economics->suicideloss; } else { /* Give opponent some points for killing us */ ++c->players[e->playerid]->kills; c->players[e->playerid]->money += c->economics->killbonus; } } if(e->playerid != p->index) { /* Give points to other player for damaging us */ c->players[e->playerid]->money += c->economics->damagebonus; } /* Make sure not self */ } void sc_player_damage_all(sc_config *c, const sc_explosion *e) { /* sc_player_damage_all */ int i; for(i = c->numplayers - 1; i >= 0; --i) { _sc_player_damage(c, c->players[i], e); } } sc_player **sc_player_random_order(sc_config *c, sc_player **playerlist) { /* sc_player_random_order */ int order[SC_MAX_PLAYERS]; int i; int j; for(i = 0; i < c->numplayers; ++i) { order[i] = i; } for(i = 0; i < c->numplayers; ++i) { for(j = 0; j < c->numplayers; ++j) { if(i != j && game_lrand(100) < 50) { order[i] += order[j]; order[j] = order[i] - order[j]; order[i] = order[i] - order[j]; } } } for(i = 0; i < c->numplayers; ++i) { playerlist[i] = c->players[order[i]]; } return(playerlist); } sc_player **sc_player_winner_order(sc_config *c, sc_player **playerlist) { /* sc_player_winner_order */ sc_player *tmp; int i; int j; sc_player_random_order(c, playerlist); for(i = 1; i < c->numplayers; ++i) { for(j = 0; j < i; ++j) { if(playerlist[i]->kills - playerlist[i]->suicides > playerlist[j]->kills - playerlist[j]->suicides) { tmp = playerlist[i]; playerlist[i] = playerlist[j]; playerlist[j] = tmp; } } } return(playerlist); } sc_player **sc_player_loser_order(sc_config *c, sc_player **playerlist) { /* sc_player_loser_order */ sc_player *tmp; int i; int j; sc_player_random_order(c, playerlist); for(i = 1; i < c->numplayers; ++i) { for(j = 0; j < i; ++j) { if(playerlist[i]->kills - playerlist[i]->suicides < playerlist[j]->kills - playerlist[j]->suicides) { tmp = playerlist[i]; playerlist[i] = playerlist[j]; playerlist[j] = tmp; } } } return(playerlist); } int sc_player_total_fuel(const sc_accessory_config *ac, const sc_player *p) { /* sc_player_total_fuel Used to discover how much fuel a player has, for the movement menu. */ const sc_accessory_info *info; int count; int fuel = 0; if(p == NULL) return(0); /* This translates this tank's tank fuel rate to the game fuel rate. */ fuel = INT_ROUND_DIV(p->fuel, p->tank->efficiency); /* Find unopened fuel in the inventory. */ count = sc_accessory_count(ac, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(ac, SC_ACCESSORY_LIMIT_ALL); for(; count > 0; --count) { if(SC_ACCESSORY_IS_FUEL(info)) { fuel += info->fuel * info->inventories[p->index]; } info = sc_accessory_next(ac, info, SC_ACCESSORY_LIMIT_ALL); } return(fuel); } static bool _sc_player_consume_fuel(const sc_accessory_config *ac, sc_player *p) { /* _sc_player_consume_fuel Used to eat up fuel, based on tank type and such. */ sc_accessory_info *info; int count; if(p == NULL) return(false); /* We are basically looking to move one pixel at this point. Thus, we bring the fuel up to at least one unit positive. If we actually have enough, that is. */ count = sc_accessory_count(ac, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(ac, SC_ACCESSORY_LIMIT_ALL); for(; count > 0; --count) { if(p->fuel >= SC_TANK_NORMAL_EFFICIENCY) break; if(SC_ACCESSORY_IS_FUEL(info)) { while(info->inventories[p->index] > 0 && p->fuel < SC_TANK_NORMAL_EFFICIENCY) { /* Scale game fuel to this tank's fuel rate. */ p->fuel += info->fuel * p->tank->efficiency; --info->inventories[p->index]; } } info = sc_accessory_next(ac, info, SC_ACCESSORY_LIMIT_ALL); } /* Actually consume some fuel if we can. */ if(p->fuel < SC_TANK_NORMAL_EFFICIENCY) return(false); p->fuel -= SC_TANK_NORMAL_EFFICIENCY; return(true); } bool sc_player_move(const sc_config *c, sc_player *p, int delta) { /* sc_player_move Move the player's tank by means of consuming fuel cells. This call is only used when moving by using fuel, and should not be used to set player position by ``forces''. If the player does not have any fuel, then we will give up and not attempt the move at all. */ int y; /* Height of the land at the destination */ /* Sanity checks */ if(c == NULL || p == NULL || delta == 0) return(false); /* Check that the player is in a mobile tank. */ if(!p->tank->mobile) return(false); /* Check that the height is not too high a climb for a heavy tank. */ y = sc_land_height_around(c->land, p->x + delta, c->fieldheight, p->tank->radius); if(y > p->y + SC_TANK_CLIMB_HEIGHT) return(false); /* Check that the land is otherwise ``passable'', i.e. no walls or other tanks in our way. */ if(!sc_player_passable(c, p, p->x + delta, y)) return(false); /* Attempt to consume fuel. If this succeeds then the move goes thru */ if(!_sc_player_consume_fuel(c->accessories, p)) return(false); sc_player_set_position(c, p, p->x + delta, y); sc_status_update(c->window, p); return(true); } int sc_player_turret_x(const sc_player *p, int angle) { /* sc_player_turret_x */ return(p->x + (p->tank->turretradius + 1) * cos(angle * M_PI / 180)); } int sc_player_turret_y(const sc_player *p, int angle) { /* sc_player_turret_y */ return(p->y + (p->tank->turretradius + 1) * sin(angle * M_PI / 180)); } void sc_player_death(const sc_config *c, const sc_player *p, sc_explosion **e) { /* sc_player_death Nice knowin' ya... Note, this function may add new explosions to the queue e that is passed in. This function does not (directly) modify the player state. */ sc_explosion *expl; assert(c != NULL && p != NULL && e != NULL); switch(game_lrand(10)) { case 0: /* Just say it with napalm ... */ expl = sc_expl_new(p->x, p->y, c->weapons->scaling * SC_WEAPON_NAPALM_RADIUS, SC_WEAPON_NAPALM_FORCE, p->killedby, SC_EXPLOSION_NAPALM); expl->data = sc_spill_new(c, c->land, SC_WEAPON_NAPALM_LIQUID, expl->centerx, expl->centery); sc_expl_add(e, expl); break; default: /* Just the usual, 3-stage detonation */ sc_expl_add(e, sc_expl_new(p->x, p->y, c->weapons->scaling * SC_WEAPON_SMALL_EXPLOSION, SC_WEAPON_SMALL_FORCE, p->killedby, SC_EXPLOSION_NORMAL)); if(game_drand() < 0.5) { sc_expl_add(e, sc_expl_new(p->x, p->y, c->weapons->scaling * SC_WEAPON_MEDIUM_EXPLOSION, SC_WEAPON_MEDIUM_FORCE, p->killedby, SC_EXPLOSION_NORMAL)); if(game_drand() < 0.1) { sc_expl_add(e, sc_expl_new(p->x, p->y, c->weapons->scaling * SC_WEAPON_LARGE_EXPLOSION, SC_WEAPON_LARGE_FORCE, p->killedby, SC_EXPLOSION_PLASMA)); } /* Do third stage? */ } /* Do second stage? */ break; } /* End of switch */ } bool sc_player_passable(const sc_config *c, const sc_player *p, int x, int y) { /* sc_player_passable Returns true if the player can be placed at the virtual coordinate indicated. (x, y) represents the new `center' of the tank. To do this we actually check the tank profile to make sure the land is passable everywhere where the tank profile is opaque. */ const unsigned char *data; int radius; int cx; int cy; if(c == NULL || p == NULL || p->tank == NULL || p->tank->data == NULL) return(false); data = p->tank->data; radius = p->tank->radius; for(cy = radius; cy >= 0; --cy) { for(cx = radius; cx >= -radius; --cx, ++data) { if(*data != SC_TANK_PROFILE_CLEAR) { if(!sc_land_passable_point(c, p, x + cx, y + cy)) return(false); } } } return(true); } bool sc_player_would_impact(const sc_config *c, const sc_player *p, int x, int y) { /* sc_player_would_impact Determines whether the x, y coordinate indicated is atop the player, i.e. a weapon at that coordinate would actually hit the player. The coordinate is a virtual coordinate; returns true if an impact would occur. */ const unsigned char *data; int radius; int dx; int dy; /* Sanity checks */ if(c == NULL || p == NULL || p->tank == NULL || p->tank->data == NULL) return(false); /* Determine where in the player tank profile we landed */ radius = p->tank->radius; if(!sc_land_calculate_deltas(c->land, &dx, &dy, p->x, p->y, x, y)) return(false); if(dx < -radius || dx > radius) return(false); if(dy < 0 || dy > radius) return(false); /* We're in the bounding box for the profile; determine if we hit */ data = p->tank->data + (radius - dy) * (radius + radius + 1) + (dx + radius); return(*data != SC_TANK_PROFILE_CLEAR); } #define SC_PLAYER_NUM_MESSAGES 36 static const char *_sc_player_messages[SC_PLAYER_NUM_MESSAGES + 1] = { "In times of trouble, go with what you know.", "Die!", "You're toast!", "Banzai!", "From Hell's heart I stab at thee...", "I didn't do it. Nobody saw me do it.", "Make my day.", "Charge!", "Attack!", "You're outta here.", "Freeze, or I'll shoot!", "Ha ha ha.", "We come in peace - Shoot to kill!", "In your face!", "I love the smell of Napalm in the morning.", "Victory!", "Show some respect.", "Just who do you think you are?", "Look out below!", "Knock, Knock.", "Look over there.", "Guess what's coming for dinner?", "Merry Christmas.", "Open wide!", "Here goes nothing...", "Don't worry, it isn't a live round.", "I wonder what this button does?", "Don't take this personally.", "Would this make you mad?", "I could spare you, but why?", "My bomb is bigger than yours.", "Don't forget about me!", "Take this!", "This screen ain't big enough for the both of us.", "Say \"Arrgghhhhh....\"", "I shall oil my turret with your blood.", NULL }; #define SC_PLAYER_NUM_DEATH_MESSAGES 29 static const char *_sc_player_death_messages[SC_PLAYER_NUM_DEATH_MESSAGES + 1] = { "Aargh!", "I hate it when that happens.", "One direct hit can ruin your whole day.", "Ouch.", "Oh no, not again.", "Another one bites the dust.", "Goodbye.", "Farewell, cruel world.", "Another day, another bomb.", "Why does everything happen to me?", "I've got a bad feeling about this.", "What was that noise?", "Mama said there'd be days like this.", "Its just one of those days...", "I see a bright light...", "I let you hit me!", "I didn't want to live anyway.", "Was that as close as I think it was?", "Join the army, see the world they said.", "I thought you liked me?", "Such senseless violence! I don't understand it.", "I think this guy's a little crazy.", "Somehow I don't feel like killing anymore.", "Gee... thanks.", "I've fallen and I can't get up!", "I'll be back...", "Hey - I've got lawyers.", "Time to call 1-900-SUE-TANK.", "~But oh, God, under the weight of life / Things seem so much brighter on the other side~", NULL }; const char *sc_player_talk(const sc_config *c, const sc_player *p) { switch(c->options.talk) { case SC_CONFIG_TALK_OFF: break; case SC_CONFIG_TALK_COMPUTERS: if(p->aitype == SC_AI_HUMAN) break; default: if(game_lrand(100) < (dword)c->options.talkprob) { return(_sc_player_messages[game_lrand(SC_PLAYER_NUM_MESSAGES)]); } } return(NULL); } const char *sc_player_death_talk(const sc_config *c, const sc_player *p) { switch(c->options.talk) { case SC_CONFIG_TALK_OFF: break; case SC_CONFIG_TALK_COMPUTERS: if(p->aitype == SC_AI_HUMAN) break; default: if(game_lrand(100) < (dword)c->options.talkprob) { return(_sc_player_death_messages[game_lrand(SC_PLAYER_NUM_DEATH_MESSAGES)]); } } return(NULL); } xscorch-0.2.1/sgame/splayer.h0000644000175000001440000001764211175116137013041 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/splayer.h,v 1.21 2009-04-26 17:39:43 jacob Exp $ */ /* xscorch - splayer.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched player information This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __splayer_h_included #define __splayer_h_included #include #include /* Forward declarations */ struct _sc_config; struct _sc_explosion; struct _sc_weapon_info; struct _sc_weapon_config; struct _sc_accessory_info; struct _sc_accessory_config; #define SC_PLAYER_NAME_LENGTH 32 /* Length of player name (chars) */ #define SC_TANK_MAX_DROP_PER_CYCLE 32 /* Maximum distance tank drops per cycle */ #define SC_TANK_CLIMB_HEIGHT 3 /* Height tank can climb upward */ #define SC_PLAYER_MAX_LIFE 1000 /* Maximum life (before rescaling) */ #define SC_PLAYER_MAX_POWER 1000 /* Maximum power */ #define SC_PLAYER_POWER_STEP 1 /* Stepping constants */ #define SC_PLAYER_POWER_BIGSTEP 20 #define SC_PLAYER_TURRET_STEP 1 #define SC_PLAYER_TURRET_BIGSTEP 5 #define SC_BATTERY_RECHARGE_PERCT 1 /* Percentage of life to restore when battery used */ #define SC_PLAYER_SHIELD_DEFAULTS 0 /* Defaults for sc_player_advance_shield */ #define SC_PLAYER_SHIELD_CHECK_CUR (1 << 1) /* Check if current shield valid before advance */ #define SC_PLAYER_IS_ALIVE(p) ((!(p)->dead) && ((p)->life > 0)) /* Player needs weapons, inventory... */ struct _sc_weapon; struct _sc_shield; struct _sc_inventory; struct _sc_tank_profile; /* Player data */ typedef struct _sc_player { /* Basic player information */ int index; /* Player number */ char name[SC_PLAYER_NAME_LENGTH];/* Player name */ const struct _sc_tank_profile *tank;/* Player's tank */ sc_ai_type aitype; /* Current AI mode */ sc_ai *ai; /* AI state information */ /* Note below that life and death may not always appear consistent. If life is nonpositive but dead is false, then the tank still exists on the screen, but is inactive and will soon detonate. When life is nonpositive, the tank should not perform any further actions but is still subject to gravity, etc... It is only when the dead flag goes true that the state machine generally thinks the tank is gone, kaput, dust. */ /* Tank information */ int turret; /* Turret angle (degrees, in [0, 180]) */ int power; /* Firing power level */ int life; /* Life remaining */ bool dead; /* Nonzero if tank destroyed */ int fuel; /* Current fuel level * 100 */ int x; /* X coordinate of tank */ int y; /* Y coordinate of tank */ int field_index; /* Index on the playing field */ /* Number of wins */ int numwins; /* Zero-- you're a loser */ int kills; /* Number of tanks killed */ int suicides; /* Number of suicides */ int killedby; /* Killed by whom? */ /* Currency and inventory */ int money; /* Player's current money */ int oldmoney; /* Money at begin of round */ struct _sc_inventory *inventory; /* Player's inventory of weapons */ /* Player weapons */ bool armed; /* True if weapon is armed */ int armslevel; /* Current player arms level */ struct _sc_weapon_info *selweapon;/* Currently selected weapon */ bool contacttriggers; /* Set if we should try using triggers */ struct _sc_weapon *weapons; /* Weapons that are currently active */ /* Player's accessories */ int ac_state; /* Accessory state/types */ struct _sc_shield *shield; /* Player shields (NULL==no shielding) */ struct _sc_accessory_info *selshield;/* Currently selected shield */ } sc_player; /* Player creation and initialization */ sc_player *sc_player_new(int index, const struct _sc_tank_profile *tank); void sc_player_free(sc_player **p); void sc_player_init_game(const struct _sc_config *c, sc_player *p); void sc_player_init_round(struct _sc_config *c, sc_player *p); void sc_player_init_turn(const struct _sc_config *c, sc_player *p); /* User control of tank */ void sc_player_advance_power( const struct _sc_config *c, sc_player *p, int delta); void sc_player_advance_turret(const struct _sc_config *c, sc_player *p, int delta); void sc_player_advance_weapon(const struct _sc_config *c, sc_player *p, int delta); void sc_player_advance_shield(const struct _sc_config *c, sc_player *p, int flags); void sc_player_set_power( const struct _sc_config *c, sc_player *p, int power); void sc_player_set_turret(const struct _sc_config *c, sc_player *p, int turret); void sc_player_set_weapon(const struct _sc_config *c, sc_player *p, struct _sc_weapon_info *info); void sc_player_set_shield(const struct _sc_config *c, sc_player *p, struct _sc_accessory_info *info); bool sc_player_activate_shield(const struct _sc_config *c, sc_player *p); bool sc_player_activate_best_shield(const struct _sc_config *c, sc_player *p); bool sc_player_activate_battery(const struct _sc_config *c, sc_player *p); void sc_player_set_position(const struct _sc_config *c, sc_player *p, int x, int y); void sc_player_set_contact_triggers(const struct _sc_config *c, sc_player *p, bool flag); void sc_player_toggle_contact_triggers(const struct _sc_config *c, sc_player *p); bool sc_player_use_contact_trigger(const struct _sc_config *c, sc_player *p); /* Miscellaneous inventory data */ int sc_player_battery_count(const struct _sc_config *c, const sc_player *p); int sc_player_contact_trigger_count(const struct _sc_config *c, const sc_player *p); /* Player scoring */ void sc_player_inc_wins(struct _sc_config *c, sc_player *p); void sc_player_died(struct _sc_config *c, sc_player *p); /* Drop the tank (land no longer supports it) */ bool sc_player_drop_all(struct _sc_config *c); void sc_player_damage_all(struct _sc_config *c, const struct _sc_explosion *e); void sc_player_death(const struct _sc_config *c, const struct _sc_player *p, struct _sc_explosion **e); /* Tank talk */ const char *sc_player_talk(const struct _sc_config *c, const sc_player *p); const char *sc_player_death_talk(const struct _sc_config *c, const sc_player *p); /* Player order selection */ sc_player **sc_player_random_order(struct _sc_config *c, sc_player **playerlist); sc_player **sc_player_winner_order(struct _sc_config *c, sc_player **playerlist); sc_player **sc_player_loser_order(struct _sc_config *c, sc_player **playerlist); /* Player movement */ int sc_player_total_fuel(const struct _sc_accessory_config *ac, const sc_player *p); bool sc_player_move(const struct _sc_config *c, sc_player *p, int delta); bool sc_player_passable(const struct _sc_config *c, const sc_player *p, int x, int y); /* Tank turret position */ int sc_player_turret_x(const sc_player *p, int angle); int sc_player_turret_y(const sc_player *p, int angle); /* Impact data */ bool sc_player_would_impact(const struct _sc_config *c, const sc_player *p, int x, int y); #endif /* __splayer_h_included */ xscorch-0.2.1/sgame/spreround.c0000644000175000001440000001545611615366345013406 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/spreround.c,v 1.7 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - spreround.c Copyright(c) 2001 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched pre round setup called from state machine This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include bool sc_autodef_activate(const sc_config *c, sc_player *p, const sc_auto_def_set *ads) { /* sc_player_activate_auto_def Activates player auto-defense, if available and if any shields are currently available. This is for the interactive GUI screen (see ...auto_shield). */ /* Sanity checks. */ if(c == NULL || p == NULL || ads == NULL) return(false); /* Check for auto defense capability. */ if(!(p->ac_state & SC_ACCESSORY_STATE_AUTO_DEF)) return(false); /* * Perform the requested auto defense actions... */ /* Select the given tracking accessory. */ /* TEMP - unimplemented - ads->auto_guidance - JL */ /* Select and activate the given shield. */ sc_player_set_shield(c, p, ads->auto_shield); sc_player_activate_shield(c, p); /* Activate parachutes, with the given pixel threshold. */ /* TEMP - unimplemented - ads->chute_height - JL */ /* Turn on or off Contact Triggers, as requested. */ sc_player_set_contact_triggers(c, p, ads->triggers); /* Success! */ return(true); } bool sc_autodef_ai_activate(const sc_config *c, sc_player *p) { /* sc_autodef_ai_activate Activate an AI's Auto Defense system. Do NOT call game_rand from this function! You have been warned! */ sc_auto_def_set ads; /* Sanity checks. */ if(c == NULL || p == NULL) return(false); /* Check for auto defense capability. */ if(!(p->ac_state & SC_ACCESSORY_STATE_AUTO_DEF)) return(false); switch(p->aitype) { case SC_AI_ANNIHILATER: case SC_AI_CALCULATER: case SC_AI_CHOOSER: case SC_AI_INSANITY: case SC_AI_MORON: case SC_AI_SHOOTER: case SC_AI_SPREADER: /* * TEMP - current issues - JL * (1) All AIs use the same settings currently. * (2) Should this perhaps be in sai or splayer instead? * (3) The tracking stuff is unimplemented currently. * (4) Same with parachutes, and is 8 pixels good? */ ads.auto_guidance = NULL; ads.auto_shield = sc_shield_find_best(c, p); ads.chute_height = 8; ads.triggers = true; return(sc_autodef_activate(c, p, &ads)); case SC_AI_HUMAN: case SC_AI_NETWORK: default: /* Non local AI players do not use this function. */ return(false); } } sc_lottery *sc_lottery_new(void) { /* sc_lottery_new Create a new lottery */ sc_lottery *lottery = (sc_lottery *)malloc(sizeof(sc_lottery)); if(lottery == NULL) return(NULL); lottery->displayed = false; lottery->winner = NULL; lottery->stake = NULL; return(lottery); } void sc_lottery_free(sc_lottery **lottery) { /* sc_lottery_free Obliterate a lottery */ if(lottery == NULL) return; free(*lottery); *lottery = NULL; } void sc_lottery_run(sc_config *c) { /* sc_lottery_run Give a random player a random weapon. */ sc_weapon_info *info; int player = game_lrand(c->numplayers); int weapon = game_lrand(sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL)); if(c == NULL) return; /* Get the first weapon. */ info = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_ALL); /* Count up to the weapon specified. */ while(info != NULL && weapon-- >= 0) info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL); /* Find the first non-useless, non-infinite weapon. */ weapon = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_ALL); while(info != NULL && (SC_WEAPON_IS_USELESS(info) || SC_WEAPON_IS_INFINITE(info)) && --weapon > 0) info = sc_weapon_next(c->weapons, info, SC_WEAPON_LIMIT_ALL); /* Tell the user and bail if we just can't do it. */ if(info == NULL || weapon == 0) { printf("lottery: unable to award a weapon because all are useless\n"); return; } /* Give the player his award, if we can. */ c->lottery->displayed = false; if(sc_inventory_award_weapon(info, player)) { /* Record the award for posterity. */ c->lottery->winner = c->players[player]; c->lottery->stake = info; } else { /* No award to announce. */ c->lottery->winner = NULL; c->lottery->stake = NULL; } return; } bool sc_preround_auto_defense(struct _sc_config *c, struct _sc_player *p) { /* sc_preround_auto_defense Run the auto defense screen in pre-round mode. Will return true if a wait is expected. */ /* Sanity checks. */ if(c == NULL || p == NULL) return(false); /* Check for auto defense capability. */ if(!(p->ac_state & SC_ACCESSORY_STATE_AUTO_DEF)) return(false); switch(p->aitype) { case SC_AI_NETWORK: /* We do not perform any action for network controlled players. */ return(false); case SC_AI_HUMAN: /* Humans get a nice screen they can set stuff on. */ sc_window_auto_defense(c->window, p); return(true); default: /* Local AIs set their auto defense parameters in realtime. */ sc_autodef_ai_activate(c, p); return(false); } } bool sc_preround_lottery(struct _sc_config *c) { /* sc_preround_lottery Run the pre-round display of lottery results. Will return true if a wait is expected. */ bool showstake = false; int playerid; /* Sanity checks. */ if(c == NULL || c->lottery == NULL || c->lottery->winner == NULL) return(false); /* Decide whether or not to show the stake (local human player). */ for(playerid = 0; playerid < c->numplayers; ++playerid) if(c->players[playerid]->aitype == SC_AI_HUMAN && c->lottery->winner->index == playerid) { showstake = true; break; } /* Paste up the window. */ sc_window_lottery_result(c->window, showstake); return(true); } xscorch-0.2.1/sgame/spreround.h0000644000175000001440000000473011615366345013404 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/spreround.h,v 1.5 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - spreround.h Copyright(c) 2001 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched pre round setup called from state machine This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __spreround_h_included #define __spreround_h_included /* Includes */ #include /* Forward declarations */ struct _sc_config; struct _sc_player; struct _sc_weapon_info; struct _sc_accessory_info; /* * Auto defense request settings (passed back from GUI code). * You must keep this sync'd with sc_auto_def_gtk in sautodef-gtk.c! */ typedef struct _sc_auto_def_set { struct _sc_accessory_info *auto_guidance; /* special guidance */ struct _sc_accessory_info *auto_shield; /* activate a shield */ int chute_height; /* parachute threshold */ bool triggers; /* use contact triggers */ } sc_auto_def_set; /* Information about who won the lottery */ typedef struct _sc_lottery { struct _sc_weapon_info *stake; /* What was won */ struct _sc_player *winner; /* Who won it */ bool displayed; /* Displayed these results yet? */ } sc_lottery; /* What we can do with an Auto Defense */ bool sc_autodef_activate(const struct _sc_config *c, struct _sc_player *p, const sc_auto_def_set *ads); bool sc_autodef_ai_activate(const struct _sc_config *c, struct _sc_player *p); /* What we can do with The Lottery */ sc_lottery *sc_lottery_new(void); void sc_lottery_free(sc_lottery **lottery); void sc_lottery_run(struct _sc_config *c); /* What we can do in pre-round. */ bool sc_preround_auto_defense(struct _sc_config *c, struct _sc_player *p); bool sc_preround_lottery(struct _sc_config *c); #endif /* __spreround_h_included */ xscorch-0.2.1/sgame/sregistry.c0000644000175000001440000001767511615366345013425 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sregistry.c,v 1.8 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sregistry.c Copyright(c) 2003-2004 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched runtime fast data registry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include sc_registry *sc_registry_new(void) { /* sc_registry_new Allocate and initialize a new registry. */ sc_registry *registry; /* Allocate the registry. */ registry = (sc_registry *)malloc(sizeof(sc_registry)); if(registry == NULL) return(NULL); /* Allocate the storage hashlist. */ registry->hashlist = shashlist_new(SC_REGISTRY_SIZE); if(registry->hashlist == NULL) { free(registry); return(NULL); } /* Start numbering custom classes at the first available integer. */ registry->nextclass = SHASHLIST_FIRST_CLASS; /* Start numbering valid registry keys at 0 (-1 means bad key). */ registry->nextkey = 0; return(registry); } void sc_registry_free(sc_registry **registry) { /* sc_registry_free Deallocate a registry (whew). */ if(registry == NULL || *registry == NULL) return; /* This will also deallocate any registry entries, but not their data... */ shashlist_free(&(*registry)->hashlist); free(*registry); *registry = NULL; } int sc_registry_get_new_class_id(sc_registry *registry) { /* sc_registry_get_new_class_id Return the next available class ID. */ if(registry == NULL) return(-1); return(registry->nextclass++); } int sc_registry_get_next_new_key(sc_registry *registry) { /* sc_registry_get_next_new_key Return the next available unique integer key. */ if(registry == NULL) return(-1); return(registry->nextkey++); } bool sc_registry_add_by_int(sc_registry *registry, void *data, int class, int key) { /* sc_registry_add_by_int Add data to the registry by integer key. */ if(registry == NULL) return(false); return(shashlist_insert_by_int(registry->hashlist, data, class, key) != NULL); } bool sc_registry_add_by_string(sc_registry *registry, void *data, int class, const char *key) { /* sc_registry_add_by_string Add data to the registry by string key. */ if(registry == NULL) return(false); return(shashlist_insert_by_string(registry->hashlist, data, class, key) != NULL); } void *sc_registry_del_by_int(sc_registry *registry, int key) { /* sc_registry_del_by_int Delete data from the registry by integer key. */ shashlist_item *item; void *data = NULL; if(registry == NULL) return(NULL); item = shashlist_remove_by_int(registry->hashlist, key); if(item != NULL) { data = item->data; shashlist_item_free(&item); } return(data); } void *sc_registry_del_by_string(sc_registry *registry, const char *key) { /* sc_registry_del_by_string Delete data from the registry by string key. */ shashlist_item *item; void *data = NULL; if(registry == NULL) return(NULL); item = shashlist_remove_by_string(registry->hashlist, key); if(item != NULL) { data = item->data; shashlist_item_free(&item); } return(data); } void *sc_registry_find_by_int(const sc_registry *registry, int key) { /* sc_registry_find_by_int Locate a specific registry item by integer key. */ shashlist_item *item; if(registry == NULL) return(NULL); item = shashlist_find_by_int(registry->hashlist, key); if(item == NULL) return(NULL); else return(item->data); } void *sc_registry_find_by_string(const sc_registry *registry, const char *key) { /* sc_registry_find_by_string Locate a specific registry item by string key. */ shashlist_item *item; if(registry == NULL) return(NULL); item = shashlist_find_by_string(registry->hashlist, key); if(item == NULL) return(NULL); else return(item->data); } inline shashlist_item *_sc_registry_internal_iter(shashlist *list, shashlist_item *item, int class, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* _sc_registry_internal_iter Local function to find the next or prev entry in a set. */ switch(direction) { case SC_REGISTRY_FORWARD: do { item = shashlist_find_next(list, item, class); } while(item != NULL && function != NULL && !function(item->data, arg)); break; case SC_REGISTRY_REVERSE: do { item = shashlist_find_prev(list, item, class); } while(item != NULL && function != NULL && !function(item->data, arg)); break; } return(item); } void *sc_registry_find_first(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* sc_registry_find_first Find the first item of a given class. */ shashlist_item *item = NULL; if(registry == NULL) return(NULL); /* Search for the first item meeting all the criteria. */ item = _sc_registry_internal_iter(registry->hashlist, item, class, direction, function, arg); if(item == NULL) return(NULL); else return(item->data); } void *sc_registry_find_next(const sc_registry *registry, int class, int key, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* sc_registry_find_next Find the next item of a given class, given an item. */ shashlist_item *item; if(registry == NULL) return(NULL); item = shashlist_find_by_int(registry->hashlist, key); /* Search for the next item meeting all the criteria. */ item = _sc_registry_internal_iter(registry->hashlist, item, class, direction, function, arg); if(item == NULL) return(NULL); else return(item->data); } sc_registry_iter *sc_registry_iter_new(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg) { /* sc_registry_iter_new Allocate an sc_registry_iter struct for fast registry set iteration. */ sc_registry_iter *iter; if(registry == NULL) return(NULL); iter = (sc_registry_iter *)malloc(sizeof(sc_registry_iter)); if(iter == NULL) return(NULL); /* Prep for the iteration. */ iter->arg = arg; iter->class = class; iter->current = NULL; iter->direction = direction; iter->function = function; iter->registry = registry; iter->running = true; return(iter); } void sc_registry_iter_free(sc_registry_iter **iter) { /* sc_registry_iter_free Free a registry iteration struct. */ if(iter == NULL || *iter == NULL) return; (*iter)->running = false; free(*iter); *iter = NULL; } void *sc_registry_iterate(sc_registry_iter *iter) { /* sc_registry_iterate Find and return the next item in the set, if any. */ if(iter == NULL) return(NULL); /* Make sure we're still iterating happily along. */ if(!iter->running) return(NULL); /* Perform the search for the next iteration. */ iter->current = _sc_registry_internal_iter(iter->registry->hashlist, iter->current, iter->class, iter->direction, iter->function, iter->arg); if(iter->current == NULL) { /* We've reached the end of the set. */ iter->running = false; return(NULL); } else { return(iter->current->data); } } xscorch-0.2.1/sgame/sregistry.h0000644000175000001440000000757211615366345013425 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sregistry.h,v 1.6 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sregistry.h Copyright(c) 2003-2004 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Scorched runtime fast data registry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sregistry_h_included #define __sregistry_h_included /* Includes */ #include /* Forward structure decl's */ struct _shashlist_item; struct _shashlist; /* This is a hash size. Of course there are practical limits here. :) */ #define SC_REGISTRY_SIZE 0x1000 /* Footprint of registry iteration test functions. */ typedef bool(*sc_registry_test_func)(void *, long); #define SC_REGISTRY_TEST_NULL (sc_registry_test_func)NULL /* Direction of iteration through the registry. */ typedef enum _sc_registry_direction { SC_REGISTRY_FORWARD = 0, SC_REGISTRY_REVERSE } sc_registry_direction; /* The registry itself. We'll probably only have one instance, heh. */ typedef struct _sc_registry { struct _shashlist *hashlist; int nextclass; int nextkey; } sc_registry; /* * This struct is used to iterate through registry sets. * A set is defined by selecting some items from the registry. * The basic level of selection is the class of the data item, * which is specified when it is entered into the registry. * However, the iterator functions also take a function in * their args. The function, and one long int argument, will * be called on the data being tested for set membership. * If the function returns true, the data will be admitted. */ typedef struct _sc_registry_iter { long arg; int class; struct _shashlist_item *current; sc_registry_direction direction; sc_registry_test_func function; const sc_registry *registry; bool running; } sc_registry_iter; /* Create and destroy the registry. */ sc_registry *sc_registry_new(void); void sc_registry_free(sc_registry **registry); /* Identification values the registry coordinates. */ int sc_registry_get_new_class_id(sc_registry *registry); int sc_registry_get_next_new_key(sc_registry *registry); /* Add and remove registered items. */ bool sc_registry_add_by_int(sc_registry *registry, void *data, int class, int key); bool sc_registry_add_by_string(sc_registry *registry, void *data, int class, const char *key); void *sc_registry_del_by_int(sc_registry *registry, int key); void *sc_registry_del_by_string(sc_registry *registry, const char *key); /* Searching in the registry... */ void *sc_registry_find_by_int(const sc_registry *registry, int key); void *sc_registry_find_by_string(const sc_registry *registry, const char *key); void *sc_registry_find_first(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg); void *sc_registry_find_next(const sc_registry *registry, int class, int key, sc_registry_direction direction, sc_registry_test_func function, long arg); /* Fast iteration through the registry. */ sc_registry_iter *sc_registry_iter_new(const sc_registry *registry, int class, sc_registry_direction direction, sc_registry_test_func function, long arg); void sc_registry_iter_free(sc_registry_iter **iter); void *sc_registry_iterate(sc_registry_iter *iter); #endif /* __sregistry_h_included */ xscorch-0.2.1/sgame/sshield.c0000644000175000001440000002774111615366345013020 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sshield.c,v 1.41 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sshield.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2000-2003 Jacob Luna Lundberg Copyright(c) 2003 Jason House justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched shields This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include sc_shield *sc_shield_new(sc_accessory_info *acc) { /* sc_shield_new Create a new shield. */ sc_shield *sh; if(!SC_ACCESSORY_IS_SHIELD(acc)) return(NULL); sh = (sc_shield *)malloc(sizeof(sc_shield)); if(sh == NULL) return(NULL); sh->info = acc; sh->life = acc->shield; return(sh); } void sc_shield_free(sc_shield **sh) { /* sc_shield_free Free an old (dead) shield. */ if(sh == NULL || *sh == NULL) return; free(*sh); *sh = NULL; } sc_accessory_info *sc_shield_find_best(const sc_config *c, const sc_player *p) { /* sc_shield_find_best Find the best shield in a player's inventory. This is very accurate, but also very sensitive to shield definition changes. */ int count; /* Iterator variable */ sc_accessory_info *info, *best = NULL; /* Sanity check */ if(c == NULL || p == NULL) return(false); /* Search for the best shield in inventory */ count = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_REVERSE); for(; count > 0; --count) { if(SC_ACCESSORY_IS_SHIELD(info) && info->inventories[p->index] > 0) { if(best == NULL) { best = info; } else { if(info->shield > best->shield) { best = info; } else if(info->shield == best->shield) { if(SC_ACCESSORY_SHIELD_IS_FORCE(info)) { best = info; } else if(SC_ACCESSORY_SHIELD_IS_STANDARD(info) && SC_ACCESSORY_SHIELD_IS_MAGNETIC(best)) { best = info; } else if(SC_ACCESSORY_SHIELD_IS_MAGNETIC(info) && SC_ACCESSORY_SHIELD_IS_MAGNETIC(best)) { if(info->repulsion > best->repulsion) { best = info; } /* shield has more repulsion? */ } /* shield better by type? */ } /* shield obviously better, or just maybe better? */ } /* found a shield already? */ } /* shield we own? */ info = sc_accessory_next(c->accessories, info, SC_ACCESSORY_LIMIT_ALL | SC_ACCESSORY_SCAN_REVERSE); } /* done */ return(best); } void sc_shield_init_turn(struct _sc_player *p) { /* sc_shield_init_turn Prepare a player's shield for the next turn. */ /* How can you expect us to recharge a nonexistant shield? */ if(p == NULL || p->shield == NULL) return; /* If the player has a shield recharger (like a Solar Panel), recharge! */ if(p->ac_state & SC_ACCESSORY_STATE_RECHARGE) { p->shield->life += SC_SHIELD_RECHARGE_RATE; if(p->shield->life > p->shield->info->shield) { p->shield->life = p->shield->info->shield; } } } bool sc_shield_would_impact(const sc_config *c, const sc_player *owner, const sc_player *p, int traj_flags, double x, double y, double nextx, double nexty) { /* sc_shield_would_impact When a shield will, to the best of our knowledge, take a hit in the next trajectory step. We look to see that we will be passing from the outside of a player's shield to the inside. */ double dx, dy, nextdx, nextdy, rad2, nextrad2; /* Sanity checks */ if(c == NULL || p == NULL) return(false); /* Make sure we have a shield here */ if(p->shield == NULL) return(false); /* Make sure the shield is absorptive, unless we must impact it anyway */ if(!(traj_flags & SC_TRAJ_HIT_SHIELDS) && SC_ACCESSORY_SHIELD_IS_MAGNETIC(p->shield->info)) return(false); /* A player's own shield is disallowed from stopping their missiles. I guess you've gotta let them past in order to fire them after all... */ if(owner != NULL && p->index == owner->index) return(false); /* Compute the distance to the missile's present and future. */ if(!sc_land_calculate_deltas_d(c->land, &dx, &dy, (double)p->x, (double)p->y, x, y) || !sc_land_calculate_deltas_d(c->land, &nextdx, &nextdy, (double)p->x, (double)p->y, nextx, nexty)) return(false); /* Square radii, whee... */ rad2 = SQR(dx) + SQR(dy); nextrad2 = SQR(nextdx) + SQR(nextdy); /* We must start outside the tank's shield range, and end up inside it to impact it. */ return((rad2 >= (double)SQR(p->tank->radius + 1)) && (nextrad2 < (double)SQR(p->tank->radius + 1))); } bool sc_shield_absorb_hit(sc_player *p, bool sapper) { /* sc_shield_absorb_hit When a shield takes a direct hit. */ /* Don't accept no substitutes! */ if(p->shield == NULL) { return(false); } /* Shield sappers take more life out of a shield. */ if(sapper) { p->shield->life -= SC_SHIELD_ABSORB_HIT * SC_SHIELD_SAPPER_RATE; } else { p->shield->life -= SC_SHIELD_ABSORB_HIT; } /* If the shield was completely obliterated, get rid of it. */ if(p->shield->life <= 0) { sc_shield_free(&p->shield); } return(true); } int sc_shield_absorb_explosion(sc_player *p, const sc_explosion *e, int damage) { /* sc_shield_absorb_explosion Try to absorb damage into a player's shield. The damage undealt is returned, or zero if all damage absorbed. */ /* Must have a shield for it to take damage */ if(p->shield == NULL) return(damage); /* Find out how much of the damage it took */ p->shield->life -= damage; if(p->shield->life <= 0) { damage = -p->shield->life; sc_shield_free(&p->shield); if(e->type == SC_EXPLOSION_NAPALM) { damage = 0; } } else { damage = 0; } /* Return damage to the actual tank */ return(damage); } bool sc_shield_get_deflection(sc_config *c, const sc_player *owner, int traj_flags, double x, double y, double *vx, double *vy) { /* sc_shield_get_deflection Find the total deflection in velocity of a missile by magnetic shields. */ double dx, dy, sdist, force; bool changed = false; sc_player *p; int index; /* Look at each player. */ for(index = 0; index < c->numplayers; ++index) { p = c->players[index]; /* There are THREE continue statements below. */ /* A player's mag shield is tuned so as not to affect his own weapons. */ if(p == NULL || p->index == owner->index) continue; /* NOTE this is a flow control point! */ /* Determine whether this player has a magnetic shield. */ if(p->shield == NULL || !SC_ACCESSORY_SHIELD_IS_MAGNETIC(p->shield->info)) continue; /* NOTE this is a flow control point! */ /* Try and get a proper distance estimate. */ if(!sc_land_calculate_deltas_d(c->land, &dx, &dy, (double)p->x, (double)p->y, x, y)) continue; /* This is a rare (perhaps nonexistant) failure case. */ /* Determine whether the tank is close enough, but not too close. */ sdist = SQR(dx) + SQR(dy); if(sdist < SQR(SC_SHIELD_MAG_MAX_DIST) && sdist > SQR(p->tank->radius)) { /* The weapon and tank are in range, so push the weapon. */ changed = true; /* Find the force to be imparted to the missile, and scale it. We avoid using the evil sqrt() function by performing most of the calculations here working with squares. This is where the LORC reside. :) To be specific: o The repulsion strength is p->shield->info->repulsion. o The repulsion strength must be attenuated by distance. To do this, we use the square of the distance, which is stored in sdist, and the attenuation rate constant, from sshield.h, SC_SHIELD_MAG_ATTENUATION. o Finally we scale the result to units of tank power with sshield.h's SC_SHIELD_MAG_TO_POWER constant, and from there to velocity units with SC_PHYSICS_VELOCITY_SCL, from sphysics.h. The result will be multiplied by the x or y distance, and then divided by the total distance, in order to get velocity differentials which can then be added into the current weapon velocities, *vx and *vy. */ force = p->shield->info->repulsion; force *= (double)SQR(SC_SHIELD_MAG_ATTENUATION) / sdist; force *= (double)(SC_SHIELD_MAG_TO_POWER * SC_PHYSICS_VELOCITY_SCL); /* Set the new partial velocities, accelerated by the magnetic shield. */ *vx += force * dx / sqrt(sdist); *vy += force * dy / sqrt(sdist); /* Sap energy off the player's shield, based on the acceleration given. */ if(!(traj_flags & SC_TRAJ_NO_MODIFY)) { p->shield->life -= rint(force / (double)(SC_PHYSICS_VELOCITY_SCL * SC_SHIELD_MAG_TO_COST)); if(p->shield->life <= 0) { sc_shield_free(&p->shield); } } } } return(changed); } bool sc_shield_get_reflection(sc_config *c, sc_player *p, int traj_flags, double *x, double *y, double *velx, double *vely) { /* sc_shield_get_reflection Find the new reflection in velocity of a missile off a force shield. */ double dx, dy, radial; /* This is only for force shields. */ if(p->shield == NULL || !SC_ACCESSORY_SHIELD_IS_FORCE(p->shield->info)) return(false); /* If calculate_deltas fails somehow, so do we. */ if(!sc_land_calculate_deltas_d(c->land, &dx, &dy, (double)p->x, (double)p->y, (*x), (*y))) return(false); /* To perform a reflection, we must reverse the radial velocity component. First we calculate the radial component of the two vectors (the velocity of the impacting missile and the radial vector from the center of the tank to the impact at the shield). Second, we subtract out twice the radial velocity, to reflect the missile off the shield surface at that point. The calculations skirt around the need for a sqrt() calculation by factoring a division by L = sqrt(SQR(dx) + SQR(dy)) outside of the radial, where it cancels in the final subtraction. */ /* Find the radial velocity component through a dot product. */ radial = (dx * (*velx) + dy * (*vely)) / (SQR(dx) + SQR(dy)); /* Subtract 2x the perpendicular component to reverse it. */ *velx -= 2 * radial * dx; *vely -= 2 * radial * dy; /* Move the weapon just (0.1 pixels) outside the shield (p->tank->radius + 1). It's difficult to get gcc to do this with the required precision. :( */ *x = (double)p->x + dx * SQR((double)1.1 + (double)p->tank->radius) / (SQR(dx) + SQR(dy)); *y = (double)p->y + dy * SQR((double)1.1 + (double)p->tank->radius) / (SQR(dx) + SQR(dy)); /* Sap the shield. */ if(!(traj_flags & SC_TRAJ_NO_MODIFY)) sc_shield_absorb_hit(p, (traj_flags & SC_TRAJ_HIT_SHIELDS)); return(true); } xscorch-0.2.1/sgame/sshield.h0000644000175000001440000000653711175116140013010 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sshield.h,v 1.22 2009-04-26 17:39:44 jacob Exp $ */ /* xscorch - sshield.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched shields This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sshield_h_included #define __sshield_h_included /* Includes */ #include /* Forward declarations */ struct _sc_accessory_info; struct _sc_explosion; struct _sc_player; struct _sc_config; /* Constants */ #define SC_SHIELD_ABSORB_HIT 700 /* Damage to shield when it absorbs a missile */ #define SC_SHIELD_SAPPER_RATE 2.0 /* Sappers take this * ABSORB_HIT out of shields */ #define SC_SHIELD_RECHARGE_RATE 500 /* Each turn shield->life += this, if recharger */ /* LORC (Lots. Of. Rescale. Constants.) for magnetic ``physics'' */ #define SC_SHIELD_MAG_MAX_DIST 100 /* Distance in pixels a magnetic shield can reach */ #define SC_SHIELD_MAG_ATTENUATION 7.00 /* Number of pixels per unit attenuation */ #define SC_SHIELD_MAG_TO_POWER 1.50 /* Change magnetic scale to power (tunable) */ #define SC_SHIELD_MAG_TO_COST 0.75 /* Scale magnetic utilization to shield depletion */ /* Macros */ #define SC_SHIELD_IS_WEAK(s) ((s)->info->shield < 5000) #define SC_SHIELD_IS_MEDIUM(s) ((s)->info->shield >= 5000 && (s)->info->shield < 10000) #define SC_SHIELD_IS_STRONG(s) ((s)->info->shield >= 10000) /* Current shield status */ typedef struct _sc_shield { struct _sc_accessory_info *info; /* Shield information */ int life; /* Shield remaining life */ } sc_shield; /* Shield creation and release */ sc_shield *sc_shield_new(struct _sc_accessory_info *acc); void sc_shield_free(sc_shield **sh); struct _sc_accessory_info *sc_shield_find_best(const struct _sc_config *c, const struct _sc_player *p); /* Shield updates */ void sc_shield_init_turn(struct _sc_player *p); bool sc_shield_would_impact(const struct _sc_config *c, const struct _sc_player *owner, const struct _sc_player *p, int traj_flags, double x, double y, double nextx, double nexty); int sc_shield_absorb_explosion(struct _sc_player *p, const struct _sc_explosion *e, int damage); bool sc_shield_absorb_hit(struct _sc_player *p, bool sapper); /* Shields that influence reality */ bool sc_shield_get_deflection(struct _sc_config *c, const struct _sc_player *owner, int traj_flags, double x, double y, double *vx, double *vy); bool sc_shield_get_reflection(struct _sc_config *c, struct _sc_player *p, int traj_flags, double *x, double *y, double *velx, double *vely); #endif /* __sshield_h_included */ xscorch-0.2.1/sgame/sspill.c0000644000175000001440000001606511615366345012670 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sspill.c,v 1.11 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - sspill.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched spillage functions (napalm, liquid dirt) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include static void _sc_spill_fill(const sc_config *c, const sc_land *l, sc_spill *sp, int curx, int cury, bool allowup); static bool _sc_spill_try_fill(const sc_config *c, const sc_land *l, sc_spill *sp, int x, int y, bool allowup) { /* sc_spill_try_fill Attempt to fill in a region of a spill. If allowup is set, then if no alternative is available (we are in a valley) we are allowed to spill in an upward direction. Otherwise, spill to the left or right whenever possible. True is returned if we were successful in spilling somewhere. */ int i; /* Make sure this is a valid index and land location. */ if(sp->index >= sp->size) { return(false); } if(!sc_land_translate_xy(l, &x, &y)) { return(false); } /* Check that this location is unoccupied. */ if(SC_LAND_IS_SKY(*SC_LAND_XY(l, x, y))) { for(i = 0; i < sp->index; ++i) { if(x == sp->spillx[i] && y == sp->spilly[i]) { return(false); } } /* Scan that the current position unoccupied */ /* We can spill here! */ sp->spillx[sp->index] = x; sp->spilly[sp->index] = y; ++sp->index; /* Continue spilling... */ _sc_spill_fill(c, l, sp, x, y, allowup); return(true); } /* We are on ground, cannot spill. */ return(false); } static void _sc_spill_fill(const sc_config *c, const sc_land *l, sc_spill *sp, int curx, int cury, bool allowup) { /* sc_spill_fill Attempt to fill in a region of a spill. This tries all directions from the current location in order to continue a spill; this assumes the current location has already been spilled (or is dirt). */ /* Randomly try to spill right/left first. */ int randdir = game_lrand(2) * 2 - 1; /* Attempt spill below first; then try to right/left downward */ _sc_spill_try_fill(c, l, sp, curx, cury - 1, false); _sc_spill_try_fill(c, l, sp, curx + randdir, cury - 1, false); _sc_spill_try_fill(c, l, sp, curx - randdir, cury - 1, false); /* Again attempt a spill, horizontally to right/left. */ _sc_spill_try_fill(c, l, sp, curx + randdir, cury, false); _sc_spill_try_fill(c, l, sp, curx - randdir, cury, false); /* If we can go up and are forced to, then spill upward. Note: we can only spill upward from the center column, so this is the only case where allowup is set. */ if(allowup) { _sc_spill_try_fill(c, l, sp, curx, cury + 1, true); _sc_spill_try_fill(c, l, sp, curx + randdir, cury + 1, true); _sc_spill_try_fill(c, l, sp, curx - randdir, cury + 1, true); /* TEMP JDS: If napalm is no longer impacting deep in the earth then okay. But something occurs to me: it is POSSIBLE that a napalm weapon that tunnels will be buried by landfall before it gets a chance to spill. */ /* TEMP JTL: It seems okay to me. And I'm not sure the land- slide thing is a real issue for us. People who don't want to risk it should have used contact triggers... */ } } static void _sc_spill_fill_initial(const sc_config *c, const sc_land *l, sc_spill *sp, int curx, int cury) { /* sc_spill_fill_initial Construct an entire spill. */ /* Start a spill at the current location; allow upward spills. */ _sc_spill_fill(c, l, sp, curx, cury - 1, true); } sc_spill *sc_spill_new(const sc_config *c, const sc_land *l, int size, int centerx, int centery) { /* sc_spill_new Create a new spill structure. This initialises the array that will describe the coordinates of the spill, in an order that is appropriate for animating the flow of the spill. Specify the explosion coordinates (usually at the topmost layer of the ground) where the spill starts, and the number of pixels that should be flooded by the spill. */ sc_spill *sp; int *lp; int i; /* Sanity checks */ assert(c != NULL); assert(l != NULL); assert(size >= 0); /* Allocate spill data structures */ sp = (sc_spill *)malloc(sizeof(sc_spill)); if(sp == NULL) { return(NULL); } sp->spillx = (int *)malloc(sizeof(int) * size); if(sp->spillx == NULL) { free(sp); return(NULL); } sp->spilly = (int *)malloc(sizeof(int) * size); if(sp->spilly == NULL) { free(sp->spillx); free(sp); return(NULL); } /* Make sure the centerx, centery coordinate is valid */ if(!sc_land_translate_xy(l, ¢erx, ¢ery)) { /* Offscreen and unable to compensate; the spill is NULL */ sp->size = 0; sp->index = 0; sp->count = 0; for(i = 0; i < size; ++i) { sp->spillx[i] = -1; sp->spilly[i] = -1; } return(sp); } /* Initialise the spill structure */ sp->size = size; sp->index = 0; sp->count = 0; for(i = 0; i < size; ++i) { sp->spillx[i] = centerx; sp->spilly[i] = centery; } /* Clear land data for the impact crater... */ lp = SC_LAND_XY(l, centerx, centery); *lp = sc_land_sky_flag(c) | sc_color_gradient_index(c->graphics.gfxdither, sc_land_sky_index(c), centery); sc_window_paint(c->window, centerx, centery, 1, 1, SC_REGENERATE_LAND | SC_PAINT_EVERYTHING); /* Compute the spill; note, we may not be able to spill all the requested number of pixels, therefore size must be updated after this computation to reflect the actual number of pixels flooded (not the requested number). */ _sc_spill_fill_initial(c, l, sp, centerx, centery); sp->size = sp->index; sp->index = 0; /* Return the spill structure */ return(sp); } void sc_spill_free(sc_spill **sp) { /* sc_spill_free */ if(sp == NULL || *sp == NULL) { return; } free((*sp)->spillx); free((*sp)->spilly); free(*sp); *sp = NULL; } xscorch-0.2.1/sgame/sspill.h0000644000175000001440000000326411175116140012655 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sspill.h,v 1.5 2009-04-26 17:39:44 jacob Exp $ */ /* xscorch - sspill.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched spillage functions (napalm, liquid dirt) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sspill_h_included #define __sspill_h_included /* Includes */ #include /* Forward type definitions */ struct _sc_config; struct _sc_land; /* Type definitions */ typedef struct _sc_spill { int size; /* Size of spillage (number of coordinates) */ int *spillx; /* Array of X coordinates describing spill */ int *spilly; /* Array of Y coordinates describing spill */ int index; /* Spill index variable */ int count; /* Final draw count */ } sc_spill; /* Spill data management */ sc_spill *sc_spill_new(const struct _sc_config *c, const struct _sc_land *l, int size, int centerx, int centery); void sc_spill_free(sc_spill **sp); #endif /* __sspill_h_included */ xscorch-0.2.1/sgame/sstate.c0000644000175000001440000007220711175116140012650 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sstate.c,v 1.24 2009-04-26 17:39:44 jacob Exp $ */ /* xscorch - sstate.c Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched game state machine This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include /* Game state header */ #include /* Config is dereferenced frequently */ #include /* Need to do interest update */ #include /* Game state header */ #include /* Need to drop the land after deton */ #include /* Need to do Wind updates */ #include /* Dereferenced in death check, etc. */ #include /* For Auto Defense and The Lottery */ #include /* Need for tracking, return codes */ #include /* We construct weapon chains here */ #include /* We do much drawing from state machine */ #include /* We are responsible for running AI */ #include /* This is a comment about snet.h */ #include /* Sound hooks are present, here */ #include /* Need a random number generator */ static void _sc_state_prelude_begin(sc_config *c, sc_game *g) { /* Start sound, if applicable */ g->musicid = SC_MUSIC_PRELUDE; sc_sound_start(c->sound, g->musicid); /* Setup screen/status */ sc_status_message(c->window, "Welcome to XScorch " VERSION "!"); /* Activate the main menu and wait */ sc_window_main_menu(c->window); sc_game_set_state(g, SC_STATE_PRELUDE_IDLE, SC_DELAY_PROMPT); } static void _sc_state_game_end(sc_config *c, sc_game *g) { /* Start end-game sound */ g->musicid = SC_MUSIC_ENDGAME; sc_sound_start(c->sound, g->musicid); /* Display end-game scores */ sc_window_paint_end_game(c->window); sc_game_set_state(g, SC_STATE_GAME_END_IDLE, SC_DELAY_PROMPT); } static void _sc_state_inventory_begin(sc_config *c, sc_game *g) { /* Enable inventory music */ g->musicid = SC_MUSIC_INVENTORY; sc_sound_start(c->sound, g->musicid); /* Starting with player 0... */ g->curplayer = 0; #if USE_NETWORK if(c->client != NULL) sc_status_message(c->window, "Waiting for other players to begin round ..."); sc_net_client_sync(c->client, SC_CONN_SYNC_INV, c->server != NULL); #endif /* Network? */ sc_game_set_state_now(c, g, SC_STATE_INVENTORY_PL_BEGIN); } static void _sc_state_inventory_pl_begin(sc_config *c, sc_game *g) { sc_player *p = c->players[g->curplayer]; if(sc_ai_player_buy(c, p) == SC_AI_CONTINUE) { sc_status_message(c->window, ""); sc_game_set_state_now(c, g, SC_STATE_INVENTORY_PL_DONE); } else { sc_status_player_message(c->window, p, "Inventory"); sc_window_inventory(c->window, p); sc_game_set_state(g, SC_STATE_INVENTORY_PL_IDLE, SC_DELAY_PROMPT); } } static void _sc_state_inventory_pl_done(sc_config *c, sc_game *g) { #if USE_NETWORK sc_net_client_send_inventory(c, c->client, g->curplayer); #endif /* Networking? */ ++g->curplayer; if(g->curplayer >= c->numplayers) { g->curplayer = 0; sc_game_set_state_now(c, g, SC_STATE_ROUND_BEGIN); } else { sc_game_set_state_now(c, g, SC_STATE_INVENTORY_PL_BEGIN); } } static void _sc_state_round_begin(sc_config *c, sc_game *g) { g->musicid = SC_MUSIC_ROUND; sc_sound_start(c->sound, g->musicid); sc_config_init_round(c); sc_window_paint(c->window, 0, 0, c->fieldwidth - 1, c->fieldheight - 1, SC_REGENERATE_LAND | SC_PAINT_EVERYTHING); #if USE_NETWORK if(c->client != NULL) sc_status_message(c->window, "Waiting for other players to close their inventory ..."); sc_net_client_sync(c->client, SC_CONN_SYNC_ROUND, c->server != NULL); #endif /* Network? */ sc_game_set_state_asap(g, SC_STATE_AUTO_DEFENSE_LOOP); } static void _sc_state_auto_defense(sc_config *c, sc_game *g) { /* _sc_state_auto_defense Select the auto defense state, and run it. The window code will advance the state for us when it's done. */ if(g->curplayer >= c->numplayers) { /* Send the state machine on to display the next state. */ g->curplayer = 0; sc_game_set_state_now(c, g, SC_STATE_LOTTERY_DISPLAY); } else if(c->players[g->curplayer]->aitype != SC_AI_NETWORK) { /* Run an auto defense session (maybe display) for the player. */ if(sc_preround_auto_defense(c, c->players[g->curplayer])) { ++g->curplayer; sc_game_set_state(g, SC_STATE_AUTO_DEFENSE, SC_DELAY_PROMPT); } else { ++g->curplayer; sc_game_set_state_now(c, g, SC_STATE_AUTO_DEFENSE_LOOP); } } else { /* Try the next player. */ ++g->curplayer; sc_game_set_state_now(c, g, SC_STATE_AUTO_DEFENSE_LOOP); } } static void _sc_state_lottery_display(sc_config *c, sc_game *g) { /* _sc_state_lottery_display Set the state for displaying The Lottery result. */ if(c->lottery != NULL && c->lottery->winner != NULL) { /* Display lottery winnings, and then wait for the user. */ if(sc_preround_lottery(c)) { sc_game_set_state(g, SC_STATE_LOTTERY_DISPLAY_WAIT, SC_DELAY_PROMPT); } else { sc_game_set_state_now(c, g, SC_STATE_TURN_BEGIN); } } else { /* Nothing to see here; advance! */ sc_game_set_state_now(c, g, SC_STATE_TURN_BEGIN); } } static void _sc_state_round_end(sc_config *c, sc_game *g) { sc_game_set_victor(c); sc_economy_interest(c, c->economics); if(c->curround + 1 >= c->numrounds) { sc_game_set_state_now(c, g, SC_STATE_GAME_END); } else { g->musicid = SC_MUSIC_ENDROUND; sc_sound_start(c->sound, g->musicid); sc_window_paint_end_round(c->window); sc_game_set_state(g, SC_STATE_ROUND_END_IDLE, SC_DELAY_PROMPT); } } static void _sc_state_turn_begin(sc_config *c, sc_game *g) { sc_game_sync_timeout(g); sc_config_init_turn(c); sc_status_message(c->window, ""); if(sc_game_victor(c)) { sc_game_set_state_now(c, g, SC_STATE_ROUND_END); } else { g->curplayer = 0; sc_game_set_state_now(c, g, SC_STATE_TURN_PL_BEGIN); } } static void _sc_state_turn_pl_begin(sc_config *c, sc_game *g) { sc_player *p = c->plorder[g->curplayer]; if(p->dead || sc_ai_player_turn(c, p) == SC_AI_CONTINUE) { sc_status_message(c->window, ""); sc_game_set_state(g, SC_STATE_TURN_PL_DONE, SC_DELAY_SHORT); } else { sc_status_update(c->window, p); sc_game_set_state(g, SC_STATE_TURN_PL_IDLE, SC_DELAY_PROMPT); } } static void _sc_state_turn_pl_done(sc_config *c, sc_game *g) { sc_player *p = c->plorder[g->curplayer]; /* Arm the player's weapon */ if(!p->dead) { p->armed = true; sc_window_redraw_tank(c->window, p); } sc_status_message(c->window, ""); switch(c->options.mode) { case SC_CONFIG_MODE_SEQUENTIAL: #if USE_NETWORK sc_net_client_send_player_state(c, c->client); if(c->client != NULL) sc_status_message(c->window, "Waiting for other players to turn ..."); sc_net_client_sync(c->client, SC_CONN_SYNC_TURN, c->server != NULL); #endif /* Network? */ sc_game_set_state_asap(g, SC_STATE_RUN_TALK); break; case SC_CONFIG_MODE_SYNCHRONOUS: sc_game_set_state_now(c, g, SC_STATE_TURN_PL_NEXT); break; } } static void _sc_state_turn_pl_next(sc_config *c, sc_game *g) { ++g->curplayer; if(g->curplayer >= c->numplayers) switch(c->options.mode) { case SC_CONFIG_MODE_SEQUENTIAL: sc_game_set_state_now(c, g, SC_STATE_TURN_END); break; case SC_CONFIG_MODE_SYNCHRONOUS: g->curplayer = 0; #if USE_NETWORK sc_net_client_send_player_state(c, c->client); if(c->client != NULL) sc_status_message(c->window, "Waiting for other players to turn ..."); sc_net_client_sync(c->client, SC_CONN_SYNC_TURN, c->server != NULL); #endif /* Network? */ sc_game_set_state_asap(g, SC_STATE_RUN_TALK); break; } else { sc_game_set_state_now(c, g, SC_STATE_TURN_PL_BEGIN); } } static void _sc_state_run_talk(sc_config *c, sc_game *g) { const char *msg; sc_player *p = c->plorder[g->curplayer]; int nextstate = 0; sc_status_message(c->window, ""); switch(c->options.mode) { case SC_CONFIG_MODE_SEQUENTIAL: nextstate = SC_STATE_RUN_CREATION; break; case SC_CONFIG_MODE_SYNCHRONOUS: if(g->curplayer + 1 >= c->numplayers) { nextstate = SC_STATE_RUN_CREATION; } else { nextstate = SC_STATE_RUN_TALK; } break; } if(nextstate == SC_STATE_RUN_TALK) ++g->curplayer; if(!p->dead && p->armed) { msg = sc_player_talk(c, p); if(!SC_CONFIG_GFX_FAST(c) && msg != NULL) { sc_status_player_message(c->window, p, msg); sc_game_set_state(g, nextstate, SC_DELAY_TALK); return; } } sc_game_set_state_now(c, g, nextstate); } static void _sc_state_run_creation(sc_config *c, sc_game *g) { g->activity = false; sc_status_message(c->window, ""); sc_game_sync_timeout(g); /* If sc_weapon_create_all returns true, we have explosions to run. */ if(sc_weapon_create_all(c, &(g->expl_init))) { sc_game_set_state_now(c, g, SC_STATE_RUN_EXPLOSION); } else { sc_game_set_state_now(c, g, SC_STATE_RUN_WEAPONS); } } static void _sc_state_run_weapons(sc_config *c, sc_game *g) { switch(sc_weapon_track_all(c, &g->expl_init)) { case SC_WEAPON_TRACK_NO_ACTION: /* Weapons have all terminated */ if(c->options.interleave && g->activity) { g->activity = false; sc_game_set_state_now(c, g, SC_STATE_RUN_EXPLOSION); } else { sc_game_set_state_now(c, g, SC_STATE_RUN_END); } break; case SC_WEAPON_TRACK_NEED_RECURSE: /* Weapons are still flying, but no detonations yet */ if(SC_STATE_ANY_EXPL(g)) { sc_game_set_state_now(c, g, SC_STATE_RUN_EXPLOSION); } else { sc_game_reinstate(g, SC_STATE_FAST(c, SC_STATE_MACHINE_INTERVAL)); } break; case SC_WEAPON_TRACK_DETONATE: /* Weapons may still be flying; a detonation occurred */ /* Move all explosions in init to the draw queue */ sc_game_set_state_now(c, g, SC_STATE_RUN_EXPLOSION); break; default: /* Oops */; } } static bool _sc_state_run_draw_expl(sc_config *c, sc_game *g, sc_explosion *e) { if(!sc_expl_annihilate(c, e)) { /* This explosion terminated quickly; proceed */ sc_game_expl_queue_item_move_prepend(&g->expl_clear_init, &g->expl_init, e); sc_game_expl_queue_postpone(e, SC_STATE_FAST(c, SC_STATE_EXPLOSION_STEPS)); } else { /* This explosion is still executing */ sc_game_expl_queue_item_move(&g->expl_draw, &g->expl_init, e); sc_game_expl_queue_postpone(e, SC_STATE_FAST(c, SC_STATE_NEXTITER_STEPS)); } return(true); } static bool _sc_state_run_draw_expl_cont(sc_config *c, sc_game *g, sc_explosion *e) { if(!sc_expl_annihilate_continue(c, e)) { /* This explosion has finally terminated */ sc_game_expl_queue_item_move_prepend(&g->expl_clear_init, &g->expl_draw, e); sc_game_expl_queue_postpone(e, SC_STATE_FAST(c, SC_STATE_EXPLOSION_STEPS)); } else { /* This explosion is still executing */ sc_game_expl_queue_postpone(e, SC_STATE_FAST(c, SC_STATE_NEXTITER_STEPS)); } return(true); } static bool _sc_state_run_clear_expl(sc_config *c, sc_game *g, sc_explosion *e) { /* Warning: damage routine must be called _before_ annihilate clear is called, as damage_all might need information that is deallocated on annihilate_clear(). */ sc_player_damage_all(c, e); if(!sc_expl_annihilate_clear(c, e)) { /* This explosion was cleared quickly */ sc_game_expl_queue_item_move(&g->expl_done, &g->expl_clear_init, e); } else { /* This explosion needs more time to clear */ sc_game_expl_queue_item_move(&g->expl_clear, &g->expl_clear_init, e); } sc_game_expl_queue_postpone(e, SC_STATE_FAST(c, SC_STATE_NEXTITER_STEPS)); return(true); } static bool _sc_state_run_clear_expl_cont(sc_config *c, sc_game *g, sc_explosion *e) { if(!sc_expl_annihilate_clear_continue(c, e)) { /* This explosion has finally cleared */ sc_game_expl_queue_item_move(&g->expl_done, &g->expl_clear, e); } sc_game_expl_queue_postpone(e, SC_STATE_FAST(c, SC_STATE_NEXTITER_STEPS)); return(true); } static bool _sc_state_run_land_fall(sc_config *c, sc_game *g, sc_explosion *e) { if(sc_land_drop(c, c->land, e->centerx, e->radius)) { sc_game_expl_queue_postpone(e, SC_STATE_FAST(c, SC_STATE_NEXTITER_STEPS)); return(true); } else { sc_game_expl_queue_item_free(&g->expl_done, e); return(false); } } static bool _sc_state_run_explosion_simult(sc_config *c, sc_game *g) { bool result; /* Process ``init'' queue */ result = sc_game_expl_queue_do_runnable(c, g, g->expl_init, _sc_state_run_draw_expl); /* Process ``draw'' queue */ result = sc_game_expl_queue_do_runnable(c, g, g->expl_draw, _sc_state_run_draw_expl_cont) | result; /* Process ``clear_init'' queue */ result = sc_game_expl_queue_do_runnable(c, g, g->expl_clear_init, _sc_state_run_clear_expl) | result; /* Process ``clear'' queue */ result = sc_game_expl_queue_do_runnable(c, g, g->expl_clear, _sc_state_run_clear_expl_cont) | result; /* Process ``done'' queue */ result = sc_game_expl_queue_do_runnable(c, g, g->expl_done, _sc_state_run_land_fall) | result; /* Were any actions taken? */ return(result); } static bool _sc_state_run_explosion_nosimult(sc_config *c, sc_game *g) { /* Check ``done'' queue */ if(g->expl_done != NULL) return(sc_game_expl_queue_run_first(c, g, g->expl_done, _sc_state_run_land_fall)); /* Check ``clear'' queue */ if(g->expl_clear != NULL) return(sc_game_expl_queue_run_first(c, g, g->expl_clear, _sc_state_run_clear_expl_cont)); /* Check ``clear_init'' queue */ if(g->expl_clear_init != NULL) return(sc_game_expl_queue_run_first(c, g, g->expl_clear_init, _sc_state_run_clear_expl)); /* Check ``draw'' queue */ if(g->expl_draw != NULL) return(sc_game_expl_queue_run_first(c, g, g->expl_draw, _sc_state_run_draw_expl_cont)); /* Check ``init'' queue */ if(g->expl_init != NULL) return(sc_game_expl_queue_run_first(c, g, g->expl_init, _sc_state_run_draw_expl)); /* No actions taken */ return(false); } static void _sc_state_run_explosion(sc_config *c, sc_game *g) { bool result; #if SC_STATE_DEBUG printf("\nrun_explosion: entering function\n"); #endif /* SC_STATE_DEBUG */ do { #if SC_STATE_DEBUG printf("run_explosion: queues init %d draw %d clear_init %d clear %d done %d\n", sc_expl_count(g->expl_init), sc_expl_count(g->expl_draw), sc_expl_count(g->expl_clear_init), sc_expl_count(g->expl_clear), sc_expl_count(g->expl_done)); #endif /* SC_STATE_DEBUG */ if(c->options.interleave) { #if SC_STATE_DEBUG printf("run_explosion: doing simultaneous\n"); #endif /* SC_STATE_DEBUG */ result = _sc_state_run_explosion_simult(c, g); } else { #if SC_STATE_DEBUG printf("run_explosion: doing non-simultaneous\n"); #endif /* SC_STATE_DEBUG */ result = _sc_state_run_explosion_nosimult(c, g); } } while(result); #if SC_STATE_DEBUG printf("run_explosion: done\n"); #endif /* SC_STATE_DEBUG */ /* Update the counters */ sc_game_expl_queue_update(g->expl_init); sc_game_expl_queue_update(g->expl_draw); sc_game_expl_queue_update(g->expl_clear_init); sc_game_expl_queue_update(g->expl_clear); sc_game_expl_queue_update(g->expl_done); /* Which state do we go to next? */ sc_game_sync_timeout(g); g->activity = g->activity || SC_STATE_ANY_EXPL(g); if(c->options.interleave) { sc_game_set_state_now(c, g, SC_STATE_RUN_PLAYER_DROP); } else { if(SC_STATE_ANY_EXPL(g)) { /* Still processing explosions... */ sc_game_set_state_allow_now(c, g, SC_STATE_RUN_EXPLOSION, SC_STATE_FAST(c, SC_STATE_MACHINE_INTERVAL)); } else { /* No more explosions to process, we may continue. */ sc_game_set_state_now(c, g, SC_STATE_RUN_PLAYER_DROP); } /* Any explosions left? */ } /* Interleaving? */ } static void _sc_state_run_player_drop(sc_config *c, sc_game *g) { if(sc_player_drop_all(c)) { g->activity = true; if(c->options.interleave) { sc_game_set_state(g, SC_STATE_RUN_WEAPONS, SC_STATE_FAST(c, SC_STATE_MACHINE_INTERVAL)); } else { sc_game_reinstate_allow_now(c, g, SC_STATE_FAST(c, SC_STATE_MACHINE_INTERVAL)); } } else { g->substate = 0; sc_game_set_state_now(c, g, SC_STATE_RUN_PLAYER_DEATH); } } static void _sc_state_run_player_death(sc_config *c, sc_game *g) { sc_player *p; const char *msg; sc_status_message(c->window, ""); if(g->substate >= c->numplayers) { sc_game_set_state(g, SC_STATE_RUN_WEAPONS, SC_STATE_FAST(c, SC_STATE_MACHINE_INTERVAL)); } else { p = c->players[g->substate]; if(!p->dead && p->life <= 0) { /* This player just died */ g->activity = true; msg = sc_player_death_talk(c, p); if(msg != NULL) { sc_status_player_message(c->window, p, msg); } else { sc_status_player_message(c->window, p, ""); } /* Should player give farewell message? */ sc_player_death(c, p, &g->expl_init); sc_player_died(c, p); sc_window_undraw_tank(c->window, p); if(c->options.interleave) { ++g->substate; sc_game_reinstate_now(c, g); } else { sc_game_set_state_now(c, g, SC_STATE_RUN_EXPLOSION); ++g->substate; } } else { ++g->substate; sc_game_reinstate_now(c, g); } } } static void _sc_state_run_end(sc_config *c, sc_game *g) { switch(c->options.mode) { case SC_CONFIG_MODE_SEQUENTIAL: sc_game_set_state_now(c, g, SC_STATE_TURN_PL_NEXT); break; case SC_CONFIG_MODE_SYNCHRONOUS: sc_game_set_state_now(c, g, SC_STATE_TURN_END); break; } } void sc_state_run(sc_config *c, sc_game *g) { struct timeval curtime; /* Check network activity */ #if USE_NETWORK sc_net_client_run(c, c->client); sc_net_server_run(c, c->server); if(sc_net_client_death(&c->client)) { sc_window_message(c->window, "Client Disconnected", "Client was disconnected from the network"); sc_window_update(c->window); } if(c->client != NULL && !SC_CONN_IS_OKAY(c->client->server)) { /* We deferred this cycle */ return; } #endif /* Network activity? */ sc_game_time(&curtime); if(curtime.tv_sec > g->timeout.tv_sec || (curtime.tv_sec == g->timeout.tv_sec && curtime.tv_usec >= g->timeout.tv_usec)) { #if SC_STATE_TIMER_DEBUG printf("... state %8x accepted %ld.%06ld\n", g->state, curtime.tv_sec, curtime.tv_usec); #endif /* SC_STATE_TIMER_DEBUG */ #if SC_STATE_DEBUG printf("State %8x ", g->state); SC_PROFILE_BEGIN("game_run") #endif /* SC_STATE_DEBUG */ switch(g->state) { /*** PRELUDE ***/ /* PRELUDE_BEGIN -> PRELUDE_IDLE Initialise for a new game; display main menu. */ case SC_STATE_PRELUDE_BEGIN: case SC_STATE_GAME_END_DONE: _sc_state_prelude_begin(c, g); break; /*** GAME ***/ /* GAME_BEGIN -> INVENTORY_BEGIN (immediate) When user first presses Enter on the main menu. Initialize configuration: Initialize config, player game data, and just about everything else relevant for game state. */ case SC_STATE_GAME_BEGIN: /* Initialize configuration for a new GAME */ sc_config_init_game(c); sc_status_message(c->window, "Starting a new game ..."); #if USE_NETWORK if(c->client != NULL) sc_status_message(c->window, "Waiting for other players to begin game ..."); sc_net_client_sync(c->client, SC_CONN_SYNC_GAME, c->server != NULL); #endif /* Network? */ sc_game_set_state_asap(g, SC_STATE_INVENTORY_BEGIN); break; /* GAME_END -> GAME_END_IDLE All rounds have been played, display the final winners. Pause for user input. */ case SC_STATE_GAME_END: _sc_state_game_end(c, g); break; /*** INVENTORY ***/ /* INVENTORY_BEGIN -> INVENTORY_PL_BEGIN (immediate) Begin inventory; prepare to take inventory for one player. */ case SC_STATE_INVENTORY_BEGIN: case SC_STATE_ROUND_END_DONE: _sc_state_inventory_begin(c, g); break; /* INVENTORY_PL_BEGIN Human: -> INVENTORY_PL_IDLE AI: -> INVENTORY_PL_DONE If this state is entered, then curplayer must be a valid player. Purchases for the player indicated. Loops back to self until all players have bought items. If this is an AI, purchases are made now. */ case SC_STATE_INVENTORY_PL_BEGIN: _sc_state_inventory_pl_begin(c, g); break; /* INVENTORY_PL_DONE -> INVENTORY_PL_BEGIN (loop) t> AUTO_DEFENSE_LOOP (terminating condition) */ case SC_STATE_INVENTORY_PL_DONE: _sc_state_inventory_pl_done(c, g); break; /*** PRE-ROUND ***/ /* AUTO DEFENSE LOOP */ case SC_STATE_AUTO_DEFENSE_LOOP: _sc_state_auto_defense(c, g); break; /* LOTTERY_DISPLAY */ case SC_STATE_LOTTERY_DISPLAY: _sc_state_lottery_display(c, g); break; /*** ROUND ***/ /* ROUND_BEGIN -> TURN_BEGIN (immediate) Begin a new round: Inventory has been taken; generate the land, place tanks as appropriate, and prepare for Scorch. */ case SC_STATE_ROUND_BEGIN: _sc_state_round_begin(c, g); break; /* ROUND_END -> ROUND_END_IDLE (end of round, will loop) t> GAME_END (end of all rounds) Round has ended; advance round, and go to inventory or final winnings (latter occurs only if all rounds have been played). In former, we identify the victor, do economics and final winning calculations, and then notify the user who won. */ case SC_STATE_ROUND_END: _sc_state_round_end(c, g); break; /*** TURNS ***/ /* TURN_BEGIN -> TURN_PL_BEGIN (normal progression) t> ROUND_END (no one/1 person alive) Player turn begin: Setup for each player to take a turn. Make sure to check if the game has already ended `tho (is there a victor?) Make sure times are in sync, and init the turn. */ case SC_STATE_TURN_BEGIN: case SC_STATE_TURN_END: _sc_state_turn_begin(c, g); break; /* TURN_PL_BEGIN Dead: -> TURN_PL_DONE (cannot play) Human: -> TURN_PL_IDLE (take orders) AI: -> TURN_PL_DONE (AI actions taken) If we get here, we must have a valid curplayer value (it may be a dead player, however). If dead, then this cycle is basically skipped; otherwise, humans are given the opportunity to enter orders, and AI actions are taken now. */ case SC_STATE_TURN_PL_BEGIN: _sc_state_turn_pl_begin(c, g); break; /* TURN_PL_DONE ==Sequential Mode== -> RUN_TALK This player has given orders; execute those orders if the player is living. If the player is dead, RUN_TALK will fall through and proceed to the next player. The player's weapon is armed here. ==Synchronous Mode== -> TURN_PL_NEXT This player has given orders; take orders from the next player. If no more players, the next state will fall to RUN_TALK loop. The player's weapon is armed here. */ case SC_STATE_TURN_PL_DONE: _sc_state_turn_pl_done(c, g); break; /* TURN_PL_NEXT ==Sequential Mode== -> TURN_PL_BEGIN (immediate) t> TURN_END (terminal, immediate) ==Synchronous Mode== -> TURN_PL_BEGIN (immediate) t> RUN_TALK (terminal, immediate) */ case SC_STATE_TURN_PL_NEXT: _sc_state_turn_pl_next(c, g); break; /*** RUN ***/ /* RUN_TALK ==Sequential Mode== -> RUN_CREATION (might be 2s delay) This state DOES NOT LOOP. If this player is not dead and armed, then we might allow them to speak (2s delay) or might launch their weapon now (immediate). ==Synchronous Mode== -> RUN_TALK (might delay, loops) t> RUN_CREATION (out of players) This state loops through all players. If the player is not dead and is armed, they may speak at this time (2s delay) or might not (loop is immediate). Once complete, this will yield to the weapon creation state. */ case SC_STATE_RUN_TALK: _sc_state_run_talk(c, g); break; /* RUN_CREATION -> RUN_WEAPONS (immediate; no explosions yet) -> RUN_EXPLOSION (immediate; explosions waiting) Create all player weapons. If the weapon creation created an explosion immediately, then process the explosion before sending any weapons into flight. */ case SC_STATE_RUN_CREATION: _sc_state_run_creation(c, g); break; /* RUN_WEAPONS (TEMP OBS DOC) -> RUN_WEAPONS (weapons still flying) -> RUN_EXPLOSION (might be flying; detonation) t> RUN_END (terminal case; no weapons) Simulate the weapons in-flight. */ case SC_STATE_RUN_WEAPONS: _sc_state_run_weapons(c, g); break; /* RUN_EXPLOSION (TEMP OBS DOC) -> RUN_EXPLOSION (this explosion chain not done; wait) t> RUN_PLAYER_DROP (immediate) Run an explosion in progress. The weapon explosion might opt to end at this point, or it may decide to continue its trend of annihilation for a few more cycles. This loop terminates when there are no explosions remaining to be drawn; then we will start clearing explosions after a respectable pause. */ case SC_STATE_RUN_EXPLOSION: _sc_state_run_explosion(c, g); break; /* RUN_PLAYER_DROP (TEMP OBS DOC) -> RUN_PLAYER_DROP (loop) t> RUN_PLAYER_DEATH (terminal) */ case SC_STATE_RUN_PLAYER_DROP: _sc_state_run_player_drop(c, g); break; /* RUN_PLAYER_DEATH (TEMP OBS DOC) -> RUN_PLAYER_DEATH t> RUN_END Check if any players just died. */ case SC_STATE_RUN_PLAYER_DEATH: _sc_state_run_player_death(c, g); break; /* RUN_END ==Sequential Mode== -> TURN_PL_NEXT (immediate) ==Synchronous Mode== -> TURN_END (immediate) */ case SC_STATE_RUN_END: _sc_state_run_end(c, g); break; /* End of (known) game states */ default: sc_game_reinstate(g, SC_DELAY_LONG); break; } #if SC_STATE_DEBUG SC_PROFILE_END #endif /* SC_STATE_DEBUG */ } } xscorch-0.2.1/sgame/sstate.h0000644000175000001440000001222511175116140012647 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sstate.h,v 1.13 2009-04-26 17:39:44 jacob Exp $ */ /* xscorch - sstate.h Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched game state machine header This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sstate_h_included #define __sstate_h_included #include /* Forward structures */ struct _sc_config; struct _sc_game; /* Warning: when set to true, following flag spews a LOT of data */ #define SC_STATE_DEBUG 0 #define SC_STATE_TIMER_DEBUG 0 /* Game state flags */ #define SC_STATE_PROMPT_FLAG 0x010000 #define SC_STATE_INVENTORY_FLAG 0x020000 #define SC_STATE_OPTIONS_FLAG 0x040000 #define SC_STATE_PAUSE_FLAG 0x080000 #define SC_STATE_ROUND_FLAG 0x100000 #define SC_STATE_DONE_FLAG 0x800000 /* Game introduction states */ #define SC_STATE_PRELUDE_BEGIN (0x00 | SC_STATE_OPTIONS_FLAG) #define SC_STATE_PRELUDE_IDLE (0x01 | SC_STATE_OPTIONS_FLAG) /* Game initialisation */ #define SC_STATE_GAME_BEGIN (0x10) #define SC_STATE_GAME_END (0x1e) #define SC_STATE_GAME_END_IDLE (0x1f | SC_STATE_PAUSE_FLAG) #define SC_STATE_GAME_END_DONE (SC_STATE_GAME_END_IDLE & ~SC_STATE_PAUSE_FLAG) /* Buy weapons! */ #define SC_STATE_INVENTORY_BEGIN (0x20) #define SC_STATE_INVENTORY_PL_BEGIN (0x21 | SC_STATE_INVENTORY_FLAG) #define SC_STATE_INVENTORY_PL_IDLE (0x22 | SC_STATE_INVENTORY_FLAG) #define SC_STATE_INVENTORY_PL_DONE (SC_STATE_INVENTORY_PL_IDLE | SC_STATE_DONE_FLAG) /* Interactive part of round */ #define SC_STATE_ROUND_BEGIN (0x40) #define SC_STATE_AUTO_DEFENSE (0x41) #define SC_STATE_AUTO_DEFENSE_LOOP (SC_STATE_AUTO_DEFENSE | SC_STATE_DONE_FLAG) #define SC_STATE_LOTTERY_DISPLAY (0x42) #define SC_STATE_LOTTERY_DISPLAY_WAIT (SC_STATE_LOTTERY_DISPLAY | SC_STATE_DONE_FLAG) #define SC_STATE_ROUND_END (0x4e) #define SC_STATE_ROUND_END_IDLE (0x4f | SC_STATE_PAUSE_FLAG) #define SC_STATE_ROUND_END_DONE (SC_STATE_ROUND_END_IDLE & ~SC_STATE_PAUSE_FLAG) /* Player turns */ #define SC_STATE_TURN_BEGIN (0x51 | SC_STATE_ROUND_FLAG) #define SC_STATE_TURN_PL_BEGIN (0x52 | SC_STATE_ROUND_FLAG | SC_STATE_PROMPT_FLAG) #define SC_STATE_TURN_PL_IDLE (0x53 | SC_STATE_ROUND_FLAG | SC_STATE_PROMPT_FLAG) #define SC_STATE_TURN_PL_DONE (SC_STATE_TURN_PL_IDLE | SC_STATE_DONE_FLAG) #define SC_STATE_TURN_PL_NEXT (0x54 | SC_STATE_ROUND_FLAG) #define SC_STATE_TURN_END (0x5f | SC_STATE_ROUND_FLAG) /* Weapon simulation part of round */ #define SC_STATE_RUN_TALK (0x80 | SC_STATE_ROUND_FLAG) #define SC_STATE_RUN_CREATION (0x81 | SC_STATE_ROUND_FLAG) #define SC_STATE_RUN_WEAPONS (0x82 | SC_STATE_ROUND_FLAG) #define SC_STATE_RUN_EXPLOSION (0x83 | SC_STATE_ROUND_FLAG) #define SC_STATE_RUN_PLAYER_DROP (0x93 | SC_STATE_ROUND_FLAG) #define SC_STATE_RUN_PLAYER_DEATH (0x95 | SC_STATE_ROUND_FLAG) #define SC_STATE_RUN_END (0xff | SC_STATE_ROUND_FLAG) /* Game state information */ #define SC_STATE_IS_PROMPT(g) ((g)->state & SC_STATE_PROMPT_FLAG) #define SC_STATE_IS_DONE(g) ((g)->state & SC_STATE_DONE_FLAG) #define SC_STATE_IS_ENABLED(g) (SC_STATE_IS_PROMPT(g) && !SC_STATE_IS_DONE(g)) #define SC_STATE_IS_OPTIONS(g) ((g)->state & SC_STATE_OPTIONS_FLAG) #define SC_STATE_IS_INVENTORY(g) ((g)->state & SC_STATE_INVENTORY_FLAG) #define SC_STATE_IS_PAUSE(g) ((g)->state & SC_STATE_PAUSE_FLAG) #define SC_STATE_IS_ROUND(g) ((g)->state & SC_STATE_ROUND_FLAG) /* Game delay times (in millisec) */ #define SC_DELAY_SHORT 50 #define SC_DELAY_LONG 800 #define SC_DELAY_PROMPT SC_DELAY_SHORT #define SC_DELAY_TALK 1200 #define SC_STATE_MACHINE_INTERVAL 50 #define SC_STATE_EXPLOSION_STEPS 10 #define SC_STATE_NEXTITER_STEPS 1 #define SC_STATE_FAST(c, t) (SC_CONFIG_GFX_FAST(c) ? 0 : (t)) #define SC_STATE_ANY_EXPL(g) ((g)->expl_init != NULL || \ (g)->expl_draw != NULL || \ (g)->expl_clear_init != NULL || \ (g)->expl_clear != NULL || \ (g)->expl_done != NULL) void sc_state_run(struct _sc_config *c, struct _sc_game *g); #endif /* __sstate_h_included? */ xscorch-0.2.1/sgame/stankpro.c0000644000175000001440000002766511175116141013217 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/stankpro.c,v 1.21 2009-04-26 17:39:45 jacob Exp $ */ /* xscorch - stankpro.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Tank profiles This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include static const reg_class_data _reg_tank_profile_class[] = { { "radius", REG_INTEGER, NULL }, { "turretRadius", REG_INTEGER, NULL }, { "shelfSize", REG_INTEGER, NULL }, { "efficiency", REG_INTEGER, NULL }, { "hardness", REG_INTEGER, NULL }, { "mobile", REG_BOOLEAN, NULL }, { 0, 0, 0 } }; static bool _sc_tank_profile_verify(sc_tank_profile *profile) { /* sc_tank_profile_verify This function is responsible for making certain that the tank profile is valid. In particular, this function checks that the tank is base-aligned (the bottom row is not blank), and that the tank has a minimum area. The latter requirement keeps people from registering tanks that are one pixel in size, which is just far too evil. Note, this function is tolerant of custom tank sizes. True is returned if the tank is valid (or has been adjusted to a valid configuration), and false is returned on an error. Caution, no sanity checks on profile pointer. */ const unsigned char *ps; /* Used in profile reads and copy */ unsigned char *pd; /* Used in profile copy - destination */ int lastrow; /* Last row that wasn't completely clear */ int height; /* Total height of the profile */ int width; /* Total width of the profile */ int area; /* Total area of the profile (pixels) */ int row; /* Iterator: current row */ int col; /* Iterator: current column */ /* Calculate the width, height of the profile; initialise area */ width = 1 + profile->radius * 2; height = 1 + profile->radius; area = 0; /* Scan to determine the last nonclear row, and also calculate area */ for(ps = profile->data, lastrow = 0, row = 0; row < height; ++row) { for(col = 0; col < width; ++col, ++ps) { if(*ps != SC_TANK_PROFILE_CLEAR) { /* Found a solid pixel */ lastrow = row; ++area; } /* Found solid? */ } /* Scanning columns */ } /* Scanning rows */ /* If last solid row was not base, then we will need to move the profile downward so it is. This is basically a memory copy. */ if(lastrow < height - 1) { /* We need to move (height - 1 - lastrow) rows down. */ ps = profile->data + (lastrow + 1) * width; /* Source */ pd = profile->data + height * width; /* Destination */ for(row = lastrow; row >= 0; --row) { for(col = width; col >= 0; --col) { /* Move this row down */ --ps; --pd; *pd = *ps; } /* Moving column */ } /* Moving rows down */ /* This loop clears the top area, which is garbage now. */ for(pd = profile->data, row = height - 1 - lastrow; row >= 0; --row) { for(col = width; col >= 0; ++pd, --col) { *pd = SC_TANK_PROFILE_CLEAR; } /* Clear columns */ } /* Clear rows */ } /* Had to move down profile? */ /* Make sure tank isn't a single pixel. */ if(area < SC_TANK_PROFILE_MIN_AREA) { /* Too small! */ fprintf(stderr, "Area of tank \"%s\" is too small, calculated %d < required %d\n", profile->name, area, SC_TANK_PROFILE_MIN_AREA); return(false); } /* Sanity check */ /* Okay, the tank checks out! */ return(true); } static bool _sc_tank_profile_new(sc_tank_profile **plist, reg *r, reg_var *rv) { /* sc_tank_profile_new This function, if successful, allocates and reads a new tank profile, and adds it to the END of the linked list specified. True is returned on success; if an error occurred while parsing the tank profile, false is returned. The tank profile data is read from the rowXX assignments in the tank_profile_class object, given in rv. Caution, input pointers are not checked for sanity. */ sc_tank_profile *profile; /* Newly allocated profile */ char linename[0x1000]; /* Variable name for a scanline */ char linedata[0x1000]; /* Assigned value for a scanline */ unsigned char *p; /* Writable pointer into profile data */ int height; /* Height of the profile */ int width; /* Width of the profile */ int row; /* Iterator: current row */ int col; /* Iterator: current column */ int lsz; /* Length of a scanline, in chars */ /* Allocate a new profile */ profile = (sc_tank_profile *)malloc(sizeof(sc_tank_profile)); if(profile == NULL) return(false); /* Initialise profile data members */ profile->next = NULL; profile->radius = 0; profile->turretradius= 0; profile->shelfsize = 5; profile->efficiency = 100; profile->hardness = 100; profile->mobile = false; strcopyb(profile->name, reg_get_var_name(rv), sizeof(profile->name)); /* Determine the radius of the profile. Note, if the radius wasn't given, then radius will remain zero, and the trap below will catch it. So we don't need to check return value here, yay. */ reg_get_integer(r, rv, "radius", &profile->radius); reg_get_integer(r, rv, "turretRadius",&profile->turretradius); reg_get_integer(r, rv, "shelfSize", &profile->shelfsize); reg_get_integer(r, rv, "efficiency", &profile->efficiency); reg_get_integer(r, rv, "hardness", &profile->hardness); reg_get_boolean(r, rv, "mobile", &profile->mobile); /* Update name of profile if immobile */ if(!profile->mobile) { strconcatb(profile->name, " (I)", sizeof(profile->name)); } /* Calculate and check width, height of the profile. */ width = 1 + profile->radius * 2; height = 1 + profile->radius; if(width <= 0 || height <= 0) { fprintf(stderr, "Tank \"%s\" has requires a positive radius, I saw %d\n", profile->name, profile->radius); free(profile); return(false); } /* Sanity check */ if(profile->turretradius <= profile->radius) { fprintf(stderr, "Tank \"%s\" has an absurdly small (<= radius) turretRadius, I saw %d\n", profile->name, profile->turretradius); free(profile); return(false); } /* Sanity check */ /* Allocate the profile data */ profile->data = (unsigned char *)malloc(sizeof(char) * width * height); if(profile->data == NULL) { free(profile); return(false); } /* Read in the profile data from the regvar given. */ for(p = profile->data, row = 0; row < height; ++row) { /* Compute the name of the current scanline */ sbprintf(linename, sizeof(linename), "row%02d", row); /* Attempt to read the scanline. If this call fails, then we assume the scanline is entirely blank. Otherwise, compute the length. */ if(reg_get_string(r, rv, linename, linedata, sizeof(linedata))) { lsz = strblenn(linedata, sizeof(linedata)); } else { lsz = 0; } /* Read data from the scanline. If we run out of characters, we will assume the remaining characters encoded for `blank' or clear. */ for(col = 0; col < width; ++col, ++p) { /* Check if we ran off the scanline */ if(col < lsz) { /* read character from scanline */ if(linedata[col] == ' ' || linedata[col] == '.') { *p = SC_TANK_PROFILE_CLEAR; } else { *p = SC_TANK_PROFILE_SOLID; } /* Data read from scanline */ } else { /* Assume clear */ *p = SC_TANK_PROFILE_CLEAR; } /* Scanline check */ } /* Reading the scanline */ } /* Reading each row... */ /* Verify that the tank profile is valid. */ if(!_sc_tank_profile_verify(profile)) { free(profile->data); free(profile); return(false); } /* Add this profile to the end of the linked list. */ while(*plist != NULL) plist = &((*plist)->next); *plist = profile; return(true); } bool sc_tank_profile_add(sc_tank_profile **plist, const char *datafile) { /* sc_tank_profile_add Adds a new set of tank profiles to the linked list given, by reading data from the datafile given. On success, this function returns true (even if the datafile contained no new tank profiles). */ reg_var *rv; /* Regvar for each block */ reg *r; /* Registry structure */ /* Sanity checks */ if(plist == NULL || datafile == NULL) return(false); /* Compute filename and initialise registry */ r = reg_new(datafile); if(r == NULL) { fprintf(stderr, "%s: core dump imminent. Critical alloc error, aborting.\n", datafile); return(false); } reg_class_add(r, "tank_profile_class"); reg_class_register_vars(r, "tank_profile_class", _reg_tank_profile_class); /* Attempt to load the registry file containing tank profiles. */ if(!reg_load(r)) { fprintf(stderr, "%s: core dump imminent. Cannot locate datafile \"%s\", aborting.\n", datafile, datafile); return(false); } /* Get the first variable in the file. */ rv = reg_get_block_head(reg_get_top(r)); while(rv != NULL) { /* Process this variable. */ if(strequal(reg_get_var_class(rv), "tank_profile_class")) { if(!_sc_tank_profile_new(plist, r, rv)) { fprintf(stderr, "%s: core dump imminent. tank profile %s failed, aborting.\n", datafile, reg_get_var_name(rv)); return(false); } /* Failed to create profile? */ } else { fprintf(stderr, "%s: warning: \"%s\" isn't a valid class in this context, for variable \"%s\".\n", datafile, reg_get_var_class(rv), reg_get_var_name(rv)); } /* Is regvar a valid tank profile? */ rv = reg_get_next_var(rv); } /* Release the registry and exit. */ reg_free(&r); return(true); } void sc_tank_profile_free(sc_tank_profile **profile) { /* sc_tank_profile_free Release a chain of tank profiles. */ sc_tank_profile *cur; if(profile == NULL) return; while(*profile != NULL) { cur = *profile; *profile = cur->next; free(cur->data); free(cur); } } const sc_tank_profile *sc_tank_profile_lookup(const sc_tank_profile *plist, int index) { /* sc_tank_profile_lookup Return the index'th element in list plist, or NULL on error. */ if(index < 0) return(NULL); while(index > 0 && plist != NULL) { plist = plist->next; --index; } return(plist); } int sc_tank_profile_index_of(const sc_tank_profile *plist, const sc_tank_profile *profile) { /* sc_tank_profile_index_of Returns the index of profile in the list, -1 if it doesn't appear. */ int index; index = 0; while(plist != NULL && plist != profile) { ++index; plist = plist->next; } if(plist == NULL) return(-1); return(index); } int sc_tank_profile_size(const sc_tank_profile *plist) { /* sc_tank_profile_size Return the number of elements in this profile list. */ int count; count = 0; while(plist != NULL) { ++count; plist = plist->next; } return(count); } xscorch-0.2.1/sgame/stankpro.h0000644000175000001440000000363411175116141013212 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/stankpro.h,v 1.8 2009-04-26 17:39:45 jacob Exp $ */ /* xscorch - stankpro.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Tank profiles This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __stank_profile_included_h #define __stank_profile_included_h /* Includes */ #include #define SC_TANK_PROFILE_NAME_SIZE 32 #define SC_TANK_PROFILE_SOLID 0xff #define SC_TANK_PROFILE_CLEAR 0x00 #define SC_TANK_PROFILE_MIN_AREA 48 #define SC_TANK_NORMAL_HARDNESS 100 #define SC_TANK_NORMAL_EFFICIENCY 100 typedef struct _sc_tank_profile { char name[SC_TANK_PROFILE_NAME_SIZE]; int radius; int turretradius; int shelfsize; int efficiency; int hardness; bool mobile; unsigned char *data; struct _sc_tank_profile *next; } sc_tank_profile; bool sc_tank_profile_add(sc_tank_profile **plist, const char *datafile); void sc_tank_profile_free(sc_tank_profile **profile); const sc_tank_profile *sc_tank_profile_lookup(const sc_tank_profile *plist, int index); int sc_tank_profile_index_of(const sc_tank_profile *plist, const sc_tank_profile *profile); int sc_tank_profile_size(const sc_tank_profile *plist); #endif /* __stank_profile_included_h */ xscorch-0.2.1/sgame/strack.c0000644000175000001440000003516411615366345012652 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/strack.c,v 1.28 2011-08-01 00:01:41 jacob Exp $ */ /* xscorch - strack.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Scorched basic weapon tracking This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*** Weapon tracking ***/ static void _sc_traj_landfall(sc_trajectory *tr, int x) { /* sc_traj_landfall This function is called with an x coordinate indicating that at least one land tile in column x was cleared. A window is maintained indicating the minimum and maximum X coordinates where landfall might occur, to optimize performance during landfall. A hint in tr is updated to indicate that landfall may occur in column x. */ /* Update the landfall for this trajectory */ if(tr->landfall_x1 > x) tr->landfall_x1 = x; if(tr->landfall_x2 < x) tr->landfall_x2 = x; } static sc_trajectory_result _sc_weapon_track_point(sc_config *c, sc_trajectory *tr, void *data) { /* sc_weapon_track_point This function takes a current trajectory tr, and a weapon (passed in using the extra data argument). This function is called when a weapon passes through a particular coordinate; this function clears any land that may have occupied the coordinate, applies "smoke" to the land mask if necessary, and updates hints indicating landfall should occur and that the screen needs to be redrawn. This function takes the trajectory's current x, y coordinates and rounds them to the nearest integer values to determine what coordinate the weapon currently occupies. It will update the land mask and hints in tr, but it will not adjust the weapon. This function has no effect if the weapon is out-of-bounds. This will always return SC_TRAJ_CONTINUE, indicating tracking should proceed. */ const int *gradient; /* Sky gradient */ int gradientflag; /* Sky gradient flag */ bool dither; /* Sky: dithering allowed? */ bool repaint = false; /* Is a repaint needed? */ sc_weapon *wp = (sc_weapon *)data; /* Weapon data */ int *trace; /* Trace location on land */ int x; /* Weapon's current X */ int y; /* Weapon's current Y */ /* Get the current land pointer at (x, y) */ x = rint(tr->curx); y = rint(tr->cury); if(!sc_land_translate_xy(c->land, &x, &y)) return(SC_TRAJ_CONTINUE); trace = SC_LAND_XY(c->land, x, y); /* Check if the weapon just clobbered some land... */ if(SC_LAND_IS_GROUND(*trace)) { /* Get the sky gradient */ gradient = sc_land_sky_index(c); gradientflag = sc_land_sky_flag(c); dither = c->graphics.gfxdither; *trace = gradientflag | sc_color_gradient_index(dither, gradient, y); _sc_traj_landfall(tr, x); repaint = true; } /* Obliterated some land? */ /* Check if the weapon is leaving a smoke trail */ if((c->weapons->tracepaths || SC_WEAPON_IS_SMOKING(wp)) && !SC_CONFIG_GFX_FAST(c)) { *trace = SC_LAND_SMOKE | wp->playerid; repaint = true; } if(repaint) { sc_window_paint(c->window, x, y, x, y, SC_REGENERATE_LAND | SC_PAINT_EVERYTHING); } /* Nothing interesting ever happens... */ return(SC_TRAJ_CONTINUE); } static sc_weapon_track_result _sc_weapon_track(sc_config *c, sc_weapon **wp, sc_explosion **e) { /* sc_weapon_track Track a single weapon component. This function undraws the weapon at its current position ((*wp)->tr->cur{x,y}). Then, it tracks the weapon to its new location, or to the point of impact if the weapon hit any- thing. Impacts are dealt with, deleting the current weapon if needed, and adding an explosion to e. wp is a list; we are only tracking the weapon at the HEAD of the list but we may append extra warheads to the tail if needed (phoenix code will do this). Similarly, e is a list; we may append new explosions to it at the tail of the list. A fair amount of phoenix processing is done here to determine if the weapon hit its apex and should break apart (for MIRVs, etc). */ sc_trajectory_result stepres; /* Indicates result of sc_traj_step */ sc_trajectory *traj; /* Shortcut to (*wp)->traj. */ bool goingup; /* True if weapon initially ascending */ int flags; /* Flags for if we are tunnelling, etc */ assert(c != NULL && wp != NULL && e != NULL); assert(*wp != NULL); /* We don't want to process this weapon now if it's deferring. Instead, we'll mark it to be processed next time and let the tracking state know it needs to keep processing the weapon. */ if(SC_WEAPON_IS_DEFERRING(*wp)) { (*wp)->state &= ~SC_WEAPON_STATE_DEFER; return(SC_WEAPON_TRACK_NEED_RECURSE); } /* At this point, traj->cur{x,y} indicate the original control point; the point that the weapon was at upon entering this function. */ traj = (*wp)->tr; sc_window_undraw_weapon(c->window, *wp); goingup = sc_traj_get_velocity_y(traj) >= 0; if(traj->timestep == 0) goingup = true; /* Are we tunnelling? This is important, as we must set the trajectory flags now! */ flags = SC_WEAPON_TRAJ_FLAGS(c, *wp); /* WEAPON collision check; since the weapon is likely to be skipping more than one pixel away per iteration, we need to make sure it wouldn't have collided with something along the way. We need to check all points between the previous and current position. We do this with a line approximation, which is well, good enough... */ stepres = sc_traj_step(c, traj, flags, _sc_weapon_track_point, *wp); /* At this point, the values traj->cur{x,y} either indicate the new control point, or the point of impact if the weapon hit something. */ /* Deal damage to shields if appropriate */ if(stepres == SC_TRAJ_IMPACT_SHIELD && !SC_WEAPON_IS_LIQUID(*wp)) { sc_shield_absorb_hit(c->players[traj->victim], SC_WEAPON_IS_SAPPER(*wp) ? 1 : 0); stepres = SC_TRAJ_SIZZLE; } /* This code checks if we just detonated. If we did, it checks whether the weapon is a LAND phoenix. If so, it calls sc_phoenix() which checks which phoenix subroutine to run on the weapon. */ if(SC_TRAJ_IS_IMPACT(stepres) && SC_PHOENIX_IS_AT_LAND((*wp)->weaponinfo)) { switch(sc_phoenix(SC_PHOENIX_AT_LAND, c, wp, e)) { /* Weapon hit something, exploded, and also created children */ case SC_PHOENIX_DETONATE: sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_DETONATE); /* Weapon hit something and created children but we call it a sizzle because we don't detonate the original weapon. Note that this is never done in the original Scorched Earth. */ case SC_PHOENIX_SIZZLE: sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_SIZZLE); /* We need to skip tracking the weapon this turn */ case SC_PHOENIX_RESET: /* Draw the weapon at its new position */ sc_window_draw_weapon(c->window, *wp); /* Defer to next tracking round */ return(SC_WEAPON_TRACK_NEED_RECURSE); /* There was an error (oom, for example) in sc_phoenix() */ case SC_PHOENIX_FAILURE: /* The default case should not arise (we hope) */ default: /* do nothing */; } } /* Decide what to do based on the return value of the path traversal */ if(SC_TRAJ_IS_IMPACT(stepres)) { /* Weapon hit something, and detonated */ if(*e == NULL) { sc_expl_add(e, sc_weapon_get_explosion(c, *wp, traj->curx, traj->cury, SC_EXPL_DEFAULT_DIR)); sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_DETONATE); } else { /* Draw the weapon at its new position. Probably not needed... */ sc_window_draw_weapon(c->window, *wp); /* We deferred */ return(SC_WEAPON_TRACK_NEED_RECURSE); } } else if(stepres == SC_TRAJ_SIZZLE) { /* Weapon sizzled */ sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_SIZZLE); } /* Any special orders? */ /* This code checks if we're at the apex of the weapon's flight curve. If we are and this is an APEX phoenix weapon, it calls sc_phoenix() which checks which phoenix function to run on the weapon. For reasons of timing it is important to interrupt sc_weapon_track. */ if(goingup && sc_traj_get_velocity_y(traj) <= 0 && SC_PHOENIX_IS_AT_APEX((*wp)->weaponinfo)) { switch(sc_phoenix(SC_PHOENIX_AT_APEX, c, wp, e)) { /* In this case the weapon split successfully */ case SC_PHOENIX_SIZZLE: sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_SIZZLE); /* In this case, we detonated in mid-air. Strange... */ case SC_PHOENIX_DETONATE: sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_DETONATE); /* In this case something is probably very wrong, since phoenix failed */ case SC_PHOENIX_FAILURE: /* In this case, nothing happened */ case SC_PHOENIX_NO_ACTION: default: /* do nothing */; } } /* Check for RAND phoenix weapons and if so check whether now is the time to run them */ /* TEMP: the probability should be selectable or perhaps scaled by the expected arc length? */ if(SC_PHOENIX_IS_AT_RAND((*wp)->weaponinfo) && game_drand() < SC_PHOENIX_PROB_AT_RAND) { switch(sc_phoenix(SC_PHOENIX_AT_RAND, c, wp, e)) { /* In this case the weapon was successfully modified by sphoenix */ case SC_PHOENIX_SIZZLE: sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_SIZZLE); /* In this case, we detonated */ case SC_PHOENIX_DETONATE: sc_weapon_landfall(c, *wp); sc_weapon_free(wp); return(SC_WEAPON_TRACK_DETONATE); /* Failure in the sphoenix code */ case SC_PHOENIX_FAILURE: /* No action to perform; we hope this case doesn't arise */ case SC_PHOENIX_NO_ACTION: default: /* do nothing */; } } /* If we're still running, then the weapon is still live. Go ahead and re-draw it at its new position. */ sc_window_draw_weapon(c->window, *wp); /* We were tracking a weapon; we'll need to recurse. */ return(SC_WEAPON_TRACK_NEED_RECURSE); } static inline sc_weapon_track_result _sc_weapon_track_chain(sc_config *c, sc_weapon **wp, sc_explosion **e) { /* sc_weapon_track_chain Track a weapon chain for a single player. This processes all weapons in the chain; it will return either: NO_ACTION, indicating that tracking has completed NEED_RECURSE, indicating that nothing of particular interest happened but tracking is not completed (we need to call this function again), DETONATE, indicating that at least one detonation occurred. Tracking will resume once the detonation is processed. All weapons in the weapon chain wp will be processed, even if some weapons at the head of the list explode, and any explosions are added to the explosions list e. */ sc_weapon_track_result result; assert(c != NULL && wp != NULL && e != NULL); result = SC_WEAPON_TRACK_NO_ACTION; while(*wp != NULL) { switch(_sc_weapon_track(c, wp, e)) { case SC_WEAPON_TRACK_DETONATE: result = SC_WEAPON_TRACK_DETONATE; case SC_WEAPON_TRACK_SIZZLE: /* In these cases, sc_weapon_track has already removed the current weapon from the queue, so wp is already updated to point to the next weapon. */ break; case SC_WEAPON_TRACK_NEED_RECURSE: if(result == SC_WEAPON_TRACK_NO_ACTION) { result = SC_WEAPON_TRACK_NEED_RECURSE; } /* Only if nothing occurred yet */ case SC_WEAPON_TRACK_NO_ACTION: /* Advance to the next weapon in the queue. */ wp = &((*wp)->chain); } } return(result); } sc_weapon_track_result sc_weapon_track_all(sc_config *c, sc_explosion **e) { /* sc_weapon_track_all Track the weapons of every player, in sync. This function will always process weapons for all players; if at least one player created a new explosion, it will return DETONATE. If at least one player still needs tracking assistance, then it will return NEED_RECURSE. This function only returns NO_ACTION if ALL players are done tracking. */ /* Note: we process all weapons in the chain, even after seeing a detonation. This is to prevent other weapons from ``lagging'' when one weapon (i.e. chaos) starts a long chain of detonates. In other words, every weapon gets its fair timeslice even if there are a lot of explosions going on. */ sc_weapon_track_result result; int i; assert(c != NULL && e != NULL); result = SC_WEAPON_TRACK_NO_ACTION; for(i = 0; i < c->numplayers; ++i) { switch(_sc_weapon_track_chain(c, &(c->players[i]->weapons), e)) { case SC_WEAPON_TRACK_DETONATE: result = SC_WEAPON_TRACK_DETONATE; break; case SC_WEAPON_TRACK_NEED_RECURSE: if(result == SC_WEAPON_TRACK_NO_ACTION) { result = SC_WEAPON_TRACK_NEED_RECURSE; } /* Only if nothing occurred yet */ break; default: /* do nothing */; } } return(result); } xscorch-0.2.1/sgame/strack.h0000644000175000001440000000317111175116141012634 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/strack.h,v 1.5 2009-04-26 17:39:45 jacob Exp $ */ /* xscorch - strack.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched basic weapon tracking This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __strack_h_included #define __strack_h_included /* Includes */ #include #include /* Forward declarations */ struct _sc_explosion; struct _sc_weapon; struct _sc_config; /* Return values for weapon tracking */ typedef enum _sc_weapon_track_result { SC_WEAPON_TRACK_NO_ACTION = 0, /* No action; tracking complete */ SC_WEAPON_TRACK_NEED_RECURSE, /* Need to recursively call */ SC_WEAPON_TRACK_DETONATE, /* Detonating a weapon */ SC_WEAPON_TRACK_SIZZLE /* Weapon sizzled */ } sc_weapon_track_result; /* Create and track all weapons */ sc_weapon_track_result sc_weapon_track_all(struct _sc_config *c, struct _sc_explosion **e); #endif /* __strack_h_included */ xscorch-0.2.1/sgame/sweapon.c0000644000175000001440000010111211615366346013023 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sweapon.c,v 1.75 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - sweapon.c Copyright(c) 2000-2004 Jacob Luna Lundberg Copyright(c) 2000-2003 Justin David Smith jacob(at)gnifty.net http://www.gnifty.net/ justins(at)chaos2.org http://chaos2.org/ Scorched basic weapon system This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*** Weapon Information ***/ typedef struct _sc_weapon_test_arg { int counter; int flags; const char *name; const sc_weapon_config *wc; } sc_weapon_test_arg; static inline bool _sc_weapon_viewable(const sc_weapon_config *wc, const sc_weapon_info *info, int flags) { /* _sc_weapon_viewable We return true if the weapon is viewable under the given rules. */ if( (!(flags & SC_WEAPON_LIMIT_ARMS) || info->armslevel <= wc->armslevel) && (!(flags & SC_WEAPON_LIMIT_USELESS) || wc->uselessitems || !info->useless) && (!(flags & SC_WEAPON_LIMIT_INDIRECT) || !info->indirect) ) { return(true); } else { return(false); } } static bool _sc_weapon_test_count(void *data, long arg) { /* _sc_weapon_test_count This is an sc_registry_test function. We will iterate, incrementing a counter, but always returning false. */ sc_weapon_info *info = (sc_weapon_info *)data; sc_weapon_test_arg *wta = (sc_weapon_test_arg *)arg; /* We don't validate args; please do so in the caller! */ const sc_weapon_config *wc = wta->wc; int flags = wta->flags; if(_sc_weapon_viewable(wc, info, flags)) ++wta->counter; return(false); } int sc_weapon_count(const sc_weapon_config *wc, int flags) { /* sc_weapon_count Counts the number of weapons that have been registered with the game's data registry. This is optimized but of course if you're calling it a lot you should cache the data. The only exception is that the count may change if a new weapon list file is appended. */ sc_registry_iter *iter; sc_weapon_test_arg wta; if(wc == NULL) return(0); /* Set up for iteration. */ wta.counter = 0; wta.flags = flags; wta.wc = wc; iter = sc_registry_iter_new(wc->registry, wc->registryclass, SC_REGISTRY_FORWARD, _sc_weapon_test_count, (long)(&wta)); if(iter == NULL) return(0); /* Iterate using the fast registry iterators. */ sc_registry_iterate(iter); /* Clean up. */ sc_registry_iter_free(&iter); return(wta.counter); } sc_weapon_info *sc_weapon_lookup(const sc_weapon_config *wc, int id, int flags) { /* sc_weapon_lookup Pass along a registry request for the weapon. */ sc_weapon_info *info; if(wc == NULL || id < 0) return(NULL); /* Find the weapon in the registry. */ info = (sc_weapon_info *)sc_registry_find_by_int(wc->registry, id); /* Verify that the rules in place allow viewing the weapon. */ if(info != NULL && _sc_weapon_viewable(wc, info, flags)) return(info); else return(NULL); } static bool _sc_weapon_test_lookup_name(void *data, long arg) { /* _sc_weapon_test_lookup_name This is an sc_registry_test function. We will seek, search, discover the weapon by name. */ sc_weapon_info *info = (sc_weapon_info *)data; sc_weapon_test_arg *wta = (sc_weapon_test_arg *)arg; /* We don't validate args; please do so in the caller! */ const char *name = wta->name; /* Use sloppy string comparison on the name (true if similar). */ return(strsimilar(info->name, name)); } sc_weapon_info *sc_weapon_lookup_by_name(const sc_weapon_config *wc, const char *name, int flags) { /* sc_weapon_lookup_by_name Tries to find a weapon by roughly the requested name. This is much slower than sc_weapon_lookup. */ sc_registry_iter *iter; sc_weapon_test_arg wta; sc_weapon_info *info; if(wc == NULL || name == NULL) return(NULL); /* Set up for iteration. */ wta.name = name; iter = sc_registry_iter_new(wc->registry, wc->registryclass, (flags & SC_WEAPON_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, _sc_weapon_test_lookup_name, (long)(&wta)); if(iter == NULL) return(NULL); /* Iterate using the fast registry iterators. */ info = (sc_weapon_info *)sc_registry_iterate(iter); /* Clean up. */ sc_registry_iter_free(&iter); /* Verify that the rules in place allow viewing the weapon. */ if(info != NULL && _sc_weapon_viewable(wc, info, flags)) return(info); else return(NULL); } static bool _sc_weapon_test_viewable(void *data, long arg) { /* _sc_weapon_test_viewable This is an sc_registry_test function. We will return true for the first viewable weapon. */ sc_weapon_info *info = (sc_weapon_info *)data; sc_weapon_test_arg *wta = (sc_weapon_test_arg *)arg; /* We don't validate args; please do so in the caller! */ const sc_weapon_config *wc = wta->wc; int flags = wta->flags; return(_sc_weapon_viewable(wc, info, flags)); } sc_weapon_info *sc_weapon_first(const sc_weapon_config *wc, int flags) { /* sc_weapon_first Return the first/last viable weapon in the weapon config space. */ sc_weapon_test_arg wta; sc_weapon_info *info; if(wc == NULL) return(NULL); wta.wc = wc; wta.flags = flags; /* Try and find the first/last weapon that meets our criteria. */ info = sc_registry_find_first(wc->registry, wc->registryclass, (flags & SC_WEAPON_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, _sc_weapon_test_viewable, (long)(&wta)); return(info); } sc_weapon_info *sc_weapon_next(const sc_weapon_config *wc, const sc_weapon_info *info, int flags) { /* sc_weapon_next Advance to the next/prev weapon in the list (with wrapping). */ sc_weapon_test_arg wta; sc_weapon_info *nxtnfo; if(wc == NULL || info == NULL) return(NULL); /* Set up the flags and args for the mission. */ wta.wc = wc; wta.flags = flags; /* Try and find the first/last weapon that meets our criteria. */ nxtnfo = sc_registry_find_next(wc->registry, wc->registryclass, info->ident, (flags & SC_WEAPON_SCAN_REVERSE) ? SC_REGISTRY_REVERSE : SC_REGISTRY_FORWARD, _sc_weapon_test_viewable, (long)(&wta)); /* In case we iterated off the end of the list, wrap to the beginning. */ if(nxtnfo == NULL) nxtnfo = sc_weapon_first(wc, flags); return(nxtnfo); } /*** Weapon Statistics ***/ static double _sc_weapon_stat_yield(const sc_weapon_config *wc, const sc_weapon_info *info, bool triple) { /* _sc_weapon_stat_yield Find an upper bound yield for a weapon. */ double yield; /* Total weapon yield */ const sc_weapon_info *child; /* Info on child weapon(s) */ int numchildren; /* Number of children for phoenix weapon */ int count; /* A counter for frog type phoenix weapons */ /* Yield from self */ yield = SQR(info->radius) * info->force; /* If liquid (napalm), must multiply by potential area of flooding -- this should scale hot napalm to near the vicinity of a nuke (but less), which is reasonable, considering both can take down large tanks. */ if(SC_WEAPON_IS_LIQUID(info)) yield *= info->liquid; /* Triple Turret weapons get three times the kaboom, but only if we have such a turret. */ if(triple && SC_WEAPON_IS_TRIPLE(info)) yield *= 3; /* Phoenix weapons have special yield rules. */ if(SC_WEAPON_IS_PHOENIX(info)) { if(!sc_phoenix_verify(wc, info)) { /* This means somebody snuck in a bad child pointer on a phoenix weapon. It shouldn't happen, but if it does, we promise to return a negative yield. AIs are advised to select another weapon as this one may cause the game to segfault or die and nobody wants that! */ fprintf(stderr, "Bad phoenix weapon: %s. Children loop or do not exist.\n", info->name); return(yield ? -abs(yield) : -1); } child = sc_weapon_lookup(wc, SC_PHOENIX_CHILD_TYPE(info), SC_WEAPON_LIMIT_NONE); numchildren = SC_PHOENIX_CHILD_COUNT(info); if(SC_PHOENIX_IS_CHAIN(info)) { /* Each child is made smaller by a constant factor, _including_ the first child */ for(count = 1; count <= numchildren; ++count) yield += _sc_weapon_stat_yield(wc, child, triple) * pow(SC_PHOENIX_INCREASE_FACTOR, count); } else if(SC_PHOENIX_IS_CONVERT(info)) { /* conversions probably aren't well represented here */ if(child != info) yield = _sc_weapon_stat_yield(wc, child, triple); } else if(SC_PHOENIX_IS_SCATTER(info)) { /* scattering doesn't detonate the original weapon */ if(child != info) yield = numchildren * _sc_weapon_stat_yield(wc, child, triple); else yield = numchildren * yield; /* as a policy, scattering takes a slight bonus for "effectiveness" */ yield *= (SC_PHOENIX_YIELD_SCATTER_SCALE + SC_PHOENIX_SCATTER(info)) / SC_PHOENIX_YIELD_SCATTER_SCALE; } else if(SC_PHOENIX_IS_SPIDER(info)) { /* spiders detonate the original weapon in the center, and on average 75% of their children */ if(child != info) yield += 0.75 * numchildren * _sc_weapon_stat_yield(wc, child, triple); else yield += 0.75 * numchildren * yield; } else if(SC_PHOENIX_IS_DETONATE(info)) { /* We do nothing with detonation requests; they have their face value yield. */ } } return(yield); } static double _sc_weapon_stat_precision(const sc_weapon_config *wc, const sc_weapon_info *info, bool triple) { /* _sc_weapon_stat_precision Find a rough estimator of a weapon's precision. Later on we might have a wind shear value, and/or a weapon eccentricity value, which would also contribute. During most of this code precision is actually inverted... */ double precision; /* Estimate of weapon precision */ const sc_weapon_info *child; /* Info on child weapon(s) */ int numchildren; /* Number of children for phoenix weapon */ int count; /* A counter for frog type phoenix weapons */ /* Horizonal (i.e. not area) space covered, usually 2 * radius. If liquid (napalm), the area of flooding is the horizonal space. */ if(SC_WEAPON_IS_LIQUID(info)) precision = info->liquid; else precision = 2 * info->radius; /* Triple Turret weapons are a third as precise, if we have such a turret. */ if(triple && SC_WEAPON_IS_TRIPLE(info)) precision *= 2; /* Phoenix weapons have special precision rules. */ if(SC_WEAPON_IS_PHOENIX(info)) { if(!sc_phoenix_verify(wc, info)) { /* This means somebody snuck in a bad child pointer on a phoenix weapon. It shouldn't happen, but if it does, we promise to return a negative yield. AIs are advised to select another weapon as this one may cause the game to segfault or die and nobody wants that! */ fprintf(stderr, "Bad phoenix weapon: %s. Children loop or do not exist.\n", info->name); return(precision ? -abs(precision) : -1); } child = sc_weapon_lookup(wc, SC_PHOENIX_CHILD_TYPE(info), SC_WEAPON_LIMIT_NONE); numchildren = SC_PHOENIX_CHILD_COUNT(info); if(SC_PHOENIX_IS_CHAIN(info)) { /* Allow the children to vote on their precisions. */ for(count = 1; count <= numchildren; ++count) precision += pow(SC_PHOENIX_INCREASE_FACTOR, count) * 100 / _sc_weapon_stat_precision(wc, child, triple); } else if(SC_PHOENIX_IS_CONVERT(info)) { /* Conversions could be more precise, but for now AI's don't know about them. */ precision *= 100; /* TEMP - Arbitrary! - JL */ } else if(SC_PHOENIX_IS_SCATTER(info)) { /* Scattering doesn't detonate the original weapon. */ if(child != info) precision = numchildren * 100 / _sc_weapon_stat_precision(wc, child, triple); else precision = numchildren * precision; /* As a rule, scattering is very imprecise, and we hit its precision value hard here. */ precision *= SC_PHOENIX_SCATTER(info); } else if(SC_PHOENIX_IS_SPIDER(info)) { /* Spiders detonate the original weapon in the center, and on average 75% of their children */ if(child != info) precision += 0.75 * numchildren * 100 / _sc_weapon_stat_precision(wc, child, triple); else precision += 0.75 * numchildren * precision; /* Spiders are also docked for their imprecise nature. */ precision *= 2 * SC_PHOENIX_SCATTER(info); } else if(SC_PHOENIX_IS_DETONATE(info)) { /* We do nothing with detonation requests; they have their face value precision. */ } } /* Invert the precision so bigger is better, and normalize a bit. This will give a Missile a precision of 1.25, by the way. If the weapon is completely imprecise, it scores a zero. Likewise, if it doesn't really explode, it gets a zero. */ precision = (precision && info->force) ? (100 / precision) : 0; return(precision); } double sc_weapon_statistic(const sc_weapon_config *wc, const sc_weapon_info *info, const sc_player *p, sc_weapon_stat statistic) { /* sc_weapon_statistic Calculate various weapon statistics used in AI purchasing. The sc_player pointer is optional (can be NULL, in which case you get defaults). */ bool triple; double result; /* Can't allow people to pass us bad info, now can we...? */ if(wc == NULL || info == NULL) return(0); /* We set triple to a bool value that is true if we have a triple turret. */ triple = p && (p->ac_state & SC_ACCESSORY_STATE_TRIPLE); switch(statistic) { case SC_WEAPON_STAT_PRICE: if(info->bundle) result = info->price / info->bundle; else result = 0; break; case SC_WEAPON_STAT_YIELD: result = _sc_weapon_stat_yield(wc, info, triple); break; case SC_WEAPON_STAT_PRECISION: result = _sc_weapon_stat_precision(wc, info, triple); break; case SC_WEAPON_STAT_ECON_YIELD: if(info->price) result = _sc_weapon_stat_yield(wc, info, triple) * info->bundle / info->price; else result = _sc_weapon_stat_yield(wc, info, triple) * info->bundle / SC_INVENTORY_CHEAPO_FACTOR; break; case SC_WEAPON_STAT_ECON_PRECISION: if(info->price) result = _sc_weapon_stat_precision(wc, info, triple) * info->bundle / info->price; else result = _sc_weapon_stat_precision(wc, info, triple) * info->bundle / SC_INVENTORY_CHEAPO_FACTOR; break; case SC_WEAPON_STAT_PRECISION_YIELD: result = _sc_weapon_stat_precision(wc, info, triple) * _sc_weapon_stat_yield(wc, info, triple); break; default: printf("Warning - someone asked for a weapon statistic we don't know how to calculate!\n"); result = 0; } return(result); } void sc_weapon_info_line(const sc_weapon_config *wc, const sc_weapon_info *info, char *buffer, int buflen) { /* sc_weapon_info_line Create a line of information about the weapon. */ int moving; assert(wc != NULL); assert(buflen >= 0); if(buffer == NULL || buflen == 0) return; if(info == NULL) { buffer[0] = '\0'; return; } /* Clear the buffer. */ memset(buffer, 0, buflen * sizeof(char)); /* Terminating NULL character. */ --buflen; /* Add the name to the buffer. */ sbprintf(buffer, buflen, "%s:", info->name); moving = strlenn(info->name) + 1; buffer += moving; buflen -= moving; /* Add spaces out to the end of the name area. */ while(++moving < 20 && --buflen > 0) *(buffer++) = ' '; /* Display the weapon's arms level. */ sbprintf(buffer, buflen, "arms = %1i, ", info->armslevel); moving = 10; buffer += moving; buflen -= moving; /* Display the weapon's yield. */ moving = sc_weapon_statistic(wc, info, NULL, SC_WEAPON_STAT_YIELD) / 1000; sbprintf(buffer, buflen, "yield = %-8i", moving); moving = 8 + (moving ? (int)log10(moving) : 1); buffer += moving; buflen -= moving; /* Add the comma. */ if(buflen-- > 0) *(buffer++) = ','; /* Add spaces out to the end of the yield area, plus two. */ while(++moving < 18 && --buflen > 0) *(buffer++) = ' '; /* Write out some weapon info flags. */ sbprintf(buffer, buflen, "%7s %8s %5s %6s %7s", SC_WEAPON_IS_PHOENIX(info) ? "complex" : "", SC_WEAPON_IS_INFINITE(info) ? "infinite" : "", SC_WEAPON_IS_SMOKING(info) ? "smoke" : "", SC_WEAPON_IS_TRIPLE(info) ? "triple" : "", info->useless ? "useless" : ""); } void sc_weapon_print_yields(const sc_weapon_config *wc) { /* sc_weapon_print_yields Print current weapon yields. This is very unoptimized, in favor of stressing things more. It can help test/troubleshoot the inventorying system... */ double price, yield, precision, econ_yield, econ_prec, prec_yield; int count = sc_weapon_count(wc, SC_WEAPON_LIMIT_NONE); const sc_weapon_info *info; /* Header */ printf("\n %-20s %8s %12s %12s %12s %12s %12s\n", "Weapon Name", "Price", "Yield", "Precision", "Econ Yield", "Econ Prec", "Prec Yield"); /* Get the first weapon. */ info = sc_weapon_first(wc, SC_WEAPON_SCAN_FORWARD); /* Loop over the weapon space. */ while(count--) { assert(info != NULL); if(info->bundle > 0) { price = sc_weapon_statistic(wc, info, NULL, SC_WEAPON_STAT_PRICE); yield = sc_weapon_statistic(wc, info, NULL, SC_WEAPON_STAT_YIELD); precision = sc_weapon_statistic(wc, info, NULL, SC_WEAPON_STAT_PRECISION); econ_yield = sc_weapon_statistic(wc, info, NULL, SC_WEAPON_STAT_ECON_YIELD); econ_prec = sc_weapon_statistic(wc, info, NULL, SC_WEAPON_STAT_ECON_PRECISION); prec_yield = sc_weapon_statistic(wc, info, NULL, SC_WEAPON_STAT_PRECISION_YIELD); printf(" %-20s %8.0f %12.0f %12.9f %12.0f %12.9f %12.0f\n", info->name, price, yield, precision, econ_yield, econ_prec, prec_yield); } /* Get the next weapon. */ info = sc_weapon_next(wc, info, SC_WEAPON_SCAN_FORWARD); } } /*** Weapon Creation / Destruction ***/ sc_weapon *sc_weapon_new(const sc_config *c, sc_weapon_info *info, double x, double y, double vx, double vy, bool has_contact_trigger, int playerid) { /* sc_weapon_new Create a new weapon with the parametres described. The weapon info to use is in info. The starting coordinates are in (x,y), and the starting velocities are in (vx,vy). Also indicate if the weapon is using a contact trigger, and which player owns the weapon. */ sc_weapon *wp; /* Weapon pointer */ int flags; /* Trajectory flags */ assert(c != NULL); assert(info != NULL); assert(playerid >= 0 && playerid < c->numplayers); /* Allocate the new weapon structure */ wp = (sc_weapon *)malloc(sizeof(sc_weapon)); if(wp == NULL) return(NULL); /* Set all weapon creation defaults */ wp->playerid = playerid; wp->state = info->state; wp->weaponinfo = info; wp->children = 0; wp->chain = NULL; wp->exp_res = 1; /* Are we tunnelling? This is important, as we must set the trajectory flags now! */ wp->triggered = has_contact_trigger; flags = SC_WEAPON_TRAJ_FLAGS(c, wp); /* Setup initial trajectory */ wp->tr = sc_traj_new_velocities(c, c->players[playerid], flags, x, y, vx, vy); /* Return the newly created weapon. */ return(wp); } void sc_weapon_landfall(sc_config *c, const sc_weapon *wp) { /* sc_weapon_landfall Perform any landfall operations pending that are associated with this particular weapon. Note that landfall may also affect player tank positions. */ if(c == NULL || wp == NULL || wp->tr == NULL) return; sc_traj_landfall(c, wp->tr); } void sc_weapon_free(sc_weapon **wp) { /* sc_weapon_free Releases the weapon at the head of the list, and sets *wp to its old chain pointer (the next weapon in the list). */ sc_weapon *chain; /* On success, wp will be set to the chain weapon */ /* Release the weapon */ if(wp == NULL || *wp == NULL) return; chain = (*wp)->chain; sc_traj_free(&(*wp)->tr); free(*wp); (*wp) = chain; } void sc_weapon_free_chain(sc_weapon **wp) { /* sc_weapon_free_chain Deletes an entire weapon chain. *wp == NULL after this call. */ sc_weapon *chain; /* We must follow the chain and exterminate it */ /* Release each weapon */ if(wp == NULL) return; while(*wp != NULL) { chain = (*wp)->chain; free(*wp); (*wp) = chain; } } static inline bool _sc_weapon_fire_new(sc_config *c, sc_player *p, sc_explosion **e) { /* _sc_weapon_fire_new A tank wants to fire a weapon. Called by sc_weapon_create_all, below. Returns true if it creates explosions. */ sc_weapon *wp; /* A pointer to point to the weapon to return */ double factorx; /* Based on turret angle; contribution to X velocity */ double factory; /* Based on turret angle; contribution to Y velocity */ sc_weapon_info *i, *ti = NULL; /* Weapon info pointers */ double x, y, vx, vy; /* Temporary weapon info */ bool ct; /* Temporary weapon info */ bool explosions = false; /* Did we trigger explosions? */ assert(c != NULL && p != NULL && e != NULL); /* But *e can be NULL if it wants. ;) */ /* Make sure we can fire and are firing something */ i = p->selweapon; p->weapons = NULL; if(p->dead || !p->armed || SC_WEAPON_IS_NULL(i)) return(false); /* Calculate contribution to each direction, based on turret angle */ factorx = cos(p->turret * M_PI / 180); factory = sin(p->turret * M_PI / 180); /* Set initial weapon position (based on turret radius and angle) */ /* Also set initial weapon velocity based on the tank's power. */ x = sc_player_turret_x(p, p->turret); y = sc_player_turret_y(p, p->turret); vx = p->power * SC_PHYSICS_VELOCITY_SCL * factorx; vy = p->power * SC_PHYSICS_VELOCITY_SCL * factory; /* Do we need to apply a contact trigger? */ ct = sc_player_use_contact_trigger(c, p); /* Decrement player weapon inventory */ if(!SC_WEAPON_IS_INFINITE(i) && (--(i->inventories[p->index]) <= 0)) { /* We ran out, so return to the default weapon. */ p->selweapon = SC_WEAPON_DEFAULT(c->weapons); } /* If it's a triple turret type weapon and we have a triple turret, then we must temporarily replace its weaponinfo with a new phoenix one. NOTE that this info will be free'd before this function exits... */ if((p->ac_state & SC_ACCESSORY_STATE_TRIPLE) && (i->state & SC_WEAPON_STATE_TRIPLE)) { ti = (sc_weapon_info *)malloc(sizeof(sc_weapon_info)); if(ti == NULL) { printf("Your weapon hasn't enough memory to fire, sir! (fire_new() malloc failure)\n"); return(false); } memcpy((void *)ti, (void *)i, sizeof(sc_weapon_info)); ti->ph_fl |= SC_PHOENIX_AT_TANK | SC_PHOENIX_TYPE_SCATTER; ti->ph_ch = i->ident; /* NOTE that we hard-code behavior of the triple turret here. It is a TRIPLE turret after all... ;-) Still, this should probably change at some point. */ ti->children = 3; ti->scatter = 3; /* Allocate the new weapon structure */ wp = sc_weapon_new(c, ti, x, y, vx, vy, ct, p->index); } else { /* Allocate the new weapon structure */ wp = sc_weapon_new(c, i, x, y, vx, vy, ct, p->index); } /* If it is the right phoenix type, the weapon should be split now. */ if(SC_WEAPON_IS_PHOENIX(wp->weaponinfo) && SC_PHOENIX_IS_AT_TANK(wp->weaponinfo)) switch(sc_phoenix(SC_PHOENIX_AT_TANK, c, &wp, e)) { /* This is the case we expect if it is a triple turret weapon */ case SC_PHOENIX_SIZZLE: sc_weapon_landfall(c, wp); sc_weapon_free(&wp); break; /* This is the case we expect for detonate at_tank weapons */ case SC_PHOENIX_DETONATE: sc_weapon_landfall(c, wp); sc_weapon_free(&wp); explosions = true; break; /* How I hate it when things fail... */ case SC_PHOENIX_FAILURE: sc_weapon_free_chain(&wp); break; /* This is the case we expect if it is not a tank phoenix weapon. */ case SC_PHOENIX_NO_ACTION: wp->weaponinfo = i; /* safety */ default: /* do nothing */; } /* Set the player as owner of the weapon chain */ p->weapons = wp; /* This is quite important, despite being usually free(NULL). */ free(ti); return(explosions); } bool sc_weapon_create_all(sc_config *c, sc_explosion **e) { /* sc_weapon_create_all Create the weapons for each player, to be launched. Returns true if we already have explosions to run... */ bool explosions = false; sc_player *p; int i; for(i = c->numplayers - 1; i >= 0; --i) { p = c->players[i]; if(!p->dead && p->armed) { if(_sc_weapon_fire_new(c, p, e)) explosions = true; p->armed = false; } } return(explosions); } /*** Weapon Lists and Configuration Structs ***/ sc_weapon_config *sc_weapon_config_create(const sc_config *c) { /* sc_weapon_config_create Allocate space and set defaults on a new sc_weapon_config struct. */ sc_weapon_config *wc; const char *filename; assert(c != NULL && c->registry != NULL); wc = (sc_weapon_config *)malloc(sizeof(sc_weapon_config)); if(wc == NULL) return(NULL); /* Default settings for weapon config. */ wc->armslevel = SC_ARMS_LEVEL_DEF; wc->bombiconsize = SC_WEAPON_BOMB_ICON_DEF; wc->tunneling = false; wc->scaling = 1.0; wc->tracepaths = false; wc->uselessitems = true; /* Get a class ID for this weapon config. */ wc->registryclass = sc_registry_get_new_class_id(c->registry); wc->registry = c->registry; /* Read in the weapon info list */ filename = SC_GLOBAL_DIR "/" SC_WEAPON_FILE; if(!sc_addconf_append_file(SC_ADDCONF_WEAPONS, filename, wc) || sc_weapon_count(wc, SC_WEAPON_LIMIT_INDIRECT) <= 0) { /* This is the root weapon list... Die! */ free(wc); return(NULL); } return(wc); } void sc_weapon_config_destroy(sc_weapon_config **wc) { /* sc_weapon_config_destroy Invalidate memory used by a weapon config struct. */ sc_weapon_info *info, *temp; if(wc == NULL || *wc == NULL) return; /* Delete all of our registry entries. */ info = (sc_weapon_info *)sc_registry_find_first((*wc)->registry, (*wc)->registryclass, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); while(info != NULL) { temp = info; info = (sc_weapon_info *)sc_registry_find_next((*wc)->registry, (*wc)->registryclass, info->ident, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); sc_registry_del_by_int((*wc)->registry, temp->ident); sc_weapon_info_free(&temp); } /* And delete ourself. */ free(*wc); *wc = NULL; } void sc_weapon_info_free(sc_weapon_info **wi) { /* sc_weapon_info_free Invalidate memory used by an sc_weapon_info. */ /* Make sure there is an item to free */ if(wi == NULL || *wi == NULL) return; /* Free the item's name if it has one */ if((*wi)->name != NULL) free((*wi)->name); /* Free the item */ free(*wi); *wi = NULL; } /*** Misc weapons functions ***/ bool _sc_weapon_inventory_clear_func(void *data, __libj_unused long arg) { /* _sc_weapon_inventory_clear_func Clear weapon inventory data, in registry fast iterators. */ sc_weapon_info *info; if(data == NULL) return(false); info = (sc_weapon_info *)data; /* Clear the weapon's inventory. */ if(!SC_WEAPON_IS_INFINITE(info)) memset(info->inventories, 0, SC_MAX_PLAYERS * sizeof(int)); /* We never "find the right weapon" ... it's faster this way. */ return(false); } void sc_weapon_inventory_clear(sc_weapon_config *wc) { /* sc_weapon_inventory_clear Clear out the player weapon inventories. */ sc_registry_iter *iter; /* Prepare a registry iterator. */ iter = sc_registry_iter_new(wc->registry, wc->registryclass, SC_REGISTRY_FORWARD, _sc_weapon_inventory_clear_func, 0); /* Iterate the entire weapons registry, with the side effect of erasing inventories. */ sc_registry_iterate(iter); /* Clean up. */ sc_registry_iter_free(&iter); } sc_explosion *sc_weapon_get_explosion(const sc_config *c, const sc_weapon *wp, int x, int y, double direction) { /* sc_weapon_get_explosion Take a weapon and a location, and return a ready-made explosion. The explosion will be created with a point-of-impact at (x,y). */ double angular_width; int realradius; int force; int playerid; sc_explosion *expl; sc_explosion_type type; bool create_spill = false; assert(c != NULL && c->weapons != NULL); assert(wp != NULL && wp->weaponinfo != NULL); /* Figure out the real radius and force of the explosion */ angular_width = wp->weaponinfo->angular_width; realradius = c->weapons->scaling * wp->exp_res * wp->weaponinfo->radius; force = wp->weaponinfo->force; playerid = wp->playerid; /* Figure out what explosion type to create. */ if(SC_WEAPON_IS_PLASMA(wp)) { type = SC_EXPLOSION_PLASMA; } else if(SC_WEAPON_IS_NAPALM(wp)) { type = SC_EXPLOSION_NAPALM; create_spill = true; } else if(SC_WEAPON_IS_LIQ_DIRT(wp)) { /* Caution: must appear before IS_DIRT! */ type = SC_EXPLOSION_LIQ_DIRT; create_spill = true; } else if(SC_WEAPON_IS_DIRT(wp)) { type = SC_EXPLOSION_DIRT; } else if(SC_WEAPON_IS_RIOT(wp)) { type = SC_EXPLOSION_RIOT; } else { type = SC_EXPLOSION_NORMAL; } /* Which type of explosion? */ /* Create the initial explosion */ if(angular_width != 0.0) { expl = sc_expl_new_with_angle(x, y, realradius, force, direction, angular_width, playerid, type); } else { expl = sc_expl_new(x, y, realradius, force, playerid, type); } if(expl == NULL) return(NULL); /* If a spill was requested, build the spill now. */ if(create_spill) { expl->data = sc_spill_new(c, c->land, wp->weaponinfo->liquid, expl->centerx, expl->centery); } /* Return the new explosion. */ return(expl); } /*** Weapon Configuration File Support ***/ /* Summary of the weapon state bits, for use in saddconf.c */ static const char *_sc_weapon_state_bit_names[] = { "beam", "defer", "digger", "dirt", "liquid", "null", "plasma", "riot", "roller", "sapper", "smoke", "triple", NULL }; static const unsigned int _sc_weapon_state_bit_items[] = { SC_WEAPON_STATE_BEAM, SC_WEAPON_STATE_DEFER, SC_WEAPON_STATE_DIGGER, SC_WEAPON_STATE_DIRT, SC_WEAPON_STATE_LIQUID, SC_WEAPON_STATE_NULL, SC_WEAPON_STATE_PLASMA, SC_WEAPON_STATE_RIOT, SC_WEAPON_STATE_ROLLER, SC_WEAPON_STATE_SAPPER, SC_WEAPON_STATE_SMOKE, SC_WEAPON_STATE_TRIPLE, 0 }; const char **sc_weapon_state_bit_names(void) { return(_sc_weapon_state_bit_names); } const unsigned int *sc_weapon_state_bit_items(void) { return(_sc_weapon_state_bit_items); } xscorch-0.2.1/sgame/sweapon.h0000644000175000001440000002547511615366346013051 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/sweapon.h,v 1.59 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - sweapon.h Copyright(c) 2000-2003 Jacob Luna Lundberg Copyright(c) 2000-2003 Justin David Smith jacob(at)gnifty.net http://www.gnifty.net/ justins(at)chaos2.org http://chaos2.org/ Scorched basic weapon configuration This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sweapon_h_included #define __sweapon_h_included /* Includes */ #include /* Forward declarations */ struct _sc_trajectory; struct _sc_explosion; struct _sc_registry; struct _sc_player; struct _sc_config; /* Basic weapon constants */ #define SC_WEAPON_BOMB_ICON_DEF 1 /* Default size of bomb icon */ #define SC_WEAPON_BOMB_ICON_MAX 4 /* Maximum size of bomb icon */ #define SC_WEAPON_SCALING_MAX 2.0 /* Maximum weapon scaling factor */ /* Definitions with respect to weapon explosions */ #define SC_WEAPON_NAPALM_RADIUS 13 /* A typical napalm radius */ #define SC_WEAPON_SMALL_EXPLOSION 40 /* Radius of a small explosion */ #define SC_WEAPON_MEDIUM_EXPLOSION 120 /* Ridiculous speed ... */ #define SC_WEAPON_LARGE_EXPLOSION 200 /* Ludicrous speed! ... */ #define SC_WEAPON_SMALL_FORCE 100 /* Small force for small expl */ #define SC_WEAPON_MEDIUM_FORCE 300 /* Medium force for medium expl */ #define SC_WEAPON_LARGE_FORCE 700 /* Large force for big expl */ #define SC_WEAPON_NAPALM_FORCE 30 /* Typical napalm force */ #define SC_WEAPON_NAPALM_LIQUID 400 /* Typical amount of napalm */ /* Data on the various types of weapons */ typedef struct _sc_weapon_info { /* DO NOT CHANGE the order of the first four items: should be ident, armslevel, price, bundle. */ int ident; /* Unique ID (none if <= 0) */ int armslevel; /* Arms level for this weapon */ int price; /* Price (0 == infinite supply) */ int bundle; /* Size of bundle (0 iff price==0) */ int state; /* General weapon initial state flags */ int radius; /* Explosion radius / radius of effect */ double angular_width; /* With in radians of wedge (use 0 for a normal circular explosion). */ int force; /* Force of explosion (0 == nondestructive) */ int liquid; /* Liquid amount (dribble, napalm, dirt) */ int scatter; /* Scattering power of scatter phoenix */ int children; /* Child counts for use by phoenix code */ int ph_ch; /* ID of phoenix children (0 == no phoenix) */ int ph_fl; /* Flags of phoenix children (0 == no kids) */ int inventories[SC_MAX_PLAYERS]; /* Player weapon inventories */ bool useless; /* Is weapon a useless item? */ bool indirect; /* Is the weapon just a support def? */ char *name; /* Weapon name */ char *description; /* Weapon information */ } sc_weapon_info; /* Weapon scanning functions need to know what to find and what not to. */ #define SC_WEAPON_LIMIT_NONE 0x0000 #define SC_WEAPON_LIMIT_ARMS 0x0001 #define SC_WEAPON_LIMIT_USELESS 0x0002 #define SC_WEAPON_LIMIT_INDIRECT 0x0004 #define SC_WEAPON_LIMIT_ALL 0x00ff /* Weapon scanning functions need to know in what direction to scan. */ #define SC_WEAPON_SCAN_DEFAULT 0x0000 #define SC_WEAPON_SCAN_FORWARD 0x0100 #define SC_WEAPON_SCAN_REVERSE 0x0200 /* Bit names in the state flag. Changes to these bits must be reflected in the functions at the bottom of sweapon.c. Also they may require some changes to saddconf.c, and perhaps to the weapons.def file as well. Note that there are still a couple bytes to spare. */ #define SC_WEAPON_STATE_TYPES 0xffff00 #define SC_WEAPON_STATE_FLAGS 0x0000ff /* Bits in the weapon state FLAGS flag */ #define SC_WEAPON_STATE_NULL 0x000001 #define SC_WEAPON_STATE_DEFER 0x000002 #define SC_WEAPON_STATE_SMOKE 0x000004 /* Bits in the weapon state TYPES flag */ #define SC_WEAPON_STATE_PLASMA 0x000100 /* Plasma weapon, nuke */ #define SC_WEAPON_STATE_LIQUID 0x000200 /* Liquid dirt, napalm */ #define SC_WEAPON_STATE_DIRT 0x000400 /* Dirt balls (solid) */ #define SC_WEAPON_STATE_BEAM 0x000800 /* Laser, beam weapons */ #define SC_WEAPON_STATE_RIOT 0x001000 /* Riot bombs, e.g. */ #define SC_WEAPON_STATE_TRIPLE 0x002000 /* Triple turret types */ #define SC_WEAPON_STATE_ROLLER 0x004000 /* Rollable weapons */ #define SC_WEAPON_STATE_DIGGER 0x008000 /* Digging weapons */ #define SC_WEAPON_STATE_SAPPER 0x010000 /* Shield sapping weapons */ /* Macros for weapon info (use on sc_weapon_info only) */ #define SC_WEAPON_TYPE(i) ((i)->ident) #define SC_WEAPON_IS_EXPLOSION(i) ((i)->force && (i)->radius) #define SC_WEAPON_IS_INFINITE(i) ((i)->bundle <= 0 || (i)->price <= 0) #define SC_WEAPON_IS_USELESS(i) ((i)->useless) /* These may be called on either an sc_weapon or an sc_weapon_info */ #define SC_WEAPON_SCATTERING(w) ((w)->scatter) #define SC_WEAPON_CHILD_COUNT(w) ((w)->children) #define SC_WEAPON_IS_NULL(w) ((w) == NULL || (w)->state & SC_WEAPON_STATE_NULL) #define SC_WEAPON_IS_DEFERRING(w) ((w)->state & SC_WEAPON_STATE_DEFER) #define SC_WEAPON_IS_SMOKING(w) ((w)->state & SC_WEAPON_STATE_SMOKE) #define SC_WEAPON_IS_PLASMA(w) ((w)->state & SC_WEAPON_STATE_PLASMA) #define SC_WEAPON_IS_LIQUID(w) ((w)->state & SC_WEAPON_STATE_LIQUID) #define SC_WEAPON_IS_DIRT(w) ((w)->state & SC_WEAPON_STATE_DIRT) #define SC_WEAPON_IS_NAPALM(w) (SC_WEAPON_IS_LIQUID(w) && !SC_WEAPON_IS_DIRT(w)) #define SC_WEAPON_IS_LIQ_DIRT(w) (SC_WEAPON_IS_LIQUID(w) && SC_WEAPON_IS_DIRT(w)) #define SC_WEAPON_IS_RIOT(w) ((w)->state & SC_WEAPON_STATE_RIOT) #define SC_WEAPON_IS_TRIPLE(w) ((w)->state & SC_WEAPON_STATE_TRIPLE) #define SC_WEAPON_IS_ROLLER(w) ((w)->state & SC_WEAPON_STATE_ROLLER) #define SC_WEAPON_IS_DIGGER(w) ((w)->state & SC_WEAPON_STATE_DIGGER) #define SC_WEAPON_IS_SAPPER(w) ((w)->state & SC_WEAPON_STATE_SAPPER) /* Stuff we can call on weapon_configs */ #define SC_WEAPON_DEFAULT(wc) (sc_weapon_first((wc), SC_WEAPON_LIMIT_ALL)) #define SC_WEAPON_TRAJ_FLAGS(c, w) ((((c)->weapons->tunneling && !(w)->triggered) ? \ SC_TRAJ_TUNNELING : SC_TRAJ_DEFAULTS) | \ (SC_WEAPON_IS_SAPPER(w) ? \ SC_TRAJ_HIT_SHIELDS : SC_TRAJ_DEFAULTS)) /* Basic weapon data structure */ typedef struct _sc_weapon { struct _sc_trajectory *tr; /* Weapon's trajectory and heading */ double exp_res; /* explosion size modifier */ int state; /* Weapon state info */ int playerid; /* Who owns this weapon? */ int children; /* Run-time tracking of child count */ bool triggered; /* Weapon has contact trigger */ struct _sc_weapon *chain; /* Needed for MIRV or other weapons which track at multiple locations */ sc_weapon_info *weaponinfo; /* Information on this weapon */ } sc_weapon; /* Weapon configuration */ typedef struct _sc_weapon_config { struct _sc_registry *registry; /* The game data registry */ int armslevel; /* Current technology (arms) level */ int bombiconsize; /* Size of a bomb icon (pixels) */ int registryclass; /* Registry class ID for weapons */ bool tunneling; /* Nonzero if weapon tunneling allowed */ bool tracepaths; /* Nonzero if weapon tracing enabled */ bool uselessitems; /* Useless items appear in inventory? */ double scaling; /* Weapon scaling factor */ } sc_weapon_config; /* Weapon statistics */ typedef enum { SC_WEAPON_STAT_PRICE, SC_WEAPON_STAT_YIELD, SC_WEAPON_STAT_PRECISION, SC_WEAPON_STAT_ECON_YIELD, SC_WEAPON_STAT_ECON_PRECISION, SC_WEAPON_STAT_PRECISION_YIELD } sc_weapon_stat; /* Weapon information lookup */ int sc_weapon_count(const sc_weapon_config *wc, int flags); sc_weapon_info *sc_weapon_lookup(const sc_weapon_config *wc, int id, int flags); sc_weapon_info *sc_weapon_lookup_by_name(const sc_weapon_config *wc, const char *name, int flags); sc_weapon_info *sc_weapon_first(const sc_weapon_config *wc, int flags); sc_weapon_info *sc_weapon_next(const sc_weapon_config *wc, const sc_weapon_info *info, int flags); /* Weapon statistics */ double sc_weapon_statistic(const sc_weapon_config *wc, const sc_weapon_info *info, const struct _sc_player *p, sc_weapon_stat statistic); void sc_weapon_info_line(const sc_weapon_config *wc, const sc_weapon_info *info, char *buffer, int buflen); /* Weapon creation and release */ sc_weapon *sc_weapon_new(const struct _sc_config *c, sc_weapon_info *i, double x, double y, double vx, double vy, bool ct, int playerid); void sc_weapon_landfall(struct _sc_config *c, const sc_weapon *wp); void sc_weapon_free_chain(sc_weapon **wp); void sc_weapon_free(sc_weapon **wp); /* Weapon configuration setup */ sc_weapon_config *sc_weapon_config_create(const struct _sc_config *c); void sc_weapon_config_destroy(sc_weapon_config **wc); void sc_weapon_info_free(sc_weapon_info **wi); /* Misc.: Clear player inventories. Create explosion from weapon. */ void sc_weapon_inventory_clear(sc_weapon_config *wc); struct _sc_explosion *sc_weapon_get_explosion(const struct _sc_config *c, const sc_weapon *wp, int x, int y, double direction); /* Create all weapons for a turn */ bool sc_weapon_create_all(struct _sc_config *c, struct _sc_explosion **e); /* Print the yields of weapons */ void sc_weapon_print_yields(const sc_weapon_config *wc); /* Summary of the weapon state bits, for use in saddconf.c */ const char **sc_weapon_state_bit_names(void); const unsigned int *sc_weapon_state_bit_items(void); #endif /* __sweapon_h_included */ xscorch-0.2.1/sgame/swindow.h0000644000175000001440000001030211175116141013031 00000000000000/* $Header: /fridge/cvs/xscorch/sgame/swindow.h,v 1.9 2009-04-26 17:39:45 jacob Exp $ */ /* xscorch - swindow.h Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched generic window interface This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __swindow_h_included #define __swindow_h_included #include #include /* Forward declarations */ struct _sc_trajectory; struct _sc_config; struct _sc_player; struct _sc_weapon; struct _sc_color; #define SC_REGENERATE_LAND 0x0001 #define SC_REDRAW_LAND 0x0002 #define SC_REDRAW_TANKS 0x0004 #define SC_REDRAW_WIND_ARROW 0x0008 #define SC_CLEAR_WIND_ARROW 0x0010 #define SC_PAINT_EVERYTHING (~SC_REGENERATE_LAND) typedef struct _sc_window { void *data; /* Not allowed to have an empty struct */ } sc_window; /* Basic window manipulation calls */ sc_window *sc_window_new(struct _sc_config *c, int argc, char **argv); void sc_window_free(sc_window **w); void sc_window_run(sc_window *w); void sc_window_idle(sc_window *w); void sc_window_update(sc_window *w); void sc_window_message(sc_window *w, const char *title, const char *msg); /* Calls related to the status bar */ void sc_status_update(sc_window *w, const struct _sc_player *p); void sc_status_message(sc_window *w, const char *msg); void sc_status_player_message(sc_window *w, const struct _sc_player *p, const char *msg); void sc_status_setup(sc_window *w); void sc_status_suspend(sc_window *w); void sc_status_resume(sc_window *w); /* Calls for drawing the game screen */ void sc_window_paint(sc_window *w, int x1, int y1, int x2, int y2, int flag); void sc_window_paint_circular(sc_window *w, int centerx, int centery, int rad, int flag); void sc_window_resize(sc_window *w); /* Calls for drawing the tanks */ void sc_window_draw_tank(sc_window *w, const struct _sc_player *p); void sc_window_undraw_tank(sc_window *w, const struct _sc_player *p); void sc_window_redraw_tank(sc_window *w, const struct _sc_player *p); /* Calls for drawing the weapons */ void sc_window_draw_weapon(sc_window *w, const struct _sc_weapon *wp); void sc_window_undraw_weapon(sc_window *w, const struct _sc_weapon *wp); /* Calls for painting other types of screens */ void sc_window_main_menu(sc_window *w); void sc_window_paint_blank(sc_window *w); /* End of round/end of game */ void sc_window_paint_end_round(sc_window *w); void sc_window_paint_end_game(sc_window *w); /* Inventory windows */ void sc_window_inventory(sc_window *w, struct _sc_player *p); void sc_window_auto_defense(sc_window *w, struct _sc_player *p); void sc_window_lottery_result(sc_window *w, bool showstake); /* Explosion cache */ int sc_expl_cache_new(sc_window *w, int radius, enum _sc_explosion_type type); void sc_expl_cache_draw(sc_window *w, int ptr, int centerx, int centery, int cacheid); /* Arc drawing */ void sc_window_draw_arc(sc_window *w, struct _sc_trajectory *tr, int playerid); void sc_window_clear_arc(sc_window *w, struct _sc_trajectory *tr); /* Spill functions */ void sc_window_draw_napalm_frame(sc_window *w, const int *xlist, const int *ylist, int size); void sc_window_draw_napalm_final(sc_window *w, const int *xlist, const int *ylist, int totalsize); void sc_window_clear_napalm(sc_window *w, const int *xlist, const int *ylist, int totalsize); /* Interface timer */ /*void sc_window_timer_enable(sc_window *w);*/ /*void sc_window_timer_disable(sc_window *w);*/ /* Network status update functions */ void sc_chat_window_update(sc_window *w, const char *msg); #endif /* __swindow_h_included */ xscorch-0.2.1/sgtk/0000755000175000001440000000000011615372007011132 500000000000000xscorch-0.2.1/sgtk/Makefile.am0000644000175000001440000000212107627105606013111 00000000000000## $Header: /fridge/cvs/xscorch/sgtk/Makefile.am,v 1.16 2003/02/26 03:49:07 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Subdirectories to build in # SUBDIRS = swidgets # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig if ANYGTK noinst_LIBRARIES = libscorch_gtk.a endif libscorch_gtk_a_SOURCES =\ sai-gtk.c \ sautodef-gtk.c \ scolor-gtk.c \ scolor-gtk.h \ sdialog-gtk.h \ seconomy-gtk.c \ send-gtk.c \ sexplosion-gtk.c\ sexplosion-gtk.h\ sfile-gtk.c \ sfont-gtk.c \ sgraphics-gtk.c \ sgtk.h \ simage-gtk.c \ simage-gtk.h \ sinventory-gtk.c\ sland-gtk.c \ slottery-gtk.c \ smainmenu-gtk.c \ smenu-gtk.c \ smenu-gtk.h \ snet-gtk.c \ snet-gtk.h \ soptions-gtk.c \ spaint-gtk.c \ sphysics-gtk.c \ splayer-gtk.c \ ssetup-gtk.h \ ssound-gtk.c \ sspill-gtk.c \ sstatus-gtk.c \ sstatus-gtk.h \ ssystem-gtk.c \ ssystem-gtk.h \ stank-gtk.c \ stank-gtk.h \ sweapons-gtk.c \ swindow-gtk.c \ swindow-gtk.h INCLUDES = $(GTK_CFLAGS) -Iswidgets -I../libj xscorch-0.2.1/sgtk/Makefile.in0000644000175000001440000005743211615371715013137 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = sgtk DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_gtk_a_AR = $(AR) $(ARFLAGS) libscorch_gtk_a_LIBADD = am_libscorch_gtk_a_OBJECTS = sai-gtk.$(OBJEXT) sautodef-gtk.$(OBJEXT) \ scolor-gtk.$(OBJEXT) seconomy-gtk.$(OBJEXT) send-gtk.$(OBJEXT) \ sexplosion-gtk.$(OBJEXT) sfile-gtk.$(OBJEXT) \ sfont-gtk.$(OBJEXT) sgraphics-gtk.$(OBJEXT) \ simage-gtk.$(OBJEXT) sinventory-gtk.$(OBJEXT) \ sland-gtk.$(OBJEXT) slottery-gtk.$(OBJEXT) \ smainmenu-gtk.$(OBJEXT) smenu-gtk.$(OBJEXT) snet-gtk.$(OBJEXT) \ soptions-gtk.$(OBJEXT) spaint-gtk.$(OBJEXT) \ sphysics-gtk.$(OBJEXT) splayer-gtk.$(OBJEXT) \ ssound-gtk.$(OBJEXT) sspill-gtk.$(OBJEXT) \ sstatus-gtk.$(OBJEXT) ssystem-gtk.$(OBJEXT) \ stank-gtk.$(OBJEXT) sweapons-gtk.$(OBJEXT) \ swindow-gtk.$(OBJEXT) libscorch_gtk_a_OBJECTS = $(am_libscorch_gtk_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_gtk_a_SOURCES) DIST_SOURCES = $(libscorch_gtk_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Subdirectories to build in # SUBDIRS = swidgets # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig @ANYGTK_TRUE@noinst_LIBRARIES = libscorch_gtk.a libscorch_gtk_a_SOURCES = \ sai-gtk.c \ sautodef-gtk.c \ scolor-gtk.c \ scolor-gtk.h \ sdialog-gtk.h \ seconomy-gtk.c \ send-gtk.c \ sexplosion-gtk.c\ sexplosion-gtk.h\ sfile-gtk.c \ sfont-gtk.c \ sgraphics-gtk.c \ sgtk.h \ simage-gtk.c \ simage-gtk.h \ sinventory-gtk.c\ sland-gtk.c \ slottery-gtk.c \ smainmenu-gtk.c \ smenu-gtk.c \ smenu-gtk.h \ snet-gtk.c \ snet-gtk.h \ soptions-gtk.c \ spaint-gtk.c \ sphysics-gtk.c \ splayer-gtk.c \ ssetup-gtk.h \ ssound-gtk.c \ sspill-gtk.c \ sstatus-gtk.c \ sstatus-gtk.h \ ssystem-gtk.c \ ssystem-gtk.h \ stank-gtk.c \ stank-gtk.h \ sweapons-gtk.c \ swindow-gtk.c \ swindow-gtk.h INCLUDES = $(GTK_CFLAGS) -Iswidgets -I../libj all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sgtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sgtk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_gtk.a: $(libscorch_gtk_a_OBJECTS) $(libscorch_gtk_a_DEPENDENCIES) -rm -f libscorch_gtk.a $(libscorch_gtk_a_AR) libscorch_gtk.a $(libscorch_gtk_a_OBJECTS) $(libscorch_gtk_a_LIBADD) $(RANLIB) libscorch_gtk.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sai-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sautodef-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scolor-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seconomy-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sexplosion-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfile-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfont-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgraphics-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simage-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sinventory-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sland-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slottery-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smainmenu-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smenu-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snet-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/soptions-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spaint-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sphysics-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splayer-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssound-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sspill-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sstatus-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssystem-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stank-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sweapons-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swindow-gtk.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-noinstLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/sgtk/sai-gtk.c0000644000175000001440000000606011175116143012555 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sai-gtk.c,v 1.14 2009-04-26 17:39:47 jacob Exp $ */ /* xscorch - sai-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ AI controller configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include typedef struct _sc_ai_controller_setup_data_gtk { sc_config *c; sc_ai_controller *aic; bool humantargets; bool allowoffsets; bool alwaysoffset; bool enablescan; bool nobudget; } sc_ai_controller_setup_data_gtk; static void _sc_ai_controller_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_ai_controller_setup_data_gtk *setup) { sc_ai_controller *aic = setup->aic; aic->humantargets = setup->humantargets; aic->allowoffsets = setup->allowoffsets; aic->alwaysoffset = setup->alwaysoffset; aic->enablescan = setup->enablescan; aic->nobudget = setup->nobudget; #if USE_NETWORK if(SC_NETWORK_SERVER(setup->c)) sc_net_server_send_config(setup->c, setup->c->server); #endif } void sc_ai_controller_setup_gtk(sc_window_gtk *w) { sc_ai_controller *aic = w->c->aicontrol; sc_ai_controller_setup_data_gtk setup; ScDialog *dialog; int confirm = (SC_NETWORK_AUTH(w->c) ? SC_DIALOG_OK : 0); int row = 0; setup.c = w->c; setup.aic = aic; setup.humantargets = aic->humantargets; setup.allowoffsets = aic->allowoffsets; setup.alwaysoffset = aic->alwaysoffset; setup.enablescan = aic->enablescan; setup.nobudget = aic->nobudget; dialog = SC_DIALOG(sc_dialog_new("AI Controller Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_ai_controller_setup_apply_gtk, &setup); attach_option(dialog, w, "Human Target Practice", sc_link_check_new(&setup.humantargets), &row); attach_option(dialog, w, "Allow Offset Targetting",sc_link_check_new(&setup.allowoffsets), &row); attach_option(dialog, w, "Always Offset", sc_link_check_new(&setup.alwaysoffset), &row); attach_option(dialog, w, "Enable Scan Refinement", sc_link_check_new(&setup.enablescan), &row); attach_option(dialog, w, "No Budget Constraints", sc_link_check_new(&setup.nobudget), &row); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/sautodef-gtk.c0000644000175000001440000005134111615366346013630 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sautodef-gtk.c,v 1.36 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - sautodef-gtk.c Copyright(c) 2001-2003 Jacob Luna Lundberg Copyright(c) 2003 Justin David Smith jacob(at)gnifty.net http://www.gnifty.net/ justins(at)chaos2.org http://chaos2.org/ Auto Defense settings screen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* list_sets are used to carry about item lists */ typedef struct _sc_list_set { int length; int *items; } sc_list_set; /* * We have to keep track of the player. * You MUST keep this sync'd with sc_auto_def_set in spreround.h! */ typedef struct _sc_auto_def_gtk { /* sc_auto_def_set copy */ struct _sc_accessory_info *auto_guidance; /* special guidance */ struct _sc_accessory_info *auto_shield; /* activate a shield */ int chute_height; /* parachute threshold */ bool triggers; /* use contact triggers */ /* sc_auto_def_gtk only */ GtkWidget *console_main; /* The primary display console */ GtkWidget *console_guidance; /* The guidance list console */ GtkWidget *console_shield; /* The shield list console */ GtkWidget *console_parachute; /* The parachute distance console */ GtkWidget *console_triggers; /* The contact triggers console */ GtkWidget *console_activate; /* The activation console */ sc_list_set set_guidance; /* The items in the guidance list */ sc_list_set set_shield; /* The items in the shield list */ ScACToggle *trigger_toggle; /* The contact trigger toggle */ sc_window_gtk *w; /* the parent window */ sc_player *p; /* the controlling player */ /* Keystroke preparedness */ bool ready; /* Until it's true, ignore keys */ } sc_auto_def_gtk; sc_auto_def_gtk *_sc_auto_def_gtk_new(void) { /* _sc_auto_def_gtk_new Set up a new auto_def_gtk */ sc_auto_def_gtk *adg; adg = (sc_auto_def_gtk *)malloc(sizeof(sc_auto_def_gtk)); if(adg == NULL) return(NULL); /* sc_auto_def_set items */ adg->auto_guidance = NULL; adg->auto_shield = NULL; adg->chute_height = 0; adg->triggers = false; /* sc_auto_def_gtk items */ adg->console_main = NULL; adg->console_guidance = NULL; adg->console_shield = NULL; adg->console_parachute = NULL; adg->console_triggers = NULL; adg->console_activate = NULL; adg->set_guidance.length = 0; adg->set_guidance.items = NULL; adg->set_shield.length = 0; adg->set_shield.items = NULL; adg->trigger_toggle = NULL; adg->w = NULL; adg->p = NULL; adg->ready = false; return(adg); } void _sc_auto_def_gtk_free(sc_auto_def_gtk **adg) { /* _sc_auto_def_gtk_free Free the memory in an sc_auto_def_gtk. */ if(adg == NULL || *adg == NULL) return; free((*adg)->set_guidance.items); free((*adg)->set_shield.items); free(*adg); *adg = NULL; } inline void _sc_window_auto_def_engage(sc_auto_def_gtk *adg) { /* _sc_window_auto_def_engage Engage the Auto Defense system with whatever settings we have. */ /* Read the Contact Trigger toggle. */ adg->triggers = sc_ac_toggle_get(adg->trigger_toggle) ? true : false; /* Activate the system. */ sc_autodef_activate(adg->w->c, adg->p, (sc_auto_def_set *)adg); } static gboolean _sc_window_auto_def_close_gtk(__libj_unused GtkWidget *widget, __libj_unused ScActiveConsoleSpot *spot, sc_auto_def_gtk *adg) { /* _sc_window_auto_def_close_gtk Enact the auto defense settings and restart the auto defense loop. */ sc_window_gtk *w = adg->w; if(!adg->ready) return(FALSE); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("accepting autodef close%s", ""); #endif /* debug */ /* Enact the user requests. */ _sc_window_auto_def_engage(adg); /* Destroy the display and restart the auto defense player loop. */ sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_set_state_now(w->c, w->c->game, SC_STATE_AUTO_DEFENSE_LOOP); sc_status_message((sc_window *)w, ""); _sc_auto_def_gtk_free(&adg); return(TRUE); } static gboolean _sc_window_auto_def_key_gtk(__libj_unused GtkWidget *widget, __libj_unused ScActiveConsoleSpot *spot, GdkEventKey *key, sc_auto_def_gtk *adg) { /* _sc_window_auto_def_key_gtk Enact the auto defense settings and restart the auto defense loop. */ sc_window_gtk *w = adg->w; if(!adg->ready) return(FALSE); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("got autodef cancel (esc)%s", ""); #endif /* debug */ switch(key->keyval) { case GDK_Return: case GDK_KP_Enter: /* Push out the settings the user gave us. */ _sc_window_auto_def_engage(adg); case GDK_Escape: /* Destroy the display and restart the auto defense player loop. */ sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_set_state_now(w->c, w->c->game, SC_STATE_AUTO_DEFENSE_LOOP); _sc_auto_def_gtk_free(&adg); return(TRUE); } return(FALSE); } static gboolean _sc_autodef_guidance_enter_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, sc_auto_def_gtk *adg) { /* _sc_autodef_guidance_enter_gtk Move the selection to a new item in the list. */ if(adg == NULL || spot == NULL) return(FALSE); if(!adg->ready) return(FALSE); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("got autodef guidance entry%s", ""); #endif /* debug */ /* Perform the selection settings. */ if(spot->y) { /* The spots are offset +1 to allow for the (none) selection. */ adg->auto_guidance = sc_accessory_lookup(adg->w->c->accessories, adg->set_guidance.items[spot->y - 1], SC_ACCESSORY_LIMIT_ALL); } else { adg->auto_guidance = NULL; } return(TRUE); } static gboolean _sc_autodef_shield_enter_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, sc_auto_def_gtk *adg) { /* _sc_autodef_shield_enter_gtk Move the selection to a new item in the list. */ if(adg == NULL || spot == NULL) return(FALSE); if(!adg->ready) return(FALSE); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("got autodef shield entry%s", ""); #endif /* debug */ /* Perform the selection settings. */ if(spot->y) { /* The spots are offset +1 to allow for the (none) selection. */ adg->auto_shield = sc_accessory_lookup(adg->w->c->accessories, adg->set_shield.items[spot->y - 1], SC_ACCESSORY_LIMIT_ALL); } else { adg->auto_shield = NULL; } return(TRUE); } void _sc_window_auto_defense_guidance_init(sc_auto_def_gtk *adg) { /* _sc_window_auto_defense_guidance_init Draw up the console pane for Guidance System selection. There is allocation here so don't call it multiple times. */ int count; char buf[SC_GTK_STRING_BUFFER]; sc_window_gtk *w = adg->w; sc_accessory_config *ac = w->c->accessories; sc_accessory_info *info; /* Make a title on the main window. */ sc_console_write_line(SC_CONSOLE(adg->console_main), 9, 3, "Guidance System"); sc_console_highlight_attach(SC_CONSOLE(adg->console_main), sc_console_get_color(SC_CONSOLE(adg->console_main), SC_CONSOLE_FORESTANDARD), NULL, TRUE, 9, 3, 15, 1); /* Create storage space for the working set and set up for the search. */ info = sc_accessory_first(ac, SC_ACCESSORY_LIMIT_ALL); count = sc_accessory_count(ac, SC_ACCESSORY_LIMIT_ALL); adg->set_guidance.items = (int *)malloc(count * sizeof(int)); adg->set_guidance.length = 0; /* Find the guidance systems we have in inventory. */ for(; count > 0; --count) { if(SC_ACCESSORY_IS_GUIDANCE(info) && info->inventories[adg->p->index] > 0) { /* We can allow them to activate this guidance system. */ adg->set_guidance.items[adg->set_guidance.length++] = info->ident; } info = sc_accessory_next(ac, info, SC_ACCESSORY_LIMIT_ALL); } /* Shrink the memory to package just what we need. */ adg->set_guidance.items = (int *)realloc(adg->set_guidance.items, adg->set_guidance.length * sizeof(int)); /* Create the guidance system window. */ adg->console_guidance = sc_window_active_console_new(w, 9, 9, 32, 3, CONSOLE_NORMAL); sc_console_buffer_size(SC_CONSOLE(adg->console_guidance), 32, adg->set_guidance.length + 1); /* Draw the ``nothing selected'' item and hook it up. */ sbprintf(buf, sizeof(buf), "(none)"); sc_console_write_line(SC_CONSOLE(adg->console_guidance), 0, 0, buf); sc_active_console_add_row_spot(SC_ACTIVE_CONSOLE(adg->console_guidance), 0, NULL); /* Draw the guidance system selections and hook them up. */ for(count = 0; count < adg->set_guidance.length; ++count) { /* Generate a name tag for the item in question. */ info = sc_accessory_lookup(ac, adg->set_guidance.items[count], SC_ACCESSORY_LIMIT_ALL); sbprintf(buf, sizeof(buf), "%s (%02i)", info->name, info->inventories[adg->p->index]); /* Display is offset +1 from index because of the ``(none)'' item. */ sc_console_write_line(SC_CONSOLE(adg->console_guidance), 0, count + 1, buf); sc_active_console_add_row_spot(SC_ACTIVE_CONSOLE(adg->console_guidance), count + 1, NULL); } /* * Attach the guidance system signal handlers. Right now there's * just enter_spot. Can you think of others that would be useful? * I can't. :) */ g_signal_connect_after(G_OBJECT(adg->console_guidance), "enter-spot", (GCallback)_sc_autodef_guidance_enter_gtk, adg); g_signal_connect_after(G_OBJECT(adg->console_guidance), "key_press_spot", (GCallback)_sc_window_auto_def_key_gtk, adg); /* Display the guidance system window. */ sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(adg->console_guidance)); } void _sc_window_auto_defense_shield_init(sc_auto_def_gtk *adg) { /* _sc_window_auto_defense_shield_init Draw up the console pane for Shield Selection. There is allocation here so don't call it multiple times. */ int count; char buf[SC_GTK_STRING_BUFFER]; sc_window_gtk *w = adg->w; sc_accessory_config *ac = w->c->accessories; sc_accessory_info *info; /* Make a title on the main window. */ sc_console_write_line(SC_CONSOLE(adg->console_main), 45, 3, "Shield Selection"); sc_console_highlight_attach(SC_CONSOLE(adg->console_main), sc_console_get_color(SC_CONSOLE(adg->console_main), SC_CONSOLE_FORESTANDARD), NULL, TRUE, 45, 3, 16, 1); /* Create storage space for the working set and set up for the search. */ info = sc_accessory_first(ac, SC_ACCESSORY_LIMIT_ALL); count = sc_accessory_count(ac, SC_ACCESSORY_LIMIT_ALL); adg->set_shield.items = (int *)malloc(count * sizeof(int)); adg->set_shield.length = 0; /* Find the shields we have in inventory. */ for(; count > 0; --count) { if(SC_ACCESSORY_IS_SHIELD(info) && info->inventories[adg->p->index] > 0) { /* We can allow them to activate this shield. */ adg->set_shield.items[adg->set_shield.length++] = info->ident; } info = sc_accessory_next(ac, info, SC_ACCESSORY_LIMIT_ALL); } /* Shrink the memory to package just what we need. */ adg->set_shield.items = (int *)realloc(adg->set_shield.items, adg->set_shield.length * sizeof(int)); /* Create the shield selection window. */ adg->console_shield = sc_window_active_console_new(w, 45, 9, 32, 3, CONSOLE_NORMAL); sc_console_buffer_size(SC_CONSOLE(adg->console_shield), 32, adg->set_shield.length + 1); /* Draw the ``nothing selected'' item and hook it up. */ sbprintf(buf, sizeof(buf), "(none)"); sc_console_write_line(SC_CONSOLE(adg->console_shield), 0, 0, buf); sc_active_console_add_row_spot(SC_ACTIVE_CONSOLE(adg->console_shield), 0, NULL); /* Draw the shield selections and hook them up. */ for(count = 0; count < adg->set_shield.length; ++count) { /* Generate a name tag for the item in question. */ info = sc_accessory_lookup(ac, adg->set_shield.items[count], SC_ACCESSORY_LIMIT_ALL); sbprintf(buf, sizeof(buf), "%s (%02i)", info->name, info->inventories[adg->p->index]); /* Display is offset +1 from index because of the ``(none)'' item. */ sc_console_write_line(SC_CONSOLE(adg->console_shield), 0, count + 1, buf); sc_active_console_add_row_spot(SC_ACTIVE_CONSOLE(adg->console_shield), count + 1, NULL); } /* * Attach the shield selection signal handlers. Right now there's * just enter_spot. Can you think of others that would be useful? * I can't. :) */ g_signal_connect_after(G_OBJECT(adg->console_shield), "enter-spot", (GCallback)_sc_autodef_shield_enter_gtk, adg); g_signal_connect_after(G_OBJECT(adg->console_shield), "key_press_spot", (GCallback)_sc_window_auto_def_key_gtk, adg); /* Display the shield selection window. */ sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(adg->console_shield)); } void _sc_window_auto_defense_parachute_init(sc_auto_def_gtk *adg) { /* _sc_window_auto_defense_parachute_init Draw up the console pane for Parachute Configuration. There is allocation here so don't call it multiple times. */ /* * TEMP - This is all supposed to be on its own active console. * But to avoid focus issues, not until it's implemented. */ sc_console_write_line(SC_CONSOLE(adg->console_main), 48, 12, "Parachutes"); sc_console_highlight_attach(SC_CONSOLE(adg->console_main), sc_console_get_color(SC_CONSOLE(adg->console_main), SC_CONSOLE_FORESTANDARD), NULL, TRUE, 48, 12, 10, 1); /* * TEMP - We need something different here, probably like * a selection dial or text box in nature. - JL * * The value to be adjusted here is: adg->chute_height */ sc_console_write_line(SC_CONSOLE(adg->console_main), 47, 13, "Unimplemented"); sc_console_highlight_attach_disabled(SC_CONSOLE(adg->console_main), 47, 13, 13, 1); } void _sc_window_auto_defense_triggers_init(sc_auto_def_gtk *adg) { /* _sc_window_auto_defense_triggers_init Draw up the console pane for Contact Trigger settings. There is allocation here so don't call it multiple times. */ sc_window_gtk *w = adg->w; /* Create the contact triggers window. */ adg->console_triggers = sc_window_active_console_new(w, 17, 16, 16, 5, CONSOLE_BORDERLESS); sc_console_write_line(SC_CONSOLE(adg->console_triggers), 0, 0, "Contact Triggers"); sc_console_highlight_attach(SC_CONSOLE(adg->console_triggers), NULL, NULL, TRUE, 0, 0, 16, 1); adg->trigger_toggle = SC_AC_TOGGLE(sc_ac_toggle_new(6, 1, 4, 2)); sc_ac_toggle_set(adg->trigger_toggle, adg->triggers ? TRUE : FALSE); sc_active_console_add_gadget_spot(SC_ACTIVE_CONSOLE(adg->console_triggers), SC_GADGET(adg->trigger_toggle), NULL); /* Desensitize the toggle if the player can't use triggers. */ if(!(adg->p->ac_state & SC_ACCESSORY_STATE_TRIGGER)) gtk_widget_set_sensitive(GTK_WIDGET(adg->console_triggers), FALSE); /* Handle signals; most are handled natively by the toggle... */ g_signal_connect_after(G_OBJECT(adg->console_triggers), "key_press_spot", (GCallback)_sc_window_auto_def_key_gtk, adg); /* Display the contact triggers window. */ sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(adg->console_triggers)); } void sc_window_auto_defense(sc_window *w_, sc_player *p) { /* sc_window_auto_defense Display the auto defense window. */ sc_auto_def_gtk *adg; sc_window_gtk *w = (sc_window_gtk *)w_; char buf[SC_GTK_STRING_BUFFER]; /* Put together the persistant information. */ adg = _sc_auto_def_gtk_new(); if(adg == NULL || w == NULL || p == NULL) { /* Terminating conditions! */ free(adg); sc_game_set_state_now(w->c, w->c->game, SC_STATE_AUTO_DEFENSE_LOOP); return; } adg->w = w; adg->p = p; /* H E A D E R */ /* Make a new window. x y w h */ adg->console_main = sc_window_active_console_new(w, 8, 4, 70, 20, CONSOLE_NORMAL); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(adg->console_main)); sc_console_set_foreground(SC_CONSOLE(adg->console_main), &w->colormap->pcolors[p->index]); gtk_widget_set_sensitive(GTK_WIDGET(adg->console_main), FALSE); /* Put a highlighted title on the new window. */ sbprintf(buf, sizeof(buf), "Tank Defense Controller for %s", p->name); sc_console_write_line(SC_CONSOLE(adg->console_main), 70 / 2 - 14 - strlenn(p->name) / 2, 0, buf); sc_console_highlight_attach(SC_CONSOLE(adg->console_main), NULL, NULL, TRUE, 70 / 2 - 14 - strlenn(p->name) / 2, 0, 28 + strlenn(p->name), 1); /* S E L E C T I O N S */ /* Display the guidance device selection. */ adg->auto_guidance = NULL; _sc_window_auto_defense_guidance_init(adg); /* Display the shield selection. */ adg->auto_shield = NULL; _sc_window_auto_defense_shield_init(adg); /* Display the parachute selection. */ adg->chute_height = 8; _sc_window_auto_defense_parachute_init(adg); /* Display the contact trigger selection. */ adg->triggers = p->contacttriggers; _sc_window_auto_defense_triggers_init(adg); /* F O O T E R */ /* Float the exit instructions on their own console to fix null-focus crap. */ adg->console_activate = sc_window_active_console_new(w, 8, 23, 70, 1, CONSOLE_BORDERLESS); /* Display the EXIT instructions. */ sc_console_write_line(SC_CONSOLE(adg->console_activate), 0, 0, "Press [Enter] to activate, or [Escape] to cancel"); /* Set up the EXIT button. */ sc_console_write_line(SC_CONSOLE(adg->console_activate), 58, 0, "< Activate >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(adg->console_activate), 58, 0, 12, 1, NULL); /* Connect the signal handlers for EXIT conditions. */ g_signal_connect_after(G_OBJECT(adg->console_activate), "key_press_spot", (GCallback)_sc_window_auto_def_key_gtk, adg); g_signal_connect_after(G_OBJECT(adg->console_activate), "select-spot", (GCallback)_sc_window_auto_def_close_gtk, adg); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(adg->console_activate)); /* Focus on this window. */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(adg->console_activate)); /* I'd do console_main here but it gives focus to some null handler. */ gtk_widget_grab_focus(GTK_WIDGET(adg->console_guidance)); /* Everything is ready and running. */ adg->ready = true; } xscorch-0.2.1/sgtk/scolor-gtk.c0000644000175000001440000001070311175116143013301 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/scolor-gtk.c,v 1.11 2009-04-26 17:39:47 jacob Exp $ */ /* xscorch - scolor-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK Colormap This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include /*** Next few functions are the gradient subsystem ***/ static inline gboolean _sc_colormap_set_gtk(sc_window_gtk *w, GdkColor *c, double r, double g, double b) { if(r < 0) r = 0; if(g < 0) g = 0; if(b < 0) b = 0; if(r > 1) r = 1; if(g > 1) g = 1; if(b > 1) b = 1; c->red = r * 0xffff; c->green = g * 0xffff; c->blue = b * 0xffff; return(gdk_colormap_alloc_color(gtk_widget_get_colormap(w->app), c, FALSE, TRUE)); } sc_color_gtk *sc_colormap_new_gtk(void) { return((sc_color_gtk *)malloc(sizeof(sc_color_gtk))); } void sc_colormap_free_gtk(sc_color_gtk **color) { if(color == NULL || *color == NULL) return; free(*color); *color = NULL; } static inline void _sc_colormap_gradient_gtk(sc_window_gtk *w, int gradidx, double r, double g, double b, double fr, double fg, double fb) { double dr; double dg; double db; int count; int i; dr = (fr - r) / SC_MAX_GRADIENT_SIZE; dg = (fg - g) / SC_MAX_GRADIENT_SIZE; db = (fb - b) / SC_MAX_GRADIENT_SIZE; for(count = 0, i = 0; i < SC_MAX_GRADIENT_SIZE; ++i) { if(_sc_colormap_set_gtk(w, &w->colormap->gradient[gradidx][count], r, g, b)) { if(count == 0 || w->colormap->gradient[gradidx][count].pixel != w->colormap->gradient[gradidx][count - 1].pixel) { ++count; } } r += dr; g += dg; b += db; } w->c->colors->gradsize[gradidx] = count; } void sc_colormap_alloc_colors_gtk(sc_window_gtk *w) { sc_color_gtk *colormap = w->colormap; sc_color *colors = w->c->colors; /* Initialise gradient subsystem */ _sc_colormap_gradient_gtk(w, SC_GRAD_GROUND, 0, 0.47, 0, 0, 0.72, 0); _sc_colormap_gradient_gtk(w, SC_GRAD_NIGHT_SKY, 0, 0, 0.05, 0, 0, 0.45); _sc_colormap_gradient_gtk(w, SC_GRAD_FIRE_SKY, 1.00, 0.75, 0.25, 0.37, 0, 0); _sc_colormap_gradient_gtk(w, SC_GRAD_EXPLOSION, 0.80, 0, 0, 0.20, 0, 0); _sc_colormap_gradient_gtk(w, SC_GRAD_FUNKY_EXPLOSION, 0.80, 0.40, 0, 0.50, 0.10, 0); _sc_colormap_gradient_gtk(w, SC_GRAD_MAGNETIC, 0, 0, 0, 1.00, 0.50, 0.00); _sc_colormap_gradient_gtk(w, SC_GRAD_SHIELD, 0, 0, 0, 1.00, 1.00, 1.00); _sc_colormap_gradient_gtk(w, SC_GRAD_FORCE, 0, 0, 0, 1.00, 0, 1.00); _sc_colormap_gradient_gtk(w, SC_GRAD_FLAMES, 0.40, 0.00, 0.00, 0.80, 0.40, 0.00); _sc_colormap_set_gtk(w, &colormap->black, 0.0, 0.0, 0.0); _sc_colormap_set_gtk(w, &colormap->gray, 0.5, 0.5, 0.5); _sc_colormap_set_gtk(w, &colormap->white, 1.0, 1.0, 1.0); _sc_colormap_set_gtk(w, &colormap->yellow,1.0, 1.0, 0.0); _sc_colormap_set_gtk(w, &colormap->napalm,1.0, 0.4, 0.1); _sc_colormap_set_gtk(w, &colormap->windar,0.7, 0.7, 1.0); _sc_colormap_set_gtk(w, &colormap->pcolors[0], 1.0, 0.1, 0.1); _sc_colormap_set_gtk(w, &colormap->pcolors[1], 1.0, 1.0, 0.2); _sc_colormap_set_gtk(w, &colormap->pcolors[2], 0.5, 0.5, 0.5); _sc_colormap_set_gtk(w, &colormap->pcolors[3], 0.2, 1.0, 1.0); _sc_colormap_set_gtk(w, &colormap->pcolors[4], 0.2, 0.2, 1.0); _sc_colormap_set_gtk(w, &colormap->pcolors[5], 1.0, 0.2, 1.0); _sc_colormap_set_gtk(w, &colormap->pcolors[6], 1.0, 1.0, 1.0); _sc_colormap_set_gtk(w, &colormap->pcolors[7], 0.2, 1.0, 0.2); _sc_colormap_set_gtk(w, &colormap->pcolors[8], 0.7, 0.7, 1.0); _sc_colormap_set_gtk(w, &colormap->pcolors[9], 1.0, 0.3, 0.05); sc_color_gradient_init(w->c, colors); } xscorch-0.2.1/sgtk/scolor-gtk.h0000644000175000001440000000322211175116143013304 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/scolor-gtk.h,v 1.8 2009-04-26 17:39:47 jacob Exp $ */ /* xscorch - scolor-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK colormap This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __scolor_gtk_h_included #define __scolor_gtk_h_included #include #include #include #include /* Forward structure definitions */ struct _sc_window_gtk; struct _sc_color; /* Structure for storing allocated colors */ typedef struct _sc_color_gtk { GdkColor gradient[SC_NUM_GRADIENTS][SC_MAX_GRADIENT_SIZE]; GdkColor pcolors[SC_MAX_PLAYERS]; GdkColor black; GdkColor gray; GdkColor white; GdkColor yellow; GdkColor napalm; GdkColor windar; } sc_color_gtk; /* Functions */ sc_color_gtk *sc_colormap_new_gtk(void); void sc_colormap_free_gtk(sc_color_gtk **color); void sc_colormap_alloc_colors_gtk(struct _sc_window_gtk *w); #endif /* __scolor_gtk_h_included */ xscorch-0.2.1/sgtk/sdialog-gtk.h0000644000175000001440000000516411615323560013436 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sdialog-gtk.h,v 1.7 2011-07-31 19:05:20 jacob Exp $ */ /* xscorch - sdialog-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK dialogue helper functions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sdialog_gtk_h_included #define __sdialog_gtk_h_included /* The order of includes does matter! */ #include #include #include #include #include #include /* Tooltips and dialogue helpers */ static inline GtkWidget *tooltip(sc_window_gtk *w, const char *help, GtkWidget *widget) { /* TOOLTIPS changed from an ass to a mule in GTK 2.12 */ if(w->c->options.tooltips) { gtk_widget_set_tooltip_text(widget, help); gtk_widget_set_has_tooltip(widget, TRUE); } else { gtk_widget_set_has_tooltip(widget, FALSE); } return(widget); } static inline void attach_label(ScDialog *dialog, sc_window_gtk *w, const char *help, const char *field, int row) { char buf[SC_GTK_STRING_BUFFER]; sbprintf(buf, sizeof(buf), "%s:", field); sc_dialog_grid_attach(dialog, tooltip(w, help, sc_label_new(buf)), row, 0); } static inline void attach_widget(ScDialog *dialog, sc_window_gtk *w, const char *help, GtkWidget *widget, int row) { sc_dialog_grid_attach(dialog, tooltip(w, help, widget), row, 1); } static inline void attach_option_help(ScDialog *dialog, sc_window_gtk *w, const char *field, const char *help, GtkWidget *widget, int *row) { attach_label (dialog, w, help, field, *row); attach_widget(dialog, w, help, widget, *row); ++(*row); } static inline void attach_option(ScDialog *dialog, sc_window_gtk *w, const char *field, GtkWidget *widget, int *row) { char help[SC_GTK_STRING_BUFFER]; sc_help_text(help, sizeof(help), field); attach_option_help(dialog, w, field, help, widget, row); } #endif /* __sdialog_gtk_h_included */ xscorch-0.2.1/sgtk/seconomy-gtk.c0000644000175000001440000001404511615366346013652 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/seconomy-gtk.c,v 1.17 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - seconomy-gtk.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Economy configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct _sc_economy_setup_data_gtk { sc_config *c; sc_economy_config *ec; double interestrate; bool dynamicinterest; int initialcash; bool computersbuy; bool computersaggressive; bool freemarket; bool lottery; int economyidx; const char **enames; } sc_economy_setup_data_gtk; static void _sc_economy_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_economy_setup_data_gtk *setup) { sc_scoring_info *info; setup->ec->interestrate = setup->interestrate; setup->ec->dynamicinterest = setup->dynamicinterest; setup->ec->initialcash = setup->initialcash; setup->ec->computersbuy = setup->computersbuy; setup->ec->computersaggressive = setup->computersaggressive; setup->ec->freemarket = setup->freemarket; setup->ec->lottery = setup->lottery; /* TEMP HACK - Well, this is ugly, maybe it should be done differently... We could make it sane by reviving old interfaces in seconomy. -JL */ info = sc_registry_find_first(setup->ec->registry, setup->ec->registryclass, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); for(; setup->economyidx > 0; --setup->economyidx) info = sc_registry_find_next(setup->ec->registry, setup->ec->registryclass, info->ident, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); /* Set the new selected economy. */ strcopyb(setup->ec->scoringname, info->name, SC_ECONOMY_MAX_NAME_LEN); #if USE_NETWORK if(SC_NETWORK_SERVER(setup->c)) sc_net_server_send_config(setup->c, setup->c->server); #endif } static int _sc_economy_init_names_gtk(sc_economy_setup_data_gtk *setup) { /* _sc_economy_init_names_gtk Make a list of names, appropriate for the combo box. */ int count, idx; sc_scoring_info *info, *target; /* Find the first economy listed. */ info = sc_registry_find_first(setup->ec->registry, setup->ec->registryclass, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); /* There must exist at least one economy scoring! */ assert(info != NULL); /* Try to find the currently selected scoring so we can hilight it. */ target = sc_scoring_lookup_by_name(setup->ec, setup->ec->scoringname); if(target == NULL) target = info; /* Build a list of economy names, and find the currently selected one. */ count = idx = 0; setup->enames = NULL; while(info != NULL) { if(count % 15 == 0) setup->enames = (const char **)realloc(setup->enames, (count + 16) * sizeof(char *)); setup->enames[count] = info->name; if(info->ident == target->ident) idx = count; ++count; info = sc_registry_find_next(setup->ec->registry, setup->ec->registryclass, info->ident, SC_REGISTRY_FORWARD, SC_REGISTRY_TEST_NULL, 0); } /* The list should be null terminated. */ if(count) setup->enames[count] = NULL; return(idx); } void sc_economy_setup_gtk(sc_window_gtk *w) { sc_economy_config *ec = w->c->economics; sc_economy_setup_data_gtk setup; ScDialog *dialog; int confirm = (SC_NETWORK_AUTH(w->c) ? SC_DIALOG_OK : 0); int row = 0; setup.c = w->c; setup.ec = ec; setup.interestrate = ec->interestrate; setup.dynamicinterest= ec->dynamicinterest; setup.initialcash = ec->initialcash; setup.computersbuy = ec->computersbuy; setup.computersaggressive = ec->computersaggressive; setup.freemarket = ec->freemarket; setup.lottery = ec->lottery; setup.economyidx = _sc_economy_init_names_gtk(&setup); dialog = SC_DIALOG(sc_dialog_new("Economy Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_economy_setup_apply_gtk, &setup); attach_option(dialog, w, "Scoring", sc_link_combo_new(&setup.economyidx, setup.enames), &row); attach_option(dialog, w, "Initial Cash", sc_link_spin_new(&setup.initialcash, 0, SC_ECONOMY_MAX_CASH, SC_ECONOMY_MAX_CASH / 100), &row); attach_option(dialog, w, "Interest Rate", sc_link_spinf_new(&setup.interestrate, 0, SC_ECONOMY_MAX_INTEREST, 0.01), &row); attach_option(dialog, w, "Dynamic Interest", sc_link_check_new(&setup.dynamicinterest), &row); attach_option(dialog, w, "AIs Can Buy", sc_link_check_new(&setup.computersbuy), &row); attach_option(dialog, w, "AIs Buy Aggressively", sc_link_check_new(&setup.computersaggressive), &row); attach_option(dialog, w, "N/A: Free Market", sc_link_check_new(&setup.freemarket), &row); attach_option(dialog, w, "The Lottery", sc_link_check_new(&setup.lottery), &row); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/send-gtk.c0000644000175000001440000001143011175116143012727 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/send-gtk.c,v 1.20 2009-04-26 17:39:47 jacob Exp $ */ /* xscorch - send-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Window painting code for end game/end round This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void _sc_window_end_populate_gtk(sc_window_gtk *w, GtkWidget *console) { char buf[SC_GTK_STRING_BUFFER]; sc_player *p; int deltamoney; int i; int j; for(i = 0; i < w->c->numplayers; ++i) { j = 3; p = w->c->players[i]; deltamoney = p->money - p->oldmoney; sbprintf(buf, sizeof(buf), "%2d %-12s %-16s %3d %3d %3d ", p->index + 1, sc_ai_name(p->aitype), p->name, p->numwins, p->kills, p->suicides); sc_console_write_line(SC_CONSOLE(console), j, i + 2, buf); j += strblenn(buf, SC_GTK_STRING_BUFFER); if(p->killedby >= 0) { sbprintf(buf, sizeof(buf), "%2d ", p->killedby + 1); } else { strcopyb(buf, " ", sizeof(buf)); } sc_console_write_line(SC_CONSOLE(console), j, i + 2, buf); sc_console_highlight_attach(SC_CONSOLE(console), &w->colormap->pcolors[p->index], NULL, FALSE, 3, i + 2, 2, 1); j += strblenn(buf, SC_GTK_STRING_BUFFER); sbprintf(buf, sizeof(buf), "$%-9d %c$%d", p->money, (deltamoney < 0 ? '-' : ' '), abs(deltamoney)); sc_console_write_line(SC_CONSOLE(console), j, i + 2, buf); } } static gboolean _sc_window_end_select_gtk(__libj_unused ScActiveConsole *widget, __libj_unused ScActiveConsoleSpot *spot, sc_window_gtk *w) { sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_unpause(w->c, w->c->game); return(TRUE); } void sc_window_paint_end_round(sc_window *w_) { GtkWidget *console; sc_window_gtk *w = (sc_window_gtk *)w_; char buf[SC_GTK_STRING_BUFFER]; console = sc_window_active_console_new(w, 4, 2, 80, w->c->numplayers + 2, CONSOLE_NORMAL); sbprintf(buf, sizeof(buf), "End of round %d, press [Enter] to continue.", w->c->curround + 1); sc_console_write_line(SC_CONSOLE(console), 0, 0, buf); sc_console_write_line(SC_CONSOLE(console), 3, 1, "# Type Name Wins Kill Suic Xby Money Winnings"); _sc_window_end_populate_gtk(w, console); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(console)); sc_console_write_line(SC_CONSOLE(console), 60, 0, "< Continue >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(console), 60, 0, 12, 1, NULL); g_signal_connect(G_OBJECT(console), "select_spot", (GCallback)_sc_window_end_select_gtk, w); /* focus on this window */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(console)); gtk_widget_grab_focus(GTK_WIDGET(console)); } void sc_window_paint_end_game(sc_window *w_) { GtkWidget *console; sc_window_gtk *w = (sc_window_gtk *)w_; console = sc_window_active_console_new(w, 4, 2, 80, w->c->numplayers + 2, CONSOLE_NORMAL); sc_console_write_line(SC_CONSOLE(console), 0, 0, "End of game, press [Enter] to restart."); sc_console_write_line(SC_CONSOLE(console), 3, 1, "# Type Name Wins Kill Suic Xby Money Winnings"); _sc_window_end_populate_gtk(w, console); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(console)); sc_console_write_line(SC_CONSOLE(console), 60, 0, "< Continue >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(console), 60, 0, 12, 1, NULL); g_signal_connect(G_OBJECT(console), "select_spot", (GCallback)_sc_window_end_select_gtk, w); /* focus on this window */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(console)); gtk_widget_grab_focus(GTK_WIDGET(console)); } xscorch-0.2.1/sgtk/sexplosion-gtk.c0000644000175000001440000005736611175116144014224 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sexplosion-gtk.c,v 1.14 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - sexplosion-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Window painting code, specific to the explosion cache I can't believe I wrote this mess... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include /* Congratulations! You are about to be treated to some pretty repulsive-looking code! You have to understand, the comments are quite intentionally misleading All of them are. You really are better off reading this file, after writing a mangler that strips out all the comments (better keep that copyright, `tho). Then you can attain "understanding" The comments will only hamper. Comprehension is insanity. First, question all boundaries. This code defies the laws of gravity. Keep your hands/feet/etc inside the vehicle at all times. Reading this code can be detrimintal to your health. Abandon all hope, ye who enter here. Batteries not included. Good luck. */ sc_expl_cache_gtk *sc_expl_cache_new_gtk(void) { /* sc_expl_cache_new_gtk Creates a new explosion cache. */ sc_expl_cache_gtk *cache; /* Newly allocated cache */ /* Create the cache */ cache = (sc_expl_cache_gtk *)malloc(sizeof(sc_expl_cache_gtk)); if(cache == NULL) return(NULL); /* Initialise the cache */ cache->fakebitmap = gdk_pixmap_new(NULL, 1, 1, 1); cache->bitmapgc = gdk_gc_new(cache->fakebitmap); cache->cachesize = 0; cache->headptr = 0; /* Return the cache */ return(cache); } void sc_expl_cache_free_gtk(sc_expl_cache_gtk **cache) { /* sc_expl_cache_free_gtk Release the cache, and associated data. */ int i; /* Iterator variable */ /* Sanity check. */ if(cache == NULL || *cache == NULL) return; /* Release pixmaps and bitmaps in cache */ for(i = 0; i < (*cache)->cachesize; ++i) { g_object_unref((*cache)->cache[(*cache)->headptr].pixmap); ++(*cache)->headptr; if((*cache)->headptr >= SC_EXPL_CACHE_SIZE) { (*cache)->headptr = 0; } } /* Releasing all pixmaps, bitmaps... */ /* Release the GC */ g_object_unref((*cache)->bitmapgc); g_object_unref((*cache)->fakebitmap); /* Release the cache memory */ free(*cache); *cache = NULL; } static inline void _sc_expl_cache_draw_points_gtk(GdkImage *image, guint32 pixel, int dx, int dy, int radius) { /* sc_expl_cache_draw_points_gtk Draw the points (cx +/- dx, cy +/- dy), using the GC's specified. */ /* Iterate through the four quadrants to update display */ gdk_image_put_pixel(image, radius - dx, radius - dy, pixel); gdk_image_put_pixel(image, radius - dx, radius + dy, pixel); gdk_image_put_pixel(image, radius + dx, radius - dy, pixel); gdk_image_put_pixel(image, radius + dx, radius + dy, pixel); } static inline void _sc_expl_cache_annihilate_column_rad2_gtk(GdkImage *image, GdkColor *gradient, int gsize, int dx, int dy, int radius, int rad2) { /* sc_expl_cache_annihilate_column_rad2_gtk Annihilate a column of an explosion. (cx,cy) is the center coordinate of the explosion. (dx,dy) is the deltax and deltay that this column begins at -- that is, the column goes from (cx+dx,cy-dy) to (cx+dx,cy+dy). rad2 is the radius, squared, of the entire explosion. Note, colors fall off with the square of the radius; this makes for more "3-D"istic explosions, and also happens to be much faster to calculate. */ int dx2y2; /* dx^2 * y^2, for current value of y */ int tile; /* Tile value for explosion */ int y; /* Current y (offset from cy, y in [0,dy]) */ /* Iteration for all four columns */ y = 0; /* We are starting on the Y axis */ dx2y2 = dx * dx; /* This starts off as x^2, since y=0 */ do { /* Calculate tile code -- any way to optimize this? */ tile = dx2y2 * gsize / rad2; /* Adjust dx2y2 for next value of y */ /* x^2 + y^2 => x^2 + y^2 + y + (y+1) = x^2 + y(y+1) + (y+1) = x^2 + (y+1)^2 */ /* Suggested by JJP */ dx2y2 += (y << 1) | 1; /* Iterate through the four quadrants to update display */ _sc_expl_cache_draw_points_gtk(image, gradient[tile].pixel, dx, y, radius); /* Next value of y (one step farther from central axis) */ ++y; } while(y <= dy); } static inline void _sc_expl_cache_annihilate_column_rad_gtk(GdkImage *image, GdkColor *gradient, int gsize, int dx, int dy, int radius) { /* sc_expl_cache_annihilate_column_rad_gtk Annihilate a column of an explosion. (cx,cy) is the center coordinate of the explosion. (dx,dy) is the deltax and deltay that this column begins at -- that is, the column goes from (cx+dx,cy-dy) to (cx+dx,cy+dy). rad2 is the radius, squared, of the entire explosion. Note, colors fall off linearly with radius, which is used by funky bombs. This is slower to calculate, I would not recommend using this routine with very large explosions. */ /* Life... Dreams... Hope... Where'd they come from... And where are they headed? These things... I am going to destroy! -- Kefka, Fourth Tier, Final Fantasy VI */ int dx2y2; /* dx^2 * y^2, for current value of y */ int tile; /* Tile value for explosion */ int y; /* Current y (offset from cy, y in [0,dy]) */ /* Iteration for all four columns */ y = 0; /* We are starting on the Y axis */ dx2y2 = dx * dx; /* This starts off as x^2, since y=0 */ do { /* Calculate tile code -- any way to optimize this? */ tile = (int)(sqrt(dx2y2) * gsize / radius); /* Adjust dx2y2 for next value of y */ /* x^2 + y^2 => x^2 + y^2 + y + (y+1) = x^2 + y(y+1) + (y+1) = x^2 + (y+1)^2 */ /* Suggested by JJP */ dx2y2 += (y << 1) | 1; /* Iterate through the four quadrants to update display */ _sc_expl_cache_draw_points_gtk(image, gradient[tile].pixel, dx, y, radius); /* Next value of y (one step farther from central axis) */ ++y; } while(y <= dy); } static inline void _sc_expl_cache_annihilate_column_plasmoid_gtk(GdkImage *image, GdkColor *gradient, int gsize, int dx, int dy, int radius, unsigned char *fractal, int fsize) { /* sc_expl_cache_annihilate_column_plasmoid_gtk Annihilate a column of an explosion. (cx,cy) is the center coordinate of the explosion. (dx,dy) is the deltax and deltay that this column begins at -- that is, the column goes from (cx+dx,cy-dy) to (cx+dx,cy+dy). rad2 is the radius, squared, of the entire explosion. Note, colors are selected as a plasmoid, whatever that is. */ int dx2y2; /* dx^2 * y^2, for current value of y */ int tile; /* Tile value for explosion */ int y; /* Current y (offset from cy, y in [0,dy]) */ int radminusdx; /* Value of radius - dx */ int radplusdx; /* Value of radius + dx */ /* Precompute as much as possible. */ radminusdx = radius - dx; radplusdx = radius + dx; /* Iteration for all four columns */ y = 0; /* We are starting on the Y axis */ dx2y2 = dx * dx; /* This starts off as x^2, since y=0 */ do { /* Warning: the division must remain inlined with the rest of the computation; it cannot be lifted out since this is integer-level arithmetic. */ /* Calculate tile code (quadrant 1) */ tile = *(fractal + (radius + y) * fsize + radplusdx) * gsize / 0x100; gdk_image_put_pixel(image, radplusdx, radius + y, gradient[tile].pixel); /* Calculate tile code (quadrant 2) */ tile = *(fractal + (radius + y) * fsize + radminusdx) * gsize / 0x100; gdk_image_put_pixel(image, radminusdx, radius + y, gradient[tile].pixel); /* Calculate tile code (quadrant 3) */ tile = *(fractal + (radius - y) * fsize + radminusdx) * gsize / 0x100; gdk_image_put_pixel(image, radminusdx, radius - y, gradient[tile].pixel); /* Calculate tile code (quadrant 4) */ tile = *(fractal + (radius - y) * fsize + radplusdx) * gsize / 0x100; gdk_image_put_pixel(image, radplusdx, radius - y, gradient[tile].pixel); /* Adjust dx2y2 for next value of y */ /* Suggested by JJP */ dx2y2 += (y << 1) | 1; /* Next value of y (one step farther from central axis) */ ++y; } while(y <= dy); } static void _sc_expl_cache_annihilate_rad2_gtk(GdkImage *image, GdkColor *gradient, int gsize, int radius) { /* sc_expl_annihilate_rad2_gtk Annihilate a region centered at (cx,cy) for a radius r. This function lets colors fall off with the square of the radius. */ int dx; /* Delta X (distance away from cx) - iterator variable */ int dy; /* Delta Y (distance away from cy) for _edge_ of circle */ int rad2; /* Radius squared */ int rad2major2; /* Radius^2 + the major_distance^2 */ int min2thresh; /* Minimum threshold to avoid redrawing columns where dx>dy */ /* DX = major axis, DY = minor axis */ dx = 0; /* DX starts at zero (iterator) */ dy = radius; /* DY is one radius away (edge of circle at cx+dx) */ rad2 = radius * radius; /* Calculate Radius Squared */ rad2major2 = rad2;/* Radius^2 + major^2, running total */ min2thresh = rad2 - dy; /* Minimum threshold before need to redraw edges */ /* TEMP HACK */ /* This is a hack to prevent the orange highlights on explosions. */ /* THIS IS A HACK -- FIXME FOR REAL. */ rad2 += radius + radius + 1; /* Should know that, we are incrementing DX every time. However, if we call the transpose method every time as well, then we will be filling parts of the circle multiple times. Hence the min2thresh variable. */ do { _sc_expl_cache_annihilate_column_rad2_gtk(image, gradient, gsize, dx, dy, radius, rad2); ++dx; rad2major2 -= (dx << 1) - 1; if(rad2major2 <= min2thresh) { _sc_expl_cache_annihilate_column_rad2_gtk(image, gradient, gsize, dy, dx, radius, rad2); --dy; min2thresh -= (dy << 1); } } while(dx <= dy); } static void _sc_expl_cache_annihilate_rad_gtk(GdkImage *image, GdkColor *gradient, int gsize, int radius) { /* sc_expl_annihilate_rad_gtk Annihilate a region centered at (cx,cy) for a radius r. This function lets colors fall off with the square of the radius. */ int dx; /* Delta X (distance away from cx) - iterator variable */ int dy; /* Delta Y (distance away from cy) for _edge_ of circle */ int rad2; /* Radius squared */ int rad2major2; /* Radius^2 + the major_distance^2 */ int min2thresh; /* Minimum threshold to avoid redrawing columns where dx>dy */ /* DX = major axis, DY = minor axis */ dx = 0; /* DX starts at zero (iterator) */ dy = radius; /* DY is one radius away (edge of circle at cx+dx) */ rad2 = radius * radius; /* Calculate Radius Squared */ rad2major2 = rad2;/* Radius^2 + major^2, running total */ min2thresh = rad2 - dy; /* Minimum threshold before need to redraw edges */ /* Should know that, we are incrementing DX every time. However, if we call the transpose method every time as well, then we will be filling parts of the circle multiple times. Hence the min2thresh variable. */ do { _sc_expl_cache_annihilate_column_rad_gtk(image, gradient, gsize, dx, dy, radius); ++dx; rad2major2 -= (dx << 1) - 1; if(rad2major2 <= min2thresh) { _sc_expl_cache_annihilate_column_rad_gtk(image, gradient, gsize, dy, dx, radius); --dy; min2thresh -= (dy << 1); } } while(dx <= dy); } static void _sc_expl_cache_annihilate_plasmoid_gtk(GdkImage *image, GdkColor *gradient, int gsize, int radius) { /* sc_expl_annihilate_plasmoid_gtk Annihilate a region centered at (cx,cy) for a radius r. This function selects colors to form a plasma manifold pattern, whatever that means. */ int dx; /* Delta X (distance away from cx) - iterator variable */ int dy; /* Delta Y (distance away from cy) for _edge_ of circle */ int rad2; /* Radius squared */ int rad2major2; /* Radius^2 + the major_distance^2 */ int min2thresh; /* Minimum threshold to avoid redrawing columns where dx>dy */ unsigned char *fractal; /* */ int fsize; /* Allocate a new fractal. */ fractal = sc_fractal_create(&fsize, radius + radius + 1); if(fractal == NULL) { _sc_expl_cache_annihilate_rad2_gtk(image, gradient, gsize, radius); return; } /* DX = major axis, DY = minor axis */ dx = 0; /* DX starts at zero (iterator) */ dy = radius; /* DY is one radius away (edge of circle at cx+dx) */ rad2 = radius * radius; /* Calculate Radius Squared */ rad2major2 = rad2;/* Radius^2 + major^2, running total */ min2thresh = rad2 - dy; /* Minimum threshold before need to redraw edges */ /* Should know that, we are incrementing DX every time. However, if we call the transpose method every time as well, then we will be filling parts of the circle multiple times. Hence the min2thresh variable. */ do { _sc_expl_cache_annihilate_column_plasmoid_gtk(image, gradient, gsize, dx, dy, radius, fractal, fsize); ++dx; rad2major2 -= (dx << 1) - 1; if(rad2major2 <= min2thresh) { _sc_expl_cache_annihilate_column_plasmoid_gtk(image, gradient, gsize, dy, dx, radius, fractal, fsize); --dy; min2thresh -= (dy << 1); } } while(dx <= dy); free(fractal); } static inline void _sc_expl_cache_annihilate_happy_gtk(sc_window_gtk *w, GdkPixmap *pixmap, int radius) { /* sc_expl_cache_annihilate_happy_gtk It's not a bug... it's a ``feature''... I wonder if anyone has actually found this egg in practice. It's quite fun once it's activated :) */ int size = radius + radius + 1; int eyesize = (radius >> 2) + (radius >> 4); int eyecoff = radius >> 2; GdkGC *gc = gdk_gc_new(pixmap); gdk_gc_set_foreground(gc, &w->colormap->yellow); gdk_draw_arc(pixmap, gc, TRUE, 0, 0, size, size, 0, 360 * 64); gdk_gc_set_foreground(gc, &w->colormap->black); gdk_gc_set_line_attributes(gc, 3, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND); gdk_draw_arc(pixmap, gc, FALSE, 0, 0, size, size, 0, 360 * 64); gdk_draw_arc(pixmap, gc, TRUE, radius - eyecoff - eyesize, radius - eyecoff - eyesize, eyesize, eyesize, 0 * 64, 360 * 64); gdk_draw_arc(pixmap, gc, TRUE, radius + eyecoff, radius - eyecoff - eyesize, eyesize, eyesize, 0 * 64, 360 * 64); gdk_draw_arc(pixmap, gc, FALSE, radius - eyecoff - eyesize, radius + (eyecoff >> 1), (eyecoff + eyesize) << 1, eyesize << 1, 200 * 64, 140 * 64); g_object_unref(gc); } static inline void _sc_expl_cache_annihilate_gtk(sc_window_gtk *w, GdkPixmap *pixmap, int radius, sc_explosion_type type) { /* sc_expl_annihilate_rad_gtk Annihilate a region centered at (cx,cy) for a radius r. This function uses the type parameter to dispatch to the appropriate drawing subfunction. */ GdkImage *image; int size; /* ...wonder why this is here... :) */ if(w->state < 4) { /* Create images */ size = radius + radius + 1; image = gdk_image_new(GDK_IMAGE_FASTEST, gtk_widget_get_visual(w->app), size, size); if(image == NULL) return; /* Draw the appropriate type of explosion. */ switch(type) { case SC_EXPLOSION_NORMAL: _sc_expl_cache_annihilate_rad2_gtk(image, w->colormap->gradient[SC_GRAD_EXPLOSION], w->c->colors->gradsize[SC_GRAD_EXPLOSION], radius); break; case SC_EXPLOSION_PLASMA: _sc_expl_cache_annihilate_plasmoid_gtk(image, w->colormap->gradient[SC_GRAD_EXPLOSION], w->c->colors->gradsize[SC_GRAD_EXPLOSION], radius); break; case SC_EXPLOSION_SPIDER: _sc_expl_cache_annihilate_rad_gtk(image, w->colormap->gradient[SC_GRAD_FUNKY_EXPLOSION], w->c->colors->gradsize[SC_GRAD_FUNKY_EXPLOSION], radius); break; default: /* do nothing */; } /* Which type of explosion to draw? */ /* Commit data to pixmap/bitmap buffers */ gdk_draw_image(pixmap, sc_display_get_gc(SC_DISPLAY(w->screen)), image, 0, 0, 0, 0, size, size); /* Destroy the local images */ g_object_unref(image); } else { _sc_expl_cache_annihilate_happy_gtk(w, pixmap, radius); } } static int _sc_expl_cache_lookup_gtk(sc_window_gtk *w, int radius, sc_explosion_type type) { /* sc_expl_cache_lookup_gtk Lookup an entry in the cache matching this description. If no such entry is found, -1 is returned. */ sc_expl_cache_gtk *cache = w->explcache; /* Cache */ int size; /* Size of cache */ int ptr; /* Current ptr into cache */ /* Determine size and starting pointer */ size = cache->cachesize; ptr = cache->headptr; /* Try to find an explosion matching these characteristics */ while(size > 0) { /* Does this explosion match? */ if(cache->cache[ptr].radius == radius && cache->cache[ptr].type == type) { /* Match found; return its cacheid */ return(ptr); } /* Found a match? */ /* Not a match; advance to next entry in the cache. */ ++ptr; if(ptr >= SC_EXPL_CACHE_SIZE) ptr = 0; --size; } /* Searching for a match... */ /* No matching explosion was found */ return(-1); } int sc_expl_cache_new(sc_window *w_, int radius, sc_explosion_type type) { /* sc_expl_cache_new Creates a new explosion with these characteristics, and returns its cache ID. Note, if an explosion of these characteristics already exists in the cache, then its cache ID will be returned, and no new explosion will be created. */ sc_window_gtk *w = (sc_window_gtk *)w_; /* Window structure */ sc_expl_cache_gtk *cache = w->explcache; /* Cache structure */ sc_expl_cache_entry_gtk *centry; /* An entry in the cache. */ int cacheid; /* Cache ID of a matching explosion */ int size; /* Size (wid/hei) of the pixmap to create. */ /* Try to find this explosion in the cache. */ cacheid = _sc_expl_cache_lookup_gtk(w, radius, type); if(cacheid < 0) { /* No matching explosion found; overwrite the oldest entry in the cache with our new explosion. */ /* TEMP BUG: We really shouldn't overwrite the OLDEST entry; we'd get better performance if we overwrite the LEAST-RECENTLY-USED entry. Need to fix this... */ --cache->headptr; if(cache->headptr < 0) cache->headptr = SC_EXPL_CACHE_SIZE - 1; cacheid = cache->headptr; /* Get the entry for the explosion we are overwriting */ centry = &cache->cache[cacheid]; if(cache->cachesize < SC_EXPL_CACHE_SIZE) { /* Cache wasn't full; this entry is vacant. */ ++cache->cachesize; } else { /* Cache was full; need to release the old pixmaps */ g_object_unref(centry->pixmap); } /* Was cache already full? */ /* Create the new pixmap and bitmap, and set characteristics */ size = radius + radius + 1; centry->pixmap = gdk_pixmap_new(w->app->window, size, size, -1); centry->radius = radius; centry->type = type; /* Draw an explosion into the new pixmap/bitmap. */ _sc_expl_cache_annihilate_gtk(w, centry->pixmap, radius, type); } /* Did explosion already exist in cache? */ /* Return the cache ID of our new explosion */ return(cacheid); } void sc_expl_cache_draw(sc_window *w_, int ptr, int centerx, int centery, int rad) { /* sc_expl_cache_draw Draws the explosion to the screen buffer. */ GdkColor black = { 0, 0x0000, 0x0000, 0x0000 }; GdkColor white = { 1, 0xffff, 0xffff, 0xffff }; sc_window_gtk *w = (sc_window_gtk *)w_;/* Window structure */ sc_expl_cache_entry_gtk *centry = &(w->explcache->cache[ptr]); GdkPixmap *mask; /* Mask to use */ int radius; /* Radius of explosion */ int size; /* Size (wid/hei) of expl */ /* Calculate the screen center coordinates */ radius = centry->radius; centerx = centerx; centery = w->c->fieldheight - centery - 1; if(rad > radius) rad = radius; size = rad + rad + 1; /* Create a new temporary mask */ mask = gdk_pixmap_new(NULL, size, size, 1); if(mask != NULL) { gdk_gc_set_foreground(w->explcache->bitmapgc, &black); gdk_draw_rectangle(mask, w->explcache->bitmapgc, TRUE, 0, 0, size, size); gdk_gc_set_foreground(w->explcache->bitmapgc, &white); gdk_draw_arc(mask, w->explcache->bitmapgc, TRUE, 0, 0, size, size, 0, 360 * 64); } /* Draw the explosion to the screen buffer */ gdk_gc_set_clip_mask(sc_display_get_gc(SC_DISPLAY(w->screen)), mask); gdk_gc_set_clip_origin(sc_display_get_gc(SC_DISPLAY(w->screen)), centerx - rad, centery - rad); gdk_draw_drawable(sc_display_get_buffer(SC_DISPLAY(w->screen)), sc_display_get_gc(SC_DISPLAY(w->screen)), centry->pixmap, radius - rad, radius - rad, centerx - rad, centery - rad, size, size); gdk_gc_set_clip_mask(sc_display_get_gc(SC_DISPLAY(w->screen)), NULL); /* Update drawing */ sc_display_queue_draw(SC_DISPLAY(w->screen), centerx - rad, centery - rad, size, size); /* Uninstall the bitmap */ if(mask != NULL) { g_object_unref(mask); } } xscorch-0.2.1/sgtk/sexplosion-gtk.h0000644000175000001440000000416611175116144014217 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sexplosion-gtk.h,v 1.8 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - sexplosion-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK interface to the explosion cache This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sexplosion_gtk_h_included #define __sexplosion_gtk_h_included /* Includes */ #include #include #include #include /* Define some constants for the characteristics of the cache */ #define SC_EXPL_CACHE_SIZE 48 /* Number of entries in the cache. */ /* Structure describing a single explosion in the cache. */ typedef struct _sc_expl_cache_entry_gtk { GdkPixmap *pixmap; /* Explosion pixmap */ sc_explosion_type type; /* Type of explosion to draw. */ int radius; /* Size of this explosion. */ } sc_expl_cache_entry_gtk; /* Structure holding the explosion cache. */ typedef struct _sc_expl_cache_gtk { sc_expl_cache_entry_gtk cache[SC_EXPL_CACHE_SIZE]; /* Each entry */ int cachesize; /* Size of this cache */ int headptr; /* Pointer to most recent addition */ GdkBitmap *fakebitmap; /* Fake bitmap,needed to create GC */ GdkGC *bitmapgc; /* Graphic context for bitmaps */ } sc_expl_cache_gtk; /* Functions */ sc_expl_cache_gtk *sc_expl_cache_new_gtk(void); void sc_expl_cache_free_gtk(sc_expl_cache_gtk **cache); #endif /* __sexplosion_gtk_h_included */ xscorch-0.2.1/sgtk/sfile-gtk.c0000644000175000001440000000463011175116144013105 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sfile-gtk.c,v 1.15 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - sfile-gtk.c Copyright(c) 2001-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Various file saving utilities This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include typedef struct _sc_file_save { sc_config *c; char name[SC_FILENAME_LENGTH]; } sc_file_save; static void _sc_config_file_save_apply_gtk(__libj_unused ScDialog *dlg, sc_file_save *save) { char buf[0x1000]; reg_set_name(save->c->cfreg, save->name); if(sc_config_file_save(save->c)) { sbprintf(buf, sizeof(buf), "Options saved successfully to \"%s\".", save->name); sc_dialog_message("Options saved", buf); } else { sbprintf(buf, sizeof(buf), "An error occurred during the save of \"%s\".", save->name); sc_dialog_error(buf); } } void sc_config_file_save_gtk(sc_window_gtk *w) { sc_file_save save; ScDialog *dialog; int row = 0; save.c = w->c; strcopyb(save.name, w->c->cfreg->filename, sizeof(save.name)); dialog = SC_DIALOG(sc_dialog_new("Save Options As ...", NULL, SC_DIALOG_OK | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_config_file_save_apply_gtk, &save); attach_option_help(dialog, w, "Save options in file", "Specify the name of a file to save your user configuration to.", sc_link_entry_new(save.name, SC_FILENAME_LENGTH), &row); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/sfont-gtk.c0000644000175000001440000001365011175116144013136 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sfont-gtk.c,v 1.14 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - sfont-gtk.c Copyright(c) 2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Various font dialogues This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include typedef struct _sc_fontsel_data_gtk { GtkWidget *entry; GtkWidget *fontsel; } sc_fontsel_data_gtk; typedef struct _sc_font_data_gtk { sc_window_gtk *w; char fixed_font[SC_FONT_LENGTH]; char italic_fixed_font[SC_FONT_LENGTH]; char bold_fixed_font[SC_FONT_LENGTH]; GtkWidget *fixed_entry; GtkWidget *italic_fixed_entry; GtkWidget *bold_fixed_entry; } sc_font_data_gtk; static void _sc_fontsel_apply_gtk(__libj_unused ScDialog *dlg, sc_fontsel_data_gtk *setup) { char *font; font = gtk_font_selection_get_font_name(GTK_FONT_SELECTION(setup->fontsel)); sc_link_entry_set_text(SC_LINK_ENTRY(setup->entry), font); } static void _sc_fontsel_gtk(const char *title, GtkWidget *entry) { sc_fontsel_data_gtk setup; ScDialog *dialog; const char *font; setup.entry = entry; font = gtk_entry_get_text(GTK_ENTRY(entry)); dialog = SC_DIALOG(sc_dialog_new(title, NULL, SC_DIALOG_OK | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_fontsel_apply_gtk, &setup); setup.fontsel = gtk_font_selection_new(); sc_dialog_grid_attach(dialog, setup.fontsel, 0, 0); gtk_font_selection_set_font_name(GTK_FONT_SELECTION(setup.fontsel), font); /* GTK 2.0 has NO font filter abilities. Numerous (user list) requests to revive this functionality appear to have gone completely unanswered. We will have to wait and hope for it to appear in newer GTK someday... TEMP: That was 2.2 ... now we're at 2.12 ... maybe it's back? -JTL */ sc_dialog_run(dialog); } static void _sc_fontsel_fixed_gtk(__libj_unused GtkWidget *widget, sc_font_data_gtk *fsetup) { _sc_fontsel_gtk("Change Fixed Font", fsetup->fixed_entry); } static void _sc_fontsel_italic_fixed_gtk(__libj_unused GtkWidget *widget, sc_font_data_gtk *fsetup) { _sc_fontsel_gtk("Change Italic Fixed Font", fsetup->italic_fixed_entry); } static void _sc_fontsel_bold_fixed_gtk(__libj_unused GtkWidget *widget, sc_font_data_gtk *fsetup) { _sc_fontsel_gtk("Change Bold Fixed Font", fsetup->bold_fixed_entry); } static void _sc_font_apply_gtk(__libj_unused ScDialog *dlg, sc_font_data_gtk *setup) { sc_window_gtk *w = setup->w; sc_config *c = w->c; strcopyb(c->fixed_font, setup->fixed_font, SC_FONT_LENGTH); strcopyb(c->italic_fixed_font, setup->italic_fixed_font, SC_FONT_LENGTH); strcopyb(c->bold_fixed_font, setup->bold_fixed_font, SC_FONT_LENGTH); sc_dialog_message("Font Update: May Cause Problems!", "Font changes don't take effect immediately on all" " consoles, and the status bar may not be updated correctly during" " a game. Be sure to save your configuration to make any font changes" " permanent."); sc_window_reload_fonts(w); } void sc_font_gtk(sc_window_gtk *w) { GtkWidget *button; int row = 0; sc_config *c = w->c; sc_font_data_gtk setup; ScDialog *dialog; setup.w = w; strcopyb(setup.fixed_font, c->fixed_font, SC_FONT_LENGTH); strcopyb(setup.italic_fixed_font, c->italic_fixed_font, SC_FONT_LENGTH); strcopyb(setup.bold_fixed_font, c->bold_fixed_font, SC_FONT_LENGTH); dialog = SC_DIALOG(sc_dialog_new("Font Selection", NULL, SC_DIALOG_APPLY | SC_DIALOG_OK | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_font_apply_gtk, &setup); sc_dialog_grid_attach(dialog, sc_label_new("Fixed font"), row, 0); setup.fixed_entry = sc_link_entry_new(setup.fixed_font, SC_FONT_LENGTH); sc_dialog_grid_attach(dialog, setup.fixed_entry, row, 1); button = gtk_button_new_with_label(" Change "); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_fontsel_fixed_gtk, &setup); sc_dialog_grid_attach(dialog, button, row, 2); ++row; sc_dialog_grid_attach(dialog, sc_label_new("Italic fixed font"), row, 0); setup.italic_fixed_entry = sc_link_entry_new(setup.italic_fixed_font, SC_FONT_LENGTH); sc_dialog_grid_attach(dialog, setup.italic_fixed_entry, row, 1); button = gtk_button_new_with_label(" Change "); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_fontsel_italic_fixed_gtk, &setup); sc_dialog_grid_attach(dialog, button, row, 2); ++row; sc_dialog_grid_attach(dialog, sc_label_new("Bold fixed font"), row, 0); setup.bold_fixed_entry = sc_link_entry_new(setup.bold_fixed_font, SC_FONT_LENGTH); sc_dialog_grid_attach(dialog, setup.bold_fixed_entry, row, 1); button = gtk_button_new_with_label(" Change "); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_fontsel_bold_fixed_gtk, &setup); sc_dialog_grid_attach(dialog, button, row, 2); ++row; sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/sgraphics-gtk.c0000644000175000001440000001147211175116144013770 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sgraphics-gtk.c,v 1.14 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - sgraphics-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Graphics configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct _sc_graphics_setup_data_gtk { sc_config *c; int fieldwidth; int fieldheight; bool gfxdither; bool gfxanimate; bool gfxfast; bool gfxcompfast; } sc_graphics_setup_data_gtk; static void _sc_graphics_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_graphics_setup_data_gtk *setup) { sc_config *c = setup->c; sc_window_gtk *w = (sc_window_gtk *)c->window; c->graphics.gfxanimate = setup->gfxanimate; c->graphics.gfxfast = setup->gfxfast; c->graphics.gfxcompfast = setup->gfxcompfast; if(c->fieldwidth != setup->fieldwidth || c->fieldheight != setup->fieldheight) { c->graphics.gfxdither = setup->gfxdither; c->fieldwidth = setup->fieldwidth; c->fieldheight = setup->fieldheight; c->maxheight = c->fieldheight - (SC_DEF_FIELD_HEIGHT - SC_DEF_MAX_HEIGHT); /* There went the landbuffer... */ /* Colormap MUST be recalculated before land is regenerated! */ sc_color_gradient_init(c, c->colors); /* Attempt to rebuild land */ sc_land_setup(c->land, c->fieldwidth, c->fieldheight, sc_land_flags(c)); sc_land_generate(c, c->land); /* We just seriously fsck'd things up */ /* Redraw everything */ sc_window_resize(c->window); } else if(c->graphics.gfxdither != setup->gfxdither) { c->graphics.gfxdither = setup->gfxdither; /* Attempt to rebuild land */ sc_land_generate(c, c->land); sc_window_paint(c->window, 0, 0, c->land->width, c->land->height, SC_REGENERATE_LAND | SC_REDRAW_LAND); sc_pixmap_copy_gtk(sc_display_get_buffer(SC_DISPLAY(w->screen)), sc_display_get_gc(SC_DISPLAY(w->screen)), w->logo, w->logo_m, c->land->width - sc_pixmap_width_gtk(w->logo), c->land->height - sc_pixmap_height_gtk(w->logo)); } /* Screen size was changed? */ #if USE_NETWORK if(SC_NETWORK_SERVER(setup->c)) sc_net_server_send_config(setup->c, setup->c->server); #endif } void sc_graphics_setup_gtk(sc_window_gtk *w) { sc_config *c = w->c; sc_graphics_setup_data_gtk setup; ScDialog *dialog; GtkWidget *button; int confirm = (SC_NETWORK_AUTH(c) ? SC_DIALOG_OK | SC_DIALOG_APPLY : 0); int row = 0; setup.c = c; setup.fieldwidth = c->fieldwidth; setup.fieldheight = c->fieldheight; setup.gfxdither = c->graphics.gfxdither; setup.gfxanimate = c->graphics.gfxanimate; setup.gfxfast = c->graphics.gfxfast; setup.gfxcompfast = c->graphics.gfxcompfast; dialog = SC_DIALOG(sc_dialog_new("Graphics Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_graphics_setup_apply_gtk, &setup); attach_option(dialog, w, "Screen Width", sc_link_spin_new(&setup.fieldwidth, SC_MIN_FIELD_WIDTH, SC_MAX_FIELD_WIDTH, 8), &row); attach_option(dialog, w, "Screen Height", sc_link_spin_new(&setup.fieldheight, SC_MIN_FIELD_HEIGHT, SC_MAX_FIELD_HEIGHT, 8), &row); attach_option(dialog, w, "Dithering", sc_link_check_new(&setup.gfxdither), &row); attach_option(dialog, w, "Animation", sc_link_check_new(&setup.gfxanimate), &row); attach_option(dialog, w, "Graphics Are Fast", sc_link_check_new(&setup.gfxfast), &row); attach_option(dialog, w, "Computers Are Fast", sc_link_check_new(&setup.gfxcompfast), &row); button = gtk_button_new_with_label(" Setup Fonts "); g_signal_connect_swapped(G_OBJECT(button), "clicked", G_CALLBACK(sc_font_gtk), w); /*swapped args for sc_font_gtk */ sc_dialog_grid_attach(dialog, button, row++, 1); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/sgtk.h0000644000175000001440000000345611175116144012202 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sgtk.h,v 1.25 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - sgtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Generic GTK header This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sgtk_h_included #define __sgtk_h_included /* This file implies xscorch.h. */ #include #ifndef __ALLOW_DEPRECATED_GDK__ /* For reasons beyond my comprehension, they deprecated this in 2.0 */ #define gdk_color_black(cmap, color) \ do { \ (color)->red = 0; \ (color)->green = 0; \ (color)->blue = 0; \ gdk_colormap_alloc_color((cmap), (color), FALSE, TRUE); \ } while(0) #endif /* __ALLOW_DEPRECATED_GDK__ undefined? */ /* Debugging constants */ #define SC_GTK_DEBUG_GTK 0 #define SC_GTK_DEBUG_PAINT 0 /* Disable deprecated GTK 2.0 interfaces, if applicable */ #if !defined(__ALLOW_DEPRECATED_GTK__) #define GTK_DISABLE_DEPRECATED #endif #if !defined(__ALLOW_DEPRECATED_GDK__) #define GDK_DISABLE_DEPRECATED #endif #endif /* __sgtk_h_included */ xscorch-0.2.1/sgtk/simage-gtk.c0000644000175000001440000000325411175116144013251 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/simage-gtk.c,v 1.7 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - simage-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK interface to image drawing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include inline gint sc_pixmap_width_gtk(GdkPixmap *pix) { gint width; width = 0; gdk_drawable_get_size(pix, &width, NULL); return(width); } inline gint sc_pixmap_height_gtk(GdkPixmap *pix) { gint height; height = 0; gdk_drawable_get_size(pix, NULL, &height); return(height); } void sc_pixmap_copy_gtk(GdkPixmap *dest, GdkGC *gc, GdkPixmap *src, GdkBitmap *mask, int dx, int dy) { gdk_gc_set_clip_origin(gc, dx, dy); gdk_gc_set_clip_mask(gc, mask); gdk_draw_drawable(dest, gc, src, 0, 0, dx, dy, sc_pixmap_width_gtk(src), sc_pixmap_height_gtk(src)); gdk_gc_set_clip_mask(gc, NULL); } xscorch-0.2.1/sgtk/simage-gtk.h0000644000175000001440000000237411175116144013260 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/simage-gtk.h,v 1.6 2009-04-26 17:39:48 jacob Exp $ */ /* xscorch - simage-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK interface to image drawing This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __simage_gtk_h_included #define __simage_gtk_h_included #include #include gint sc_pixmap_width_gtk(GdkPixmap *pix); gint sc_pixmap_height_gtk(GdkPixmap *pix); void sc_pixmap_copy_gtk(GdkPixmap *dest, GdkGC *gc, GdkPixmap *src, GdkBitmap *mask, int dx, int dy); #endif /* __simage_gtk_h_included */ xscorch-0.2.1/sgtk/sinventory-gtk.c0000644000175000001440000004436211615366346014243 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sinventory-gtk.c,v 1.46 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - sinventory-gtk.c Copyright(c) 2000-2004 Justin David Smith Copyright(c) 2001-2004 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Player configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Alter this constant at risk of total annihilation. */ #define SC_MIN_WINDOW_SIZE 10 typedef struct _sc_inventory_gtk { sc_window_gtk *w; /* Backpointer to main window */ sc_player *p; /* Inventory is for this player */ GtkWidget *infopane; /* Top panel, which has name */ GtkWidget *weaponpane; /* Weapons panel */ GtkWidget *accessorypane; /* Accessories panel */ GtkWidget *invinfopane; /* Bottom information panel */ } sc_inventory_gtk; static void _sc_inventory_info_paint_gtk(sc_inventory_gtk *inv) { /* sc_inventory_info_paint_gtk Paints the inventory window with player name, budget, etc. */ char buf[SC_GTK_STRING_BUFFER]; sbprintf(buf, sizeof(buf), "Inventory for player %-17s $%-9d Round #%-2d (%-2d remaining)", inv->p->name, inv->p->money, inv->w->c->curround + 2, inv->w->c->numrounds - inv->w->c->curround - 1); sc_console_write_line(SC_CONSOLE(inv->infopane), 0, 0, buf); } static void _sc_inventory_weapon_paint_gtk(sc_inventory_gtk *inv) { /* sc_inventory_weapon_paint_gtk Paint the weapons window pane. */ int count; /* Number of weapons to display */ int index; /* Current weapon index/iterator */ sc_weapon_config *wc; /* Weapon configuration data */ const sc_weapon_info *info; /* Data on the current weapon */ char buf[SC_GTK_STRING_BUFFER]; /* Arbitrary text buffer */ char less, great; /* Can buy/sell indicators */ /* Get the weapon lists */ wc = inv->w->c->weapons; /* Deactivate any highlighting in the weapon panel */ sc_console_highlight_detach_all(SC_CONSOLE(inv->weaponpane)); /* Iterate through the list of weapons */ count = sc_weapon_count(wc, SC_WEAPON_LIMIT_ALL); info = sc_weapon_first(wc, SC_WEAPON_LIMIT_ALL); for(index = 0; index < count; ++index) { /* Get data about this weapon */ less = (sc_inventory_can_sell_weapon(inv->p, info) ? '<' : ' '); great = (sc_inventory_can_buy_weapon(inv->p, info, SC_INVENTORY_INFINITE) ? '>' : ' '); sbprintf(buf, sizeof(buf), " %c %-17s %2d/$%-7d %2d %c", less, info->name, info->bundle, info->price, info->inventories[inv->p->index], great); /* Display the weapon data. If the player's budget currently does not allow them to buy or sell, or the inventory constraints kick in, then disable the item. */ sc_console_write_line(SC_CONSOLE(inv->weaponpane), 0, index, buf); if(less == ' ' && great == ' ') { sc_console_highlight_attach_disabled(SC_CONSOLE(inv->weaponpane), 0, index, sc_console_get_width(SC_CONSOLE(inv->weaponpane)), 1); } /* Disabling the item? */ info = sc_weapon_next(wc, info, SC_WEAPON_LIMIT_ALL); } /* Iterate through weapons */ } static void _sc_inventory_accessory_paint_gtk(sc_inventory_gtk *inv) { /* sc_inventory_accessory_paint_gtk Paints the accessories pane. */ int count; /* Number of accessories to display */ int index; /* Current accessory index/iterator */ sc_accessory_config *ac; /* Accessory configuration data */ const sc_accessory_info *info; /* Data on the current accessory */ char buf[SC_GTK_STRING_BUFFER]; /* Arbitrary text buffer */ char less, great; /* Can buy/sell indicators */ /* Get the accessory lists */ ac = inv->w->c->accessories; /* Deactivate any highlighting in the accessory panel */ sc_console_highlight_detach_all(SC_CONSOLE(inv->accessorypane)); /* Iterate through the list of accessories */ count = sc_accessory_count(ac, SC_ACCESSORY_LIMIT_ALL); info = sc_accessory_first(ac, SC_ACCESSORY_LIMIT_ALL); for(index = 0; index < count; ++index) { /* Get data about this accessory */ less = (sc_inventory_can_sell_accessory(inv->p, info) ? '<' : ' '); great = (sc_inventory_can_buy_accessory(inv->p, info, SC_INVENTORY_INFINITE) ? '>' : ' '); sbprintf(buf, sizeof(buf), " %c %-17s %2d/$%-7d %2d %c", less, info->name, info->bundle, info->price, info->inventories[inv->p->index], great); /* Display the accessory data. If the player's budget currently does not allow them to buy or sell, or the inventory constraints kick in, then disable the item. */ sc_console_write_line(SC_CONSOLE(inv->accessorypane), 0, index, buf); if(less == ' ' && great == ' ') { sc_console_highlight_attach_disabled(SC_CONSOLE(inv->accessorypane), 0, index, sc_console_get_width(SC_CONSOLE(inv->accessorypane)), 1); } /* Disabling the item? */ info = sc_accessory_next(ac, info, SC_ACCESSORY_LIMIT_ALL); } /* Iterate through accessories */ } static gboolean _sc_inventory_weapon_key_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventKey *event, sc_inventory_gtk *inv) { /* sc_inventory_weapon_key_gtk User hit a key in the weapons panel; process it and return TRUE if the key has been processed by this function. */ sc_weapon_info *info = (sc_weapon_info *)spot->data; switch(event->keyval) { case GDK_Right: case GDK_KP_Right: sc_inventory_buy_weapon(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); case GDK_Left: case GDK_KP_Left: sc_inventory_sell_weapon(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); } return(FALSE); } static gboolean _sc_inventory_accessory_key_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventKey *event, sc_inventory_gtk *inv) { /* sc_inventory_accessory_key_gtk User hit a key in the accessory panel; process it and return TRUE if the key has been processed by this function. */ sc_accessory_info *info = (sc_accessory_info *)spot->data; switch(event->keyval) { case GDK_Right: case GDK_KP_Right: sc_inventory_buy_accessory(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); case GDK_Left: case GDK_KP_Left: sc_inventory_sell_accessory(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); } return(FALSE); } static gboolean _sc_inventory_weapon_button_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventButton *event, sc_inventory_gtk *inv) { /* sc_inventory_weapon_button_gtk User clicked in the weapon panel; process it and return TRUE if the key has been processed by this function. */ sc_weapon_info *info = (sc_weapon_info *)spot->data; /* Make sure this is a SINGLE click event */ if(event->type != GDK_BUTTON_PRESS) return(FALSE); switch(event->button) { case 1: /* Left mouse */ sc_inventory_buy_weapon(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); case 3: /* Right mouse */ sc_inventory_sell_weapon(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); } return(FALSE); } static gboolean _sc_inventory_accessory_button_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventButton *event, sc_inventory_gtk *inv) { /* sc_inventory_accessory_button_gtk User clicked in the accessory panel; process it and return TRUE if the key has been processed by this function. */ sc_accessory_info *info = (sc_accessory_info *)spot->data; /* Make sure this is a SINGLE click event */ if(event->type != GDK_BUTTON_PRESS) return(FALSE); switch(event->button) { case 1: /* Left mouse */ sc_inventory_buy_accessory(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); case 3: /* Right mouse */ sc_inventory_sell_accessory(inv->p, info); _sc_inventory_info_paint_gtk(inv); _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); return(TRUE); } return(FALSE); } static gboolean _sc_inventory_weapon_enter_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, sc_inventory_gtk *inv) { /* sc_inventory_weapon_enter_gtk */ char buf[SC_GTK_STRING_BUFFER]; const sc_weapon_config *wc = inv->w->c->weapons; const sc_weapon_info *info = (const sc_weapon_info *)spot->data; /* Display its info */ sc_weapon_info_line(wc, info, buf, sizeof(buf)); sc_console_write_line(SC_CONSOLE(inv->invinfopane), 0, 0, buf); if(info->description != NULL) { sc_console_write_line(SC_CONSOLE(inv->invinfopane), 0, 1, info->description); } return(FALSE); } static gboolean _sc_inventory_accessory_enter_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, sc_inventory_gtk *inv) { /* sc_inventory_accessory_enter_gtk */ char buf[SC_GTK_STRING_BUFFER]; const sc_accessory_config *ac = inv->w->c->accessories; const sc_accessory_info *info = (const sc_accessory_info *)spot->data; /* Display its info */ sc_accessory_info_line(ac, info, buf, sizeof(buf)); sc_console_write_line(SC_CONSOLE(inv->invinfopane), 0, 0, buf); if(info->description != NULL) { sc_console_write_line(SC_CONSOLE(inv->invinfopane), 0, 1, info->description); } return(FALSE); } static gboolean _sc_inventory_info_leave_gtk(__libj_unused ScActiveConsole *cons, __libj_unused ScActiveConsoleSpot *spot, sc_inventory_gtk *inv) { /* sc_inventory_info_leave_gtk */ /* Clear the info line */ sc_console_clear_line(SC_CONSOLE(inv->invinfopane), 0); sc_console_clear_line(SC_CONSOLE(inv->invinfopane), 1); return(FALSE); } static gboolean _sc_inventory_continue_gtk(__libj_unused ScActiveConsole *cons, __libj_unused ScActiveConsoleSpot *spot, sc_inventory_gtk *inv) { /* sc_inventory_continue_gtk User has closed the inventory window. */ sc_status_message((sc_window *)inv->w, ""); sc_display_console_detach_all(SC_DISPLAY(inv->w->screen)); sc_game_set_state_asap(inv->w->c->game, SC_STATE_INVENTORY_PL_DONE); free(inv); return(TRUE); } static void _sc_inventory_create_gtk(sc_window_gtk *w, sc_player *p) { /* sc_inventory_create_gtk Construct the inventory window for given player. */ sc_inventory_gtk *inv; int windowheight; int i; /* Weapons */ int wpcount; sc_weapon_config *wc = w->c->weapons; sc_weapon_info *wpinfo = sc_weapon_first(wc, SC_WEAPON_LIMIT_ALL); /* Accessories */ int account; sc_accessory_config *ac = w->c->accessories; sc_accessory_info *acinfo = sc_accessory_first(ac, SC_ACCESSORY_LIMIT_ALL); /* Compute the window size */ windowheight = w->c->fieldheight / sc_console_get_row_height(SC_CONSOLE(w->status)) - 16; if(windowheight < SC_MIN_WINDOW_SIZE) windowheight = SC_MIN_WINDOW_SIZE; /* How many weapons/accessories, so we can decide height of panes? */ wpcount = sc_weapon_count(w->c->weapons, SC_WEAPON_LIMIT_ALL); account = sc_accessory_count(w->c->accessories, SC_ACCESSORY_LIMIT_ALL); inv = (sc_inventory_gtk *)malloc(sizeof(sc_inventory_gtk)); inv->w = w; inv->p = p; /* Construct the info, weapons, and accessories panels. */ inv->weaponpane = sc_window_active_console_new(w, 4, 7, 40, windowheight, CONSOLE_NORMAL); inv->accessorypane = sc_window_active_console_new(w, 50, 7, 40, windowheight, CONSOLE_NORMAL); inv->infopane = sc_window_active_console_new(w, 4, 2, 86, 2, CONSOLE_NORMAL); /* Weapons and accessories maintain offscreen buffers for scrolling */ sc_console_buffer_size(SC_CONSOLE(inv->weaponpane), 40, wpcount); sc_console_buffer_size(SC_CONSOLE(inv->accessorypane), 40, account); /* Construct the bottom informational console. */ inv->invinfopane = sc_window_console_new(w, 4, windowheight + 10, 86, 4, CONSOLE_NORMAL); sc_console_highlight_attach(SC_CONSOLE(inv->invinfopane), &w->colormap->white, NULL, FALSE, 0, 0, sc_console_get_width(SC_CONSOLE(inv->invinfopane)), 2); sc_console_write_line(SC_CONSOLE(inv->invinfopane), 0, 2, "Keyboard: [Right] buys a bundle, [Left] sells, and [Tab]/[Up]/[Down] navigate."); sc_console_write_line(SC_CONSOLE(inv->invinfopane), 0, 3, "Mouse: [Left click] buys, [Right click] sells. Press [Enter] when you're done."); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(inv->invinfopane)); /* Hook up the various callbacks and add hotspots for each weapon which is in the panel. */ g_signal_connect_after(G_OBJECT(inv->weaponpane), "key_press_spot", (GCallback)_sc_inventory_weapon_key_gtk, inv); g_signal_connect_after(G_OBJECT(inv->weaponpane), "button_press_spot", (GCallback)_sc_inventory_weapon_button_gtk, inv); g_signal_connect_after(G_OBJECT(inv->weaponpane), "enter_spot", (GCallback)_sc_inventory_weapon_enter_gtk, inv); g_signal_connect_after(G_OBJECT(inv->weaponpane), "leave_spot", (GCallback)_sc_inventory_info_leave_gtk, inv); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(inv->weaponpane)); for(i = 0; i < wpcount; ++i) { sc_active_console_add_row_spot(SC_ACTIVE_CONSOLE(inv->weaponpane), i, wpinfo); wpinfo = sc_weapon_next(wc, wpinfo, SC_WEAPON_LIMIT_ALL); } /* Hook up the various callbacks and add hotspots for each accessory which is in the panel. */ g_signal_connect_after(G_OBJECT(inv->accessorypane), "key_press_spot", (GCallback)_sc_inventory_accessory_key_gtk, inv); g_signal_connect_after(G_OBJECT(inv->accessorypane), "button_press_spot", (GCallback)_sc_inventory_accessory_button_gtk, inv); g_signal_connect_after(G_OBJECT(inv->accessorypane), "enter_spot", (GCallback)_sc_inventory_accessory_enter_gtk, inv); g_signal_connect_after(G_OBJECT(inv->accessorypane), "leave_spot", (GCallback)_sc_inventory_info_leave_gtk, inv); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(inv->accessorypane)); for(i = 0; i < account; ++i) { sc_active_console_add_row_spot(SC_ACTIVE_CONSOLE(inv->accessorypane), i, acinfo); acinfo = sc_accessory_next(ac, acinfo, SC_ACCESSORY_LIMIT_ALL); } /* Display the panes, and hookup miscellaneous signals. */ sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(inv->infopane)); sc_console_set_foreground(SC_CONSOLE(inv->infopane), &w->colormap->pcolors[p->index]); sc_console_write_line(SC_CONSOLE(inv->infopane), 70, 1, "< Continue >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(inv->infopane), 70, 1, 12, 1, NULL); g_signal_connect_after(G_OBJECT(inv->infopane), "select_spot", (GCallback)_sc_inventory_continue_gtk, inv); /* Paint every pane. */ _sc_inventory_weapon_paint_gtk(inv); _sc_inventory_accessory_paint_gtk(inv); _sc_inventory_info_paint_gtk(inv); /* Focus on the weapon pane */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(inv->infopane)); gtk_widget_grab_focus(GTK_WIDGET(inv->weaponpane)); } void sc_window_inventory(sc_window *w_, sc_player *p) { /* sc_window_inventory Interface function for obtaining inventory (purchases and sales) from the specified player. Usually we do all players in order, at the beginning of every round. */ sc_window_gtk *w = (sc_window_gtk *)w_; sc_display_console_detach_all(SC_DISPLAY(w->screen)); _sc_inventory_create_gtk(w, p); } xscorch-0.2.1/sgtk/sland-gtk.c0000644000175000001440000000726411175116145013113 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sland-gtk.c,v 1.14 2009-04-26 17:39:49 jacob Exp $ */ /* xscorch - sland-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Landscape configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct _sc_land_setup_data_gtk { sc_config *c; sc_window_gtk *w; sc_land *land; int skyidx; bool hostileenv; int generatoridx; double bumpiness; } sc_land_setup_data_gtk; static void _sc_land_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_land_setup_data_gtk *setup) { sc_land *land = setup->land; land->sky = sc_land_sky_types()[setup->skyidx]; land->hostileenv = setup->hostileenv; land->generator = sc_land_generator_types()[setup->generatoridx]; land->bumpiness = setup->bumpiness; sc_land_generate(setup->w->c, land); sc_window_paint((sc_window *)setup->w, 0, 0, land->width, land->height, SC_REGENERATE_LAND | SC_REDRAW_LAND); sc_pixmap_copy_gtk(sc_display_get_buffer(SC_DISPLAY(setup->w->screen)), sc_display_get_gc(SC_DISPLAY(setup->w->screen)), setup->w->logo, setup->w->logo_m, land->width - sc_pixmap_width_gtk(setup->w->logo), land->height - sc_pixmap_height_gtk(setup->w->logo)); #if USE_NETWORK if(SC_NETWORK_SERVER(setup->c)) sc_net_server_send_config(setup->c, setup->c->server); #endif } void sc_land_setup_gtk(sc_window_gtk *w) { sc_land *land = w->c->land; sc_land_setup_data_gtk setup; ScDialog *dialog; int confirm = (SC_NETWORK_AUTH(w->c) ? SC_DIALOG_OK | SC_DIALOG_APPLY : 0); int row = 0; setup.c = w->c; setup.w = w; setup.land = land; setup.hostileenv = land->hostileenv; setup.generatoridx= 0; setup.bumpiness = land->bumpiness; setup.skyidx = 0; while(land->sky != sc_land_sky_types()[setup.skyidx]) ++setup.skyidx; while(land->generator != sc_land_generator_types()[setup.generatoridx]) ++setup.generatoridx; dialog = SC_DIALOG(sc_dialog_new("Landscape Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_land_setup_apply_gtk, &setup); attach_option(dialog, w, "Land Generator", sc_link_combo_new(&setup.generatoridx, sc_land_generator_names()), &row); attach_option(dialog, w, "Bumpiness", sc_link_spinf_new(&setup.bumpiness, 0, SC_LAND_BUMPINESS_MAX, 0.1), &row); attach_option(dialog, w, "Sky", sc_link_combo_new(&setup.skyidx, sc_land_sky_names()), &row); attach_option(dialog, w, "N/A: Hostile Environment", sc_link_check_new(&setup.hostileenv), &row); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/slottery-gtk.c0000644000175000001440000001122511615366346013700 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/slottery-gtk.c,v 1.15 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - slottery-gtk.c Copyright(c) 2001-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Lottery results screen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static gboolean _sc_window_lottery_close_gtk(__libj_unused GtkWidget *widget, __libj_unused ScActiveConsoleSpot *spot, sc_window_gtk *w) { /* _sc_window_lottery_close_gtk Advance on to the round proper. */ sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_set_state_now(w->c, w->c->game, SC_STATE_TURN_BEGIN); return(TRUE); } static gboolean _sc_window_lottery_key_gtk(__libj_unused GtkWidget *widget, __libj_unused ScActiveConsoleSpot *spot, GdkEventKey *key, sc_window_gtk *w) { /* _sc_window_lottery_key_gtk Handle keystrokes. Advance on to the round proper. */ switch(key->keyval) { case GDK_Return: case GDK_KP_Enter: case GDK_Escape: sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_set_state_now(w->c, w->c->game, SC_STATE_TURN_BEGIN); return(TRUE); } return(FALSE); } void sc_window_lottery_result(sc_window *w_, bool showstake) { /* sc_window_lottery_result Paste up a window describing the result of the lottery. */ sc_window_gtk *w = (sc_window_gtk *)w_; char buf[SC_GTK_STRING_BUFFER]; GtkWidget *console; /* Make sure there's something to display. */ if(w->c->lottery == NULL || w->c->lottery->winner == NULL) { printf("Warning: called sc_window_lottery_result with no winners!\n"); sc_game_set_state_now(w->c, w->c->game, SC_STATE_TURN_BEGIN); return; } /* Create a new console window. x y w h */ console = sc_window_active_console_new(w, 8, 4, 36, 7, CONSOLE_NORMAL); /* Display the title, highlighted. */ sc_console_write_line(SC_CONSOLE(console), 10, 0, "Lottery Winner!"); sc_console_highlight_attach(SC_CONSOLE(console), &w->colormap->white, NULL, TRUE, 10, 0, 15, 1); /* Show the winner's name. */ sbprintf(buf, sizeof(buf), "%s won the lottery!", w->c->lottery->winner->name); sc_console_write_line(SC_CONSOLE(console), 0, 2, buf); /* If we've been instructed to, show the stake. */ if(showstake) { sbprintf(buf, sizeof(buf), "You just received a bundle of:"); sc_console_write_line(SC_CONSOLE(console), 0, 3, buf); sbprintf(buf, sizeof(buf), w->c->lottery->stake->name); sc_console_write_line(SC_CONSOLE(console), 0, 4, buf); } /* Tell them how to exit this display. */ sc_console_write_line(SC_CONSOLE(console), 0, 6, "Press [Enter] to close"); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(console)); /* Display the close button. */ sc_console_write_line(SC_CONSOLE(console), 27, 6, "< Close >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(console), 27, 6, 9, 1, NULL); /* Connect the exit methods. */ g_signal_connect_after(G_OBJECT(console), "key_press_spot", (GCallback)_sc_window_lottery_key_gtk, w); g_signal_connect_after(G_OBJECT(console), "select-spot", (GCallback)_sc_window_lottery_close_gtk, w); /* focus on this window */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(console)); gtk_widget_grab_focus(GTK_WIDGET(console)); } xscorch-0.2.1/sgtk/smainmenu-gtk.c0000644000175000001440000001263711175116145014006 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/smainmenu-gtk.c,v 1.23 2009-04-26 17:39:49 jacob Exp $ */ /* xscorch - smainmenu-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Main menu console for scorch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include /* Various actions we may take on main menu */ #define SC_ACTION_PLAYER 1 #define SC_ACTION_ECONOMY 2 #define SC_ACTION_PHYSICS 3 #define SC_ACTION_LAND 4 #define SC_ACTION_WEAPONS 5 #define SC_ACTION_GRAPHICS 6 #define SC_ACTION_OPTIONS 7 #define SC_ACTION_AI 8 #define SC_ACTION_SOUND 9 #define SC_ACTION_SAVE 10 #define SC_ACTION_BEGIN 11 #define SC_ACTION_QUIT 12 static gboolean _sc_main_menu_action_gtk(sc_window_gtk *w, gint row) { switch(row) { case SC_ACTION_PLAYER: sc_player_setup_gtk(w); return(TRUE); case SC_ACTION_ECONOMY: sc_economy_setup_gtk(w); return(TRUE); case SC_ACTION_PHYSICS: sc_physics_setup_gtk(w); return(TRUE); case SC_ACTION_LAND: sc_land_setup_gtk(w); return(TRUE); case SC_ACTION_WEAPONS: sc_weapons_setup_gtk(w); return(TRUE); case SC_ACTION_OPTIONS: sc_options_setup_gtk(w); return(TRUE); case SC_ACTION_GRAPHICS: sc_graphics_setup_gtk(w); return(TRUE); case SC_ACTION_AI: sc_ai_controller_setup_gtk(w); return(TRUE); case SC_ACTION_SOUND: sc_sound_setup_gtk(w); return(TRUE); case SC_ACTION_SAVE: sc_config_file_save_gtk(w); return(TRUE); case SC_ACTION_BEGIN: if(sc_config_okay_to_begin(w->c)) { sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_set_state_now(w->c, w->c->game, SC_STATE_GAME_BEGIN); } return(TRUE); case SC_ACTION_QUIT: gtk_main_quit(); return(TRUE); default: return(FALSE); } } static gboolean _sc_main_menu_select_gtk(__libj_unused ScActiveConsole *cons, ScActiveConsoleSpot *spot, sc_window_gtk *w) { return(_sc_main_menu_action_gtk(w, spot->y)); } void sc_window_main_menu(sc_window *w_) { sc_window_gtk *w = (sc_window_gtk *)w_; static const char *mainmenu[] = { "XScorch Options:", " Setup Players/Rounds", " Setup Economics", " Setup Physics", " Setup Landscape", " Setup Weapons", " Setup Graphics", " Setup Gameplay Options", " Setup AI Controller", " Setup Sound Support", " Save Options", " Begin Game", " Exit XScorch", "You may use mouse or arrow", "keys to select menu options.", NULL }; const char **current; GtkWidget *console; /* Detach any currently visible consoles */ sc_display_console_detach_all(SC_DISPLAY(w->screen)); /* Setup the background image */ sc_window_paint_blank(w_); sc_window_paint(w_, 0, 0, w->c->fieldwidth, w->c->fieldheight, SC_REGENERATE_LAND | SC_REDRAW_LAND); sc_pixmap_copy_gtk(sc_display_get_buffer(SC_DISPLAY(w->screen)), sc_display_get_gc(SC_DISPLAY(w->screen)), w->logo, w->logo_m, w->c->fieldwidth - sc_pixmap_width_gtk(w->logo), w->c->fieldheight - sc_pixmap_height_gtk(w->logo)); /* Put strings into menu; activate the relevant rows */ console = sc_window_active_console_new(w, 4, 2, 30, 15, CONSOLE_NORMAL); for(current = mainmenu; *current != NULL; ++current) { sc_console_write_line(SC_CONSOLE(console), 0, current - mainmenu, *current); if(**current == ' ') { /* We assume this line is a menu entry, if indented */ sc_active_console_add_row_spot(SC_ACTIVE_CONSOLE(console), current - mainmenu, NULL); } } /* Must be connected after default handler is run */ g_signal_connect_after(G_OBJECT(console), "select_spot", (GCallback)_sc_main_menu_select_gtk, w); g_object_set_data(G_OBJECT(console), "user_data", w); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(console)); /* Setup the general interface */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(console)); gtk_widget_grab_focus(GTK_WIDGET(console)); } xscorch-0.2.1/sgtk/smenu-gtk.c0000644000175000001440000003341711615366346013151 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/smenu-gtk.c,v 1.23 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - smenu-gtk.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2009 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ GTK menus for xscorch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void _sc_action_game_restart_gtk(sc_window_gtk *w) { sc_game_pause(w->c, w->c->game); if(sc_dialog_query("Resign Game?", "Are you sure you want to RESIGN this game?")) { sc_config_init_game(w->c); } sc_game_unpause(w->c, w->c->game); } static void _sc_action_game_pause_gtk(sc_window_gtk *w) { sc_game_pause(w->c, w->c->game); sc_dialog_message("Game Paused", "Game paused. Click `Ok' to unpause the game"); sc_game_unpause(w->c, w->c->game); } static void _sc_action_game_exit_gtk(__libj_unused sc_window_gtk *w) { gtk_main_quit(); } static void _sc_action_help_manual_gtk(sc_window_gtk *w) { sc_dialog_text_buffer("Xscorch manual", data_xscorch_txt, w->fixed_font, w->italic_fixed_font, w->bold_fixed_font); } static void _sc_action_help_license_gtk(sc_window_gtk *w) { sc_dialog_text_buffer("GNU General Public License", data_copying_txt, w->fixed_font, w->italic_fixed_font, w->bold_fixed_font); } static void _sc_action_help_about_gtk(__libj_unused sc_window_gtk *w) { sc_dialog_message("About XScorch", g_convert_with_fallback("XScorch version " VERSION "\n" SC_COPYRIGHT_NOTICE "\nContributors:\n" SC_CONTRIBUTORS_NOTICE, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL, NULL)); } #if USE_NETWORK static void _sc_action_network_server_gtk(sc_window_gtk *w) { sc_network_server_gtk(w); sc_window_update_menus_gtk(w); } static void _sc_action_network_client_gtk(sc_window_gtk *w) { sc_network_client_gtk(w); sc_window_update_menus_gtk(w); } static void _sc_action_network_disconnect_gtk(sc_window_gtk *w) { if(w->c->client != NULL) sc_net_client_free(&w->c->client, "User disconnected"); if(w->c->server != NULL) sc_net_server_free(&w->c->server, "User disconnected"); sc_window_update_menus_gtk(w); } static void _sc_action_network_status_gtk(sc_window_gtk *w) { char buf[SC_GTK_STRING_BUFFER]; const char *title; sc_connection *conn; sc_net_status *status; sc_player *p; int i; if(w->c->client != NULL) { /* we have a connection; is it client or server? */ if(w->c->server != NULL) { sbprintf(buf, sizeof(buf), "Running as server. Other players:\n"); for(i = 0; i < w->c->server->connections; ++i) { p = w->c->players[i]; conn = &w->c->server->clients[i]; sbprintf_concat(buf, sizeof(buf), " %s (%s, %08x, %d, %d)\n", p->name, inet_ntoa(conn->address.sin_addr), conn->flags, p->turret, p->power); } title = "Server"; } else { conn = &w->c->client->server; sbprintf(buf, sizeof(buf), "Connected to server %s as %s\n", inet_ntoa(conn->address.sin_addr), w->c->client->name); title = "Client"; } /* dump the status information from the client */ strconcatb(buf, "\nPlayer Status:\n", sizeof(buf)); for(i = 0; i < w->c->numplayers; ++i) { p = w->c->players[i]; status = &w->c->client->status[i]; sbprintf_concat(buf, sizeof(buf), " %s (%s, %08x, %08x, %08x, %08x)\n", p->name, inet_ntoa(status->address.sin_addr), status->cli_flags, status->cli_syncarg, status->srv_flags, status->srv_syncarg); } /* display the messagebox */ sc_dialog_message(title, buf); } else { /* no connection is currently active. */ sc_dialog_message("No connection", "No network connection\n"); } } #endif /* USE_NETWORK */ void sc_window_update_menus_gtk(sc_window_gtk *w) { #if USE_NETWORK sc_config *c = w->c; gtk_widget_set_sensitive(w->net_server, TRUE); gtk_widget_set_sensitive(w->net_client, TRUE); gtk_widget_set_sensitive(w->net_disconnect, c->client != NULL || c->server != NULL); gtk_widget_set_sensitive(w->net_chat, c->client != NULL || c->server != NULL); gtk_widget_set_sensitive(w->net_status, c->client != NULL || c->server != NULL); #endif /* Network? */ } void sc_window_create_menus_gtk(sc_window_gtk *w) { GError *gerr = NULL; GtkAction *action = NULL; GtkActionGroup *menu_action_group = gtk_action_group_new("menu"); GtkUIManager *menu_ui_manager = gtk_ui_manager_new(); /* OMG I HATE XML */ char *main_menu_xml = " \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "; char *network_menu_xml = " \ \ \ \ \ \ \ \ \ \ \ \ \ "; /* OMG what was so simple in GTK 1.2 is this complex in GTK 2.12. x_x */ gtk_action_group_add_action(menu_action_group, gtk_action_new("MenuGame", "_Game", NULL, NULL)); action = gtk_action_new("Pause", "_Pause", NULL, NULL); gtk_accel_map_add_entry("/Game/Pause", 'z', GDK_CONTROL_MASK); gtk_action_set_accel_path(action, "/Game/Pause"); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_game_pause_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("RestartGame", "_Restart Game", NULL, NULL); gtk_accel_map_add_entry("/Game/Restart Game", 'r', GDK_CONTROL_MASK); gtk_action_set_accel_path(action, "/Game/Restart Game"); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_game_restart_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("SystemMenu", "S_ystem Menu", NULL, NULL); gtk_accel_map_add_entry("/Game/System Menu", 'y', GDK_CONTROL_MASK); gtk_action_set_accel_path(action, "/Game/System Menu"); g_signal_connect_swapped(action, "activate", G_CALLBACK(sc_system_menu_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("FontSetup", "_Font Setup ...", NULL, NULL); gtk_accel_map_add_entry("/Game/Font Setup ...", 'f', GDK_CONTROL_MASK); gtk_action_set_accel_path(action, "/Game/Font Setup ..."); g_signal_connect_swapped(action, "activate", G_CALLBACK(sc_font_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("SoundSetup", "S_ound Setup ...", NULL, NULL); gtk_accel_map_add_entry("/Game/Sound Setup ...", 'o', GDK_CONTROL_MASK); gtk_action_set_accel_path(action, "/Game/Sound Setup ..."); g_signal_connect_swapped(action, "activate", G_CALLBACK(sc_sound_setup_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("SaveConfig", "Sa_ve Configuration", NULL, NULL); gtk_accel_map_add_entry("/Game/Save Configuration", 's', GDK_CONTROL_MASK); gtk_action_set_accel_path(action, "/Game/Save Configuration"); g_signal_connect_swapped(action, "activate", G_CALLBACK(sc_config_file_save_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("Exit", "E_xit", NULL, NULL); gtk_accel_map_add_entry("/Game/Exit", 'x', GDK_CONTROL_MASK); gtk_action_set_accel_path(action, "/Game/Exit"); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_game_exit_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); gtk_action_group_add_action(menu_action_group, gtk_action_new("MenuHelp", "_Help", NULL, NULL)); action = gtk_action_new("Manual", "_Manual page ...", NULL, NULL); gtk_accel_map_add_entry("/Help/Manual page ...", gdk_keyval_from_name("F1"), 0); gtk_action_set_accel_path(action, "/Help/Manual page ..."); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_help_manual_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("License", "_License ...", NULL, NULL); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_help_license_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("About", "_About ...", NULL, NULL); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_help_about_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); #if USE_NETWORK gtk_action_group_add_action(menu_action_group, gtk_action_new("MenuNetwork", "_Network", NULL, NULL)); action = gtk_action_new("CreateServer", "Create _Server ...", NULL, NULL); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_network_server_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("ConnectClient", "Connect as _Client ...", NULL, NULL); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_network_client_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("DisconnectClient", "_Disconnect", NULL, NULL); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_network_disconnect_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("Chat", "C_hat ...", NULL, NULL); g_signal_connect_swapped(action, "activate", G_CALLBACK(sc_chat_window_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); action = gtk_action_new("Status", "S_tatus ...", NULL, NULL); g_signal_connect_swapped(action, "activate", G_CALLBACK(_sc_action_network_status_gtk), w); gtk_action_group_add_action(menu_action_group, action); g_object_unref(action); #endif /* Network? */ /* Make the new actions available to the menu items. */ gtk_ui_manager_insert_action_group(menu_ui_manager, menu_action_group, 0); /* Turn XML crap into menu structures. */ gtk_ui_manager_add_ui_from_string(menu_ui_manager, main_menu_xml, -1, &gerr); if (gerr != NULL) { fprintf(stderr, "Failed parsing main menu structure: \n%s\n", gerr->message); g_error_free(gerr); } #if USE_NETWORK gtk_ui_manager_add_ui_from_string(menu_ui_manager, network_menu_xml, -1, &gerr); if (gerr != NULL) { fprintf(stderr, "Failed parsing main menu structure: \n%s\n", gerr->message); g_error_free(gerr); } w->net_server = gtk_ui_manager_get_widget(menu_ui_manager, "/ui/NetworkMenu/Create Server ..."); w->net_client = gtk_ui_manager_get_widget(menu_ui_manager, "/ui/NetworkMenu/Connect as Client ..."); w->net_disconnect = gtk_ui_manager_get_widget(menu_ui_manager, "/ui/NetworkMenu/Disconnect"); w->net_chat = gtk_ui_manager_get_widget(menu_ui_manager, "/ui/NetworkMenu/Chat ..."); w->net_status = gtk_ui_manager_get_widget(menu_ui_manager, "/ui/NetworkMenu/Status ..."); #endif /* Network? */ /* Install the new menus. */ gtk_window_add_accel_group(GTK_WINDOW(w->app), gtk_ui_manager_get_accel_group(menu_ui_manager)); /* Finally we have something we can call a menu. */ w->mainmenu = gtk_ui_manager_get_widget(menu_ui_manager, "/MenuBar"); /* Do it now. Yes really. */ gtk_ui_manager_ensure_update(menu_ui_manager); /* I don't see a way to free the UI Manager, oh well... */ } xscorch-0.2.1/sgtk/smenu-gtk.h0000644000175000001440000000221411175116145013134 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/smenu-gtk.h,v 1.5 2009-04-26 17:39:49 jacob Exp $ */ /* xscorch - smenu-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK menus for xscorch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __smenu_gtk_h_included #define __smenu_gtk_h_included #include void sc_window_create_menus_gtk(sc_window_gtk *w); void sc_window_update_menus_gtk(sc_window_gtk *w); #endif /* __smenu_gtk_h_included */ xscorch-0.2.1/sgtk/snet-gtk.c0000644000175000001440000002235111175116145012755 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/snet-gtk.c,v 1.18 2009-04-26 17:39:49 jacob Exp $ */ /* xscorch - snet-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Chat dialogue, network server/client connects This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #if USE_NETWORK #define SC_PLAYER_HELP "Specify the name you will connect to the server as; this will be the name of your player." #define SC_SERVER_HELP "Specify the name or IP address of the server to connect to." #define SC_PORT_HELP "Specify the port number on the server to connect to." typedef struct _sc_chat { sc_config *c; GtkWidget *entry; } sc_chat; /* TEMP - Serious revisions needed in this file for GTK 2.0 support. */ #if GTK12_ENABLED static void _sc_chat_window_delete(__libj_unused GtkWidget *window, sc_chat *config) { sc_window_gtk *w = (sc_window_gtk *)config->c->window; w->chatbox = NULL; } static void _sc_chat_send_gtk(__libj_unused GtkWidget *send, sc_chat *config) { if(config->c->client != NULL) { const char *text = gtk_entry_get_text(GTK_ENTRY(config->entry)); if(strlenn(text) > 0) { sc_net_client_chat(config->c->client, text); gtk_entry_set_text(GTK_ENTRY(config->entry), ""); } } } static gboolean _sc_chat_send_key_gtk(GtkWidget *text, GdkEventKey *key, sc_chat *config) { if(key->keyval == GDK_KP_Enter || key->keyval == GDK_Return) { _sc_chat_send_gtk(text, config); return(TRUE); } return(FALSE); } void sc_chat_window_update(sc_window *_w, const char *msg) { sc_window_gtk *w = (sc_window_gtk *)_w; if(w->chatbox == NULL) return; gtk_text_insert(GTK_TEXT(w->chatbox), NULL, NULL, NULL, msg, strlenn(msg)); gtk_text_insert(GTK_TEXT(w->chatbox), NULL, NULL, NULL, "\n", 1); } void sc_chat_window_gtk(sc_window_gtk *w) { sc_chat config; char input[SC_NET_INPUT_SIZE]; ScDialog *dialog; GtkWidget *widget; GtkWidget *view; input[0] = '\0'; config.c = w->c; dialog = SC_DIALOG(sc_dialog_new("Chat", NULL, SC_DIALOG_CLOSE | SC_DIALOG_NONMODAL)); g_signal_connect(G_OBJECT(dialog), "destroy", (GCallback)_sc_chat_window_delete, &config); view = gtk_scrolled_window_new(NULL, NULL); gtk_widget_set_usize(view, 550, 100); gtk_table_attach(GTK_TABLE(dialog->grid), view, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); widget = gtk_text_new(NULL, NULL); gtk_text_set_editable(GTK_TEXT(widget), FALSE); gtk_container_add(GTK_CONTAINER(view), widget); w->chatbox = widget; widget = sc_link_entry_new(input, SC_NET_INPUT_SIZE); gtk_widget_set_usize(widget, 450, 0); g_signal_connect(G_OBJECT(widget), "key-press-event", (GCallback)_sc_chat_send_key_gtk, &config); gtk_table_attach(GTK_TABLE(dialog->grid), widget, 0, 1, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 2); config.entry = widget; widget = gtk_button_new_with_label(" Send "); g_signal_connect(G_OBJECT(widget), "clicked", (GCallback)_sc_chat_send_gtk, &config); gtk_table_attach(GTK_TABLE(dialog->grid), widget, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 2, 2); sc_dialog_run(dialog); } #else /* GTK 2.0 */ /* TEMP - GtkTextView (GTK2) support not implemented yet for chat window. */ void sc_chat_window_update(sc_window *_w, const char *msg) { /* GtkTextView (GTK2) support not implemented yet for chat window. */ } void sc_chat_window_gtk(sc_window_gtk *w) { /* GtkTextView (GTK2) support not implemented yet for chat window. */ sc_dialog_message("Text viewer unimplemented", "Sorry, the GTK 2 text viewer has not been implemented yet."); } #endif /* GTK version? */ typedef struct _sc_server_config { sc_config *c; char name[SC_NET_NAME_SIZE]; char port[SC_NET_INPUT_SIZE]; } sc_server_config; static void _sc_network_server_apply_gtk(__libj_unused ScDialog *dlg, sc_server_config *config) { int portnum; if(config->c->server != NULL) { ScDialog *dlg = (ScDialog *)sc_dialog_new("Close Existing Server?", "Are you sure you want to close the existing server?", SC_DIALOG_YES | SC_DIALOG_NO); if(!sc_dialog_run(dlg)) return; sc_net_client_free(&config->c->client, "User creating new server"); sc_net_server_free(&config->c->server, "User creating new server"); } else if(config->c->client != NULL) { ScDialog *dlg = (ScDialog *)sc_dialog_new("Close Existing Connection?", "Are you sure you want to close the existing connection to a server?", SC_DIALOG_YES | SC_DIALOG_NO); if(!sc_dialog_run(dlg)) return; sc_net_client_free(&config->c->client, "User creating new server"); } portnum = atoi(config->port); config->c->server = sc_net_server_new(config->c, portnum); if(config->c->server == NULL) { sc_dialog_message("Server failed", "Server failed"); } else { config->c->client = sc_net_client_new(config->name, SC_NET_LOCALHOST, portnum); if(config->c->client == NULL) { sc_dialog_message("Client connection to server failed", "Client connection to server failed"); } } } void sc_network_server_gtk(sc_window_gtk *w) { sc_server_config config; ScDialog *dialog; int row = 0; config.c = w->c; strcopyb(config.name, getenv("USER"), sizeof(config.name)); sbprintf(config.port, sizeof(config.port), "%d", SC_NET_DEFAULT_PORT); dialog = SC_DIALOG(sc_dialog_new("Create server", NULL, SC_DIALOG_OK | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_network_server_apply_gtk, &config); attach_option_help(dialog, w, "Player name", SC_PLAYER_HELP, sc_link_entry_new(config.name, SC_NET_NAME_SIZE), &row); attach_option_help(dialog, w, "Listen on port", SC_PORT_HELP, sc_link_entry_new(config.port, SC_NET_INPUT_SIZE), &row); sc_dialog_run(dialog); } typedef struct _sc_client_config { sc_config *c; char name[SC_NET_NAME_SIZE]; char port[SC_NET_INPUT_SIZE]; char server[SC_NET_INPUT_SIZE]; } sc_client_config; static void _sc_network_client_apply_gtk(__libj_unused ScDialog *dlg, sc_client_config *config) { int portnum; if(config->c->server != NULL) { ScDialog *dlg = (ScDialog *)sc_dialog_new("Close Existing Server?", "Are you sure you want to close the existing server?", SC_DIALOG_YES | SC_DIALOG_NO); if(!sc_dialog_run(dlg)) return; sc_net_client_free(&config->c->client, "User creating new connection"); sc_net_server_free(&config->c->server, "User creating new connection"); } else if(config->c->client != NULL) { ScDialog *dlg = (ScDialog *)sc_dialog_new("Close Existing Connection?", "Are you sure you want to close the existing connection to a server?", SC_DIALOG_YES | SC_DIALOG_NO); if(!sc_dialog_run(dlg)) return; sc_net_client_free(&config->c->client, "User creating new connection"); } portnum = atoi(config->port); config->c->client = sc_net_client_new(config->name, config->server, portnum); if(config->c->client == NULL) { sc_dialog_message("Client failed", "Client failed"); } } void sc_network_client_gtk(sc_window_gtk *w) { sc_client_config config; ScDialog *dialog; int row = 0; config.c = w->c; strcopyb(config.name, getenv("USER"), sizeof(config.name)); sbprintf(config.port, sizeof(config.port), "%d", SC_NET_DEFAULT_PORT); strcopyb(config.server, SC_NET_DEFAULT_SERVER, sizeof(config.server)); dialog = SC_DIALOG(sc_dialog_new("Connect as client", NULL, SC_DIALOG_OK | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_network_client_apply_gtk, &config); attach_option_help(dialog, w, "Player name", SC_PLAYER_HELP, sc_link_entry_new(config.name, SC_NET_NAME_SIZE), &row); attach_option_help(dialog, w, "Server name", SC_SERVER_HELP, sc_link_entry_new(config.server, SC_NET_INPUT_SIZE), &row); attach_option_help(dialog, w, "Listen on port", SC_PORT_HELP, sc_link_entry_new(config.port, SC_NET_INPUT_SIZE), &row); sc_dialog_run(dialog); } #endif /* Network? */ xscorch-0.2.1/sgtk/snet-gtk.h0000644000175000001440000000247711175116145012771 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/snet-gtk.h,v 1.6 2009-04-26 17:39:49 jacob Exp $ */ /* xscorch - snet-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Function prototypes for network windows This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __snet_gtk_h_included #define __snet_gtk_h_included #include #include #if USE_NETWORK #define SC_NET_INPUT_SIZE 0x100 /* Interface functions */ void sc_chat_window_gtk(sc_window_gtk *w); void sc_network_server_gtk(sc_window_gtk *w); void sc_network_client_gtk(sc_window_gtk *w); #endif /* USE_NETWORK */ #endif /* __snet_gtk_h_included */ xscorch-0.2.1/sgtk/soptions-gtk.c0000644000175000001440000001076011615332723013664 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/soptions-gtk.c,v 1.19 2011-07-31 20:06:43 jacob Exp $ */ /* xscorch - soptions-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Generic options configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include typedef struct _sc_options_setup_data_gtk { sc_config *c; sc_config_options *co; int modeidx; int teamidx; int orderidx; int talkidx; int talkprob; bool extstatus; bool tooltips; bool interleave; } sc_options_setup_data_gtk; static void _sc_options_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_options_setup_data_gtk *setup) { sc_config_options *co = setup->co; sc_window_gtk *w = (sc_window_gtk *)setup->c->window; bool oldextstatus; bool oldtooltips; oldextstatus = co->extstatus; oldtooltips = co->tooltips; co->mode = sc_config_mode_types()[setup->modeidx]; co->team = sc_config_team_types()[setup->teamidx]; co->order = sc_config_order_types()[setup->orderidx]; co->talk = sc_config_talk_types()[setup->talkidx]; co->talkprob = setup->talkprob; co->extstatus= setup->extstatus; co->tooltips = setup->tooltips; co->interleave=setup->interleave; /* Reconfigure the statusbar */ if(oldextstatus != co->extstatus) sc_status_setup(setup->c->window); /* TEMP: I can't find a way to do this with GTK2... * Probably tooltips won't appear if they're off until you enable them and restart xscorch. * if(oldtooltips != co->tooltips) { if(co->tooltips) gtk_tooltips_enable(w); else gtk_tooltips_disable(w); } */ #if USE_NETWORK if(SC_NETWORK_SERVER(setup->c)) sc_net_server_send_config(setup->c, setup->c->server); #endif } void sc_options_setup_gtk(sc_window_gtk *w) { sc_config_options *co = &w->c->options; sc_options_setup_data_gtk setup; ScDialog *dialog; int confirm = (SC_NETWORK_AUTH(w->c) ? SC_DIALOG_OK : 0); int row = 0; setup.c = w->c; setup.co = co; setup.modeidx = 0; setup.teamidx = 0; setup.orderidx = 0; setup.talkidx = 0; setup.talkprob = co->talkprob; setup.extstatus= co->extstatus; setup.tooltips = co->tooltips; setup.interleave=co->interleave; while(sc_config_mode_types()[setup.modeidx] != co->mode) ++setup.modeidx; while(sc_config_team_types()[setup.teamidx] != co->team) ++setup.teamidx; while(sc_config_order_types()[setup.orderidx]!=co->order)++setup.orderidx; while(sc_config_talk_types()[setup.talkidx] != co->talk) ++setup.talkidx; dialog = SC_DIALOG(sc_dialog_new("Options Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_options_setup_apply_gtk, &setup); attach_option(dialog, w, "Mode", sc_link_combo_new(&setup.modeidx, sc_config_mode_names()), &row); attach_option(dialog, w, "N/A: Teams", sc_link_combo_new(&setup.teamidx, sc_config_team_names()), &row); attach_option(dialog, w, "Order", sc_link_combo_new(&setup.orderidx, sc_config_order_names()), &row); attach_option(dialog, w, "Talk Mode", sc_link_combo_new(&setup.talkidx, sc_config_talk_names()), &row); attach_option(dialog, w, "Talk Probability", sc_link_spin_new(&setup.talkprob, 0, 100, 1), &row); attach_option(dialog, w, "Extended Status", sc_link_check_new(&setup.extstatus), &row); attach_option(dialog, w, "Tooltips", sc_link_check_new(&setup.tooltips), &row); attach_option(dialog, w, "Interleaved Tracking", sc_link_check_new(&setup.interleave), &row); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/spaint-gtk.c0000644000175000001440000007063111551757751013322 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/spaint-gtk.c,v 1.18 2011-04-15 06:04:25 jacob Exp $ */ /* xscorch - spain-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Window painting code for scorch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define USE_PIXMAP_MAX_AREA 400 /* If redraw area is less than this, draw w/ pixmap code */ #define SC_WIND_MINIMUM_ARROW 5 /* Minimum wind arrow size for it to be drawn at all */ #define SC_WIND_MAXIMUM_ARROW 100 /* Maximum wind arrow size - will truncate if larger */ #define SC_WIND_ARROW_MARGIN 10 /* Padding around arrow in corner of screen */ #define SC_WIND_ARROW_SIZE 4 /* Size of the arrowhead (in pixels) */ static inline bool _sc_lines_overlap_gtk(int a1, int a2, int b1, int b2) { /* sc_lines_overlap_gtk */ /* Check if line segment (a1,a2) overlaps (b1,b2) */ return(b1 <= a2 && a1 <= b2); } static inline bool _sc_rects_overlap_gtk(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2) { /* sc_rects_overlap_gtk */ /* Check if rectangle A overlaps any part of rectanble B. */ return(_sc_lines_overlap_gtk(ax1, ax2, bx1, bx2) && _sc_lines_overlap_gtk(ay1, ay2, by1, by2)); } static void _sc_window_draw_arrow(GdkPixmap *buffer, GdkGC *gc, int x, int y, int size, bool right) { /* sc_window_draw_arrow Draws an arrow on the screen whose RIGHT coordinate of the mainline is at (x, y), and whose mainline is pixels long. The flag is true iff the arrow cap should be drawn on the right-hand side of the arrow. The coordinates MUST be real coordinates. */ /* Draw the arrow mainline */ gdk_draw_line(buffer, gc, x, y, x - size, y); /* Draw the arrow cap */ if(right) { gdk_draw_line(buffer, gc, x, y, x - SC_WIND_ARROW_SIZE, y - SC_WIND_ARROW_SIZE); gdk_draw_line(buffer, gc, x, y, x - SC_WIND_ARROW_SIZE, y + SC_WIND_ARROW_SIZE); } else { gdk_draw_line(buffer, gc, x - size, y, x - size + SC_WIND_ARROW_SIZE, y - SC_WIND_ARROW_SIZE); gdk_draw_line(buffer, gc, x - size, y, x - size + SC_WIND_ARROW_SIZE, y + SC_WIND_ARROW_SIZE); } } static void _sc_window_draw_x(GdkPixmap *buffer, GdkGC *gc, int x, int y) { /* sc_window_draw_x Used by arrow drawing code to draw an X whose right-center coordinate is at (x, y) -- this is used to indicate no wind is present. The coordinates MUST be real coordiantes. */ /* Draw the X */ gdk_draw_line(buffer, gc, x, y + SC_WIND_ARROW_SIZE, x - SC_WIND_ARROW_SIZE - SC_WIND_ARROW_SIZE, y - SC_WIND_ARROW_SIZE); gdk_draw_line(buffer, gc, x, y - SC_WIND_ARROW_SIZE, x - SC_WIND_ARROW_SIZE - SC_WIND_ARROW_SIZE, y + SC_WIND_ARROW_SIZE); } static void _sc_window_draw_wind_arrow(sc_window_gtk *w, bool drawing) { /* sc_window_draw_wind_arrow Draws the wind arrow in the upper-right corner of the screen. If drawing is set, we will draw an arrow; otherwise we will erase the last arrow that was drawn to the screen. */ GdkPixmap *buffer; /* Screen buffer */ GdkGC *gc; /* Screen gc */ int size; /* Size of wind arrow */ int x; /* Anchor X (screen coords) */ int y; /* Anchor Y (screen coords) */ /* Get the buffer and GC to use in drawing. */ buffer = sc_display_get_buffer(SC_DISPLAY(w->screen)); gc = sc_display_get_gc(SC_DISPLAY(w->screen)); /* Calculate the arrow size */ if(drawing) { size = abs((int)(w->c->physics->curwind * 5000 / SC_PHYSICS_WIND_MAX)); } else { size = w->windarrowsize; } x = w->c->fieldwidth - SC_WIND_ARROW_MARGIN; y = SC_WIND_ARROW_SIZE + SC_WIND_ARROW_MARGIN; if(size > SC_WIND_MAXIMUM_ARROW) size = SC_WIND_MAXIMUM_ARROW; /* Drawing or clearing? */ if(drawing) { /* Update the current windarrow size */ w->windarrowsize = size; if(size < SC_WIND_MINIMUM_ARROW) { size = SC_WIND_ARROW_SIZE + SC_WIND_ARROW_SIZE; /* Draw the SHADOW */ gdk_gc_set_foreground(gc, &w->colormap->black); _sc_window_draw_x(buffer, gc, x + 1, y + 1); _sc_window_draw_x(buffer, gc, x + 1, y + 2); /* Draw the arrow mainline and cap */ gdk_gc_set_foreground(gc, &w->colormap->windar); _sc_window_draw_x(buffer, gc, x, y); } else { /* Draw the arrow SHADOW */ gdk_gc_set_foreground(gc, &w->colormap->black); _sc_window_draw_arrow(buffer, gc, x + 1, y + 1, size, w->c->physics->curwind >= 0); _sc_window_draw_arrow(buffer, gc, x + 1, y + 2, size, w->c->physics->curwind >= 0); /* Draw the arrow mainline and cap */ gdk_gc_set_foreground(gc, &w->colormap->windar); _sc_window_draw_arrow(buffer, gc, x, y, size, w->c->physics->curwind >= 0); } } else { /* Clearing an existing arrow */ if(size < SC_WIND_MINIMUM_ARROW) size = SC_WIND_ARROW_SIZE + SC_WIND_ARROW_SIZE; gdk_draw_drawable(buffer, gc, w->landbuffer, x - size, y - SC_WIND_ARROW_SIZE, x - size, y - SC_WIND_ARROW_SIZE, size + 3, SC_WIND_ARROW_SIZE + SC_WIND_ARROW_SIZE + 3); } /* Drawing or clearing? */ /* Update the display */ sc_display_queue_draw(SC_DISPLAY(w->screen), x - size, y - SC_WIND_ARROW_SIZE, size + 3, SC_WIND_ARROW_SIZE + SC_WIND_ARROW_SIZE + 3); } static void _sc_window_draw_tank_gtk(sc_window_gtk *w, const sc_player *p) { /* sc_window_draw_tank_gtk Draws the player's tank to the screen, as well as any shielding which might currently be equipped on the player. */ GdkPixmap *buffer; /* Screen buffer */ GdkGC *gc; /* Screen gc */ sc_gradient_list grad; /* Gradient for shields */ unsigned char *data; /* Profile data pointer */ int radius; /* Tank's radius */ int index; /* Shield gradient index */ int size; /* Size = radius * 2 + 1 */ int tx1; /* Translate interval X1 */ int tx2; /* Translate interval X2 */ int cx; /* Current X coord for draw */ int cy; /* Current Y coord for draw */ int tx; /* Translated X coord */ int ty; /* Translated Y corod */ int x; /* Player X (screen coords) */ int y; /* Player Y (screen coords) */ /* Get the buffer and GC to use in drawing. */ buffer = sc_display_get_buffer(SC_DISPLAY(w->screen)); gc = sc_display_get_gc(SC_DISPLAY(w->screen)); /* Get current player coordinates. */ x = p->x; y = w->c->fieldheight - p->y - 1; radius = p->tank->radius; size = radius + radius + 1; /* Draw tank shields (if available) */ if(p->shield != NULL) { /* Determine which gradient to use */ if(SC_ACCESSORY_SHIELD_IS_FORCE(p->shield->info)) { grad = SC_GRAD_FORCE; } else if(SC_ACCESSORY_SHIELD_IS_MAGNETIC(p->shield->info)) { grad = SC_GRAD_MAGNETIC; } else { grad = SC_GRAD_SHIELD; } /* Draw the shield */ index = w->c->colors->gradsize[grad] * p->shield->life / (p->shield->info->shield + 1); gdk_gc_set_foreground(gc, &w->colormap->gradient[grad][index]); gdk_draw_arc(buffer, gc, FALSE, x - radius, y - radius, 2 * radius + 1, 2 * radius + 1, 0, 360 * 64); if(SC_SHIELD_IS_MEDIUM(p->shield) || SC_SHIELD_IS_STRONG(p->shield)) { gdk_draw_arc(buffer, gc, FALSE, x - radius - 1, y - radius - 1, 2 * radius + 3, 2 * radius + 3, 0, 360 * 64); if(SC_SHIELD_IS_STRONG(p->shield)) { gdk_draw_arc(buffer, gc, FALSE, x - radius - 2, y - radius - 2, 2 * radius + 5, 2 * radius + 5, 0, 360 * 64); } /* Extra shielding for strongest shields */ } /* Extra shielding for stronger shields */ } /* Set foreground pen color. */ gdk_gc_set_foreground(gc, &w->colormap->pcolors[p->index]); /* Draw tank base and body. */ data = p->tank->data; for(cy = -radius; cy <= 0; ++cy) { for(cx = -radius; cx <= radius; ++data, ++cx) { if(*data != SC_TANK_PROFILE_CLEAR) { tx = x + cx; ty = y + cy; if(sc_land_translate_x(w->c->land, &tx)) { gdk_draw_point(buffer, gc, tx, ty); } /* Is this coordinate on the screen? */ } /* Is this point part of the tank? */ } /* Iterate over X */ } /* Iterate over Y */ /* Draw tank's turret. */ radius = p->tank->turretradius; gdk_draw_line(buffer, gc, x, y, (int)(x + rint(radius * cos(p->turret * M_PI / 180))), (int)(y - rint(radius * sin(p->turret * M_PI / 180)))); /* Make sure all of this gets drawn. */ tx1 = x - radius; tx2 = x + radius; if(sc_land_translate_x_range(w->c->land, &tx1, &tx2)) { sc_display_queue_draw(SC_DISPLAY(w->screen), tx1, y - radius, tx2 - tx1 + 1, size); if(sc_land_overlap_x(w->c->land, &tx1, &tx2)) { sc_display_queue_draw(SC_DISPLAY(w->screen), tx1, y - radius, tx2 - tx1 + 1, size); } } } static void _sc_window_draw_all_tanks_gtk(sc_window_gtk *w, int x1, int y1, int x2, int y2) { /* sc_window_draw_all_tanks_gtk Draws all player tanks to the screen which are partially or entirely within the bounding box given by (x1, y1)-(x2, y2). All coordinates given to this function MUST be real coordinates. */ sc_player *p; /* Current Player pointer */ int radius; /* Radius for player */ int x; /* Current player X (land coords) */ int y; /* Current player Y (land coords) */ int px1; /* Player X range left */ int px2; /* Player X range right */ int i; /* Iterate through all players. */ i = w->c->numplayers - 1; while(i >= 0) { /* Get player info; make sure they're not dead. */ p = w->c->players[i]; if(!p->dead) { /* Get player coordinates; see if any part of the tank falls in redraw field. */ x = p->x; y = p->y; radius = p->tank->turretradius; px1 = x - radius; px2 = x + radius; if(sc_land_translate_x_range(w->c->land, &px1, &px2)) { if(_sc_rects_overlap_gtk(x1, y1, x2, y2, px1, y - radius, px2, y + radius)) { _sc_window_draw_tank_gtk(w, p); } /* Is tank in redraw range? */ /* Check for overlap range as well */ if(sc_land_overlap_x(w->c->land, &px1, &px2)) { if(_sc_rects_overlap_gtk(x1, y1, x2, y2, px1, y - radius, px2, y + radius)) { _sc_window_draw_tank_gtk(w, p); } /* Is tank in redraw range? */ } /* Any overlap? */ } /* Range translation successful? */ } /* Is player not dead? */ --i; } /* Loop through players. */ } static void _sc_window_draw_land_pixmap_gtk(sc_window_gtk *w, int x1, int y1, int x2, int y2) { /* sc_window_draw_land_pixmap_gtk This was the original drawing code, sending pixels at a time to the X server. Note this is not at all efficient in that it wastes bandwidth and seriously slows us down for large area updates. See the next function for a faster approach. However, if very small areas are being updated (say, 10x10 region) this method is still faster. The bounding box MUST be in real coordinates. */ sc_color_gtk *colormap; /* Colormap data */ GdkPixmap *buffer; /* Land pixmap buffer */ GdkColor *lcolor; /* Last-used color */ GdkColor *color; /* Current color */ GdkGC *gc; /* Graphics context */ const int *lpointer; /* Pointer into land */ int height; /* Plotter height */ int x; /* Current X (land coords) */ int y; /* Current Y (land coords) */ int y0; /* Y0 of the current line */ /* Get the colormap data, pixmap, and graphics context */ height = w->c->fieldheight - 1; colormap = w->colormap; buffer = w->landbuffer; gc = sc_display_get_gc(SC_DISPLAY(w->screen)); /* All points must be redrawn */ lcolor = NULL; for(x = x1; x <= x2; ++x) { /* Get pointer to bottom of current column. */ lpointer = SC_LAND_XY(w->c->land, x, y1); lcolor = NULL; y0 = -1; for(y = y1; y <= y2; ++y, ++lpointer) { /* Iterating along the column ... */ switch(SC_LAND_GET_TYPE(*lpointer)) { case SC_LAND_GROUND: color = &colormap->gradient[SC_GRAD_GROUND][SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_NIGHT_SKY: color = &colormap->gradient[SC_GRAD_NIGHT_SKY][SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_FIRE_SKY: color = &colormap->gradient[SC_GRAD_FIRE_SKY][SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_SMOKE: color = &colormap->pcolors[SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_OBJECT: color = &colormap->white; break; default: color = &colormap->black; } /* Only set new pen color if we actually changed pens. */ if(color != lcolor) { if(y0 >= 0) { gdk_gc_set_foreground(gc, lcolor); gdk_draw_line(buffer, gc, x, height - y0, x, height - y + 1); } lcolor = color; y0 = y; } /* Draw the point. */ /*gdk_draw_point(buffer, gc, x, height - y);*/ } /* Iterating in Y ... */ if(y0 >= 0) { gdk_gc_set_foreground(gc, lcolor); gdk_draw_line(buffer, gc, x, height - y0, x, height - y2); } } /* Iterating in X ... */ } static void _sc_window_draw_land_image_gtk(sc_window_gtk *w, int x1, int y1, int x2, int y2) { /* sc_window_draw_land_image_gtk This code draws land using a GdkImage object (stored client-side). I have found for pixel-by-pixel images, it is faster to construct a client- side image and send the entire image across as a single command, as opposed to sending a large number of draw-pixel commands to the server. Note this does have some overhead associated, and in general the classic pixel-by-pixel approach should be used if only a small rectangular area is being updated. The bounding box MUST be in real coordinates. */ GdkImage *image; /* Local image to draw into */ sc_color_gtk *colormap; /* Colormap data */ GdkColor *color; /* Current color */ const int *lpointer; /* Pointer into land */ int fheight; /* Plotter field height */ int height; /* Image height */ int width; /* Image width */ int x; /* Current X offset (land coords) */ int y; /* Current Y offset (land coords) */ /* Get the colormap data, pixmap, and graphics context */ fheight = w->c->fieldheight - 1; colormap = w->colormap; /* Create the local image to draw into */ height= y2 - y1 + 1; width = x2 - x1 + 1; image = gdk_image_new(GDK_IMAGE_FASTEST, gtk_widget_get_visual(w->app), width, height); if(image == NULL) return; /* All points must be redrawn */ for(x = 0; x < width; ++x) { /* Get pointer to bottom of current column. */ lpointer = SC_LAND_XY(w->c->land, x1 + x, y1); for(y = 0; y < height; ++y, ++lpointer) { /* Iterating along the column ... */ switch(SC_LAND_GET_TYPE(*lpointer)) { case SC_LAND_GROUND: color = &colormap->gradient[SC_GRAD_GROUND][SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_NIGHT_SKY: color = &colormap->gradient[SC_GRAD_NIGHT_SKY][SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_FIRE_SKY: color = &colormap->gradient[SC_GRAD_FIRE_SKY][SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_SMOKE: color = &colormap->pcolors[SC_LAND_GET_COLOR(*lpointer)]; break; case SC_LAND_OBJECT: color = &colormap->white; break; default: color = &colormap->black; } /* What type of land? */ /* Draw the point. */ gdk_image_put_pixel(image, x, height - y - 1, color->pixel); } /* Iterating in Y ... */ } /* Iterating in X ... */ /* Copy local image to the offscreen pixmap */ gdk_draw_image(w->landbuffer, sc_display_get_gc(SC_DISPLAY(w->screen)), image, 0, 0, x1, fheight - y2, width, height); g_object_unref(image); } static inline void _sc_window_draw_land_gtk(sc_window_gtk *w, int x1, int y1, int x2, int y2) { /* sc_window_draw_land_gtk This is a wrapper for the above two functions, which will select the appropriate function based on the number of pixels needing update. This will also clip the input arguments to make sure they are in a valid range. */ /* Make sure X, Y are in bounds. */ if(x1 < 0) x1 = 0; if(y1 < 0) y1 = 0; if(x2 >= w->c->fieldwidth) x2 = w->c->fieldwidth - 1; if(y2 >= w->c->fieldheight) y2 = w->c->fieldheight- 1; /* Which subfunction to use? */ if((y2 - y1) * (x2 - x1) <= USE_PIXMAP_MAX_AREA) { _sc_window_draw_land_pixmap_gtk(w, x1, y1, x2, y2); } else { _sc_window_draw_land_image_gtk(w, x1, y1, x2, y2); } } void sc_window_paint(sc_window *w_, int x1, int y1, int x2, int y2, int flags) { /* sc_window_paint This function updates a rectangular region of the display, using the coordinates (x1,y1)-(x2,y2) as a bounding box for the area needing update. Flags are also given to indicate which drawing operations should be done -- note SC_REGENERATE_LAND is VERY expensive and should be avoided when the land hasn't been physically altered. */ sc_window_gtk *w = (sc_window_gtk *)w_;/* Window structure */ int ox1; /* Overlap X1 */ int ox2; /* Overlap X2 */ int screenx; /* Screen top-left X */ int screeny; /* Screen top-left Y */ int screenw; /* Width of area being redrawn */ int screenh; /* Height of area being redrawn */ /* Swap boundaries if they are reversed. */ if(x1 > x2) { x1 = x1 + x2; x2 = x1 - x2; x1 = x1 - x2; } /* X coordinates swapped? */ if(y1 > y2) { y1 = y1 + y2; y2 = y1 - y2; y1 = y1 - y2; } /* Y coordinates swapped? */ /* Correct X bounds */ if(!sc_land_translate_x_range(w->c->land, &x1, &x2)) return; /* Check for overlap */ ox1 = x1; ox2 = x2; if(sc_land_overlap_x(w->c->land, &ox1, &ox2)) { sc_window_paint(w_, ox1, y1, ox2, y2, flags); } /* Determine the screen boundaries. */ screenx = x1; screeny = w->c->fieldheight - y2 - 1; screenw = x2 - x1 + 1; screenh = y2 - y1 + 1; /* Regeneration of land pixmap */ if(flags & SC_REGENERATE_LAND) { _sc_window_draw_land_gtk(w, x1, y1, x2, y2); } /* Regenerate the land? */ /* Unpaint any existing wind arrow, if clear given */ if(flags & SC_CLEAR_WIND_ARROW || flags & SC_REDRAW_WIND_ARROW) { _sc_window_draw_wind_arrow(w, false); } /* Undraw wind arrow from screen? */ /* Copy current land pixmap to screen. */ if(flags & SC_REDRAW_LAND) { gdk_draw_drawable(sc_display_get_buffer(SC_DISPLAY(w->screen)), sc_display_get_gc(SC_DISPLAY(w->screen)), w->landbuffer, screenx, screeny, screenx, screeny, screenw, screenh); sc_display_queue_draw(SC_DISPLAY(w->screen), screenx, screeny, screenw, screenh); } /* Copy land to screen? */ /* Draw any tanks in redraw area to the screen. */ if(flags & SC_REDRAW_TANKS) { _sc_window_draw_all_tanks_gtk(w, x1, y1, x2, y2); } /* Draw tanks to screen? */ /* Draw wind arrow if requested */ if(flags & SC_REDRAW_WIND_ARROW) { _sc_window_draw_wind_arrow(w, true); } /* Draw wind arrow to screen? */ } void sc_window_paint_circular(sc_window *w_, int centerx, int centery, int rad, int flags) { /* sc_window_paint_circular Like the above function, but this updates a circular region of the physical display (it will still update a rectangular region of the INTERNAL data structures, however). (centerx, centery) are specified in the usual virtual coordinates. It is NOT advised that you call this during a SC_REGENERATE_LAND. */ /* TEMP: I don't play the wraparound game, yet. */ /* TEMP: I don't play with wind arrows yet. */ GdkGC *gc = NULL; GdkGC *displaygc; GdkPixmap *mask = NULL; GdkColor black = { 0, 0x0000, 0x0000, 0x0000 }; GdkColor white = { 1, 0xffff, 0xffff, 0xffff }; sc_window_gtk *w = (sc_window_gtk *)w_;/* Window structure */ int size; int minx; int miny; /* Make sure radius is sane. */ if(rad < 0) return; /* Construct the clipping mask. This code is modelled from the code in sc_expl_cache_draw(). In fact, it pretty much is the same code... */ /* Get the display GC */ displaygc = sc_display_get_gc(SC_DISPLAY(w->screen)); /* Calculate the screen center coordinates */ size = rad + rad + 1; minx = centerx - rad; miny = (w->c->fieldheight - centery - 1) - rad; /* Create a new temporary mask */ mask = gdk_pixmap_new(NULL, size, size, 1); if(mask != NULL) gc = gdk_gc_new(mask); if(mask != NULL && gc != NULL) { gdk_gc_set_foreground(gc, &black); gdk_draw_rectangle(mask, gc, TRUE, 0, 0, size, size); gdk_gc_set_foreground(gc, &white); gdk_draw_arc(mask, gc, TRUE, 0, 0, size, size, 0, 360 * 64); gdk_gc_set_clip_mask(displaygc, mask); gdk_gc_set_clip_origin(displaygc, minx, miny); } /* Call the main painter */ sc_window_paint(w_, centerx - rad, centery - rad, centerx + rad, centery + rad, flags); /* Uninstall the clipping mask */ gdk_gc_set_clip_mask(displaygc, NULL); if(mask != NULL) g_object_unref(mask); if(gc != NULL) g_object_unref(gc); } void sc_window_undraw_tank(sc_window *w_, const sc_player *p) { /* sc_window_undraw_tank Erases the indicated tank from the player field (useful, f.e., if the tank is about to move). Uses p's coordinates to determine the current tank location. */ int radius = p->tank->turretradius; sc_window_paint(w_, p->x - radius, p->y - radius, p->x + radius, p->y + radius, SC_REDRAW_LAND); } void sc_window_draw_tank(sc_window *w_, const sc_player *p) { /* sc_window_draw_tank Draws the indicated tank from the player field (useful, f.e., if the tank has just moved). Uses p's coordinates to determine the current tank location. */ int radius = p->tank->turretradius; sc_window_paint(w_, p->x - radius, p->y - radius, p->x + radius, p->y + radius, SC_REDRAW_TANKS); } void sc_window_redraw_tank(sc_window *w_, const sc_player *p) { /* sc_window_redraw_tank Redraws the indicated tank to the screen - useful when the tank has just changed configuration, e.g. shield or turret-angle changes. */ int radius = p->tank->turretradius; sc_window_paint(w_, p->x - radius, p->y - radius, p->x + radius, p->y + radius, SC_REDRAW_LAND | SC_REDRAW_TANKS); } void sc_window_undraw_weapon(sc_window *w_, const sc_weapon *wp) { /* sc_window_undraw_weapon Erase the indicated weapon from the screen. */ sc_window_gtk *w = (sc_window_gtk *)w_; int size = w->c->weapons->bombiconsize; int x = rint(wp->tr->curx) - (size >> 1); int y = rint(wp->tr->cury) - (size >> 1); sc_window_paint(w_, x, y - size + 1, x + size - 1, y, SC_REDRAW_LAND | SC_REDRAW_TANKS); } void sc_window_draw_weapon(sc_window *w_, const sc_weapon *wp) { /* sc_window_draw_weapon Draw the indicated weapon to the screen. */ sc_window_gtk *w = (sc_window_gtk *)w_; int size = w->c->weapons->bombiconsize; GdkPixmap *buffer; GdkGC *gc; int x; int y; x = rint(wp->tr->curx) - (size >> 1); y = rint(wp->tr->cury) - (size >> 1); if(!sc_land_translate_xy(w->c->land, &x, &y)) return; x = x; y = w->c->fieldheight - y - 1; buffer = sc_display_get_buffer(SC_DISPLAY(w->screen)); gc = sc_display_get_gc(SC_DISPLAY(w->screen)); gdk_gc_set_foreground(gc, &w->colormap->white); gdk_draw_rectangle(buffer, gc, TRUE, x, y, size, size); sc_display_queue_draw(SC_DISPLAY(w->screen), x, y, size, size); } void sc_window_paint_blank(sc_window *w_) { /* sc_window_paint_blank Erase the entire screen and fill it in with black. */ sc_window_gtk *w = (sc_window_gtk *)w_; gdk_gc_set_foreground(sc_display_get_gc(SC_DISPLAY(w->screen)), &w->colormap->black); gdk_draw_rectangle(sc_display_get_buffer(SC_DISPLAY(w->screen)), sc_display_get_gc(SC_DISPLAY(w->screen)), TRUE, 0, 0, w->screen->allocation.width, w->screen->allocation.height); sc_display_queue_draw(SC_DISPLAY(w->screen), 0, 0, w->screen->allocation.width, w->screen->allocation.height); } static sc_trajectory_result _sc_window_draw_arc_gtk(sc_config *c, sc_trajectory *tr, void *data) { /* sc_window_draw_arc_gtk */ sc_window_gtk *w = (sc_window_gtk *)data; GdkPixmap *buffer; GdkGC *gc; int x; int y; x = rint(tr->curx); y = rint(tr->cury); if(!sc_land_translate_xy(w->c->land, &x, &y)) { return(SC_TRAJ_CONTINUE); } buffer = sc_display_get_buffer(SC_DISPLAY(w->screen)); gc = sc_display_get_gc(SC_DISPLAY(w->screen)); gdk_gc_set_foreground(gc, &w->colormap->pcolors[tr->victim]); gdk_draw_rectangle(buffer, gc, TRUE, x, c->fieldheight - y - 1, 1, 1); sc_display_queue_draw(SC_DISPLAY(w->screen), x, c->fieldheight - y - 1, 1, 1); return(SC_TRAJ_CONTINUE); } static sc_trajectory_result _sc_window_clear_arc_gtk(__libj_unused sc_config *c, sc_trajectory *tr, void *data) { /* sc_window_clear_arc_gtk */ sc_window_gtk *w = (sc_window_gtk *)data; int x = rint(tr->curx); int y = rint(tr->cury); sc_window_paint((sc_window *)w, x, y, x, y, SC_REDRAW_LAND | SC_REDRAW_TANKS); return(SC_TRAJ_CONTINUE); } void sc_window_draw_arc(sc_window *w_, sc_trajectory *tr, int playerid) { /* sc_window_draw_arc */ sc_window_gtk *w = (sc_window_gtk *)w_; sc_traj_reinitialize(tr); tr->victim = playerid; sc_traj_run(w->c, tr, SC_TRAJ_IGNORE_TANK | SC_TRAJ_IGNORE_LAND, _sc_window_draw_arc_gtk, w); } void sc_window_clear_arc(sc_window *w_, sc_trajectory *tr) { /* sc_window_clear_arc */ sc_window_gtk *w = (sc_window_gtk *)w_; sc_traj_reinitialize(tr); sc_traj_run(w->c, tr, SC_TRAJ_IGNORE_TANK | SC_TRAJ_IGNORE_LAND, _sc_window_clear_arc_gtk, w); } xscorch-0.2.1/sgtk/sphysics-gtk.c0000644000175000001440000001013711175116145013650 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sphysics-gtk.c,v 1.14 2009-04-26 17:39:49 jacob Exp $ */ /* xscorch - sphysics-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Physics configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include typedef struct _sc_physics_setup_data_gtk { sc_config *c; sc_physics *ph; double airviscosity; double gravity; double damping; double maxwind; bool dynamicwind; int suspenddirt; int tanksfall; int bordersextend; int wallidx; } sc_physics_setup_data_gtk; static void _sc_physics_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_physics_setup_data_gtk *setup) { sc_physics *ph = setup->ph; ph->airviscosity = setup->airviscosity; ph->gravity = setup->gravity; ph->damping = setup->damping; ph->maxwind = setup->maxwind; ph->dynamicwind = setup->dynamicwind; ph->suspenddirt = setup->suspenddirt; ph->tanksfall = setup->tanksfall; ph->bordersextend= setup->bordersextend; ph->walls = sc_physics_wall_types()[setup->wallidx]; #if USE_NETWORK if(SC_NETWORK_SERVER(setup->c)) sc_net_server_send_config(setup->c, setup->c->server); #endif } void sc_physics_setup_gtk(sc_window_gtk *w) { sc_physics *ph = w->c->physics; sc_physics_setup_data_gtk setup; ScDialog *dialog; int confirm = (SC_NETWORK_AUTH(w->c) ? SC_DIALOG_OK : 0); int row = 0; setup.c = w->c; setup.ph = ph; setup.airviscosity = ph->airviscosity; setup.gravity = ph->gravity; setup.damping = ph->damping; setup.maxwind = ph->maxwind; setup.dynamicwind = ph->dynamicwind; setup.suspenddirt = ph->suspenddirt; setup.tanksfall = ph->tanksfall; setup.bordersextend= ph->bordersextend; setup.wallidx = 0; while(ph->walls != sc_physics_wall_types()[setup.wallidx]) ++setup.wallidx; dialog = SC_DIALOG(sc_dialog_new("Physics Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_physics_setup_apply_gtk, &setup); attach_option(dialog, w, "N/A: Air Viscosity", sc_link_spinf_new(&setup.airviscosity, 0, SC_PHYSICS_VISCOUS_MAX, 0.001), &row); attach_option(dialog, w, "Gravity", sc_link_spinf_new(&setup.gravity, 0, SC_PHYSICS_GRAVITY_MAX, 0.01), &row); attach_option(dialog, w, "Ground Damping", sc_link_spinf_new(&setup.damping, 0, SC_TRAJ_DAMPING_MAX, 0.01), &row); attach_option(dialog, w, "N/A: Suspend Dirt", sc_link_spin_new(&setup.suspenddirt, 0, 100, 1), &row); attach_option(dialog, w, "N/A: Tanks Fall", sc_link_spin_new(&setup.tanksfall, 0, 100, 1), &row); attach_option(dialog, w, "Borders Extend", sc_link_spin_new(&setup.bordersextend, 0, SC_PHYSICS_BORDERS_MAX, SC_PHYSICS_BORDERS_MAX / 100), &row); attach_option(dialog, w, "Walls Are", sc_link_combo_new(&setup.wallidx, sc_physics_wall_names()), &row); attach_option(dialog, w, "Maximum Wind Speed", sc_link_spinf_new(&setup.maxwind, 0, SC_PHYSICS_WIND_MAX, 0.01), &row); attach_option(dialog, w, "Wind is Dynamic", sc_link_check_new(&setup.dynamicwind), &row); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/splayer-gtk.c0000644000175000001440000001720311175116146013464 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/splayer-gtk.c,v 1.16 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - splayer-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Player configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include typedef struct _sc_single_player_setup { char name[SC_PLAYER_NAME_LENGTH]; int aiidx; int tankidx; bool enabled; } sc_single_player_setup; typedef struct _sc_player_setup_data_gtk { sc_config *c; bool aionly; int numplayers; int minplayers; int numrounds; const unsigned int *aitypes; const char **ainames; sc_single_player_setup players[SC_MAX_PLAYERS]; GtkWidget *isai[SC_MAX_PLAYERS]; GtkWidget *name[SC_MAX_PLAYERS]; GtkWidget *tank[SC_MAX_PLAYERS]; } sc_player_setup_data_gtk; static inline void _sc_player_sensitize_gtk(__libj_unused GtkWidget *widget, gpointer data) { sc_player_setup_data_gtk *pl = data; bool enabled; int i; for(i = 0; i < SC_MAX_PLAYERS; ++i) { enabled = (i < pl->numplayers) && pl->players[i].enabled; gtk_widget_set_sensitive(pl->isai[i], enabled); gtk_widget_set_sensitive(pl->name[i], enabled); gtk_widget_set_sensitive(pl->tank[i], enabled); } } static void _sc_player_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_player_setup_data_gtk *pl) { sc_config *c = pl->c; int i; c->numplayers = pl->numplayers; c->numrounds = pl->numrounds; for(i = 0; i < SC_MAX_PLAYERS; ++i) { strcopyb(c->players[i]->name, pl->players[i].name, sizeof(c->players[i]->name)); c->players[i]->aitype = pl->aitypes[pl->players[i].aiidx]; c->players[i]->tank = sc_tank_profile_lookup(c->tanks, pl->players[i].tankidx); } } void sc_player_setup_gtk(sc_window_gtk *w) { char help1[SC_GTK_STRING_BUFFER]; char help2[SC_GTK_STRING_BUFFER]; char help3[SC_GTK_STRING_BUFFER]; const char **tanklist; int tankcount; sc_config *c = w->c; sc_player_setup_data_gtk pl; ScDialog *dialog; GtkWidget *tbox; GtkWidget *widget; int confirm = (SC_NETWORK_MODE(c) ? 0 : SC_DIALOG_OK); unsigned int aitype; int i; /* What is the player minimum? */ if(SC_NETWORK_MODE(c)) { pl.minplayers = 0; pl.aionly = true; for(i = 0; i < c->numplayers; ++i) { if(c->players[i]->aitype == SC_AI_HUMAN || c->players[i]->aitype == SC_AI_NETWORK) ++pl.minplayers; } pl.aitypes = sc_ai_types_nohuman(); pl.ainames = sc_ai_names_nohuman(); } else { pl.minplayers = 2; pl.aionly = false; pl.aitypes = sc_ai_types_nonet(); pl.ainames = sc_ai_names_nonet(); } pl.c = c; pl.numplayers = c->numplayers; pl.numrounds = c->numrounds; for(i = 0; i < SC_MAX_PLAYERS; ++i) { strcopyb(pl.players[i].name, c->players[i]->name, sizeof(pl.players[i].name)); pl.players[i].tankidx = sc_tank_profile_index_of(c->tanks, c->players[i]->tank); /* Compute the player index -- use caution! */ aitype = c->players[i]->aitype; if(aitype == SC_AI_NETWORK) aitype = SC_AI_HUMAN; if(pl.aionly && aitype == SC_AI_HUMAN) { pl.players[i].enabled = false; pl.players[i].aiidx = 0; /* caution: assumes human is first */ } else { pl.players[i].enabled = true; pl.players[i].aiidx = 0; /* caution: assumes human is first */ while(pl.aitypes[pl.players[i].aiidx] != aitype) { ++pl.players[i].aiidx; } } } dialog = SC_DIALOG(sc_dialog_new("Player Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_player_setup_apply_gtk, &pl); tbox = gtk_table_new(2, 2, FALSE); gtk_table_attach(GTK_TABLE(dialog->grid), tbox, 0, 3, 0, 1, GTK_FILL, GTK_FILL | GTK_EXPAND, 2, 2); sc_help_text(help1, sizeof(help1), "Number of Players"); widget = tooltip(w, help1, sc_label_new("Number of players:")); gtk_table_attach(GTK_TABLE(tbox), widget, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 2, 2); gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); widget = tooltip(w, help1, sc_link_spin_new(&pl.numplayers, pl.minplayers, SC_MAX_PLAYERS, 1)); g_signal_connect(G_OBJECT(widget), "modified", (GCallback)_sc_player_sensitize_gtk, &pl); gtk_table_attach(GTK_TABLE(tbox), widget, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); sc_help_text(help1, sizeof(help1), "Number of Rounds"); widget = tooltip(w, help1, sc_label_new("Number of rounds:")); gtk_table_attach(GTK_TABLE(tbox), widget, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 2, 2); gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); widget = tooltip(w, help1, sc_link_spin_new(&pl.numrounds, 1, SC_MAX_ROUNDS, 1)); g_signal_connect(G_OBJECT(widget), "modified", (GCallback)_sc_player_sensitize_gtk, &pl); gtk_table_attach(GTK_TABLE(tbox), widget, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); sc_help_text(help1, sizeof(help1), "AI Type"); sc_help_text(help2, sizeof(help1), "Player Name"); sc_help_text(help3, sizeof(help1), "Tank Style"); sc_dialog_grid_attach(dialog, tooltip(w, help1, sc_label_new("AI type")), 3, 0); sc_dialog_grid_attach(dialog, tooltip(w, help2, sc_label_new("Player name")), 3, 1); sc_dialog_grid_attach(dialog, tooltip(w, help3, sc_label_new("Tank style")), 3, 2); tankcount = sc_tank_profile_size(c->tanks); tanklist = (const char **)malloc(sizeof(char *) * (tankcount + 1)); for(i = 0; i < tankcount; ++i) { tanklist[i] = sc_tank_profile_lookup(c->tanks, i)->name; } tanklist[tankcount] = NULL; for(i = 0; i < SC_MAX_PLAYERS; ++i) { if(pl.players[i].enabled) { pl.isai[i] = tooltip(w, help1, sc_link_combo_new(&pl.players[i].aiidx, pl.ainames)); } else { pl.isai[i] = tooltip(w, help1, sc_link_combo_new(&pl.players[i].aiidx, sc_ai_names())); } g_signal_connect(G_OBJECT(pl.isai[i]), "modified", (GCallback)_sc_player_sensitize_gtk, &pl); sc_dialog_grid_attach(dialog, pl.isai[i], i + 7, 0); pl.name[i] = tooltip(w, help2, sc_link_entry_new(pl.players[i].name, SC_PLAYER_NAME_LENGTH)); g_signal_connect(G_OBJECT(pl.name[i]), "modified", (GCallback)_sc_player_sensitize_gtk, &pl); sc_dialog_grid_attach(dialog, pl.name[i], i + 7, 1); pl.tank[i] = tooltip(w, help3, sc_link_combo_new(&pl.players[i].tankidx, tanklist)); g_signal_connect(G_OBJECT(pl.tank[i]), "modified", (GCallback)_sc_player_sensitize_gtk, &pl); sc_dialog_grid_attach(dialog, pl.tank[i], i + 7, 2); } _sc_player_sensitize_gtk(NULL, &pl); sc_dialog_run(dialog); free(tanklist); } xscorch-0.2.1/sgtk/ssetup-gtk.h0000644000175000001440000000311411175116146013331 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/ssetup-gtk.h,v 1.8 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - ssetup-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Function prototypes for the various setup functions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __ssetup_gtk_h_included #define __ssetup_gtk_h_included #include /* Interface functions */ void sc_player_setup_gtk(sc_window_gtk *w); void sc_economy_setup_gtk(sc_window_gtk *w); void sc_physics_setup_gtk(sc_window_gtk *w); void sc_land_setup_gtk(sc_window_gtk *w); void sc_weapons_setup_gtk(sc_window_gtk *w); void sc_options_setup_gtk(sc_window_gtk *w); void sc_graphics_setup_gtk(sc_window_gtk *w); void sc_ai_controller_setup_gtk(sc_window_gtk *w); void sc_sound_setup_gtk(sc_window_gtk *w); void sc_config_file_save_gtk(sc_window_gtk *w); void sc_font_gtk(sc_window_gtk *w); #endif /* __ssetup_gtk_h_included */ xscorch-0.2.1/sgtk/ssound-gtk.c0000644000175000001440000000504611175116146013322 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/ssound-gtk.c,v 1.12 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - ssound-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Sound configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #if !USE_SOUND void sc_sound_setup_gtk(sc_window_gtk *w) { sc_dialog_message("Sound support not enabled", "Sound support not enabled"); } #else /* Sound dialogue... */ typedef struct _sc_sound_setup_data_gtk { sc_config *c; bool enablesound; bool usehqmixer; } sc_sound_setup_data_gtk; static void _sc_sound_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_sound_setup_data_gtk *setup) { sc_config *c = setup->c; if(c->enablesound != setup->enablesound || c->usehqmixer != setup->usehqmixer) { c->enablesound = setup->enablesound; c->usehqmixer = setup->usehqmixer; sc_sound_config(&c->sound, c->enablesound, c->usehqmixer); sc_sound_start(c->sound, c->game->musicid); } } void sc_sound_setup_gtk(sc_window_gtk *w) { sc_config *c = w->c; sc_sound_setup_data_gtk setup; ScDialog *dialog; int row = 0; setup.c = c; setup.enablesound = c->enablesound; setup.usehqmixer = c->usehqmixer; dialog = SC_DIALOG(sc_dialog_new("Sound Setup", NULL, SC_DIALOG_OK | SC_DIALOG_CANCEL | SC_DIALOG_APPLY)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_sound_setup_apply_gtk, &setup); attach_option(dialog, w, "Enable Sound", sc_link_check_new(&setup.enablesound), &row); attach_option(dialog, w, "Use HQ Mixer", sc_link_check_new(&setup.usehqmixer), &row); sc_dialog_run(dialog); } #endif /* Sound allowed? */ xscorch-0.2.1/sgtk/sspill-gtk.c0000644000175000001440000002121111175116146013305 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sspill-gtk.c,v 1.9 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - sspill-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Window painting code, specific to "spill" explosions like napalm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #define SC_NAPALM_FLAME_RAD 16 #define SC_NAPALM_FLAME_PROB 0.015 static int *_sc_window_height_map_gtk(const sc_config *c, const int *xlist, const int *ylist, int size) { /* sc_window_height_map_gtk Creates a heightmap for the list of coordinates, given. If there is no data point for a particular value of x, the cooresponding height will be set to -1. On success, a structure is returned which must be released manually, using free(). */ const int *pxlist; /* Pointer into X coord array */ const int *pylist; /* Pointer into Y coord array */ int *heightmap; /* Data structure storing hmap */ int *pmap; /* Pointer into the map */ int x; /* X coordinate */ int y; /* Y coordiante */ int i; /* Iterator */ /* Create storage for the heightmap */ heightmap = (int *)malloc(sizeof(int) * c->fieldwidth); if(heightmap == NULL) return(NULL); /* Initialise the heightmap */ pmap = heightmap; for(x = 0; x < c->fieldwidth; ++x) { *(pmap++) = -1; } /* Initialising map array */ /* Construct datavalues for the heightmap, as needed */ pxlist = xlist; pylist = ylist; for(i = 0; i < size; ++i) { /* Get the raw X,Y coordinates */ x = *(pxlist++); y = *(pylist++); /* Translate to `proper' screen coordinates, if possible. */ if(sc_land_translate_xy(c->land, &x, &y)) { /* Was this point higher than previously known height? */ if(heightmap[x] < y) heightmap[x] = y; } } /* Successful return */ return(heightmap); } static int *_sc_window_flame_map_gtk(const sc_config *c) { /* sc_window_flame_map_gtk */ double dist; int *flamemap; int maxdelta; int effect; int bigrad; int delta; int theta; int size; int rad; int max; int idx; int x; int y; size = SC_NAPALM_FLAME_RAD * 2 + 1; flamemap = (int *)malloc(sizeof(int) * SQR(size)); if(flamemap == NULL) return(NULL); memset((char *)flamemap, 0xff, sizeof(int) * SQR(size)); max = c->colors->gradsize[SC_GRAD_FLAMES] - 1; rad = SC_NAPALM_FLAME_RAD / 2 + sys_lrand(SC_NAPALM_FLAME_RAD / 2) + 1; theta = 60; bigrad = rad / sin(theta * M_PI / 180); maxdelta = (1 - cos(theta * M_PI / 180)) * bigrad; effect = 0; for(y = -rad; y < rad; ++y) { delta = sqrt(SQR(bigrad) - SQR(y)) - cos(theta * M_PI / 180) * bigrad; if(effect - delta < -SC_NAPALM_FLAME_RAD) effect = -SC_NAPALM_FLAME_RAD + delta; if(effect + delta > SC_NAPALM_FLAME_RAD) effect = SC_NAPALM_FLAME_RAD - delta; for(x = -delta; x < delta; ++x) { idx = (y + rad) * size + x + effect + SC_NAPALM_FLAME_RAD; dist = sqrt(SQR((double)x / maxdelta) + SQR((double)(y + rad) / (2 * rad))); *(flamemap + idx) = max - dist * max / M_SQRT2; } switch(sys_lrand(5)) { case 0: ++effect; break; case 1: --effect; break; } } return(flamemap); } static void _sc_window_draw_flames_gtk(sc_window_gtk *w, const int *xlist, const int *ylist, int size) { /* sc_window_draw_flames_gtk */ GdkPixmap *buffer; GdkGC *gc; int *flamemap; int *heights; int *heightp; int boundx1; int boundy1; int boundx2; int boundy2; int height; int px; int py; int x; int y; heights = _sc_window_height_map_gtk(w->c, xlist, ylist, size); if(heights == NULL) return; height = w->c->fieldheight; buffer = sc_display_get_buffer(SC_DISPLAY(w->screen)); gc = sc_display_get_gc(SC_DISPLAY(w->screen)); gdk_gc_set_foreground(gc, &w->colormap->napalm); boundx1 = w->c->fieldwidth; boundx2 = w->c->fieldheight; boundy1 = 0; boundy2 = 0; for(heightp = heights, x = 0; x < w->c->fieldwidth; ++heightp, ++x) { y = *heightp; if(y >= 0 && sys_drand() < SC_NAPALM_FLAME_PROB) { flamemap = _sc_window_flame_map_gtk(w->c); if(flamemap != NULL) { for(py = 0; py < SC_NAPALM_FLAME_RAD * 2 + 1; ++py) { for(px = 0; px < SC_NAPALM_FLAME_RAD * 2 + 1; ++px) { if(*(flamemap + py * (SC_NAPALM_FLAME_RAD * 2 + 1) + px) >= 0) { gdk_gc_set_foreground(gc, &w->colormap->gradient[SC_GRAD_FLAMES][*(flamemap + py * (SC_NAPALM_FLAME_RAD * 2 + 1) + px)]); gdk_draw_point(buffer, gc, x + px - SC_NAPALM_FLAME_RAD, height - y - py); } } } free(flamemap); } if(x - SC_NAPALM_FLAME_RAD < boundx1) boundx1 = x - SC_NAPALM_FLAME_RAD; if(x + SC_NAPALM_FLAME_RAD > boundx2) boundx2 = x + SC_NAPALM_FLAME_RAD; if(y < boundy1) boundy1 = y; if(y + 2 * SC_NAPALM_FLAME_RAD > boundy2) boundy2 = y + 2 * SC_NAPALM_FLAME_RAD; } } free(heights); sc_display_queue_draw(SC_DISPLAY(w->screen), boundx1, height - boundy2 - 1, boundx2 - boundx1 + 1, boundy2 - boundy1 + 1); } void sc_window_draw_napalm_frame(sc_window *w_, const int *xlist, const int *ylist, int size) { /* sc_window_draw_napalm_frame */ sc_window_gtk *w = (sc_window_gtk *)w_; GdkPixmap *buffer; GdkGC *gc; int boundx1; int boundy1; int boundx2; int boundy2; int height; int x; int y; if(xlist == NULL || ylist == NULL || w_ == NULL) return; boundx1 = w->c->fieldwidth; boundx2 = w->c->fieldheight; boundy1 = 0; boundy2 = 0; height = w->c->fieldheight; buffer = sc_display_get_buffer(SC_DISPLAY(w->screen)); gc = sc_display_get_gc(SC_DISPLAY(w->screen)); gdk_gc_set_foreground(gc, &w->colormap->napalm); while(size > 0) { x = *xlist; y = *ylist; if(sc_land_translate_xy(w->c->land, &x, &y)) { gdk_draw_point(buffer, gc, x, height - y - 1); if(*xlist < boundx1) boundx1 = x; if(*xlist > boundx2) boundx2 = x; if(*ylist < boundy1) boundy1 = y; if(*ylist > boundy2) boundy2 = y; } ++xlist; ++ylist; --size; } sc_display_queue_draw(SC_DISPLAY(w->screen), boundx1, height - boundy2 - 1, boundx2 - boundx1 + 1, boundy2 - boundy1 + 1); } void sc_window_draw_napalm_final(sc_window *w_, const int *xlist, const int *ylist, int totalsize) { /* sc_window_draw_napalm_final */ if(xlist == NULL || ylist == NULL || w_ == NULL) return; _sc_window_draw_flames_gtk((sc_window_gtk *)w_, xlist, ylist, totalsize); } void sc_window_clear_napalm(sc_window *w_, const int *xlist, const int *ylist, int totalsize) { /* sc_window_clear_napalm */ sc_window_gtk *w = (sc_window_gtk *)w_; int boundx1; int boundy1; int boundx2; int boundy2; if(xlist == NULL || ylist == NULL || w_ == NULL) return; boundx1 = w->c->fieldwidth; boundx2 = w->c->fieldheight; boundy1 = 0; boundy2 = 0; while(totalsize > 0) { if(*xlist < boundx1) boundx1 = *xlist; if(*xlist > boundx2) boundx2 = *xlist; if(*ylist < boundy1) boundy1 = *ylist; if(*ylist > boundy2) boundy2 = *ylist; ++xlist; ++ylist; --totalsize; } boundx1 -= SC_NAPALM_FLAME_RAD; boundx2 += SC_NAPALM_FLAME_RAD; boundy2 += 2 * SC_NAPALM_FLAME_RAD; sc_window_paint(w_, boundx1, boundy1, boundx2, boundy2, SC_REDRAW_LAND | SC_REDRAW_TANKS); } xscorch-0.2.1/sgtk/sstatus-gtk.c0000644000175000001440000002660511175116146013521 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sstatus-gtk.c,v 1.38 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - sstatus-gtk.c Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK top statusbar This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define SC_TWO_ROW_BOUNDARY 90 typedef enum _sc_status_state { SC_STATUS_NORMAL, SC_STATUS_PLAYER, SC_STATUS_BOLD } sc_status_state; #define SC_STATUS_TOGGLE_WEAPON 0x01 #define SC_STATUS_TOGGLE_SHIELD 0x02 #define SC_STATUS_TOGGLE_TRIGGER 0x03 #define SC_STATUS_ACTIVATE_SHIELD 0x10 #define SC_STATUS_ACTIVATE_BATTERY 0x11 #define SC_STATUS_MOVE_PLAYER 0x20 static void _sc_status_reset_state(sc_window_gtk *w, gboolean sens) { w->statenabled = sens; gtk_widget_set_sensitive(GTK_WIDGET(w->status), sens); sc_active_console_detach_all_spots(SC_ACTIVE_CONSOLE(w->status)); sc_console_clear(SC_CONSOLE(w->status)); } static void _sc_status_write_line(const sc_window_gtk *w, const sc_player *p, int x, int y, const char *text, sc_status_state state) { switch(state) { case SC_STATUS_NORMAL: break; case SC_STATUS_PLAYER: sc_console_highlight_attach(SC_CONSOLE(w->status), &w->colormap->pcolors[p->index], NULL, FALSE, x, y, strlenn(text), 1); break; case SC_STATUS_BOLD: sc_console_highlight_attach(SC_CONSOLE(w->status), &w->colormap->white, NULL, TRUE, x, y, strlenn(text), 1); break; } /* what highlight mode? */ sc_console_write_line(SC_CONSOLE(w->status), x, y, text); } static gboolean _sc_status_activate_item(__libj_unused GtkWidget *widget, ScActiveConsoleSpot *spot, sc_window_gtk *w) { sc_player *curplayer = w->c->plorder[w->c->game->curplayer]; /* Make sure the game is enabled at this point */ if(!SC_STATE_IS_ENABLED(w->c->game) || SC_STATE_IS_PAUSE(w->c->game)) return(FALSE); /* What action to perform? */ switch((long)spot->data) { case SC_STATUS_TOGGLE_WEAPON: sc_player_advance_weapon(w->c, curplayer, 1); return(TRUE); case SC_STATUS_TOGGLE_SHIELD: sc_player_advance_shield(w->c, curplayer, SC_PLAYER_SHIELD_DEFAULTS); return(TRUE); case SC_STATUS_TOGGLE_TRIGGER: sc_player_set_contact_triggers(w->c, curplayer, !curplayer->contacttriggers); return(TRUE); case SC_STATUS_ACTIVATE_SHIELD: sc_player_activate_shield(w->c, curplayer); return(TRUE); case SC_STATUS_ACTIVATE_BATTERY: sc_player_activate_battery(w->c, curplayer); return(TRUE); case SC_STATUS_MOVE_PLAYER: sc_window_tank_move_gtk(w, curplayer); return(TRUE); } return(FALSE); } void sc_status_update(sc_window *w_, const sc_player *p) { int size; const sc_weapon_info *wi; const sc_accessory_info *si; char buf[SC_GTK_STRING_BUFFER]; sc_window_gtk *w = (sc_window_gtk *)w_; int start; int spot_start; int end_line_one; if(w == NULL) return; wi = p->selweapon; si = p->selshield; if(wi == NULL || si == NULL) { fprintf(stderr, "warning: player is missing either shields or weapons, status NOT updated!\n"); return; } sc_window_redraw_tank(w_, p); if(p->aitype == SC_AI_NETWORK) return; size = w->c->fieldwidth / sc_console_get_col_width(SC_CONSOLE(w->status)); _sc_status_reset_state(w, TRUE); _sc_status_write_line(w, p, size - strlenn(p->name) - 2, size < SC_TWO_ROW_BOUNDARY ? 1 : 0, p->name, SC_STATUS_PLAYER); if(size < SC_TWO_ROW_BOUNDARY) { /* We must scale player tank life to display in game life units. */ sbprintf(buf, sizeof(buf), "Ang: %3d %c Pwr: %4d %c Shld: %3d%% %3d%c", (p->turret >= 90 ? 180 - p->turret : p->turret), p->turret > 90 ? '<' : '>', p->power, (p->contacttriggers ? 'T' : ' '), p->shield != NULL ? p->shield->life * 100 / p->shield->info->shield : 0, si->shield / 100, SC_ACCESSORY_SHIELD_CHAR(si)); sc_console_write_line(SC_CONSOLE(w->status), 1, 0, buf); sbprintf(buf, sizeof(buf), "%2d %-16s Wind: %4d %c", wi->inventories[p->index], wi->name, abs((int)(w->c->physics->curwind * 1000 / SC_PHYSICS_WIND_MAX)), (w->c->physics->curwind >= 0 ? '>' : '<')); sc_console_write_line(SC_CONSOLE(w->status), 1, 1, buf); } else { /* Skip the first column */ start = 1; sbprintf(buf, sizeof(buf), "[Ang: %2d %c]", p->turret >= 90 ? 180 - p->turret : p->turret, p->turret > 90 ? '<' : '>'); _sc_status_write_line(w, p, start, 0, buf, SC_STATUS_NORMAL); start += 11; sbprintf(buf, sizeof(buf), "[Pwr: %4d]", p->power); _sc_status_write_line(w, p, start, 0, buf, SC_STATUS_NORMAL); start += 11; _sc_status_write_line(w, p, start, 0, "[Shld: Cur: ]", SC_STATUS_NORMAL); if(SC_ACCESSORY_IS_NULL(si)) { sbprintf(buf, sizeof(buf), " None"); } else { sbprintf(buf, sizeof(buf), "%2dx %3d%c", si->inventories[p->index], si->shield / 100, SC_ACCESSORY_SHIELD_CHAR(si)); } spot_start = start + 7; sc_active_console_add_spot(SC_ACTIVE_CONSOLE(w->status), spot_start, 0, 8, 1, (gpointer)SC_STATUS_TOGGLE_SHIELD); _sc_status_write_line(w, p, spot_start, 0, buf, SC_ACCESSORY_IS_NULL(si) ? SC_STATUS_BOLD : SC_STATUS_NORMAL); spot_start += 14; sc_active_console_add_spot(SC_ACTIVE_CONSOLE(w->status), spot_start, 0, 4, 1, (gpointer)SC_STATUS_ACTIVATE_SHIELD); sbprintf(buf, sizeof(buf), "%3d%%", p->shield != NULL ? p->shield->life * 100 / p->shield->info->shield : 0); _sc_status_write_line(w, p, spot_start, 0, buf, p->shield == NULL ? SC_STATUS_BOLD : SC_STATUS_NORMAL); start += 26; _sc_status_write_line(w, p, start, 0, "[ ]", SC_STATUS_NORMAL); if(SC_WEAPON_IS_NULL(wi)) { sbprintf(buf, sizeof(buf), " "); } else { sbprintf(buf, sizeof(buf), "%2dx", wi->inventories[p->index]); } spot_start = start + 1; sc_active_console_add_spot(SC_ACTIVE_CONSOLE(w->status), spot_start, 0, 23, 1, (gpointer)SC_STATUS_TOGGLE_WEAPON); _sc_status_write_line(w, p, spot_start, 0, buf, SC_STATUS_NORMAL); spot_start += 4; sbprintf(buf, sizeof(buf), "%-16s ", wi->name); _sc_status_write_line(w, p, spot_start, 0, buf, SC_WEAPON_IS_NULL(wi) ? SC_STATUS_BOLD : SC_STATUS_NORMAL); spot_start += 18; sbprintf(buf, sizeof(buf), "%c", p->contacttriggers ? 'T' : ' '); _sc_status_write_line(w, p, spot_start, 0, buf, SC_STATUS_NORMAL); start += 25; end_line_one = start; if(w->c->options.extstatus) { start = 1; sbprintf(buf, sizeof(buf), "Round %d/%d", w->c->curround + 1, w->c->numrounds); _sc_status_write_line(w, p, size - strlenn(buf) - 2, 1, buf, SC_STATUS_NORMAL); sbprintf(buf, sizeof(buf), "[Life: %4d]", INT_ROUND_DIV(p->life, p->tank->hardness)); _sc_status_write_line(w, p, start, 1, buf, SC_STATUS_PLAYER); start += 12; sbprintf(buf, sizeof(buf), "[Batt: %2d]", sc_player_battery_count(w->c, p)); spot_start = start + 1; sc_active_console_add_spot(SC_ACTIVE_CONSOLE(w->status), spot_start, 1, 8, 1, (gpointer)SC_STATUS_ACTIVATE_BATTERY); _sc_status_write_line(w, p, start, 1, buf, SC_STATUS_PLAYER); start += 10; sbprintf(buf, sizeof(buf), "[Trig: %2d]", sc_player_contact_trigger_count(w->c, p)); spot_start = start + 1; sc_active_console_add_spot(SC_ACTIVE_CONSOLE(w->status), spot_start, 1, 8, 1, (gpointer)SC_STATUS_TOGGLE_TRIGGER); _sc_status_write_line(w, p, start, 1, buf, SC_STATUS_PLAYER); start += 10; sbprintf(buf, sizeof(buf), "[Fuel: %4d]", sc_player_total_fuel(w->c->accessories, p)); spot_start = start + 1; sc_active_console_add_spot(SC_ACTIVE_CONSOLE(w->status), spot_start, 1, 10, 1, (gpointer)SC_STATUS_MOVE_PLAYER); _sc_status_write_line(w, p, start, 1, buf, SC_STATUS_PLAYER); start += 28; sbprintf(buf, sizeof(buf), "[Wind: %3d %c]", abs((int)(w->c->physics->curwind * 1000 / SC_PHYSICS_WIND_MAX)), (w->c->physics->curwind >= 0 ? '>' : '<')); _sc_status_write_line(w, p, start, 1, buf, SC_STATUS_NORMAL); start += 13; assert(end_line_one == start); } /* Extended status */ } } void sc_status_player_message(sc_window *w_, const sc_player *p, const char *msg) { sc_window_gtk *w = (sc_window_gtk *)w_; char buf[SC_GTK_STRING_BUFFER]; if(w == NULL) return; sbprintf(buf, sizeof(buf), " %s: %s", p->name, msg); _sc_status_reset_state(w, FALSE); _sc_status_write_line(w, p, 1, 0, buf, SC_STATUS_PLAYER); } void sc_status_message(sc_window *w_, const char *msg) { sc_window_gtk *w = (sc_window_gtk *)w_; if(w == NULL) return; _sc_status_reset_state(w, FALSE); sc_console_write_line(SC_CONSOLE(w->status), 1, 0, msg); } void sc_status_setup(sc_window *w_) { sc_window_gtk *w = (sc_window_gtk *)w_; int size; int rows; if(w == NULL) return; rows = 1; size = w->c->fieldwidth / sc_console_get_col_width(SC_CONSOLE(w->status)); if(size < SC_TWO_ROW_BOUNDARY || w->c->options.extstatus) ++rows; sc_active_console_init(SC_ACTIVE_CONSOLE(w->status), 0, 0, size, rows, CONSOLE_BORDERLESS, w->fixed_font, w->bold_fixed_font); gtk_widget_set_sensitive(GTK_WIDGET(w->status), FALSE); } void sc_status_suspend(sc_window *_w) { sc_window_gtk *w = (sc_window_gtk *)_w; gtk_widget_set_sensitive(GTK_WIDGET(w->status), FALSE); } void sc_status_resume(sc_window *_w) { sc_window_gtk *w = (sc_window_gtk *)_w; gtk_widget_set_sensitive(GTK_WIDGET(w->status), w->statenabled); } void sc_status_configure_gtk(sc_window_gtk *w) { g_signal_connect_after(G_OBJECT(w->status), "select-spot", (GCallback)_sc_status_activate_item, w); sc_active_console_set_allow_keyboard(SC_ACTIVE_CONSOLE(w->status), FALSE); _sc_status_reset_state(w, FALSE); } xscorch-0.2.1/sgtk/sstatus-gtk.h0000644000175000001440000000213511175116146013516 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sstatus-gtk.h,v 1.4 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - sstatus-gtk.h Copyright(c) 2001-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK top statusbar header This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sstatus_gtk_h_included #define __sstatus_gtk_h_included #include void sc_status_configure_gtk(sc_window_gtk *w); #endif /* __sstatus_gtk_h_included */ xscorch-0.2.1/sgtk/ssystem-gtk.c0000644000175000001440000001346711175116146013524 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/ssystem-gtk.c,v 1.12 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - ssystem-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ System menu dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include typedef struct _sc_system_menu_data_gtk { sc_config *c; bool gfxanimate; bool gfxfast; bool gfxcompfast; } sc_system_menu_data_gtk; static void _sc_system_menu_apply_gtk(__libj_unused ScDialog *dlg, sc_system_menu_data_gtk *setup) { setup->c->graphics.gfxanimate = setup->gfxanimate; setup->c->graphics.gfxfast = setup->gfxfast; setup->c->graphics.gfxcompfast= setup->gfxcompfast; } static void _sc_system_retreat_gtk(__libj_unused GtkWidget *button, __libj_unused sc_system_menu_data_gtk *setup) { sc_dialog_error("Sorry, not implemented"); } static void _sc_system_resign_gtk(__libj_unused GtkWidget *button, sc_system_menu_data_gtk *setup) { #if USE_NETWORK if(setup->c->server != NULL || setup->c->client != NULL) { /* TEMP this is a bug */ sc_dialog_message("Not allowed in network", "Resign is broken in network mode, sorry."); return; } #endif /* Networking? */ sc_game_pause(setup->c, setup->c->game); if(sc_dialog_query("Resign Game?", "Are you sure you want to RESIGN this game?")) { sc_config_init_game(setup->c); } sc_game_unpause(setup->c, setup->c->game); } static void _sc_system_mass_kill_gtk(__libj_unused GtkWidget *button, sc_system_menu_data_gtk *setup) { #if USE_NETWORK if(setup->c->server != NULL || setup->c->client != NULL) { sc_dialog_message("Not allowed in network", "Mass kill is not permitted in network mode."); return; } #endif /* Networking? */ sc_game_pause(setup->c, setup->c->game); if(!SC_STATE_IS_ROUND(setup->c->game)) { sc_dialog_error("Cannot mass kill if not in round"); } else if(sc_dialog_query("Mass Kill?", "Are you sure you want to kill everyone and end this round?")) { sc_game_mass_kill(setup->c, setup->c->game); } sc_game_unpause(setup->c, setup->c->game); } static void _sc_system_erase_smoke_gtk(__libj_unused GtkWidget *button, sc_system_menu_data_gtk *setup) { sc_land_clear_smoke(setup->c, setup->c->land); } static void _sc_system_sound_gtk(__libj_unused GtkWidget *button, sc_system_menu_data_gtk *setup) { sc_sound_setup_gtk((sc_window_gtk *)setup->c->window); } void sc_system_menu_gtk(sc_window_gtk *w) { char help[SC_GTK_STRING_BUFFER]; sc_config *c = w->c; sc_system_menu_data_gtk setup; GtkWidget *button; ScDialog *dialog; int row = 0; setup.c = c; setup.gfxanimate = c->graphics.gfxanimate; setup.gfxfast = c->graphics.gfxfast; setup.gfxcompfast = c->graphics.gfxcompfast; dialog = SC_DIALOG(sc_dialog_new("System Menu", NULL, SC_DIALOG_OK | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_system_menu_apply_gtk, &setup); attach_option(dialog, w, "Animation", sc_link_check_new(&setup.gfxanimate), &row); attach_option(dialog, w, "Graphics Are Fast", sc_link_check_new(&setup.gfxfast), &row); attach_option(dialog, w, "Computers Are Fast", sc_link_check_new(&setup.gfxcompfast), &row); sc_help_text(help, sizeof(help), "Mass Kill"); button = tooltip(w, help, gtk_button_new_with_label(" Mass Kill ")); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_system_mass_kill_gtk, &setup); sc_dialog_grid_attach(dialog, button, row++, 1); sc_help_text(help, sizeof(help), "Erase Smoke"); button = tooltip(w, help, gtk_button_new_with_label(" Erase Smoke ")); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_system_erase_smoke_gtk, &setup); sc_dialog_grid_attach(dialog, button, row++, 1); sc_help_text(help, sizeof(help), "Retreat"); button = tooltip(w, help, gtk_button_new_with_label(" N/A: Retreat ")); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_system_retreat_gtk, &setup); sc_dialog_grid_attach(dialog, button, row++, 1); sc_help_text(help, sizeof(help), "Resign Game"); button = tooltip(w, help, gtk_button_new_with_label(" Resign Game ")); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_system_resign_gtk, &setup); sc_dialog_grid_attach(dialog, button, row++, 1); sc_help_text(help, sizeof(help), "Sound Setup"); button = tooltip(w, help, gtk_button_new_with_label(" Sound Setup ")); g_signal_connect(G_OBJECT(button), "clicked", (GCallback)_sc_system_sound_gtk, &setup); sc_dialog_grid_attach(dialog, button, row++, 1); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/ssystem-gtk.h0000644000175000001440000000217111175116146013517 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/ssystem-gtk.h,v 1.6 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - ssystem-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Header file for system menu This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __ssystem_gtk_h_included #define __ssystem_gtk_h_included #include /* Interface functions */ void sc_system_menu_gtk(sc_window_gtk *w); #endif /* __ssystem_gtk_h_included */ xscorch-0.2.1/sgtk/stank-gtk.c0000644000175000001440000002121311175116146013121 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/stank-gtk.c,v 1.23 2009-04-26 17:39:50 jacob Exp $ */ /* xscorch - stank-gtk.c Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Tank configuration screen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static gboolean _sc_window_tank_close_gtk(__libj_unused GtkWidget *widget, __libj_unused ScActiveConsoleSpot *spot, sc_window_gtk *w) { sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_unpause(w->c, w->c->game); return(TRUE); } static gboolean _sc_window_tank_info_key_gtk(__libj_unused GtkWidget *widget, __libj_unused ScActiveConsoleSpot *spot, GdkEventKey *key, sc_window_gtk *w) { switch(key->keyval) { case GDK_Return: case GDK_KP_Enter: case GDK_Escape: sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_unpause(w->c, w->c->game); return(TRUE); } return(FALSE); } void sc_window_tank_info_gtk(sc_window_gtk *w, sc_player *p) { char buf[SC_GTK_STRING_BUFFER]; GtkWidget *console; console = sc_window_active_console_new(w, 8, 4, 46, 7, CONSOLE_NORMAL); sc_console_set_foreground(SC_CONSOLE(console), &w->colormap->pcolors[p->index]); sc_console_write_line(SC_CONSOLE(console), 36, 6, "< Close >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(console), 36, 6, 9, 1, NULL); g_signal_connect_after(G_OBJECT(console), "key_press_spot", (GCallback)_sc_window_tank_info_key_gtk, w); g_signal_connect_after(G_OBJECT(console), "select-spot", (GCallback)_sc_window_tank_close_gtk, w); sbprintf(buf, sizeof(buf), "%2d: %s (%s)", p->index + 1, p->name, sc_ai_name(p->aitype)); sc_console_write_line(SC_CONSOLE(console), 0, 0, buf); /* We must scale player tank life to display in game life units. */ sbprintf(buf, sizeof(buf), " Life: %-5d Shield: %-5d", INT_ROUND_DIV(p->life, p->tank->hardness), p->shield == NULL ? 0 : p->shield->life); sc_console_write_line(SC_CONSOLE(console), 0, 1, buf); sbprintf(buf, sizeof(buf), " Wins: %-2d Kills: %-2d", p->numwins, p->kills); sc_console_write_line(SC_CONSOLE(console), 0, 2, buf); sbprintf(buf, sizeof(buf), " Suicides: %d", p->suicides); sc_console_write_line(SC_CONSOLE(console), 0, 3, buf); sbprintf(buf, sizeof(buf), " Money: $%-8d %c$%d this round", p->money, p->money > p->oldmoney ? '+' : '-', p->money - p->oldmoney); sc_console_write_line(SC_CONSOLE(console), 0, 4, buf); sbprintf(buf, sizeof(buf), " Battery: %-2d Trigger: %-2d", sc_player_battery_count(w->c, p), sc_player_contact_trigger_count(w->c, p)); sc_console_write_line(SC_CONSOLE(console), 0, 5, buf); sbprintf(buf, sizeof(buf), "Press [Enter] to close"); sc_console_write_line(SC_CONSOLE(console), 0, 6, buf); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(console)); sc_game_pause(w->c, w->c->game); /* focus on this tank */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(console)); gtk_widget_grab_focus(GTK_WIDGET(console)); } static gboolean _sc_window_tank_move_btn_gtk(GtkWidget *widget, ScActiveConsoleSpot *spot, sc_window_gtk *w) { char buf[SC_GTK_STRING_BUFFER]; int fuel; switch((long)spot->data) { case 1: if(sc_player_move(w->c, w->c->plorder[w->c->game->curplayer], -1)) { fuel = sc_player_total_fuel(w->c->accessories, w->c->plorder[w->c->game->curplayer]); sbprintf(buf, sizeof(buf), "%4d", fuel); sc_console_write_line(SC_CONSOLE(widget), 22, 0, buf); } return(TRUE); case 2: if(sc_player_move(w->c, w->c->plorder[w->c->game->curplayer], +1)) { fuel = sc_player_total_fuel(w->c->accessories, w->c->plorder[w->c->game->curplayer]); sbprintf(buf, sizeof(buf), "%4d", fuel); sc_console_write_line(SC_CONSOLE(widget), 22, 0, buf); } return(TRUE); case 3: sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_unpause(w->c, w->c->game); return(TRUE); } return(FALSE); } static gboolean _sc_window_tank_move_key_gtk(GtkWidget *widget, __libj_unused ScActiveConsoleSpot *spot, GdkEventKey *key, sc_window_gtk *w) { char buf[SC_GTK_STRING_BUFFER]; int fuel; switch(key->keyval) { case GDK_Left: case GDK_KP_Left: if(sc_player_move(w->c, w->c->plorder[w->c->game->curplayer], -1)) { fuel = sc_player_total_fuel(w->c->accessories, w->c->plorder[w->c->game->curplayer]); sbprintf(buf, sizeof(buf), "%4d", fuel); sc_console_write_line(SC_CONSOLE(widget), 22, 0, buf); } return(TRUE); case GDK_Right: case GDK_KP_Right: if(sc_player_move(w->c, w->c->plorder[w->c->game->curplayer], +1)) { fuel = sc_player_total_fuel(w->c->accessories, w->c->plorder[w->c->game->curplayer]); sbprintf(buf, sizeof(buf), "%4d", fuel); sc_console_write_line(SC_CONSOLE(widget), 22, 0, buf); } return(TRUE); case GDK_Return: case GDK_KP_Enter: case GDK_Escape: sc_display_console_detach_all(SC_DISPLAY(w->screen)); sc_game_unpause(w->c, w->c->game); return(TRUE); } return(FALSE); } void sc_window_tank_move_gtk(sc_window_gtk *w, sc_player *p) { char buf[SC_GTK_STRING_BUFFER]; GtkWidget *console; int x; if(p->x < w->c->fieldwidth / 2) { x = w->c->fieldwidth / (2 * sc_console_get_col_width(SC_CONSOLE(w->status))) + 1; } else { x = 2; } console = sc_window_active_console_new(w, x, 2, 26, 8, CONSOLE_NORMAL); sc_console_set_foreground(SC_CONSOLE(console), &w->colormap->pcolors[p->index]); sc_console_write_line(SC_CONSOLE(console), 0, 0, p->name); sbprintf(buf, sizeof(buf), "%4d", sc_player_total_fuel(w->c->accessories, p)); sc_console_write_line(SC_CONSOLE(console), 22, 0, buf); sc_console_write_line(SC_CONSOLE(console), 0, 1, "Right means left and left"); sc_console_write_line(SC_CONSOLE(console), 0, 2, "means right. Go which way?"); sc_console_write_line(SC_CONSOLE(console), 0, 3, "(arrows/buttons move tank,"); sc_console_write_line(SC_CONSOLE(console), 0, 4, " [Enter] closes window)"); g_signal_connect_after(G_OBJECT(console), "key_press_spot", (GCallback)_sc_window_tank_move_key_gtk, w); g_signal_connect_after(G_OBJECT(console), "select-spot", (GCallback)_sc_window_tank_move_btn_gtk, w); sc_console_write_line(SC_CONSOLE(console), 2, 6, "< Left >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(console), 2, 6, 8, 1, (void *)1); sc_console_write_line(SC_CONSOLE(console), 15,6, "< Right >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(console), 15,6, 9, 1, (void *)2); sc_console_write_line(SC_CONSOLE(console), 15,7, "< Close >"); sc_active_console_add_spot(SC_ACTIVE_CONSOLE(console), 15,7, 9, 1, (void *)3); sc_display_console_attach(SC_DISPLAY(w->screen), SC_CONSOLE(console)); sc_game_pause(w->c, w->c->game); /* focus on this tank */ gtk_window_set_default(GTK_WINDOW(w->app), GTK_WIDGET(console)); gtk_widget_grab_focus(GTK_WIDGET(console)); } xscorch-0.2.1/sgtk/stank-gtk.h0000644000175000001440000000233011175116147013126 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/stank-gtk.h,v 1.5 2009-04-26 17:39:51 jacob Exp $ */ /* xscorch - stank-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Tank configuration screens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __stank_gtk_h_included #define __stank_gtk_h_included struct _sc_window_gtk; struct _sc_player; void sc_window_tank_info_gtk(struct _sc_window_gtk *w, struct _sc_player *p); void sc_window_tank_move_gtk(struct _sc_window_gtk *w, struct _sc_player *p); #endif /* __stank_gtk_h_included */ xscorch-0.2.1/sgtk/sweapons-gtk.c0000644000175000001440000000634111175116147013646 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/sweapons-gtk.c,v 1.16 2009-04-26 17:39:51 jacob Exp $ */ /* xscorch - sweapons-gtk.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Weapon configuration dialogue This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include typedef struct _sc_weapons_setup_data_gtk { sc_config *c; sc_weapon_config *wpc; int armslevel; int bombicon; bool tunneling; double scaling; bool tracepaths; bool uselessitems; } sc_weapons_setup_data_gtk; static void _sc_weapons_setup_apply_gtk(__libj_unused ScDialog *dlg, sc_weapons_setup_data_gtk *setup) { sc_weapon_config *wpc = setup->wpc; wpc->armslevel = setup->armslevel; wpc->bombiconsize = setup->bombicon; wpc->tunneling = setup->tunneling; wpc->scaling = setup->scaling; wpc->tracepaths = setup->tracepaths; wpc->uselessitems = setup->uselessitems; #if USE_NETWORK if(SC_NETWORK_SERVER(setup->c)) sc_net_server_send_config(setup->c, setup->c->server); #endif } void sc_weapons_setup_gtk(sc_window_gtk *w) { sc_weapon_config *wpc = w->c->weapons; sc_weapons_setup_data_gtk setup; ScDialog *dialog; int confirm = (SC_NETWORK_AUTH(w->c) ? SC_DIALOG_OK : 0); int row = 0; setup.c = w->c; setup.wpc = wpc; setup.armslevel = wpc->armslevel; setup.bombicon = wpc->bombiconsize; setup.tunneling = wpc->tunneling; setup.scaling = wpc->scaling; setup.tracepaths = wpc->tracepaths; setup.uselessitems= wpc->uselessitems; dialog = SC_DIALOG(sc_dialog_new("Weapon Setup", NULL, confirm | SC_DIALOG_CANCEL)); g_signal_connect(G_OBJECT(dialog), "apply", (GCallback)_sc_weapons_setup_apply_gtk, &setup); attach_option(dialog, w, "Arms Level", sc_link_spin_new(&setup.armslevel, 0, SC_ARMS_LEVEL_MAX, 1), &row); attach_option(dialog, w, "Bomb Icon Size",sc_link_spin_new(&setup.bombicon, 0, SC_WEAPON_BOMB_ICON_MAX, 1), &row); attach_option(dialog, w, "Scaling", sc_link_spinf_new(&setup.scaling, 0, SC_WEAPON_SCALING_MAX, 0.01), &row); attach_option(dialog, w, "Tunneling", sc_link_check_new(&setup.tunneling), &row); attach_option(dialog, w, "Trace Paths", sc_link_check_new(&setup.tracepaths), &row); attach_option(dialog, w, "Useless Items", sc_link_check_new(&setup.uselessitems), &row); sc_dialog_run(dialog); } xscorch-0.2.1/sgtk/swindow-gtk.c0000644000175000001440000004341211615323560013477 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swindow-gtk.c,v 1.34 2011-07-31 19:05:20 jacob Exp $ */ /* xscorch - swindow-gtk.c Copyright(c) 2000-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK interface to xscorch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #define __ALLOW_DEPRECATED_GDK__ /* Start with system includes */ #include #include #include /* Pick up xscorch GTK *first*, then pick up custom widgets */ #include #include #include #include /* Next, grab files for the xscorch interface components */ #include #include #include #include #include #include #include /* Pick up xscorch game engine headers */ #include #include #include #include #include #include /* Miscellaneous headers */ #include static gint _sc_window_timeout_gtk(gpointer data) { sc_window_gtk *w = data; /* Execute next state in the state machine */ sc_state_run(w->c, w->c->game); /* Run sound updates */ #if USE_SOUND sc_sound_update(w->c->sound); #endif /* Sound? */ /* Leave the timeout in place */ return(TRUE); } void sc_window_timer_enable(sc_window *w_) { sc_window_gtk *w = (sc_window_gtk *)w_; w->timer_id = g_timeout_add(SC_SLEEP_TIME, _sc_window_timeout_gtk, w); } void sc_window_timer_disable(sc_window *w_) { sc_window_gtk *w = (sc_window_gtk *)w_; g_source_remove(w->timer_id); } static void _sc_screen_expose_gtk(__libj_unused GtkWidget *widget, __libj_unused GdkEvent *event, gpointer data) { sc_window_gtk *w = data; #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER_(); #endif /* debug */ /* Start game if this is our first drawing */ if(!w->exposed && w->ready) { sc_window_timer_enable((sc_window *)w); w->exposed = TRUE; } #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_EXIT_(); #endif /* debug */ } static gint _sc_delete_event_gtk(__libj_unused GtkWidget *app, __libj_unused GdkEventAny *event, __libj_unused gpointer data) { #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER_(); #endif /* debug */ gtk_main_quit(); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_EXIT_(); #endif /* debug */ return(TRUE); } static gboolean _sc_window_keypress_gtk(GtkWidget *widget, GdkEventKey *key, gpointer data) { sc_window_gtk *w = data; sc_player *curplayer = w->c->plorder[w->c->game->curplayer]; bool controlled = key->state & GDK_CONTROL_MASK; bool shifted = key->state & GDK_SHIFT_MASK; #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("%d (%s) xx", key->keyval, gdk_keyval_name(key->keyval)); #endif /* debug */ /* ? */ if(w->state < 4 && w->c->insanity && !(SC_STATE_IS_ENABLED(w->c->game) && !SC_STATE_IS_PAUSE(w->c->game))) { if(w->state == 0 && key->keyval == GDK_b) ++w->state; else if(w->state == 1 && key->keyval == GDK_o) ++w->state; else if(w->state == 2 && key->keyval == GDK_o) ++w->state; else if(w->state == 3 && key->keyval == GDK_m) ++w->state; else w->state = 0; if(w->state >= 4) { sc_status_message((sc_window *)w, "BOOM! Heh heh heh..."); } } /* NOTE: the g_signal_stop_emission_by_name() calls prevent GTK's focus manager from attempting to tab to other active controls on the screen; this prevents, f.e., the Tab key from simult. refocusing the controls and advancing weapons, which if you think about it really makes no sense. */ /* Main game */ if(SC_STATE_IS_ENABLED(w->c->game) && !SC_STATE_IS_PAUSE(w->c->game) && !controlled) { /* Make sure the current player is human */ if(curplayer != NULL && curplayer->aitype == SC_AI_HUMAN) switch(key->keyval) { case GDK_Tab: sc_player_advance_weapon(w->c, curplayer, shifted ? -1 : 1); g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event"); return(TRUE); case GDK_Up: case GDK_KP_Up: case GDK_Page_Up: sc_player_advance_power(w->c, curplayer, shifted ? SC_PLAYER_POWER_STEP : SC_PLAYER_POWER_BIGSTEP); g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event"); return(TRUE); case GDK_Down: case GDK_KP_Down: case GDK_Page_Down: sc_player_advance_power(w->c, curplayer, -(shifted ? SC_PLAYER_POWER_STEP : SC_PLAYER_POWER_BIGSTEP)); g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event"); return(TRUE); case GDK_Right: case GDK_KP_Right: sc_player_advance_turret(w->c, curplayer, -(shifted ? SC_PLAYER_TURRET_STEP : SC_PLAYER_TURRET_BIGSTEP)); g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event"); return(TRUE); case GDK_Left: case GDK_KP_Left: sc_player_advance_turret(w->c, curplayer, shifted ? SC_PLAYER_TURRET_STEP : SC_PLAYER_TURRET_BIGSTEP); g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event"); return(TRUE); case GDK_B: case GDK_b: sc_player_activate_battery(w->c, curplayer); return(TRUE); case GDK_E: case GDK_e: sc_player_activate_shield(w->c, curplayer); return(TRUE); case GDK_F: case GDK_f: sc_window_tank_move_gtk(w, curplayer); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_R: case GDK_r: sc_window_paint((sc_window *)w, 0, 0, w->c->fieldwidth, w->c->fieldheight, SC_PAINT_EVERYTHING); return(TRUE); case GDK_S: case GDK_s: sc_player_advance_shield(w->c, curplayer, SC_PLAYER_SHIELD_DEFAULTS); return(TRUE); case GDK_T: case GDK_t: sc_player_toggle_contact_triggers(w->c, curplayer); return(TRUE); case GDK_1: case GDK_KP_1: if(w->c->numplayers < 1) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[0]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_2: case GDK_KP_2: if(w->c->numplayers < 2) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[1]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_3: case GDK_KP_3: if(w->c->numplayers < 3) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[2]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_4: case GDK_KP_4: if(w->c->numplayers < 4) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[3]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_5: case GDK_KP_5: if(w->c->numplayers < 5) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[4]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_6: case GDK_KP_6: if(w->c->numplayers < 6) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[5]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_7: case GDK_KP_7: if(w->c->numplayers < 7) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[6]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_8: case GDK_KP_8: if(w->c->numplayers < 8) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[7]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_9: case GDK_KP_9: if(w->c->numplayers < 9) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[8]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_0: case GDK_KP_0: if(w->c->numplayers < 10) return(FALSE); sc_window_tank_info_gtk(w, w->c->players[9]); sc_game_pause(w->c, w->c->game); return(TRUE); case GDK_Return: case GDK_KP_Enter: sc_status_message((sc_window *)w, ""); sc_game_set_state_asap(w->c->game, SC_STATE_TURN_PL_DONE); g_signal_stop_emission_by_name(G_OBJECT(widget), "key_press_event"); return(TRUE); } } return(FALSE); } static bool _sc_load_images(sc_window_gtk *w) { const char *filename; filename = SC_GLOBAL_DIR "/" SC_IMAGE_DIR "/xscorch-logo.xpm"; w->logo = gdk_pixmap_colormap_create_from_xpm(w->app->window, NULL, &w->logo_m, NULL, filename); if(w->logo == NULL) { fprintf(stderr, "Cannot load \"%s\", aborting.\n", filename); return(false); } filename = SC_GLOBAL_DIR "/" SC_IMAGE_DIR "/xscorch-icon.xpm"; w->icon = gdk_pixmap_colormap_create_from_xpm(w->app->window, NULL, &w->icon_m, NULL, filename); if(w->icon == NULL) { fprintf(stderr, "Cannot load \"%s\", aborting.\n", filename); return(false); } return(true); } sc_window *sc_window_new(sc_config *c, __libj_unused int argc, __libj_unused char **argv) { sc_window_gtk *w; GtkWidget *cont; GdkColor black; gint fake_argc = 1; gchar* fake_argv[] = { "xscorch", NULL }; char **fake_argv_p; /* initialise GTK */ fake_argv_p = fake_argv; gtk_init(&fake_argc, &fake_argv_p); /* Initialise w */ w = g_new0(sc_window_gtk, 1); c->window = (sc_window *)w; w->exposed = FALSE; w->ready = FALSE; w->statenabled = TRUE; w->chatbox = NULL; w->windarrowsize = 0; w->state = 0; w->c = c; /* Load the necessary fonts */ sc_window_load_fonts(w); /* Create the window */ w->app = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(w->app), "XScorch"); g_signal_connect(G_OBJECT(w->app), "delete_event", (GCallback)_sc_delete_event_gtk, w); gtk_window_set_resizable(GTK_WINDOW(w->app), FALSE); /* Create the main (vertical) container */ cont = gtk_vbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(cont), 1); gtk_container_add(GTK_CONTAINER(w->app), cont); /* Create menus, etc */ sc_window_create_menus_gtk(w); gtk_box_pack_start(GTK_BOX(cont), w->mainmenu, TRUE, TRUE, 0); /* Next comes the top statusbar */ w->status = sc_window_active_console_new(w, 0, 0, 1, 1, CONSOLE_BORDERLESS); sc_status_configure_gtk(w); sc_status_setup((sc_window *)w); gtk_box_pack_start(GTK_BOX(cont), w->status, FALSE, TRUE, 1); /* Create drawable screen area */ /*w->border = sc_display_new(w->c->fieldwidth + 4, w->c->fieldheight + 4); gtk_box_pack_start(GTK_BOX(cont), w->border, TRUE, TRUE, 0);*/ w->screen = sc_display_new(w->c->fieldwidth, w->c->fieldheight); g_signal_connect(G_OBJECT(sc_display_get_drawbuf(SC_DISPLAY(w->screen))), "expose_event", (GCallback)_sc_screen_expose_gtk, w); /*gtk_fixed_put(GTK_FIXED(w->border), w->screen, 2, 2);*/ gtk_box_pack_start(GTK_BOX(cont), w->screen, TRUE, TRUE, 0); /* Please initialise the colormaps */ w->colormap = sc_colormap_new_gtk(); sc_colormap_alloc_colors_gtk(w); /* Show everything */ gtk_widget_show_all(w->app); /* Setup display background color */ gdk_color_black(gtk_widget_get_colormap(w->screen), &black); gdk_window_set_background(w->screen->window, &black); /* Setup the offscreen land buffer */ w->landbuffer = gdk_pixmap_new(w->app->window, w->c->fieldwidth, w->c->fieldheight, -1); /* Setup explosion cache */ w->explcache = sc_expl_cache_new_gtk(); /* Load the images */ if(!_sc_load_images(w)) return(NULL); gdk_window_set_icon(w->app->window, NULL, w->icon, w->icon_m); w->ready = TRUE; /* connect after loading, just to retain sanity. */ g_signal_connect(G_OBJECT(w->app), "key_press_event", (GCallback)_sc_window_keypress_gtk, w); /* Return the structure */ return((sc_window *)w); } static inline void _sc_window_unref_land_buffer(sc_window_gtk *w) { if(w->landbuffer != NULL) { g_object_unref(w->landbuffer); } } void sc_window_free(sc_window **w_) { sc_window_gtk *w = (sc_window_gtk *)(*w_); _sc_window_unref_land_buffer(w); gtk_widget_destroy(w->app); w->c->window = NULL; sc_colormap_free_gtk(&w->colormap); sc_expl_cache_free_gtk(&w->explcache); sc_window_unload_fonts(w); free(w); *w_ = NULL; } void sc_window_run(sc_window *w_) { sc_window_gtk *w = (sc_window_gtk *)w_; if(w == NULL) return; gtk_main(); return; } void sc_window_idle(sc_window *w_) { if(w_ == NULL) return; while (gtk_events_pending()) gtk_main_iteration(); } void sc_window_message(__libj_unused sc_window *w_, const char *title, const char *msg) { sc_dialog_message(title, msg); } void sc_window_update(sc_window *w_) { sc_window_gtk *w = (sc_window_gtk *)w_; sc_window_update_menus_gtk(w); } void sc_window_resize(sc_window *w_) { sc_window_gtk *w = (sc_window_gtk *)w_; sc_config *c = w->c; /* There went the landbuffer... */ _sc_window_unref_land_buffer(w); w->landbuffer = gdk_pixmap_new(w->app->window, c->fieldwidth, c->fieldheight, -1); /* We just seriously fsck'd things up */ gtk_widget_set_size_request(sc_display_get_drawbuf(SC_DISPLAY(w->screen)), c->fieldwidth, c->fieldheight); sc_status_setup(c->window); sc_window_idle(c->window); /* Redraw everything */ sc_land_generate(c, c->land); sc_window_paint(c->window, 0, 0, c->land->width, c->land->height, SC_REGENERATE_LAND | SC_REDRAW_LAND); sc_pixmap_copy_gtk(sc_display_get_buffer(SC_DISPLAY(w->screen)), sc_display_get_gc(SC_DISPLAY(w->screen)), w->logo, w->logo_m, c->land->width - sc_pixmap_width_gtk(w->logo), c->land->height - sc_pixmap_height_gtk(w->logo)); } GtkWidget *sc_window_console_new(sc_window_gtk *w, int x, int y, int width, int height, ScConsoleStyle style) { assert(w != NULL); return(sc_console_new(x, y, width, height, style, w->fixed_font, w->bold_fixed_font)); } GtkWidget *sc_window_active_console_new(sc_window_gtk *w, int x, int y, int width, int height, ScConsoleStyle style) { assert(w != NULL); return(sc_active_console_new(x, y, width, height, style, w->fixed_font, w->bold_fixed_font)); } void sc_window_console_set_fonts(sc_window_gtk *w, ScConsole *cons) { sc_console_set_fonts(cons, w->fixed_font, w->bold_fixed_font); } void sc_window_load_fonts(sc_window_gtk *w) { sc_config *c; assert(w != NULL); c = w->c; /* Load the necessary fonts */ w->fixed_font = gdk_font_load(c->fixed_font); w->italic_fixed_font = gdk_font_load(c->italic_fixed_font); w->bold_fixed_font = gdk_font_load(c->bold_fixed_font); /* Make sure the fonts actually loaded */ if(w->fixed_font == NULL) { printf("WARNING: The font \"%s\" could not be loaded. Trying \"fixed\"\n", c->fixed_font); w->fixed_font = gdk_font_load("fixed"); if(w->fixed_font == NULL) { printf("ERROR: Oh hell, you've got serious problems. I couldn't find \"fixed\" either. Bailing out.\n"); abort(); } } if(w->italic_fixed_font == NULL) { printf("WARNING: The font \"%s\" could not be loaded. Trying \"%s\". You won't have italic fonts.\n", c->italic_fixed_font, c->fixed_font); w->italic_fixed_font = w->fixed_font; gdk_font_ref(w->italic_fixed_font); } if(w->bold_fixed_font == NULL) { printf("WARNING: The font \"%s\" could not be loaded. Trying \"%s\". You won't have bold fonts.\n", c->bold_fixed_font, c->fixed_font); w->bold_fixed_font = w->fixed_font; gdk_font_ref(w->bold_fixed_font); } } void sc_window_unload_fonts(sc_window_gtk *w) { int i; assert(w != NULL); if(w->fixed_font != NULL) gdk_font_unref(w->fixed_font); if(w->italic_fixed_font != NULL) gdk_font_unref(w->italic_fixed_font); if(w->bold_fixed_font != NULL) gdk_font_unref(w->bold_fixed_font); } void sc_window_reload_fonts(sc_window_gtk *w) { sc_window_unload_fonts(w); sc_window_load_fonts(w); sc_window_console_set_fonts(w, SC_CONSOLE(w->status)); sc_status_setup((sc_window *)w); sc_status_message((sc_window *)w, "BUG: Sure would be nice if the status bar was restored here..."); sc_display_console_set_fonts(SC_DISPLAY(w->screen), w->fixed_font, w->bold_fixed_font); } xscorch-0.2.1/sgtk/swindow-gtk.h0000644000175000001440000000724511175116147013512 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swindow-gtk.h,v 1.16 2009-04-26 17:39:51 jacob Exp $ */ /* xscorch - swindow-gtk.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ GTK interface to xscorch This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __swindow_gtk_h_included #define __swindow_gtk_h_included /* The order of includes does matter here! */ #include #include #include #include #include /* Forward structure declarations */ struct _sc_expl_cache_gtk; struct _sc_colormap_gtk; struct _sc_config; /* Miscellaneous constants */ #define SC_GTK_STRING_BUFFER 0x4000 /* String buffer size */ #define SC_GTK_TOOLTIP_DELAY 1000 /* Delay (in ms) of tooltips */ /* Main window structure */ typedef struct _sc_window_gtk { struct _sc_config *c; /* Config structure */ int buffer_a[1024]; struct _sc_color_gtk *colormap; /* GTK allocated colors */ struct _sc_expl_cache_gtk *explcache; /* List of drawn explosions */ guint state; /* ? */ guint timer_id; /* Installed timer signal ID */ guint windarrowsize; /* Size of the drawn wind arrow */ gboolean ready; /* True when ready to play */ gboolean exposed; /* True once win exposed */ gboolean statenabled; /* True if status pane is enabled */ GdkFont *fixed_font; /* Normal fixed-width font */ GdkFont *italic_fixed_font; /* Italic fixed-width font */ GdkFont *bold_fixed_font; /* Boldface fixed-width font */ GtkWidget *app; /* GtkWindow main window */ GtkWidget *mainmenu; /* Main menu bar */ GtkWidget *status; /* Status widget */ GtkWidget *screen; /* Drawing screen */ GdkPixmap *landbuffer; /* Offscreen pix for land */ GdkPixmap *logo; /* Offscreen game logo */ GdkBitmap *logo_m; /* Offscreen logo mask */ GdkPixmap *icon; /* Offscreen game icon */ GdkBitmap *icon_m; /* Offscreen icon mask */ GtkWidget *border; /* Border of playing field */ GtkWidget *chatbox; /* Chatbox for network mode */ GtkWidget *net_server; GtkWidget *net_client; GtkWidget *net_disconnect; GtkWidget *net_chat; GtkWidget *net_status; } sc_window_gtk; GtkWidget *sc_window_console_new(sc_window_gtk *w, int x, int y, int width, int height, ScConsoleStyle style); GtkWidget *sc_window_active_console_new(sc_window_gtk *w, int x, int y, int width, int height, ScConsoleStyle style); void sc_window_console_set_fonts(sc_window_gtk *w, ScConsole *cons); void sc_window_load_fonts(sc_window_gtk *w); void sc_window_unload_fonts(sc_window_gtk *w); void sc_window_reload_fonts(sc_window_gtk *w); #endif /* __swindow_gtk_h_included */ xscorch-0.2.1/sgtk/swidgets/0000755000175000001440000000000011615372007012763 500000000000000xscorch-0.2.1/sgtk/swidgets/Makefile.am0000644000175000001440000000142507624267405014753 00000000000000## $Header: /fridge/cvs/xscorch/sgtk/swidgets/Makefile.am,v 1.8 2003/02/17 22:44:52 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig if ANYGTK noinst_LIBRARIES = libscorch_widget_gtk.a endif libscorch_widget_gtk_a_SOURCES =\ sactiveconsole.c\ sactiveconsole.h\ sactoggle.c \ sactoggle.h \ sconsole.c \ sconsole.h \ sdialog.c \ sdialog.h \ sdisplay.c \ sdisplay.h \ sdrawbuf.c \ sdrawbuf.h \ slabel.c \ slabel.h \ slinkcheck.c \ slinkcheck.h \ slinkcombo.c \ slinkcombo.h \ slinkentry.c \ slinkentry.h \ slinkspin.c \ slinkspin.h INCLUDES = $(GTK_CFLAGS) -I../ -I../../sutil -I../../libj xscorch-0.2.1/sgtk/swidgets/Makefile.in0000644000175000001440000004127611615371715014767 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = sgtk/swidgets DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_widget_gtk_a_AR = $(AR) $(ARFLAGS) libscorch_widget_gtk_a_LIBADD = am_libscorch_widget_gtk_a_OBJECTS = sactiveconsole.$(OBJEXT) \ sactoggle.$(OBJEXT) sconsole.$(OBJEXT) sdialog.$(OBJEXT) \ sdisplay.$(OBJEXT) sdrawbuf.$(OBJEXT) slabel.$(OBJEXT) \ slinkcheck.$(OBJEXT) slinkcombo.$(OBJEXT) slinkentry.$(OBJEXT) \ slinkspin.$(OBJEXT) libscorch_widget_gtk_a_OBJECTS = $(am_libscorch_widget_gtk_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_widget_gtk_a_SOURCES) DIST_SOURCES = $(libscorch_widget_gtk_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig @ANYGTK_TRUE@noinst_LIBRARIES = libscorch_widget_gtk.a libscorch_widget_gtk_a_SOURCES = \ sactiveconsole.c\ sactiveconsole.h\ sactoggle.c \ sactoggle.h \ sconsole.c \ sconsole.h \ sdialog.c \ sdialog.h \ sdisplay.c \ sdisplay.h \ sdrawbuf.c \ sdrawbuf.h \ slabel.c \ slabel.h \ slinkcheck.c \ slinkcheck.h \ slinkcombo.c \ slinkcombo.h \ slinkentry.c \ slinkentry.h \ slinkspin.c \ slinkspin.h INCLUDES = $(GTK_CFLAGS) -I../ -I../../sutil -I../../libj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sgtk/swidgets/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sgtk/swidgets/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_widget_gtk.a: $(libscorch_widget_gtk_a_OBJECTS) $(libscorch_widget_gtk_a_DEPENDENCIES) -rm -f libscorch_widget_gtk.a $(libscorch_widget_gtk_a_AR) libscorch_widget_gtk.a $(libscorch_widget_gtk_a_OBJECTS) $(libscorch_widget_gtk_a_LIBADD) $(RANLIB) libscorch_widget_gtk.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactiveconsole.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sactoggle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sconsole.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdisplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdrawbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slabel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slinkcheck.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slinkcombo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slinkentry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slinkspin.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/sgtk/swidgets/sactiveconsole.c0000644000175000001440000016700511615330557016105 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sactiveconsole.c,v 1.46 2011-07-31 19:47:59 jacob Exp $ */ /* xscorch - sactiveconsole.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Display an active console This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include static ScConsoleClass *parent_class; static ScGadgetClass *gadget_parent_class; enum _ScMenuConsoleSignals { ACTIVATE_SIGNAL, SELECT_SPOT_SIGNAL, ENTER_SPOT_SIGNAL, LEAVE_SPOT_SIGNAL, BUTTON_PRESS_SPOT_SIGNAL, BUTTON_RELEASE_SPOT_SIGNAL, KEY_PRESS_SPOT_SIGNAL, KEY_RELEASE_SPOT_SIGNAL, LAST_SIGNAL }; static guint _sc_active_console_signals[LAST_SIGNAL] = { 0 }; enum _ScMenuGadgetSignals { G_PAINT_SIGNAL, G_SELECT_SPOT_SIGNAL, G_ENTER_SPOT_SIGNAL, G_LEAVE_SPOT_SIGNAL, G_BUTTON_PRESS_SPOT_SIGNAL, G_BUTTON_RELEASE_SPOT_SIGNAL, G_KEY_PRESS_SPOT_SIGNAL, G_KEY_RELEASE_SPOT_SIGNAL, G_LAST_SIGNAL }; static guint _sc_gadget_signals[G_LAST_SIGNAL] = { 0 }; /*** GTK Custom Signal Marshallers ***/ #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer static void _sc_marshal_BOOLEAN__VOID(GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, __libj_unused gpointer invocation_hint, gpointer marshal_data) { typedef gint (*GMarshalFunc_BOOLEAN__VOID)(gpointer data1, gpointer data2); register GMarshalFunc_BOOLEAN__VOID callback; register GCClosure *cc = (GCClosure *)closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail(return_value != NULL); g_return_if_fail(n_param_values == 1); if(G_CCLOSURE_SWAP_DATA(closure)) { data1 = closure->data; data2 = g_value_peek_pointer(param_values + 0); } else { data1 = g_value_peek_pointer(param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__VOID)(marshal_data ? marshal_data : cc->callback); v_return = callback(data1, data2); g_value_set_boolean(return_value, v_return); } static void _sc_marshal_BOOLEAN__POINTER(GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, __libj_unused gpointer invocation_hint, gpointer marshal_data) { typedef gint (*GMarshalFunc_BOOLEAN__POINTER)(gpointer data1, gpointer arg_1, gpointer data2); register GMarshalFunc_BOOLEAN__POINTER callback; register GCClosure *cc = (GCClosure *)closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail(return_value != NULL); g_return_if_fail(n_param_values == 2); if(G_CCLOSURE_SWAP_DATA(closure)) { data1 = closure->data; data2 = g_value_peek_pointer(param_values + 0); } else { data1 = g_value_peek_pointer(param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__POINTER)(marshal_data ? marshal_data : cc->callback); v_return = callback(data1, g_marshal_value_peek_pointer(param_values + 1), data2); g_value_set_boolean(return_value, v_return); } static void _sc_marshal_BOOLEAN__POINTER_POINTER(GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, __libj_unused gpointer invocation_hint, gpointer marshal_data) { typedef gint (*GMarshalFunc_BOOLEAN__POINTER_POINTER)(gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__POINTER_POINTER callback; register GCClosure *cc = (GCClosure *)closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail(return_value != NULL); g_return_if_fail(n_param_values == 3); if(G_CCLOSURE_SWAP_DATA(closure)) { data1 = closure->data; data2 = g_value_peek_pointer(param_values + 0); } else { data1 = g_value_peek_pointer(param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__POINTER_POINTER)(marshal_data ? marshal_data : cc->callback); v_return = callback(data1, g_marshal_value_peek_pointer(param_values + 1), g_marshal_value_peek_pointer(param_values + 2), data2); g_value_set_boolean(return_value, v_return); } /*** Class Destructor ***/ static void _sc_active_console_destroy(GtkObject *obj) { /* sc_active_console_destroy Destroys the active console passed in. */ ScActiveConsole *cons = SC_ACTIVE_CONSOLE(obj); GList *cur = cons->spots; while(cur != NULL) { if(cur->data != NULL) { free(cur->data); } cur->data = NULL; cur = cur->next; } g_list_free(cons->spots); cons->spots = NULL; /* Call parent handler? */ if(GTK_OBJECT_CLASS(parent_class)->destroy != NULL) { GTK_OBJECT_CLASS(parent_class)->destroy(obj); } /* Parent handler */ } /*** Signal Emitters ***/ static inline gboolean _sc_active_console_emit_event(ScActiveConsole *cons, int signalid, gpointer event, ScActiveConsoleSpot *spot) { /* sc_active_console_emit_event Emits the indicated signalid, which should be KEY_PRESS_SPOT_SIGNAL, KEY_RELEASE_SPOT_SIGNAL, BUTTON_PRESS_SPOT_SIGNAL, or BUTTON_RELEASE_SPOT_SIGNAL, to the spot's gadget (if one is installed), and then to the console itself. If either of these signals returns TRUE, indicating the signal has been handled, then this function will return TRUE. This function returns FALSE if both emitted signals return FALSE, to indicate the signal may not be fully processed. */ gboolean rtnval = FALSE; const char *signalname = NULL; assert(IS_SC_ACTIVE_CONSOLE(cons)); assert(event != NULL); assert(spot != NULL); switch(signalid) { case KEY_PRESS_SPOT_SIGNAL: signalname = "key_press_spot"; break; case KEY_RELEASE_SPOT_SIGNAL: signalname = "key_release_spot"; break; case BUTTON_PRESS_SPOT_SIGNAL: signalname = "button_press_spot"; break; case BUTTON_RELEASE_SPOT_SIGNAL: signalname = "button_release_spot"; break; default: printf("ERROR: received bad signal ID in sactiveconsole.\n"); abort(); } /* Check to see if the spot includes a gadget. */ if(spot->gadget != NULL) { assert(IS_SC_GADGET(spot->gadget)); g_signal_emit_by_name(GTK_OBJECT(spot->gadget), signalname, event, &rtnval); if(rtnval) { return(TRUE); } } /* Emit the select-spot signal to the console itself */ g_signal_emit(GTK_OBJECT(cons), _sc_active_console_signals[signalid], 0, spot, event, &rtnval); if(rtnval) { return(TRUE); } /* The signal may require additional processing if we made it here */ return(FALSE); } static inline gboolean _sc_active_console_emit(ScActiveConsole *cons, int signalid, ScActiveConsoleSpot *spot) { /* sc_active_console_emit Emits the indicated signalid, which should be ENTER_SPOT_SIGNAL, LEAVE_SPOT_SIGNAL, or SELECT_SPOT_SIGNAL, to the spot's gadget (if one is installed), and then to the console itself. If either of these signals returns TRUE, indicating the signal has been handled, then this function will return TRUE. This function returns FALSE if both emitted signals return FALSE, to indicate the signal may not be fully processed. */ gboolean rtnval = FALSE; const char *signalname = NULL; assert(IS_SC_ACTIVE_CONSOLE(cons)); assert(spot != NULL); switch(signalid) { case ENTER_SPOT_SIGNAL: signalname = "enter_spot"; break; case LEAVE_SPOT_SIGNAL: signalname = "leave_spot"; break; case SELECT_SPOT_SIGNAL: signalname = "select_spot"; break; default: printf("ERROR: received bad signal ID in sactiveconsole.\n"); abort(); } /* Check to see if the spot includes a gadget. */ if(spot->gadget != NULL) { assert(IS_SC_GADGET(spot->gadget)); g_signal_emit_by_name(GTK_OBJECT(spot->gadget), signalname, &rtnval); if(rtnval) { return(TRUE); } } /* Emit the select-spot signal to the console itself */ g_signal_emit(GTK_OBJECT(cons), _sc_active_console_signals[signalid], 0, spot, &rtnval); if(rtnval) { return(TRUE); } /* The signal may require additional processing if we made it here */ return(FALSE); } /*** Signal Handlers ***/ static void _sc_active_console_activate(ScActiveConsole *cons) { /* sc_active_console_activate Called when the console is activated with Return. This should activate the current spot, if any is selected. */ #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("got an activate request%s", ""); #endif /* debug */ if(cons->current != NULL) { _sc_active_console_emit(cons, SELECT_SPOT_SIGNAL, cons->current->data); } } static inline int _sc_lines_overlap_gtk(int a1, int a2, int b1, int b2) { /* sc_lines_overlap_gtk */ /* Check if line segment (a1,a2) overlaps (b1,b2) */ return(b1 <= a2 && a1 <= b2); } static inline int _sc_rects_overlap_gtk(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2) { /* sc_rects_overlap_gtk */ /* Check if rectangle A overlaps any part of rectanble B. */ return(_sc_lines_overlap_gtk(ax1, ax2, bx1, bx2) && _sc_lines_overlap_gtk(ay1, ay2, by1, by2)); } static void _sc_active_console_paint_region(ScConsole *_cons, GdkRectangle *bounds) { /* _sc_active_console_paint_region This signal is sent to us from sconsole.c to tell us when we need to ask our widgets to redraw in a region. */ ScActiveConsole *cons = SC_ACTIVE_CONSOLE(_cons); ScActiveConsoleSpot *spot; gint x1, y1, x2, y2; GList *cur; #if SC_GTK_DEBUG_PAINT SC_DEBUG_ENTER("paint region call%s", ""); #endif /* debug */ /* Check parent handler FIRST; we want to override them */ if(parent_class->paint_region != NULL) { parent_class->paint_region(_cons, bounds); } /* Parent handler */ /* Find our bounding box in terms of console location, not pixels. */ x1 = bounds->x; y1 = bounds->y; x2 = bounds->x + bounds->width - 1; y2 = bounds->y + bounds->height - 1; #if SC_GTK_DEBUG_PAINT SC_DEBUG_MSG("paint region is %d,%d-%d,%d CHARS", x1, y1, x2, y2); #endif /* debug */ /* Look through the spots for overlapping gadgets to repaint. */ cur = cons->spots; while(cur != NULL) { spot = cur->data; /* If the spot is inside the bounding box, it may need repainting. */ if(_sc_rects_overlap_gtk(x1, y1, x2, y2, spot->x, spot->y, spot->x + spot->width - 1, spot->y + spot->height - 1)) { /* Tell the gadget to repaint itself. */ #if SC_GTK_DEBUG_PAINT SC_DEBUG_MSG("found a spot to repaint! %p", spot); #endif /* debug */ if(spot->gadget != NULL) { #if SC_GTK_DEBUG_PAINT SC_DEBUG_MSG("found a gadget even! %p", spot->gadget); #endif /* debug */ g_signal_emit_by_name(GTK_OBJECT(spot->gadget), "paint", NULL, NULL); } } cur = cur->next; } } static void _sc_active_console_enter_spot(ScActiveConsole *cons, gboolean forceenter) { if(!forceenter && !gtk_widget_has_focus(GTK_WIDGET(cons))) { return; } if(cons->current != NULL) { _sc_active_console_emit(cons, ENTER_SPOT_SIGNAL, cons->current->data); } } static void _sc_active_console_leave_spot(ScActiveConsole *cons, gboolean forceleave) { if(!forceleave && !gtk_widget_has_focus(GTK_WIDGET(cons))) { return; } if(cons->current != NULL) { _sc_active_console_emit(cons, LEAVE_SPOT_SIGNAL, cons->current->data); } } static gint _sc_active_console_focus_in(GtkWidget *widget, GdkEventFocus *focus) { /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->focus_in_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->focus_in_event(widget, focus)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("will process focus in%s", ""); #endif /* debug */ _sc_active_console_enter_spot(SC_ACTIVE_CONSOLE(widget), TRUE); return(FALSE); } static gint _sc_active_console_focus_out(GtkWidget *widget, GdkEventFocus *focus) { /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->focus_out_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->focus_out_event(widget, focus)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("will process focus out%s", ""); #endif /* debug */ _sc_active_console_leave_spot(SC_ACTIVE_CONSOLE(widget), TRUE); return(FALSE); } static gint _sc_active_console_key_press(GtkWidget *widget, GdkEventKey *event) { ScActiveConsole *cons = SC_ACTIVE_CONSOLE(widget); ScActiveConsoleSpot *spot; /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->key_press_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->key_press_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ if(cons->current == NULL) return(FALSE); if(!cons->allowkeyboard) return(FALSE); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("key is %d (%s) xx", event->keyval, gdk_keyval_name(event->keyval)); #endif /* debug */ switch(event->keyval) { case GDK_Up: case GDK_KP_Up: _sc_active_console_leave_spot(cons, FALSE); cons->current = cons->current->prev; if(cons->current == NULL) { cons->current = g_list_last(cons->spots); } spot = cons->current->data; _sc_active_console_enter_spot(cons, FALSE); sc_console_set_cursor(SC_CONSOLE(cons), spot->x, spot->y, spot->width, spot->height); return(TRUE); case GDK_Down: case GDK_KP_Down: _sc_active_console_leave_spot(cons, FALSE); cons->current = cons->current->next; if(cons->current == NULL) { cons->current = cons->spots; } spot = cons->current->data; _sc_active_console_enter_spot(cons, FALSE); sc_console_set_cursor(SC_CONSOLE(cons), spot->x, spot->y, spot->width, spot->height); return(TRUE); /* Note: there should be NO logic here for processing GDK_Return or GDK_KP_Enter. Every dialogue seems to work fine without Return logic here, and the tank dialogue gets really messed up if we have processing for Return here. */ case GDK_space: case GDK_KP_Space: #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("emitting %d", _sc_active_console_signals[SELECT_SPOT_SIGNAL]); #endif /* debug */ spot = cons->current->data; if(_sc_active_console_emit(cons, SELECT_SPOT_SIGNAL, spot)) { return(TRUE); } if(_sc_active_console_emit_event(cons, KEY_PRESS_SPOT_SIGNAL, event, spot)) { return(TRUE); } break; default: #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("emitting %d", _sc_active_console_signals[KEY_PRESS_SPOT_SIGNAL]); #endif /* debug */ spot = cons->current->data; if(_sc_active_console_emit_event(cons, KEY_PRESS_SPOT_SIGNAL, event, spot)) { return(TRUE); } break; } return(FALSE); } static gint _sc_active_console_key_release(GtkWidget *widget, GdkEventKey *event) { ScActiveConsole *cons = SC_ACTIVE_CONSOLE(widget); ScActiveConsoleSpot *spot; /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->key_release_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->key_release_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ if(cons->current == NULL) return(FALSE); if(!cons->allowkeyboard) return(FALSE); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("key is %d (%s) xx", event->keyval, gdk_keyval_name(event->keyval)); #endif /* debug */ switch(event->keyval) { case GDK_Up: case GDK_KP_Up: case GDK_Down: case GDK_KP_Down: case GDK_space: case GDK_KP_Space: #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("ignored%s", ""); #endif /* debug */ return(TRUE); default: #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("emitting %d", _sc_active_console_signals[KEY_RELEASE_SPOT_SIGNAL]); #endif /* debug */ spot = cons->current->data; if(_sc_active_console_emit_event(cons, KEY_RELEASE_SPOT_SIGNAL, event, spot)) { return(TRUE); } break; } return(FALSE); } /* This code is insane... All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Justin go insane! All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. */ static inline gboolean _sc_active_console_adjust_xy(ScActiveConsole *cons, GdkEventButton *event, gint *row, gint *col) { /* sc_active_console_adjust_xy */ gint currow; gint curcol; currow = event->y; curcol = event->x; sc_console_get_char_from_pixel(SC_CONSOLE(cons), &curcol, &currow, FALSE); if(currow < 0 || currow >= sc_console_get_view_height(SC_CONSOLE(cons))) return(FALSE); if(curcol < 0 || curcol >= sc_console_get_view_width(SC_CONSOLE(cons))) return(FALSE); *row = event->y; *col = event->x; sc_console_get_char_from_pixel(SC_CONSOLE(cons), col, row, TRUE); return(TRUE); } static gint _sc_active_console_button_press(GtkWidget *widget, GdkEventButton *event) { ScActiveConsole *cons = SC_ACTIVE_CONSOLE(widget); ScActiveConsoleSpot *spot; gint currow; gint curcol; GList *cur; /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->button_press_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->button_press_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ /* Make sure this is a SINGLE click event */ if(event->type != GDK_BUTTON_PRESS) return(FALSE); gtk_widget_grab_focus(GTK_WIDGET(cons)); if(cons->current == NULL) return(FALSE); /* Make sure the click is within the usable window space */ if(!_sc_active_console_adjust_xy(cons, event, &currow, &curcol)) return(FALSE); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("will process a button press at row %d, col %d", currow, curcol); #endif /* debug */ cur = cons->spots; while(cur != NULL) { spot = cur->data; if(curcol >= spot->x && curcol < spot->x + spot->width && currow >= spot->y && currow < spot->y + spot->height) { _sc_active_console_leave_spot(cons, FALSE); cons->current = cur; _sc_active_console_enter_spot(cons, FALSE); sc_console_set_cursor(SC_CONSOLE(cons), spot->x, spot->y, spot->width, spot->height); sc_console_set_cursor_highlighted(SC_CONSOLE(cons), TRUE); _sc_active_console_emit_event(cons, BUTTON_PRESS_SPOT_SIGNAL, event, spot); return(TRUE); } cur = cur->next; } return(FALSE); } static gint _sc_active_console_button_release(GtkWidget *widget, GdkEventButton *event) { ScActiveConsole *cons = SC_ACTIVE_CONSOLE(widget); ScActiveConsoleSpot *spot; gint currow; gint curcol; GList *cur; /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->button_release_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->button_release_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ gtk_widget_grab_focus(GTK_WIDGET(cons)); if(cons->current == NULL) return(FALSE); /* Adjust click so it is within the usable window space */ _sc_active_console_adjust_xy(cons, event, &currow, &curcol); #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("will process a button release at row %d, col %d", currow, curcol); #endif /* debug */ spot = cons->current->data; if(cons->allowkeyboard) { /* Maintain the cursor, just unhighlight it */ sc_console_set_cursor(SC_CONSOLE(cons), spot->x, spot->y, spot->width, spot->height); sc_console_set_cursor_highlighted(SC_CONSOLE(cons), FALSE); } else { /* No keyboard allowed; just destroy the cursor */ sc_console_set_cursor(SC_CONSOLE(cons), 0, 0, 0, 0); sc_console_set_cursor_highlighted(SC_CONSOLE(cons), FALSE); } cur = cons->spots; while(cur != NULL) { spot = cur->data; if(curcol >= spot->x && curcol < spot->x + spot->width && currow >= spot->y && currow < spot->y + spot->height) { if(cons->current == cur) { if(_sc_active_console_emit(cons, SELECT_SPOT_SIGNAL, spot)) { return(TRUE); } } _sc_active_console_emit_event(cons, BUTTON_RELEASE_SPOT_SIGNAL, event, spot); return(TRUE); } cur = cur->next; } return(FALSE); } static void _sc_active_console_class_init(ScActiveConsoleClass *klass) { GtkObjectClass *object_class = (GtkObjectClass *)klass; parent_class = g_type_class_peek(sc_console_get_type()); _sc_active_console_signals[ACTIVATE_SIGNAL] = g_signal_new("activate", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, /* Signal flags; run this signal first */ offsetof(ScActiveConsoleClass, activate), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); _sc_active_console_signals[SELECT_SPOT_SIGNAL] = g_signal_new("select_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScActiveConsoleClass, select_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first argument */ ); _sc_active_console_signals[ENTER_SPOT_SIGNAL] = g_signal_new("enter_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScActiveConsoleClass, enter_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first argument */ ); _sc_active_console_signals[LEAVE_SPOT_SIGNAL] = g_signal_new("leave_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScActiveConsoleClass, leave_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first argument */ ); _sc_active_console_signals[BUTTON_PRESS_SPOT_SIGNAL] = g_signal_new("button_press_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScActiveConsoleClass, button_press_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER_POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 2, /* Number of extra parametres to pass */ G_TYPE_POINTER, /* Type of first argument */ G_TYPE_POINTER /* Type of second argument */ ); _sc_active_console_signals[BUTTON_RELEASE_SPOT_SIGNAL] = g_signal_new("button_release_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScActiveConsoleClass, button_release_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER_POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 2, /* Number of extra parametres to pass */ G_TYPE_POINTER, /* Type of first argument */ G_TYPE_POINTER /* Type of second argument */ ); _sc_active_console_signals[KEY_PRESS_SPOT_SIGNAL] = g_signal_new("key_press_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScActiveConsoleClass, key_press_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER_POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 2, /* Number of extra parametres to pass */ G_TYPE_POINTER, /* Type of first argument */ G_TYPE_POINTER /* Type of second argument */ ); _sc_active_console_signals[KEY_RELEASE_SPOT_SIGNAL] = g_signal_new("key_release_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScActiveConsoleClass, key_release_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER_POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 2, /* Number of extra parametres to pass */ G_TYPE_POINTER, /* Type of first argument */ G_TYPE_POINTER /* Type of second argument */ ); ((GtkWidgetClass *)klass)->activate_signal = _sc_active_console_signals[ACTIVATE_SIGNAL]; /* Setup new signal default handlers */ klass->activate = _sc_active_console_activate; klass->select_spot = NULL; klass->enter_spot = NULL; klass->leave_spot = NULL; klass->button_press_spot = NULL; klass->button_release_spot = NULL; klass->key_press_spot = NULL; klass->key_release_spot = NULL; /* Install signals from parent class */ SC_CONSOLE_CLASS(klass)->paint_region = _sc_active_console_paint_region; GTK_WIDGET_CLASS(klass)->key_press_event = _sc_active_console_key_press; GTK_WIDGET_CLASS(klass)->key_release_event = _sc_active_console_key_release; GTK_WIDGET_CLASS(klass)->button_press_event = _sc_active_console_button_press; GTK_WIDGET_CLASS(klass)->button_release_event= _sc_active_console_button_release; GTK_WIDGET_CLASS(klass)->focus_in_event = _sc_active_console_focus_in; GTK_WIDGET_CLASS(klass)->focus_out_event = _sc_active_console_focus_out; GTK_OBJECT_CLASS(klass)->destroy = _sc_active_console_destroy; } static void _sc_gadget_class_init(ScGadgetClass *klass) { GtkObjectClass *object_class = (GtkObjectClass *)klass; gadget_parent_class = g_type_class_peek(gtk_object_get_type()); _sc_gadget_signals[G_PAINT_SIGNAL] = g_signal_new("paint", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, paint), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); _sc_gadget_signals[G_SELECT_SPOT_SIGNAL] = g_signal_new("select_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, select_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__VOID, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); _sc_gadget_signals[G_ENTER_SPOT_SIGNAL] = g_signal_new("enter_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, enter_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__VOID, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); _sc_gadget_signals[G_LEAVE_SPOT_SIGNAL] = g_signal_new("leave_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, leave_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__VOID, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); _sc_gadget_signals[G_BUTTON_PRESS_SPOT_SIGNAL] = g_signal_new("button_press_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, button_press_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first argument */ ); _sc_gadget_signals[G_BUTTON_RELEASE_SPOT_SIGNAL] = g_signal_new("button_release_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, button_release_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first argument */ ); _sc_gadget_signals[G_KEY_PRESS_SPOT_SIGNAL] = g_signal_new("key_press_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, key_press_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first argument */ ); _sc_gadget_signals[G_KEY_RELEASE_SPOT_SIGNAL] = g_signal_new("key_release_spot", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScGadgetClass, key_release_spot), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ _sc_marshal_BOOLEAN__POINTER, /* Marshal function for this signal */ G_TYPE_BOOLEAN, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first argument */ ); /* Setup new signal default handlers */ klass->paint = NULL; klass->select_spot = NULL; klass->enter_spot = NULL; klass->leave_spot = NULL; klass->button_press_spot = NULL; klass->button_release_spot = NULL; klass->key_press_spot = NULL; klass->key_release_spot = NULL; } static void _sc_active_console_init_obj(ScActiveConsole *cons) { cons->spots = NULL; cons->current = NULL; gtk_widget_set_can_default(GTK_WIDGET(cons), TRUE); gtk_widget_set_events(GTK_WIDGET(cons), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); } static void _sc_gadget_init_obj(ScGadget *gadget) { gadget->spot = NULL; gadget->console = NULL; gadget->x = 0; gadget->y = 0; gadget->width = 0; gadget->height = 0; } GType sc_active_console_get_type(void) { static GType sc_active_console_type = 0; if(sc_active_console_type == 0) { static const GTypeInfo sc_active_console_info = { sizeof(ScActiveConsoleClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_active_console_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScActiveConsole), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_active_console_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_active_console_type = g_type_register_static(sc_console_get_type(), "ScActiveConsole", &sc_active_console_info, 0); } return(sc_active_console_type); } GType sc_gadget_get_type(void) { static GType sc_gadget_type = 0; if(sc_gadget_type == 0) { static const GTypeInfo sc_gadget_info = { sizeof(ScGadgetClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_gadget_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScGadget), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_gadget_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_gadget_type = g_type_register_static(gtk_object_get_type(), "ScGadget", &sc_gadget_info, 0); } return(sc_gadget_type); } void sc_active_console_init(ScActiveConsole *cons, gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont) { cons->current = NULL; sc_console_init(SC_CONSOLE(cons), x, y, width, height, style, font, boldfont); sc_console_set_cursor(SC_CONSOLE(cons), 0, 0, 0, 0); gtk_widget_set_sensitive(GTK_WIDGET(cons), TRUE); } GtkWidget *sc_active_console_new(gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont) { ScActiveConsole *cons; cons = g_object_new(sc_active_console_get_type(), NULL); g_return_val_if_fail(cons != NULL, NULL); cons->allowkeyboard = TRUE; gtk_widget_set_sensitive(GTK_WIDGET(cons), TRUE); sc_active_console_init(cons, x, y, width, height, style, font, boldfont); return(GTK_WIDGET(cons)); } static ScActiveConsoleSpot *_sc_active_console_new_spot(gint x, gint y, gint width, gint height, gpointer data) { ScActiveConsoleSpot *spot; spot = (ScActiveConsoleSpot *)malloc(sizeof(ScActiveConsoleSpot)); if(spot == NULL) return(NULL); spot->x = x; spot->y = y; spot->width = width; spot->height= height; spot->data = data; spot->gadget = NULL; return(spot); } static void _sc_active_console_append_spot(ScActiveConsole *cons, ScActiveConsoleSpot *spot) { if(spot == NULL) return; cons->spots = g_list_append(cons->spots, spot); if(cons->current == NULL) { cons->current = cons->spots; _sc_active_console_enter_spot(cons, FALSE); if(cons->allowkeyboard) { sc_console_set_cursor(SC_CONSOLE(cons), spot->x, spot->y, spot->width, spot->height); } } } void sc_active_console_add_spot(ScActiveConsole *cons, gint x, gint y, gint width, gint height, gpointer data) { ScActiveConsoleSpot *spot; spot = _sc_active_console_new_spot(x, y, width, height, data); _sc_active_console_append_spot(cons, spot); } void sc_active_console_add_row_spot(ScActiveConsole *cons, gint row, gpointer data) { sc_active_console_add_spot(cons, 0, row, sc_console_get_width(SC_CONSOLE(cons)), 1, data); } void sc_active_console_add_gadget_spot(ScActiveConsole *cons, ScGadget *gadget, gpointer data) { ScActiveConsoleSpot *spot; if(gadget == NULL) return; spot = _sc_active_console_new_spot(gadget->x, gadget->y, gadget->width, gadget->height, data); if(spot != NULL) { /* what the gadget knows about its spot */ gadget->spot = spot; gadget->console = cons; /* what the spot knows about its gadget */ spot->gadget = gadget; _sc_active_console_append_spot(cons, spot); } } gboolean sc_active_console_detach_spot(ScActiveConsole *cons) { ScActiveConsoleSpot *spot; GList *cur; gint x; gint y; gint width; gint height; /* Is there anything to delete? */ cur = cons->spots; if(cur == NULL) return(FALSE); /* reset the current selection */ cons->current = NULL; _sc_active_console_leave_spot(cons, FALSE); sc_console_set_cursor(SC_CONSOLE(cons), 0, 0, 0, 0); sc_console_set_cursor_highlighted(SC_CONSOLE(cons), FALSE); /* Delete the last spot */ while(cur->next != NULL) cur = cur->next; spot = cur->data; cur->data = NULL; /* Release any associated gadget */ if(spot->gadget != NULL) { g_object_unref(GTK_OBJECT(spot->gadget)); spot->gadget = NULL; } x = spot->x; y = spot->y; width = spot->width; height= spot->height; free(cur->data); cur->data = NULL; cons->spots = g_list_remove_link(cons->spots, cur); g_list_free(cur); return(TRUE); } void sc_active_console_detach_all_spots(ScActiveConsole *cons) { while(sc_active_console_detach_spot(cons)) /* Just loop */; } void sc_active_console_set_allow_keyboard(ScActiveConsole *cons, gboolean allowkeyboard) { cons->allowkeyboard = allowkeyboard; } void sc_gadget_get_extents(ScGadget *gadget, GdkRectangle *bounds) { ScConsole *cons; gint x, y; if(bounds == NULL) return; bounds->width = bounds->height = 0; if(gadget == NULL) return; if(gadget->spot == NULL) return; if(gadget->console == NULL) return; cons = SC_CONSOLE(gadget->console); /* Determine the pixel locations. */ x = gadget->spot->x; y = gadget->spot->y; sc_console_get_pixel_from_char(cons, &x, &y, TRUE); /* Update the result rectangle */ bounds->x = x; bounds->y = y; bounds->width = sc_console_get_col_width (cons) * gadget->spot->width; bounds->height = sc_console_get_row_height(cons) * gadget->spot->height; } xscorch-0.2.1/sgtk/swidgets/sactiveconsole.h0000644000175000001440000001122711206414245016075 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sactiveconsole.h,v 1.18 2009-05-25 04:03:49 jacob Exp $ */ /* xscorch - sactiveconsole.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Display an active console (a console with "hotspots") This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sactiveconsole_h_included #define __sactiveconsole_h_included #include #include #include /*** Forward Declaractions ***/ struct _ScGadget; /*** Active Consoles ***/ #define SC_ACTIVE_CONSOLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_active_console_get_type(), ScActiveConsole) #define SC_ACTIVE_CONSOLE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_active_console_get_type(), ScActiveConsoleClass) #define IS_SC_ACTIVE_CONSOLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_active_console_get_type()) typedef struct _ScActiveConsoleSpot { gint x; gint y; gint width; gint height; struct _ScGadget *gadget; gpointer data; } ScActiveConsoleSpot; typedef struct _ScActiveConsole { ScConsole console; GList *spots; GList *current; gboolean allowkeyboard; } ScActiveConsole; typedef struct _ScActiveConsoleClass { ScConsoleClass parent_class; void (*activate)(ScActiveConsole *cons); gboolean (*button_press_spot)(ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventButton *event); gboolean (*button_release_spot)(ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventButton *event); gboolean (*key_press_spot)(ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventKey *event); gboolean (*key_release_spot)(ScActiveConsole *cons, ScActiveConsoleSpot *spot, GdkEventKey *event); gboolean (*select_spot)(ScActiveConsole *cons, ScActiveConsoleSpot *spot); gboolean (*enter_spot)(ScActiveConsole *cons, ScActiveConsoleSpot *spot); gboolean (*leave_spot)(ScActiveConsole *cons, ScActiveConsoleSpot *spot); } ScActiveConsoleClass; /*** Gadgets ***/ #define SC_GADGET(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_gadget_get_type(), ScGadget) #define SC_GADGET_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_gadget_get_type(), ScGadgetClass) #define IS_SC_GADGET(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_gadget_get_type()) typedef struct _ScGadget { GtkObject object; ScActiveConsole *console; ScActiveConsoleSpot *spot; gint x; gint y; gint width; gint height; } ScGadget; typedef struct _ScGadgetClass { GtkObjectClass parent_class; void (*paint)(ScGadget *gadget); gboolean (*button_press_spot)(ScGadget *gadget, GdkEventButton *event); gboolean (*button_release_spot)(ScGadget *gadget, GdkEventButton *event); gboolean (*key_press_spot)(ScGadget *gadget, GdkEventKey *event); gboolean (*key_release_spot)(ScGadget *gadget, GdkEventKey *event); gboolean (*select_spot)(ScGadget *gadget); gboolean (*enter_spot)(ScGadget *gadget); gboolean (*leave_spot)(ScGadget *gadget); } ScGadgetClass; /*** Function Prototypes ***/ GType sc_active_console_get_type(void); GtkWidget *sc_active_console_new(gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont); void sc_active_console_init(ScActiveConsole *cons, gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont); void sc_active_console_set_allow_keyboard(ScActiveConsole *cons, gboolean allowkeyboard); GType sc_gadget_get_type(void); void sc_gadget_get_extents(ScGadget *gadget, GdkRectangle *bounds); void sc_active_console_add_spot(ScActiveConsole *cons, gint x, gint y, gint width, gint height, gpointer data); void sc_active_console_add_row_spot(ScActiveConsole *cons, gint row, gpointer data); void sc_active_console_add_gadget_spot(ScActiveConsole *cons, ScGadget *gadget, gpointer data); gboolean sc_active_console_detach_spot(ScActiveConsole *cons); void sc_active_console_detach_all_spots(ScActiveConsole *cons); #endif /* __sactiveconsole_h_included */ xscorch-0.2.1/sgtk/swidgets/sactoggle.c0000644000175000001440000002357111615366346015040 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sactoggle.c,v 1.33 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - sactoggle.c Copyright(c) 2001-2011 Jacob Luna Lundberg Copyright(c) 2001-2003 Justin David Smith jacob(at)gnifty.net http://www.gnifty.net/ justins(at)chaos2.org http://chaos2.org/~justins Basic toggle button widget for xscorch consoles. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include static ScGadgetClass *parent_class; static inline void _sc_ac_toggle_emit_paint(ScACToggle *toggle) { assert(IS_SC_AC_TOGGLE(toggle)); g_signal_emit_by_name(GTK_OBJECT(toggle), "paint", NULL, NULL); } static void _sc_ac_toggle_draw(ScGadget *gadget) { /* _sc_ac_toggle_draw Draw a toggle, depressed or not. */ ScACToggle *toggle = SC_AC_TOGGLE(gadget); ScActiveConsole *cons = gadget->console; GtkWidget *widget = (GtkWidget *)cons; gboolean focus, sensitive; GdkGC *foreground; GdkRectangle bounds; /* TEMP - We want to use a real palette color (see below). */ GdkColor color; /* Can we even draw yet? */ if(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)) == NULL) return; /* Request a GC. */ foreground = gdk_gc_new(widget->window); /* Figure out our extents */ sc_gadget_get_extents(gadget, &bounds); /* Find out if this gadget has the focus right now. */ focus = (gtk_widget_has_focus((GtkWidget *)gadget->console) && (gadget->console->current->data == gadget->spot)) ? TRUE : FALSE; /* Find out if the gadget will be sensitive. */ sensitive = gtk_widget_is_sensitive(GTK_WIDGET(gadget->console)); /* Setup the GC colors for the toggle (drawing outer). */ if(!sensitive) gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_FOREDISABLED)); else if(focus) gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_FORECURSOR)); else gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_FOREGROUND)); /* Draw the outer circle of the toggle. */ gdk_draw_arc(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, TRUE, bounds.x, bounds.y, bounds.width - 1, bounds.height - 1, 0, 360 * 64); #ifndef ___TEMP_toggle_color /* * TEMP - We want to use a real palette color here... * However, we haven't gotten around to deciding exactly * what colors go in the palette for consoles or even * how to make that decision, so for now we temporarily * allocate our own here in the toggle. This should * definitely be considered a rather sad hack in nature. */ if(!sensitive) gdk_color_parse("#444444", &color); else if(focus) gdk_color_parse("#886666", &color); else gdk_color_parse("#777777", &color); gdk_colormap_alloc_color(gtk_widget_get_colormap((GtkWidget *)cons), &color, FALSE, TRUE); gdk_gc_set_foreground(foreground, &color); #else /* Setup the GC colors for the toggle (drawing center). */ if(!sensitive) gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_BACKDISABLED)); else if(focus) gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_BACKCURSOR)); else gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_BACKGROUND)); #endif /* Draw the interior lighted section of the toggle. */ gdk_draw_arc(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, TRUE, bounds.x + bounds.width * 1 / 8, bounds.y + bounds.height * 1 / 8, bounds.width * 3 / 4, bounds.height * 3 / 4, 0, 360 * 64); /* If the toggle is depressed, give it some Prozac. No, seriously, draw its little filled inner circle. */ if(toggle->state) { /* Setup the GC colors for the toggle (drawing inner). */ if(!sensitive) gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_FOREDISABLED)); else if(focus) gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_FORECURSOR)); else gdk_gc_set_foreground(foreground, sc_console_get_color(SC_CONSOLE(cons), SC_CONSOLE_FOREGROUND)); /* And then draw it. */ gdk_draw_arc(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, TRUE, bounds.x + bounds.width * 1 / 3, bounds.y + bounds.height * 1 / 3, bounds.width * 1 / 3, bounds.height * 1 / 3, 0, 360 * 64); } /* Release the GC. */ g_object_unref(foreground); /* Make sure everything is queued to be drawn. */ sc_drawbuf_queue_draw(SC_DRAWBUF(widget), bounds.x, bounds.y, bounds.width, bounds.height); } static gint _sc_ac_toggle_button(ScGadget *gadget, GdkEventButton *event) { /* _sc_ac_toggle_button Button press events for the toggle. */ ScACToggle *toggle = SC_AC_TOGGLE(gadget); /* Try out parent handler first */ if(parent_class->button_press_spot != NULL) { if(parent_class->button_press_spot(gadget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("will process button %d press", event->button); #endif /* debug */ switch(event->button) { case 1: /* Left mouse */ toggle->state = toggle->state ? FALSE : TRUE; _sc_ac_toggle_emit_paint(toggle); return(TRUE); } /* Fallthrough */ return(FALSE); } static gint _sc_ac_toggle_key(ScGadget *gadget, GdkEventKey *event) { /* _sc_ac_toggle_key Key press events for the toggle. */ ScACToggle *toggle = SC_AC_TOGGLE(gadget); /* Try out parent handler first */ if(parent_class->key_press_spot != NULL) { if(parent_class->key_press_spot(gadget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ #if SC_GTK_DEBUG_GTK && __debugging_macros SC_DEBUG_ENTER("will process key %d press", event->keyval); #endif /* debug */ switch(event->keyval) { case GDK_Return: case GDK_KP_Enter: case GDK_space: case GDK_KP_Space: toggle->state = toggle->state ? FALSE : TRUE; _sc_ac_toggle_emit_paint(toggle); return(TRUE); } /* Fallthrough */ return(FALSE); } static void _sc_ac_toggle_class_init(ScACToggleClass *klass) { /* _sc_ac_toggle_class_init Initialize the toggle class for GTK. */ parent_class = g_type_class_peek(sc_gadget_get_type()); /* Setup new signal default handlers */ SC_GADGET_CLASS(klass)->paint = _sc_ac_toggle_draw; SC_GADGET_CLASS(klass)->button_press_spot = _sc_ac_toggle_button; SC_GADGET_CLASS(klass)->key_press_spot = _sc_ac_toggle_key; } static void _sc_ac_toggle_init_obj(ScACToggle *toggle) { /* _sc_ac_toggle_init_obj Initialize a toggle object to default values. */ toggle->state = FALSE; } GType sc_ac_toggle_get_type(void) { /* sc_ac_toggle_get_type Define the toggle's GTK type. */ static GType sc_ac_toggle_type = 0; if(sc_ac_toggle_type == 0) { static const GTypeInfo sc_ac_toggle_info = { sizeof(ScACToggleClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_ac_toggle_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScACToggle), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_ac_toggle_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_ac_toggle_type = g_type_register_static(sc_gadget_get_type(), "ScACToggle", &sc_ac_toggle_info, 0); } return(sc_ac_toggle_type); } ScGadget *sc_ac_toggle_new(gint x, gint y, gint width, gint height) { /* sc_ac_toggle_new Instantiate a new toggle widget. */ ScACToggle *toggle; ScGadget *gadget; toggle = g_object_new(sc_ac_toggle_get_type(), NULL); g_return_val_if_fail(toggle != NULL, NULL); gadget = SC_GADGET(toggle); gadget->x = x; gadget->y = y; gadget->width = width; gadget->height = height; toggle->state = FALSE; return(SC_GADGET(toggle)); } void sc_ac_toggle_set(ScACToggle *toggle, gboolean newstate) { /* sc_ac_toggle_set Set a toggle and update on screen. */ if(toggle == NULL) return; if(toggle->state != newstate) { toggle->state = newstate; _sc_ac_toggle_emit_paint(toggle); } } gboolean sc_ac_toggle_get(const ScACToggle *toggle) { /* sc_ac_toggle_get Read the state of a toggle. */ if(toggle == NULL) return(FALSE); return(toggle->state); } xscorch-0.2.1/sgtk/swidgets/sactoggle.h0000644000175000001440000000401411615366346015034 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sactoggle.h,v 1.9 2011-08-01 00:01:42 jacob Exp $ */ /* xscorch - sactoggle.h Copyright(c) 2001-2003 Jacob Luna Lundberg Copyright(c) 2001-2003 Justin David Smith jacob(at)gnifty.net http://www.gnifty.net/ justins(at)chaos2.org http://chaos2.org/~justins Header for scorched toggle button widgets. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sactoggle_h_included #define __sactoggle_h_included /* Some definitions are needed. */ #include #include #include #define SC_AC_TOGGLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_ac_toggle_get_type(), ScACToggle) #define SC_AC_TOGGLE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_ac_toggle_get_type(), ScACToggleClass) #define IS_SC_AC_TOGGLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_ac_toggle_get_type()) typedef struct _ScACToggle { ScGadget gadget; gboolean state; } ScACToggle; typedef struct _ScACToggleClass { ScGadgetClass parent_class; } ScACToggleClass; /* Functions for toggle instantiation. */ GType sc_ac_toggle_get_type(void); ScGadget *sc_ac_toggle_new(gint x, gint y, gint width, gint height); /* Functions for toggle state. */ void sc_ac_toggle_set(ScACToggle *toggle, gboolean newstate); gboolean sc_ac_toggle_get(const ScACToggle *toggle); #endif /* __sactoggle_h_included */ xscorch-0.2.1/sgtk/swidgets/sconsole.c0000644000175000001440000016556611615326764014730 00000000000000/* xscorch - sconsole.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Code for a text console This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #define __ALLOW_DEPRECATED_GDK__ #include #include #include #include #include #include static ScDrawbufClass *parent_class; #define SC_CONSOLE_BORDER_WIDTH_CHARS 2 #define SC_CONSOLE_BORDER_HEIGHT_CHARS 1 enum _ScConsoleSignals { PAINT_REGION_SIGNAL, LAST_SIGNAL }; static guint _sc_console_signals[LAST_SIGNAL] = { 0 }; /*** Low-level Support Functions ***/ static inline char *_sc_console_get_text_buffer(ScConsole *cons) { /* sc_console_get_text_buffer Returns the text buffer for this console. */ assert(IS_SC_CONSOLE(cons)); return(cons->text.buffer); } static inline char *_sc_console_get_char_ptr(ScConsole *cons, int x, int y) { /* sc_console_get_char_ptr Returns a pointer to the (x,y)'th character in the text buffer. */ char *p; assert(IS_SC_CONSOLE(cons)); p = _sc_console_get_text_buffer(cons); if(p == NULL) return(NULL); return(p + y * sc_console_get_width(cons) + x); } static inline void _sc_console_valid_fonts(ScConsole *cons) { /* sc_console_valid_fonts Make sure both fonts in this console are valid. */ assert(IS_SC_CONSOLE(cons)); assert(cons->screen_font != NULL); assert(cons->screen_bold_font != NULL); } static inline void _sc_console_unref_fonts(ScConsole *cons) { /* sc_console_unref_fonts Release the fonts on this console. */ assert(IS_SC_CONSOLE(cons)); if(cons->screen_font != NULL) { gdk_font_unref(cons->screen_font); cons->screen_font = NULL; } if(cons->screen_bold_font != NULL) { gdk_font_unref(cons->screen_bold_font); cons->screen_bold_font = NULL; } } static inline void _sc_console_ref_fonts(ScConsole *cons) { /* sc_console_ref_fonts Install new fonts for this console. This function assumes the new GdkFont's have been assigned to screen_font and screen_bold_font, but have NOT yet been referenced. This is not used when the font is loaded with gdk_font_load; it is ONLY used when we are passed a new font from the outside world, that we need to reference. */ assert(IS_SC_CONSOLE(cons)); _sc_console_valid_fonts(cons); gdk_font_ref(cons->screen_font); gdk_font_ref(cons->screen_bold_font); } static inline void _sc_console_init_fonts(ScConsole *cons) { /* sc_console_init_fonts Load a reasonable set of default fonts. */ assert(IS_SC_CONSOLE(cons)); cons->screen_font = gdk_fontset_load("fixed"); cons->screen_bold_font = gdk_fontset_load("fixed"); _sc_console_valid_fonts(cons); } static inline void _sc_console_set_fonts(ScConsole *cons, GdkFont *font, GdkFont *boldfont) { /* sc_console_set_fonts Release the current fonts on this console, and install the new fonts that are passed as arguments. The reference count on the existing fonts is decremented, and the reference count on the new fonts will be incremented. */ _sc_console_unref_fonts(cons); cons->screen_font = font; cons->screen_bold_font = boldfont; _sc_console_ref_fonts(cons); } /*** Destructor ***/ static void _sc_console_destroy_data(ScConsole *cons) { /* sc_console_destroy_data Destroys the data buffer currently allocated to this console, and data allocated in the highlight structures. This does not release interface widgets. */ GList *cur; assert(IS_SC_CONSOLE(cons)); /* Delete the console text buffer */ if(_sc_console_get_text_buffer(cons) != NULL) { free(_sc_console_get_text_buffer(cons)); cons->text.buffer = NULL; } /* Delete the highlights list */ cur = cons->highlights; while(cur != NULL) { if(cur->data != NULL) free(cur->data); cur->data = NULL; cur = cur->next; } g_list_free(cons->highlights); cons->highlights = NULL; } static void _sc_console_destroy(GtkObject *obj) { /* sc_console_destroy Destroys the indicated console. This includes all internal data structures, and all widgets associated with the console. The current fonts will also be unreferenced. */ ScConsole *cons = SC_CONSOLE(obj); _sc_console_destroy_data(cons); _sc_console_unref_fonts(cons); /* Check for a parent signal handler */ if(GTK_OBJECT_CLASS(parent_class)->destroy != NULL) { GTK_OBJECT_CLASS(parent_class)->destroy(obj); } /* Does parent have default? */ } /*** Font Metrics, and Character<->Pixel Conversions ***/ static inline gint _sc_console_char_width(ScConsole *cons) { /* sc_console_char_width Return the width of one character, in pixels */ int width1 = gdk_char_width(cons->screen_font, 'w'); int width2 = gdk_char_width(cons->screen_bold_font, 'w'); return(max(max(width1, width2), 1)); } static inline gint _sc_console_char_height(ScConsole *cons) { /* sc_console_char_height Return the height of one character, in pixels */ int height1 = cons->screen_font->ascent + cons->screen_font->descent; int height2 = cons->screen_bold_font->ascent + cons->screen_bold_font->descent; return(max(max(height1, height2), 1)); } static inline gint _sc_console_char_x(ScConsole *cons, gint x) { /* sc_console_char_x Return the screen position of the X'th character. Does not compensate for scrolling, so char position is REAL */ return(x * _sc_console_char_width(cons)); } static inline gint _sc_console_char_y(ScConsole *cons, gint y) { /* sc_console_char_y Return the screen position of the Y'th character Does not compensate for scrolling, so char position is REAL */ return(y * _sc_console_char_height(cons)); } gint sc_console_get_row_height(ScConsole *cons) { /* sc_console_get_row_height Return one row height, in pixels */ return(_sc_console_char_height(cons)); } gint sc_console_get_col_width(ScConsole *cons) { /* sc_console_get_col_width Return one column width, in pixels */ return(_sc_console_char_width(cons)); } inline gint sc_console_get_char_from_pixel_x(ScConsole *cons, gint x, gboolean view) { /* sc_console_get_char_from_pixel_x Returns the character X position which is under pixel position x, where x is relative to the top-left of the widget. This takes scrolling into account if view is TRUE, so you will get a valid position into the char buffer if view is set. This always compensates for borders. */ x = x / sc_console_get_col_width(cons); if(view) x += sc_console_get_view_x(cons); if(cons->style != CONSOLE_BORDERLESS) x -= SC_CONSOLE_BORDER_WIDTH_CHARS; return(x); } inline gint sc_console_get_char_from_pixel_y(ScConsole *cons, gint y, gboolean view) { /* sc_console_get_char_from_pixel_y Returns the character Y position which is under pixel position y, where y is relative to the top-left of the widget. This takes scrolling into account if view is set to TRUE, so you will get a valid position into the char buffer if view is set. This always compensates for borders. */ y = y / sc_console_get_row_height(cons); if(view) y += sc_console_get_view_y(cons); if(cons->style != CONSOLE_BORDERLESS) y -= SC_CONSOLE_BORDER_HEIGHT_CHARS; return(y); } inline void sc_console_get_char_from_pixel(ScConsole *cons, gint *x, gint *y, gboolean view) { /* sc_console_get_char_from_pixel Interface that updates both X and Y */ *x = sc_console_get_char_from_pixel_x(cons, *x, view); *y = sc_console_get_char_from_pixel_y(cons, *y, view); } void sc_console_get_char_from_pixel_rect(ScConsole *cons, GdkRectangle *r, gboolean view) { /* sc_console_get_char_from_pixel_rect Fancy rectangle version */ r->x = sc_console_get_char_from_pixel_x(cons, r->x, view); r->y = sc_console_get_char_from_pixel_y(cons, r->y, view); r->width = r->width * sc_console_get_col_width(cons); r->height = r->height * sc_console_get_row_height(cons); } inline gint sc_console_get_pixel_from_char_x(ScConsole *cons, gint x, gboolean view) { /* sc_console_get_pixel_from_char_x Returns the pixel X position which corresponds to character col x, where x is relative to the top-left of the inner border. This takes scrolling into account if view is TRUE. This always compensates for borders; if view is false, (0,0) will be inside the border, never outside. */ if(cons->style != CONSOLE_BORDERLESS) x += SC_CONSOLE_BORDER_WIDTH_CHARS; if(view) x -= sc_console_get_view_x(cons); x = _sc_console_char_x(cons, x); return(x); } inline gint sc_console_get_pixel_from_char_y(ScConsole *cons, gint y, gboolean view) { /* sc_console_get_pixel_from_char_y Returns the pixel Y position which corresponds to character col y, where y is relative to the top-left of the inner border. This takes scrolling into account if view is TRUE. This always compensates for borders; if view is false, (0,0) will be inside the border, never outside. */ if(cons->style != CONSOLE_BORDERLESS) y += SC_CONSOLE_BORDER_HEIGHT_CHARS; if(view) y -= sc_console_get_view_y(cons); y = _sc_console_char_y(cons, y); return(y); } inline void sc_console_get_pixel_from_char(ScConsole *cons, gint *x, gint *y, gboolean view) { /* sc_console_get_pixel_from_char Interface that updates both X and Y */ *x = sc_console_get_pixel_from_char_x(cons, *x, view); *y = sc_console_get_pixel_from_char_y(cons, *y, view); } void sc_console_get_pixel_from_char_rect(ScConsole *cons, GdkRectangle *r, gboolean view) { /* sc_console_get_pixel_from_char_rect Fancy rectangle version */ r->x = sc_console_get_pixel_from_char_x(cons, r->x, view); r->y = sc_console_get_pixel_from_char_y(cons, r->y, view); r->width = r->width * sc_console_get_col_width(cons); r->height = r->height * sc_console_get_row_height(cons); } /*** Drawing Routines ***/ static inline gboolean _sc_console_in_bounds(gint cx, gint cy, gint x, gint y, gint width, gint height) { /* sc_console_in_bounds Returns true if the indicated (cx,cy) coordinate is within the bounds of the rectangle with corner (x,y) and the indicated width and height. */ assert(width >= 0); assert(height >= 0); return(cx >= x && cy >= y && cx < x + width && cy < y + height); } static void _sc_console_draw_char(ScConsole *cons, GdkGC *fg, GdkGC *bg, gboolean bold, gint x, gint y, char ch) { /* sc_console_draw_char Draws a single character using the indicated fg/bg GCs, and at the CHARACTER position (x,y). The coordinate will be converted to pixels automatically in this function. The character to write is specified by this function; this function will select the bold or normal font based on the "bold" flag. The coordinates are CHARACTER coordinates, but they are with respect to the VIEWPORT, not the character buffer. */ GdkFont *font; assert(IS_SC_CONSOLE(cons)); assert(fg != NULL); assert(bg != NULL); /* Which font to select? */ if(bold) { font = cons->screen_bold_font; } else { font = cons->screen_font; } /* Update X, Y to account for a window frame; also, set X, Y to the screen coordinates to write to. */ sc_console_get_pixel_from_char(cons, &x, &y, FALSE); /* Write the text! */ gdk_draw_rectangle(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), bg, TRUE, x, y, _sc_console_char_width(cons), _sc_console_char_height(cons)); gdk_draw_text(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), font, fg, x, y + font->ascent, &ch, 1); } static void _sc_console_draw_region(ScConsole *cons, gint x, gint y, gint width, gint height) { /* sc_console_draw_region Draws a region of the console, specified by the rectangle using CHARACTER coordinates, with corner (x,y) and the indicated width and height. This function uses information about active highlights and the text buffer to determine what to draw. width/height may be negative, in which case the rectangle is flipped appropriately. The coordinates are CHARACTER coordinates, but they are relative to the CHARACTER BUFFER, not the viewport. */ ScConsoleHighlight *high; /* Active highlight for current position */ GdkColor *oldfgcolor; /* Previous foreground colour (to speed up GC ops) */ GdkColor *oldbgcolor; /* Previous background colour (to speed up GC ops) */ GdkRectangle region; /* Rectangle representing redraw region */ GdkColor *fgcolor; /* Current foreground colour */ GdkColor *bgcolor; /* Current background colour */ GdkGC *fg_gc; /* Foreground GC */ GdkGC *bg_gc; /* Background GC */ GList *cur; /* List to iterate the highlights */ char *chptr; /* Pointer to current character to draw */ gint x1; /* Left X boundary */ gint y1; /* Top Y boundary */ gint x2; /* Right X boundary */ gint y2; /* Bottom Y boundary */ gint cx; /* Current X iter */ gint cy; /* Current Y iter */ gboolean bold; /* Draw this in bold? */ assert(IS_SC_CONSOLE(cons)); if(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)) == NULL) return; /* Set up the region variable. */ region.x = x; region.y = y; region.width = width; region.height = height; x1 = x; y1 = y; x2 = x + width - 1; y2 = y + height - 1; /* Check to see if width/height were negative, and swap if needed */ if(x1 > x2) { x1 = x1 + x2; x2 = x1 - x2; x1 = x1 - x2; } if(y1 > y2) { y1 = y1 + y2; y2 = y1 - y2; y1 = y1 - y2; } /* Clip the bottom/left coordinates based on extents of the text buffer */ if(x1 < cons->text.viewx) x1 = cons->text.viewx; if(y1 < cons->text.viewy) y1 = cons->text.viewy; if(x1 >= cons->text.viewx + cons->text.vieww) return; if(y1 >= cons->text.viewy + cons->text.viewh) return; /* Clip the top/right coordinates based on extents of the text buffer */ if(x2 < cons->text.viewx) return; if(y2 < cons->text.viewy) return; if(x2 >= cons->text.viewx + cons->text.vieww) x2 = cons->text.viewx + cons->text.vieww - 1; if(y2 >= cons->text.viewy + cons->text.viewh) y2 = cons->text.viewy + cons->text.viewh - 1; /* Request a GC */ fg_gc = gdk_gc_new(((GtkWidget *)cons)->window); bg_gc = gdk_gc_new(((GtkWidget *)cons)->window); /* Setup default foreground, background colors */ oldfgcolor = &cons->colors.foreground; oldbgcolor = &cons->colors.background; gdk_gc_set_foreground(fg_gc, oldfgcolor); gdk_gc_set_foreground(bg_gc, oldbgcolor); /* Start printing characters... */ for(cy = y1; cy <= y2; ++cy) { /* Get the character to be drawn */ chptr = _sc_console_get_char_ptr(cons, x1, cy); g_return_if_fail(chptr != NULL); for(cx = x1; cx <= x2; ++cx, ++chptr) { fgcolor = &cons->colors.foreground; bgcolor = &cons->colors.background; bold = cons->colors.bold; /* What highlight are we using? */ cur = cons->highlights; while(cur != NULL) { /* Are we on this highlight? */ high = cur->data; assert(high != NULL); cur = cur->next; if(_sc_console_in_bounds(cx, cy, high->x, high->y, high->width, high->height)) { /* We are on this highlight; set new fg/bg color */ if(!high->colors.colors_alloc) { high->colors.colors_alloc = TRUE; gdk_colormap_alloc_color(gtk_widget_get_colormap((GtkWidget *)cons), &high->colors.foreground, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap((GtkWidget *)cons), &high->colors.background, FALSE, TRUE); } fgcolor = &high->colors.foreground; bgcolor = &high->colors.background; bold = high->colors.bold; } /* Coordinates in bound? */ } /* Iterating thru installed highlights ... */ /* Are we drawing the new cursor? */ if(_sc_console_in_bounds(cx, cy, cons->cursor.x, cons->cursor.y, cons->cursor.width, cons->cursor.height)) { /* Welp, we're on the cursor.. all that work, for nothing */ if(gtk_widget_has_focus((GtkWidget *)cons)) { if(cons->cursor.highlighted) { fgcolor = &cons->colors.forelight; bgcolor = &cons->colors.backlight; } else { fgcolor = &cons->colors.forecursor; bgcolor = &cons->colors.backcursor; } } else { fgcolor = &cons->colors.foreshadow; bgcolor = &cons->colors.backshadow; } } /* We be a cursor? */ /* Only update the GC if we absolutely have to */ if(oldfgcolor != fgcolor) { oldfgcolor = fgcolor; gdk_gc_set_foreground(fg_gc, fgcolor); } if(oldbgcolor != bgcolor) { oldbgcolor = bgcolor; gdk_gc_set_foreground(bg_gc, bgcolor); } _sc_console_draw_char(cons, fg_gc, bg_gc, bold, cx - cons->text.viewx, cy - cons->text.viewy, *chptr); } /* Iterating thru X */ } /* Iterate thru Y */ /* Update X, Y to account for a window frame; also, set X, Y to the screen coordinates to write to. */ sc_console_get_pixel_from_char(cons, &x, &y, TRUE); /* Update width, height to screen coordinates */ width = width * _sc_console_char_width(cons); height= height* _sc_console_char_height(cons); /* Make sure this update is queued for display to screen. */ sc_drawbuf_queue_draw(SC_DRAWBUF(cons), x, y, width, height); /* Propagate the draw request to the active console. */ g_signal_emit_by_name(GTK_OBJECT(cons), "paint_region", ®ion, NULL); /* Release the GC's */ g_object_unref(fg_gc); g_object_unref(bg_gc); } static void _sc_console_draw_horiz_scroll(__libj_unused ScConsole *cons) { /* sc_console_draw_horiz_scroll Currently not supported :( */ } static inline void _sc_console_vert_scroll_extents(ScConsole *cons, gint *startx, gint *starty, gint *width, gint *height, gint *arrowh) { /* sc_console_vert_scroll_extents Figure out the extents of the vertical scrollbar. The arguments are startx, starty: bottomleft coordinate of scrollbar body. The starty is ABOVE the bottom arrow. width, height: total dimensions of the scrollbar body. The height does NOT include the height of the 2 arrows. arrowh: height of each arrow (the width of arrow is == width). */ *width = ((_sc_console_char_width(cons) + 2) & ~1); *height = GTK_WIDGET(cons)->allocation.height - 3 * _sc_console_char_height(cons); *startx = GTK_WIDGET(cons)->allocation.width - 2 * _sc_console_char_width(cons) + 1; *starty = _sc_console_char_height(cons) * 3 / 2; *arrowh = *width + 2; } static inline void _sc_console_vert_trough_extents(ScConsole *cons, gint starty, gint height, gint *pos, gint *size) { /* sc_console_vert_trough_extents Figure out the extents of the trough (the "box" in the scrollbar body that indicates the current position of the scrollbar and the size of the viewable area). The function is given starty and height, and returns pos, which indicates the bottommost coordinate of the trough, and size, which indicates the height of the trough. */ *pos = starty + height * cons->text.viewy / cons->text.bufferh; *size = height * cons->text.viewh / cons->text.bufferh; } static inline gboolean _sc_console_can_scroll_up(ScConsole *cons) { /* sc_console_can_scroll_up Returns true if it is possible to scroll up currently. */ return(sc_console_get_view_y(cons) > 0); } static inline gboolean _sc_console_can_scroll_down(ScConsole *cons) { /* sc_console_can_scroll_down Returns true if it is possible to scroll down currently. */ return(sc_console_get_view_y(cons) + sc_console_get_view_height(cons) < sc_console_get_height(cons)); } static void _sc_console_draw_vert_scroll(ScConsole *cons) { /* sc_console_draw_vert_scroll Draws the vertical scrollbar. */ GtkWidget *widget = (GtkWidget *)cons; GdkPoint points[3]; GdkGC *foreground; gint arrowh; gint startx; gint starty; gint height; gint width; gint size; gint pos; assert(IS_SC_CONSOLE(cons)); /* Can we even draw yet? */ if(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)) == NULL) return; if(cons->style == CONSOLE_BORDERLESS) return; /* Request a GC */ foreground = gdk_gc_new(widget->window); /* Determine vertical scrollbar extents */ _sc_console_vert_scroll_extents(cons, &startx, &starty, &width, &height, &arrowh); _sc_console_vert_trough_extents(cons, starty, height, &pos, &size); /* erase any original bars */ gdk_gc_set_foreground(foreground, &cons->colors.backscroll); gdk_draw_rectangle(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, TRUE, startx, starty - arrowh, width, height + 2 * arrowh); /* setup gc colors for bar */ gdk_gc_set_foreground(foreground, &cons->colors.forescroll); /* Draw vertical slider */ gdk_draw_rectangle(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, TRUE, startx, pos, width, size); /* Determine if up-arrow is required */ if(_sc_console_can_scroll_up(cons)) { points[0].x = startx + width / 2; points[0].y = starty - arrowh; points[1].x = points[0].x - width / 2; points[1].y = starty - 2; points[2].x = points[0].x + width / 2; points[2].y = starty - 2; gdk_draw_polygon(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, TRUE, points, 3); } /* Up arrow? */ /* Determine if down-arrow is required */ if(_sc_console_can_scroll_down(cons)) { points[0].x = startx + width / 2; points[0].y = starty + height + arrowh; points[1].x = points[0].x - width / 2; points[1].y = starty + height + 2; points[2].x = points[0].x + width / 2; points[2].y = starty + height + 2; gdk_draw_polygon(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, TRUE, points, 3); } /* Down arrow? */ /* Release the GC's */ g_object_unref(foreground); /* Make sure everything is queued for draw */ sc_drawbuf_queue_draw(SC_DRAWBUF(widget), startx, starty - arrowh, width, height + 2 * arrowh); } static void _sc_console_draw_frame(ScConsole *cons) { /* sc_console_draw_frame Draws the window border for this console, if applicable, and draws the scrollbars for this console if they need to be displayed. */ GtkWidget *widget = (GtkWidget *)cons; GdkGC *foreground; GdkGC *background; assert(IS_SC_CONSOLE(cons)); /* Can we even draw yet? */ if(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)) == NULL) return; /* Request a GC */ foreground = gdk_gc_new(widget->window); background = gdk_gc_new(widget->window); /* setup gc colors */ gdk_gc_set_foreground(foreground, &cons->colors.foreground); gdk_gc_set_foreground(background, &cons->colors.background); /* Clear the screen; draw window border if appropriate */ gdk_draw_rectangle(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), background, TRUE, 0, 0, widget->allocation.width, widget->allocation.height); if(cons->style != CONSOLE_BORDERLESS) { /* Draw a border as well... */ gdk_draw_rectangle(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)), foreground, FALSE, _sc_console_char_width(cons) - 4, _sc_console_char_height(cons) / 2 - 2, widget->allocation.width - 2 * _sc_console_char_width(cons) + 8, widget->allocation.height - _sc_console_char_height(cons) + 4); /* Did we need scrollers? */ if(cons->text.scrollx) { _sc_console_draw_horiz_scroll(cons); } /* horizontal scrollbar */ if(cons->text.scrolly) { _sc_console_draw_vert_scroll(cons); } /* vertical scrollbar */ } /* Draw the window border? */ /* Release the GC's */ g_object_unref(foreground); g_object_unref(background); } static void _sc_console_draw_all(ScConsole *cons) { /* sc_console_draw_all Redraws the entire console, including all displayable text, all borders, and the scrollbars if they are applicable. */ GtkWidget *widget = (GtkWidget *)cons; assert(IS_SC_CONSOLE(cons)); /* Can we even draw yet? */ if(sc_drawbuf_get_buffer(SC_DRAWBUF(cons)) == NULL) return; /* Setup default foreground, background colors */ /* (make sure to allocate them if not done already) */ if(!cons->colors.colors_alloc) { cons->colors.colors_alloc = TRUE; gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.foreground, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.background, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.forecursor, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.backcursor, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.foreshadow, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.backshadow, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.forescroll, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.backscroll, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.forelight, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.backlight, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.foredisabled, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.backdisabled, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.forestandard, FALSE, TRUE); gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &cons->colors.backstandard, FALSE, TRUE); } /* Redraw the window frame */ _sc_console_draw_frame(cons); /* Redraw each line of text */ _sc_console_draw_region(cons, 0, 0, sc_console_get_width(cons), sc_console_get_height(cons)); /* Make sure everything is queued for draw */ sc_drawbuf_queue_draw(SC_DRAWBUF(widget), 0, 0, widget->allocation.width, widget->allocation.height); } /*** Standard Events ***/ static gint _sc_console_configure(GtkWidget *widget, GdkEventConfigure *event) { /* sc_console_configure This is the configure event when a console is resized. Takes care of redrawing the entire console. */ /* Check for a parent signal handler */ if(GTK_WIDGET_CLASS(parent_class)->configure_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->configure_event(widget, event)) { /* Oops; we must halt */ return(TRUE); } /* Can we continue? */ } /* Does parent have default? */ /* Draw the console */ _sc_console_draw_all(SC_CONSOLE(widget)); /* Let other events run as well... */ return(FALSE); } static gint _sc_console_draw_focus(GtkWidget *widget, GdkEventFocus *event) { /* sc_console_draw_focus Draws the console's cursor as if it were focused. This sets the GTK flags to indicate the console currently has the focus. */ ScConsole *cons = SC_CONSOLE(widget); gtk_widget_grab_focus(widget); _sc_console_draw_region(cons, cons->cursor.x, cons->cursor.y, cons->cursor.width, cons->cursor.height); /* Check for a parent signal handler */ if(GTK_WIDGET_CLASS(parent_class)->focus_in_event != NULL) { return(GTK_WIDGET_CLASS(parent_class)->focus_in_event(widget, event)); } /* Does parent have default? */ /* Allow other events */ return(FALSE); } static gint _sc_console_undraw_focus(GtkWidget *widget, GdkEventFocus *event) { /* sc_console_undraw_focus Draws the console's cursor as if it were unfocused. */ ScConsole *cons = SC_CONSOLE(widget); _sc_console_draw_region(cons, cons->cursor.x, cons->cursor.y, cons->cursor.width, cons->cursor.height); /* Check for a parent signal handler */ if(GTK_WIDGET_CLASS(parent_class)->focus_out_event != NULL) { return(GTK_WIDGET_CLASS(parent_class)->focus_out_event(widget, event)); } /* Does parent have default? */ /* Allow other events */ return(FALSE); } static gint _sc_console_button_press(GtkWidget *widget, GdkEventButton *event) { /* sc_console_button_press Someone clicked the mouse. Update the cursor/active highlight if needed, and check for scrollbar events. */ ScConsole *cons = SC_CONSOLE(widget); gboolean needredraw = FALSE; gint arrowh; gint height; gint width; gint size; gint pos; gint x; gint y; /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->button_press_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->button_press_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ /* Make sure this is a SINGLE click event */ if(event->type != GDK_BUTTON_PRESS) return(FALSE); /* See if this was a click onto a scrollbar */ if(cons->text.scrolly) { /* Check to see if we're clicking in vertical scrollbar region */ _sc_console_vert_scroll_extents(cons, &x, &y, &width, &height, &arrowh); _sc_console_vert_trough_extents(cons, y, height, &pos, &size); if(event->x >= x && event->x < x + width && event->y >= y - arrowh && event->y < y + height + arrowh) { /* Click was onto the scrollbar itself */ if(event->y >= y - arrowh && event->y < y) { /* Clicked up-arrow */ if(_sc_console_can_scroll_up(cons)) { --cons->text.viewy; needredraw = TRUE; } /* Can we scroll down? */ needredraw = TRUE; } else if(event->y >= y + height && event->y < y + height + arrowh) { if(_sc_console_can_scroll_down(cons)) { ++cons->text.viewy; needredraw = TRUE; } /* Can we scroll down? */ } else if(event->y < pos) { /* Page up */ if(_sc_console_can_scroll_up(cons)) { cons->text.viewy -= cons->text.viewh; if(cons->text.viewy < 0) cons->text.viewy = 0; needredraw = TRUE; } /* Can we page up? */ } else if(event->y >= pos + size) { /* Page down */ if(_sc_console_can_scroll_down(cons)) { cons->text.viewy += cons->text.viewh; if(cons->text.viewy > sc_console_get_height(cons) - cons->text.viewh) { cons->text.viewy = sc_console_get_height(cons) - cons->text.viewh; } needredraw = TRUE; } /* Can we page up? */ } /* Checking Y coordinate */ /* Redraw components? */ if(needredraw) { _sc_console_draw_vert_scroll(cons); _sc_console_draw_region(cons, 0, 0, sc_console_get_width(cons), sc_console_get_height(cons)); } /* Click was in scrollbar, abort */ cons->ignorerelease = TRUE; return(TRUE); } /* Checking X, Y coordinate */ } /* Checking vertical scrollbar */ /* Nothing interesting... */ return(FALSE); } static gint _sc_console_button_release(GtkWidget *widget, GdkEventButton *event) { /* sc_console_button_release Someone released the mouse button. Update the cursor/active highlight if needed, and check for scrollbar events. */ ScConsole *cons = SC_CONSOLE(widget); /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->button_release_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->button_release_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ /* See if this was a click onto a scrollbar */ if(cons->ignorerelease) { cons->ignorerelease = FALSE; return(TRUE); } /* Clicked a scrollbar */ /* Nothing interesting... */ return(FALSE); } static gint _sc_console_key_press(GtkWidget *widget, GdkEventKey *event) { /* sc_console_key_press Process a key that was pressed. */ ScConsole *cons = SC_CONSOLE(widget); /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->key_press_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->key_press_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ switch(event->keyval) { case GDK_Page_Up: case GDK_KP_Page_Up: if(_sc_console_can_scroll_up(cons)) { cons->text.viewy -= cons->text.viewh; if(cons->text.viewy < 0) cons->text.viewy = 0; _sc_console_draw_vert_scroll(cons); _sc_console_draw_region(cons, 0, 0, sc_console_get_width(cons), sc_console_get_height(cons)); } return(TRUE); case GDK_Page_Down: case GDK_KP_Page_Down: if(_sc_console_can_scroll_down(cons)) { cons->text.viewy += cons->text.viewh; if(cons->text.viewy > sc_console_get_height(cons) - cons->text.viewh) { cons->text.viewy = sc_console_get_height(cons) - cons->text.viewh; } _sc_console_draw_vert_scroll(cons); _sc_console_draw_region(cons, 0, 0, sc_console_get_width(cons), sc_console_get_height(cons)); } return(TRUE); } /* Search for special keys */ /* Fallthrough */ return(FALSE); } static gint _sc_console_key_release(GtkWidget *widget, GdkEventKey *event) { /* sc_console_key_release Process a key that was released. */ /* Try out parent handler first */ if(GTK_WIDGET_CLASS(parent_class)->key_release_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->key_release_event(widget, event)) { /* Crap. The signal's already been handled */ return(TRUE); } /* Signal processed? */ } /* Signal handler available? */ switch(event->keyval) { case GDK_Page_Up: case GDK_KP_Page_Up: case GDK_Page_Down: case GDK_KP_Page_Down: return(TRUE); } /* Search for special keys */ /* Fallthrough */ return(FALSE); } /*** Console Class Initializers ***/ static void _sc_console_class_init(ScConsoleClass *klass) { /* sc_console_class_init Initialise the console class. */ GtkObjectClass *object_class = (GtkObjectClass *)klass; /* Determine parent class */ parent_class = g_type_class_peek(sc_drawbuf_get_type()); /* Construct new signals */ _sc_console_signals[PAINT_REGION_SIGNAL] = g_signal_new("paint_region", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScConsoleClass, paint_region), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__POINTER, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 1, /* Number of extra parametres to pass */ G_TYPE_POINTER /* Type of first parametre to marshaller */ ); /* Attach default signal handlers */ klass->paint_region = NULL; GTK_OBJECT_CLASS(klass)->destroy = _sc_console_destroy; GTK_WIDGET_CLASS(klass)->configure_event = _sc_console_configure; GTK_WIDGET_CLASS(klass)->focus_in_event = _sc_console_draw_focus; GTK_WIDGET_CLASS(klass)->focus_out_event = _sc_console_undraw_focus; GTK_WIDGET_CLASS(klass)->button_press_event = _sc_console_button_press; GTK_WIDGET_CLASS(klass)->button_release_event= _sc_console_button_release; GTK_WIDGET_CLASS(klass)->key_press_event = _sc_console_key_press; GTK_WIDGET_CLASS(klass)->key_release_event = _sc_console_key_release; } static void _sc_console_init_obj(ScConsole *cons) { /* sc_console_init_obj Initialize a new instance of a console. */ /* Clear the text buffer */ cons->text.scrollx = 0; cons->text.scrolly = 0; cons->text.buffer = NULL; _sc_console_init_fonts(cons); cons->cursor.highlighted = FALSE; cons->highlights = NULL; cons->ignorerelease = FALSE; /* Reset the cursor */ cons->cursor.x = 0; cons->cursor.y = 0; cons->cursor.width = 0; cons->cursor.height= 0; /* Initialize console colours */ gdk_color_parse("#000000", &cons->colors.background); gdk_color_parse("#c0c0c0", &cons->colors.foreground); gdk_color_parse("#701010", &cons->colors.backcursor); gdk_color_parse("#ffffff", &cons->colors.forecursor); gdk_color_parse("#202020", &cons->colors.backshadow); gdk_color_parse("#e0e0e0", &cons->colors.foreshadow); gdk_color_parse("#101060", &cons->colors.backscroll); gdk_color_parse("#7090a0", &cons->colors.forescroll); gdk_color_parse("#a02020", &cons->colors.backlight); gdk_color_parse("#ffffff", &cons->colors.forelight); gdk_color_parse("#000000", &cons->colors.backdisabled); gdk_color_parse("#606060", &cons->colors.foredisabled); gdk_color_parse("#000000", &cons->colors.backstandard); gdk_color_parse("#c0c0c0", &cons->colors.forestandard); cons->colors.colors_alloc = FALSE; cons->colors.bold = FALSE; /* Make sure the console is focusable. */ gtk_widget_set_can_focus(GTK_WIDGET(cons), TRUE); } GType sc_console_get_type(void) { /* sc_console_get_type Return the console type. */ static GType sc_console_type = 0; if(sc_console_type == 0) { static const GTypeInfo sc_console_info = { sizeof(ScConsoleClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_console_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScConsole), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_console_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_console_type = g_type_register_static(sc_drawbuf_get_type(), "ScConsole", &sc_console_info, 0); } return(sc_console_type); } void sc_console_buffer_size(ScConsole *cons, gint width, gint height) { /* sc_console_buffer_size This resets the console size. The buffer text is cleared. This does not automatically redraw the console; it is generally used as an initialization event only. This does NOT update the viewport dimensions, although it will reset the viewport position to the top-left of the buffer. */ if(width <= 0 || height <= 0) { printf("Let me get this straight. You want to create an empty buffer?\n"); printf("... oh, you are SO going to regret this operation. The console\n"); printf("... library will make you SUFFER HORRIBLY for this transgression.\n"); printf("(this is Jacob's honorary bug!)\n"); } g_return_if_fail(width > 0 && height > 0); if(width < cons->text.vieww) width = cons->text.vieww; if(height< cons->text.viewh) height= cons->text.viewh; cons->text.buffer = (char *)realloc(cons->text.buffer, width * height); if(cons->text.buffer != NULL) { memset(cons->text.buffer, ' ', width * height); } cons->text.viewx = 0; cons->text.viewy = 0; cons->text.bufferw = width; cons->text.bufferh = height; cons->text.scrollx = (cons->text.vieww < width); cons->text.scrolly = (cons->text.viewh < height); } static inline void _sc_console_init_dimensions(ScConsole *cons) { /* sc_console_init_dimensions Initialize console dimensions based on the current font metrics, and set the console's usize request. */ int x; int y; int width; int height; assert(IS_SC_CONSOLE(cons)); x = cons->text.dispx; y = cons->text.dispy; width = cons->text.vieww; height = cons->text.viewh; if(cons->style != CONSOLE_BORDERLESS) { x -= SC_CONSOLE_BORDER_WIDTH_CHARS; y -= SC_CONSOLE_BORDER_HEIGHT_CHARS; width += SC_CONSOLE_BORDER_WIDTH_CHARS * 2; height+= SC_CONSOLE_BORDER_HEIGHT_CHARS * 2; } cons->req_alloc.x = _sc_console_char_x(cons, x); cons->req_alloc.y = _sc_console_char_y(cons, y); cons->req_alloc.width = width * _sc_console_char_width(cons); cons->req_alloc.height= height* _sc_console_char_height(cons); gtk_widget_set_size_request(GTK_WIDGET(cons), cons->req_alloc.width, cons->req_alloc.height); } void sc_console_init(ScConsole *cons, gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont) { /* sc_console_init Initialize a console. */ g_return_if_fail(IS_SC_CONSOLE(cons)); g_return_if_fail(x >= 0 && y >= 0); g_return_if_fail(width > 0 && height > 0); g_return_if_fail(font != NULL && boldfont != NULL); _sc_console_destroy_data(cons); _sc_console_set_fonts(cons, font, boldfont); cons->text.vieww = width; cons->text.viewh = height; cons->text.dispx = x; cons->text.dispy = y; sc_console_buffer_size(cons, width, height); cons->style = style; _sc_console_init_dimensions(cons); gtk_widget_set_sensitive(GTK_WIDGET(cons), FALSE); sc_console_clear(cons); } void sc_console_clear(ScConsole *cons) { /* sc_console_clear Erase console text and release all highlights. */ g_return_if_fail(IS_SC_CONSOLE(cons)); if(cons->text.buffer != NULL) { memset(cons->text.buffer, ' ', sc_console_get_width(cons) * sc_console_get_height(cons)); } sc_console_highlight_detach_all(cons); _sc_console_draw_region(cons, 0, 0, sc_console_get_width(cons), sc_console_get_height(cons)); } GtkWidget *sc_console_new(gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont) { /* sc_console_new Create a new console. */ ScConsole *cons; g_return_val_if_fail(x >= 0 && y >= 0, NULL); g_return_val_if_fail(width > 0 && height > 0, NULL); g_return_val_if_fail(font != NULL && boldfont != NULL, NULL); cons = g_object_new(sc_console_get_type(), NULL); g_return_val_if_fail(cons != NULL, NULL); sc_console_init(cons, x, y, width, height, style, font, boldfont); return(GTK_WIDGET(cons)); } /*** Console Write Functions ***/ void sc_console_write_char(ScConsole *cons, gint x, gint y, char ch) { /* sc_console_write_char Writes a single character at (x,y). */ char *p; g_return_if_fail(IS_SC_CONSOLE(cons)); if(x < 0 || x >= sc_console_get_width(cons)) return; if(y < 0 || y >= sc_console_get_height(cons)) return; if(ch < 0x20) ch = ' '; p = _sc_console_get_char_ptr(cons, x, y); g_return_if_fail(p != NULL); *p = ch; _sc_console_draw_region(cons, x, y, 1, 1); } void sc_console_write_line(ScConsole *cons, gint x, gint y, const char *line) { /* sc_console_write_line Writes a line of text starting at character position (x,y). If the line overflows the width of the text buffer, then the line is truncated. If x < 0, then the first (-x) characters of line will be trimmed, and printing will begin in column 0. */ gint width; const char *start; const char *end; char *p; g_return_if_fail(IS_SC_CONSOLE(cons)); g_return_if_fail(line != NULL); width = sc_console_get_width(cons); if(y < 0 || y >= sc_console_get_height(cons)) return; for(start = line; *start != '\0' && (line - start) + x < 0; ++start) /* Just loop */; for(end = start; *end != '\0' && (end - start) + x < width; ++end) /* Just loop */; if(end == start) return; p = _sc_console_get_char_ptr(cons, x, y); g_return_if_fail(p != NULL); memcpy(p, start, end - start); _sc_console_draw_region(cons, x, y, end - start, 1); } void sc_console_clear_line(ScConsole *cons, gint y) { /* sc_console_clear_line Clears a single line of text on row y. */ char *p; g_return_if_fail(IS_SC_CONSOLE(cons)); if(y < 0 || y >= sc_console_get_height(cons)) return; p = _sc_console_get_char_ptr(cons, 0, y); g_return_if_fail(p != NULL); memset(p, ' ', sc_console_get_width(cons)); _sc_console_draw_region(cons, 0, y, sc_console_get_width(cons), 1); } void sc_console_write_line_wrap(ScConsole *cons, gint x, gint y, const char *line) { /* sc_console_write_line_wrap Writes a line of text starting at character position (x,y). If the line overflows the width of the text buffer, then it is continued on the next line starting in column 0. If the text overflows the height of the text buffer in this manner, then it will be truncated. It is considered an error if x < 0 or y < 0. If x is beyond the width of the line, then printing will start on the next line. */ gint width; gint height; gint minx; char *p; g_return_if_fail(IS_SC_CONSOLE(cons)); g_return_if_fail(line != NULL); g_return_if_fail(x >= 0 && y >= 0); width = sc_console_get_width(cons); height= sc_console_get_height(cons); if(x >= width) { x = 0; ++y; } if(y >= height) return; minx = x; p = _sc_console_get_char_ptr(cons, x, y); g_return_if_fail(p != NULL); while(y < height && *line != '\0') { *p = *line; ++line; ++p; ++x; if(x >= width) { _sc_console_draw_region(cons, minx, y, x - minx, 1); minx = 0; x = 0; ++y; } } if(x > minx) { _sc_console_draw_region(cons, minx, y, x - minx, 1); } } /*** Console Cursors ***/ static void _sc_console_lock_view_to_cursor(ScConsole *cons, ScConsoleCursor *cursor) { /* sc_console_lock_view_to_cursor Forces the cursor to appear within the viewport by altering the viewport if necessary. */ gboolean needrewrite = FALSE; assert(IS_SC_CONSOLE(cons)); assert(cursor != NULL); if(cursor->x < cons->text.viewx) { cons->text.viewx = cursor->x; _sc_console_draw_horiz_scroll(cons); needrewrite = TRUE; } else if(cursor->x + cursor->width > cons->text.viewx + cons->text.vieww) { cons->text.viewx = cursor->y - (cons->text.vieww - cursor->width); _sc_console_draw_horiz_scroll(cons); needrewrite = TRUE; } if(cursor->y < cons->text.viewy) { cons->text.viewy = cursor->y; _sc_console_draw_vert_scroll(cons); needrewrite = TRUE; } else if(cursor->y + cursor->height > cons->text.viewy + cons->text.viewh) { cons->text.viewy = cursor->y - (cons->text.viewh - cursor->height); _sc_console_draw_vert_scroll(cons); needrewrite = TRUE; } if(needrewrite) { _sc_console_draw_region(cons, 0, 0, sc_console_get_width(cons), sc_console_get_height(cons)); } } void sc_console_set_cursor(ScConsole *cons, gint x, gint y, gint width, gint height) { /* sc_console_set_cursor Updates all attributes of the cursor. The cursor's position is given in (x,y) which are CHARACTER coordinates relative to the TEXT BUFFER (not the viewport). The cursor's dimensions are also specified. To make the cursor invisible, use width = height = 0. The viewport may be altered to ensure that the cursor is visible within the viewport. */ ScConsoleCursor *cursor; /* Pointer to the cursor structure */ gint oldx; /* Cursor's original position X */ gint oldy; /* Cursor's original position Y */ gint oldw; /* Cursor's original width */ gint oldh; /* Cursor's original height */ g_return_if_fail(IS_SC_CONSOLE(cons)); g_return_if_fail(width >= 0 && height >= 0); /* Get the cursor */ cursor = &cons->cursor; /* Update the cursor attributes */ oldx = cursor->x; oldy = cursor->y; oldw = cursor->width; oldh = cursor->height; cursor->x = x; cursor->y = y; cursor->width = width; cursor->height= height; /* Update the display. Make sure the cursor is on the screen somewhere. */ _sc_console_lock_view_to_cursor(cons, cursor); _sc_console_draw_region(cons, oldx, oldy, oldw, oldh); _sc_console_draw_region(cons, cursor->x, cursor->y, cursor->width, cursor->height); } void sc_console_set_cursor_pos(ScConsole *cons, gint x, gint y) { /* sc_console_set_cursor_pos Modifies the cursor position to the CHARACTER coordinates (x,y) (which are relative to the TEXT BUFFER, not the viewport). The cursor's width and height are left unaltered. The viewport may be altered to ensure that the cursor is visible within the viewport. */ ScConsoleCursor *cursor; /* Pointer to the cursor structure */ gint oldx; /* Original cursor position X */ gint oldy; /* Original cursor position Y */ g_return_if_fail(IS_SC_CONSOLE(cons)); /* Get the cursor */ cursor = &cons->cursor; /* Update the position */ oldx = cursor->x; oldy = cursor->y; cursor->x = x; cursor->y = y; /* Update the display. Make sure the cursor is on the screen somewhere. */ _sc_console_lock_view_to_cursor(cons, cursor); _sc_console_draw_region(cons, oldx, oldy, cursor->width, cursor->height); _sc_console_draw_region(cons, cursor->x, cursor->y, cursor->width, cursor->height); } void sc_console_set_cursor_highlighted(ScConsole *cons, gboolean highlighted) { /* sc_console_set_cursor_highlighted Sets a flag indicating whether the cursor should appear "highlighted" or not. The cursor is usually positioned on an active spot. The highlighted flag determines whether the cursor is very bright, or just its normal colours. */ g_return_if_fail(IS_SC_CONSOLE(cons)); if((highlighted && !cons->cursor.highlighted) || (!highlighted && cons->cursor.highlighted)) { cons->cursor.highlighted = highlighted; _sc_console_draw_region(cons, sc_console_get_cursor_x(cons), sc_console_get_cursor_y(cons), sc_console_get_cursor_width(cons), sc_console_get_cursor_height(cons)); } } /*** Console Colours and Fonts ***/ void sc_console_set_fonts(ScConsole *cons, GdkFont *font, GdkFont *boldfont) { /* sc_console_set_fonts Update the fonts installed for this console. Neither font pointer should be NULL. The currently-installed fonts will be unreferenced, the new fonts will have their reference counts incremented by 1, and the entire console will be resized, repositioned, and redrawn. */ #if SC_GTK_DEBUG_GTK printf("sc_console_set_fonts: installing new console fonts for %p: %p %p\n", (void *)cons, (void *)font, (void *)boldfont); #endif /* SC_GTK_DEBUG_GTK */ g_return_if_fail(IS_SC_CONSOLE(cons)); g_return_if_fail(font != NULL && boldfont != NULL); _sc_console_set_fonts(cons, font, boldfont); _sc_console_init_dimensions(cons); #if SC_GTK_DEBUG_GTK printf("sc_console_set_fonts: finished installing new console fonts for %p\n", (void *)cons); #endif /* SC_GTK_DEBUG_GTK */ } void sc_console_set_colors(ScConsole *cons, GdkColor *fg, GdkColor *bg) { /* sc_console_set_colors Modify the normal foreground/background colours for this console. This does not alter the colour attributes for highlights or the cursor. If either colour is NULL, then the console's current colour is preserved. */ g_return_if_fail(IS_SC_CONSOLE(cons)); if(fg != NULL) { cons->colors.foreground.red = fg->red; cons->colors.foreground.green = fg->green; cons->colors.foreground.blue = fg->blue; } if(bg != NULL) { cons->colors.background.red = bg->red; cons->colors.background.green = bg->green; cons->colors.background.blue = bg->blue; } cons->colors.colors_alloc = FALSE; cons->colors.bold = FALSE; _sc_console_draw_all(cons); } GdkColor *sc_console_get_color(ScConsole *cons, ScConsoleColorId rqst) { /* sc_console_get_color Returns the GdkColor for the specified console attribute. */ g_return_val_if_fail(IS_SC_CONSOLE(cons), NULL); switch(rqst) { case SC_CONSOLE_FOREGROUND: return(&cons->colors.foreground); case SC_CONSOLE_BACKGROUND: return(&cons->colors.background); case SC_CONSOLE_FORECURSOR: return(&cons->colors.forecursor); case SC_CONSOLE_BACKCURSOR: return(&cons->colors.backcursor); case SC_CONSOLE_FORESHADOW: return(&cons->colors.foreshadow); case SC_CONSOLE_BACKSHADOW: return(&cons->colors.backshadow); case SC_CONSOLE_FORESCROLL: return(&cons->colors.forescroll); case SC_CONSOLE_BACKSCROLL: return(&cons->colors.backscroll); case SC_CONSOLE_FORELIGHT: return(&cons->colors.forelight); case SC_CONSOLE_BACKLIGHT: return(&cons->colors.backlight); case SC_CONSOLE_FOREDISABLED: return(&cons->colors.foredisabled); case SC_CONSOLE_BACKDISABLED: return(&cons->colors.backdisabled); case SC_CONSOLE_FORESTANDARD: return(&cons->colors.forestandard); case SC_CONSOLE_BACKSTANDARD: return(&cons->colors.backstandard); } return(NULL); } /*** Console Highlights ***/ void sc_console_highlight_attach(ScConsole *cons, GdkColor *fg, GdkColor *bg, gboolean bold, gint x, gint y, gint width, gint height) { /* sc_console_highlight_attach Attach a new highlight to the console, with the indicated colours and font weight, and indicated bounding box. If either colour is NULL, then the default console text colours will be used. Highlights are used to change the appearance of text in a particular region; they do not alter the text itself, however. The coordinates are relative to the TEXT BUFFER, not the viewport. */ ScConsoleHighlight *high; g_return_if_fail(IS_SC_CONSOLE(cons)); high = (ScConsoleHighlight *)malloc(sizeof(ScConsoleHighlight)); g_return_if_fail(high != NULL); if(fg != NULL) { high->colors.foreground.red = fg->red; high->colors.foreground.green = fg->green; high->colors.foreground.blue = fg->blue; } else { high->colors.foreground.red = cons->colors.foreground.red; high->colors.foreground.green = cons->colors.foreground.green; high->colors.foreground.blue = cons->colors.foreground.blue; } if(bg != NULL) { high->colors.background.red = bg->red; high->colors.background.green = bg->green; high->colors.background.blue = bg->blue; } else { high->colors.background.red = cons->colors.background.red; high->colors.background.green = cons->colors.background.green; high->colors.background.blue = cons->colors.background.blue; } high->colors.colors_alloc = FALSE; high->colors.bold = bold; high->x = x; high->y = y; high->width = width; high->height= height; cons->highlights = g_list_append(cons->highlights, high); _sc_console_draw_region(cons, high->x, high->y, high->width, high->height); } void sc_console_highlight_attach_disabled(ScConsole *cons, gint x, gint y, gint width, gint height) { /* sc_console_highlight_attach_disabled Attach a "disabled" highlight to the console; one that follows the built-in disabled colour scheme, using a normal font (not bold). The coordinates are CHARACTER coordinates, and are relative to the TEXT BUFFER, not the viewport. */ sc_console_highlight_attach(cons, &cons->colors.foredisabled, &cons->colors.backdisabled, FALSE, x, y, width, height); } gboolean sc_console_highlight_detach(ScConsole *cons) { /* sc_console_highlight_detach Remove the most recently attached highlight on this console. Returns FALSE if there were no consoles available for deletion. */ ScConsoleHighlight *high; /* Highlight to delete */ GList *cur; /* Linked list iterator */ gint x; /* X position of highlight */ gint y; /* Y position of highlight */ gint width; /* Width of highlight */ gint height; /* Height of highlight */ g_return_val_if_fail(IS_SC_CONSOLE(cons), FALSE); /* Is there anything to delete? */ cur = cons->highlights; if(cur == NULL) return(FALSE); /* Delete the last highlight */ while(cur->next != NULL) cur = cur->next; high = cur->data; g_return_val_if_fail(high != NULL, FALSE); cur->data = NULL; /* Find out the extents of the highlight */ x = high->x; y = high->y; width = high->width; height= high->height; /* Release the highlight */ free(high); cons->highlights = g_list_remove_link(cons->highlights, cur); g_list_free(cur); /* Update display */ _sc_console_draw_region(cons, x, y, width, height); return(TRUE); } void sc_console_highlight_detach_all(ScConsole *cons) { /* sc_console_highlight_detach_all Remove all highlights from this console. */ assert(IS_SC_CONSOLE(cons)); while(sc_console_highlight_detach(cons)) /* Just loop */; } xscorch-0.2.1/sgtk/swidgets/sconsole.h0000644000175000001440000002302011175116151014673 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sconsole.h,v 1.18 2009-04-26 17:39:53 jacob Exp $ */ /* xscorch - sconsole.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Display "console" This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sconsole_h_included #define __sconsole_h_included #include #include #include /* Console typecasts */ #define SC_CONSOLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_console_get_type(), ScConsole) #define SC_CONSOLE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_console_get_type(), ScConsoleClass) #define IS_SC_CONSOLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_console_get_type()) /* Console style information */ typedef enum _ScConsoleStyle { CONSOLE_NORMAL, /* Normal borders */ CONSOLE_BORDERLESS /* No borders or padding */ } ScConsoleStyle; /* Console colors */ typedef struct _ScConsoleColors { GdkColor foreground; /* Normal foreground */ GdkColor background; /* Normal background */ GdkColor forecursor; /* Cursor foreground */ GdkColor backcursor; /* Cursor background */ GdkColor foreshadow; /* Shadow foreground */ GdkColor backshadow; /* Shadow background */ GdkColor forescroll; /* Scrollbar foreground */ GdkColor backscroll; /* Scrollbar background */ GdkColor forelight; /* Lighted foreground */ GdkColor backlight; /* Lighted background */ GdkColor foredisabled; /* Disabled foreground */ GdkColor backdisabled; /* Disabled background */ GdkColor forestandard; /* Standard foreground */ GdkColor backstandard; /* Standard background */ gboolean colors_alloc; /* True of FG/BG allocated */ gboolean bold; /* True if font should bold */ } ScConsoleColors; /* Console color values */ typedef enum _ScConsoleColorId { SC_CONSOLE_FOREGROUND, SC_CONSOLE_BACKGROUND, SC_CONSOLE_FORECURSOR, SC_CONSOLE_BACKCURSOR, SC_CONSOLE_FORESHADOW, SC_CONSOLE_BACKSHADOW, SC_CONSOLE_FORESCROLL, SC_CONSOLE_BACKSCROLL, SC_CONSOLE_FORELIGHT, SC_CONSOLE_BACKLIGHT, SC_CONSOLE_FOREDISABLED, SC_CONSOLE_BACKDISABLED, SC_CONSOLE_FORESTANDARD, SC_CONSOLE_BACKSTANDARD } ScConsoleColorId; /* Console text */ typedef struct _ScConsoleText { char *buffer; /* Actual character data */ gint bufferw; /* Width of char window */ gint bufferh; /* Height of char window */ gint dispx; /* Actual display topleft X */ gint dispy; /* Actual display topleft Y */ gint viewx; /* Viewport topleft X */ gint viewy; /* Viewport topleft Y */ gint vieww; /* Viewport width */ gint viewh; /* Viewport height */ gboolean scrollx; /* Scrollbar along X? */ gboolean scrolly; /* Scrollbar along Y? */ } ScConsoleText; /* Console cursor */ typedef struct _ScConsoleCursor { gboolean highlighted; /* Cursor is "highlighted" */ gint x; /* Cursor X position */ gint y; /* Cursor Y position */ gint width; /* Width of cursor */ gint height; /* Height of cursor */ } ScConsoleCursor; /* Console highlight */ typedef struct _ScConsoleHighlight { ScConsoleColors colors; /* Highlight colors */ gint x; /* X coordinate of light */ gint y; /* Y coordinate of light */ gint width; /* Width of the light */ gint height; /* Height of the light */ } ScConsoleHighlight; /* The ScConsole structure */ typedef struct _ScConsole { ScDrawbuf draw_buffer; /* Parent is a drawing buf */ ScConsoleColors colors; /* Colors for this console */ GdkFont *screen_font; /* Font used in this console */ GdkFont *screen_bold_font; /* Bold font that is used */ GtkAllocation req_alloc; /* Req. pos/size allocation */ ScConsoleText text; /* Data for the console text */ ScConsoleCursor cursor; /* Info associated with cursor */ ScConsoleStyle style; /* Windowing style for console */ GList *highlights; /* List of color highlights */ gboolean ignorerelease; /* Ignore next release if true */ } ScConsole; /* ScConsoleClass structure */ typedef struct _ScConsoleClass { ScDrawbufClass parent_class; void (*paint_region)(ScConsole *cons, GdkRectangle *bounds); } ScConsoleClass; /* Console initialisation */ GType sc_console_get_type(void); GtkWidget *sc_console_new(gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont); /* Console modification */ void sc_console_init(ScConsole *cons, gint x, gint y, gint width, gint height, ScConsoleStyle style, GdkFont *font, GdkFont *boldfont); void sc_console_buffer_size(ScConsole *cons, gint width, gint height); /* Writing strings and characters */ void sc_console_write_char(ScConsole *cons, gint x, gint y, char ch); void sc_console_write_line(ScConsole *cons, gint x, gint y, const char *line); void sc_console_write_line_wrap(ScConsole *cons, gint x, gint y, const char *line); void sc_console_clear_line(ScConsole *cons, gint y); void sc_console_clear(ScConsole *cons); /* Setup colors and highlights */ #define sc_console_get_foreground(cons) (&(cons)->colors.foreground) #define sc_console_get_background(cons) (&(cons)->colors.background) void sc_console_set_fonts(ScConsole *cons, GdkFont *font, GdkFont *boldfont); void sc_console_set_colors(ScConsole *cons, GdkColor *fg, GdkColor *bg); #define sc_console_set_foreground(cons, fg) sc_console_set_colors(cons, fg, NULL) #define sc_console_set_background(cons, bg) sc_console_set_colors(cons, NULL, bg) GdkColor *sc_console_get_color(ScConsole *cons, ScConsoleColorId rqst); void sc_console_highlight_attach(ScConsole *cons, GdkColor *fg, GdkColor *bg, gboolean bold, gint x, gint y, gint width, gint height); void sc_console_highlight_attach_disabled(ScConsole *cons, gint x, gint y, gint width, gint height); gboolean sc_console_highlight_detach(ScConsole *cons); void sc_console_highlight_detach_all(ScConsole *cons); /* Setup cursor attributes */ void sc_console_set_cursor(ScConsole *cons, gint x, gint y, gint width, gint height); void sc_console_set_cursor_pos(ScConsole *cons, gint x, gint y); void sc_console_set_cursor_highlighted(ScConsole *cons, gboolean highlighted); /* General information functions */ #define sc_console_get_cursor_x(cons) (cons->cursor.x) #define sc_console_get_cursor_y(cons) (cons->cursor.y) #define sc_console_get_cursor_width(cons) (cons->cursor.width) #define sc_console_get_cursor_height(cons) (cons->cursor.height) /* These functions return the number of pixels required for a character, both a width and height. */ gint sc_console_get_col_width(ScConsole *cons); gint sc_console_get_row_height(ScConsole *cons); /* These functions convert a REAL pixel coordinate (that is relative to top-left of widget) to a character value, where character (0,0) is the top-left character on the screen. These functions ADJUST to take scrolling (the viewport) into account if view is set to TRUE; for most applications, you should set view to TRUE. */ gint sc_console_get_char_from_pixel_x(ScConsole *cons, gint x, gboolean view); gint sc_console_get_char_from_pixel_y(ScConsole *cons, gint y, gboolean view); void sc_console_get_char_from_pixel(ScConsole *cons, gint *x, gint *y, gboolean view); gint sc_console_get_pixel_from_char_x(ScConsole *cons, gint x, gboolean view); gint sc_console_get_pixel_from_char_y(ScConsole *cons, gint y, gboolean view); void sc_console_get_pixel_from_char(ScConsole *cons, gint *x, gint *y, gboolean view); /* Fancier versions of the same; the rectangle widths and heights will also be updated in these versions. */ void sc_console_get_char_from_pixel_rect(ScConsole *cons, GdkRectangle *r, gboolean view); void sc_console_get_pixel_from_char_rect(ScConsole *cons, GdkRectangle *r, gboolean view); /* These functions return characteristics of the text buffer, all return units in terms of characters. The first two return the total size of the buffer, and the remaining functions return characteristics of the viewport (used when scrollbars are active). */ #define sc_console_get_width(cons) (cons->text.bufferw) #define sc_console_get_height(cons) (cons->text.bufferh) #define sc_console_get_view_x(cons) (cons->text.viewx) #define sc_console_get_view_y(cons) (cons->text.viewy) #define sc_console_get_view_width(cons) (cons->text.vieww) #define sc_console_get_view_height(cons) (cons->text.viewh) #endif /* __sconsole_h_included */ xscorch-0.2.1/sgtk/swidgets/sdialog.c0000644000175000001440000005622211175116151014475 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sdialog.c,v 1.32 2009-04-26 17:39:53 jacob Exp $ */ /* xscorch - sdialog.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched dialogues This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #define __ALLOW_DEPRECATED_GDK__ #include #include #include #include #include #include #include #include #include static GtkWindowClass *parent_class; enum _ScDialogSignals { APPLY_SIGNAL, LAST_SIGNAL }; static guint _sc_dialog_signals[LAST_SIGNAL] = { 0 }; /*** Dialog Signal Handlers ***/ static void _sc_dialog_destroy(GtkObject *obj) { /* sc_dialog_destroy Destroy a dialogue window. If the state pointer is not NULL, then the state is updated to indicate the dialog has been destroyed. The parent destructor will be called. */ ScDialog *dlg = SC_DIALOG(obj); /* Update state flag */ if(dlg->state != NULL) { *dlg->state = SC_DIALOG_DESTROYED; } /* Call parent destructor */ if(GTK_OBJECT_CLASS(parent_class)->destroy != NULL) { GTK_OBJECT_CLASS(parent_class)->destroy(obj); } } static void _sc_dialog_apply_clicked(__libj_unused GtkWidget *button, ScDialog *dlg) { /* sc_dialog_apply_clicked The Apply button was clicked. Emit the "apply" signal, causing any changes in the dialog window to take effect. This button does not automatically close the window. */ assert(IS_SC_DIALOG(dlg)); /* Emit "apply" signal, causing changes to take effect. Reference this dialog window while we process the signal, to ensure that it does not get prematurely destroyed. */ g_object_ref(G_OBJECT(dlg)); g_signal_emit(GTK_OBJECT(dlg), _sc_dialog_signals[APPLY_SIGNAL], 0); g_object_unref(G_OBJECT(dlg)); } static void _sc_dialog_ok_clicked(GtkWidget *button, ScDialog *dlg) { /* sc_dialog_ok_clicked The OK button was clicked. Emit the "apply" signal, then close out the dialog window (unless defer was selected). */ assert(IS_SC_DIALOG(dlg)); /* Emit "apply" signal */ _sc_dialog_apply_clicked(button, dlg); /* Update the current dialog state */ if(dlg->state != NULL) { *dlg->state = SC_DIALOG_ACCEPTED; } /* Destroy the dialog window, unless the flags indicate we should defer. */ if(!(dlg->flags & SC_DIALOG_DELAY_DESTROY)) { gtk_widget_destroy(GTK_WIDGET(dlg)); } } static void _sc_dialog_cancel_clicked(__libj_unused GtkWidget *button, ScDialog *dlg) { /* sc_dialog_cancel_clicked The Cancel button was clicked. Close the dialogue window without emitting an "apply" signal; changes in the dialog are discarded. Note that Cancel is functionally equivalent to Close. */ assert(IS_SC_DIALOG(dlg)); /* Update the current dialog state */ if(dlg->state != NULL) { *dlg->state = SC_DIALOG_REJECTED; } /* Destroy the dialog window, unless the flags indicate we should defer. */ if(!(dlg->flags & SC_DIALOG_DELAY_DESTROY)) { gtk_widget_destroy(GTK_WIDGET(dlg)); } } static gint _sc_dialog_key_press(GtkWidget *widget, GdkEventKey *key) { /* sc_dialog_key_press Process a keypress event in this dialog window. */ ScDialog *dlg = SC_DIALOG(widget); /* Check to see if enter or escape were pressed. */ switch(key->keyval) { case GDK_Return: case GDK_KP_Enter: if(dlg->flags & SC_DIALOG_OK) _sc_dialog_ok_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_YES) _sc_dialog_ok_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_APPLY) _sc_dialog_apply_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_CANCEL) _sc_dialog_cancel_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_NO) _sc_dialog_cancel_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_CLOSE) _sc_dialog_cancel_clicked(widget, dlg); else return(FALSE); return(TRUE); case GDK_Escape: if(dlg->flags & SC_DIALOG_CANCEL) _sc_dialog_cancel_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_NO) _sc_dialog_cancel_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_CLOSE) _sc_dialog_cancel_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_OK) _sc_dialog_ok_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_YES) _sc_dialog_ok_clicked(widget, dlg); else if(dlg->flags & SC_DIALOG_APPLY) _sc_dialog_apply_clicked(widget, dlg); else return(FALSE); return(TRUE); } /* Try to run parent keyhandler if we weren't able to do anything. */ if(GTK_WIDGET_CLASS(parent_class)->key_press_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->key_press_event(widget, key)) { return(TRUE); } } /* We don't understand this key; defer to next handler. */ return(FALSE); } /*** Dialog Class Instantiation ***/ static void _sc_dialog_class_init(ScDialogClass *klass) { /* sc_dialog_class_init Initialise the dialog class. */ GtkObjectClass *object_class = (GtkObjectClass *)klass; /* Get parent class */ parent_class = g_type_class_peek(gtk_window_get_type()); _sc_dialog_signals[APPLY_SIGNAL] = g_signal_new("apply", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScDialogClass, apply), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); /* Setup new signals */ klass->apply = NULL; /* Setup signals from parent */ GTK_OBJECT_CLASS(klass)->destroy = _sc_dialog_destroy; GTK_WIDGET_CLASS(klass)->key_press_event = _sc_dialog_key_press; } static void _sc_dialog_init_obj(ScDialog *dlg) { /* sc_dialog_init_obj Initialise an instance of a dialog window. */ dlg->state = NULL; } GType sc_dialog_get_type(void) { /* sc_dialog_get_type Return the GTK type for a dialog window. */ static GType sc_dialog_type = 0; if(sc_dialog_type == 0) { static const GTypeInfo sc_dialog_info = { sizeof(ScDialogClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_dialog_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScDialog), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_dialog_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_dialog_type = g_type_register_static(gtk_window_get_type(), "ScDialog", &sc_dialog_info, 0); } return(sc_dialog_type); } /*** Dialog Interface ***/ GtkWidget *sc_dialog_new(const char *title, const char *msgtext, guint flags) { /* sc_dialog_new Create a new dialog window, with the indicated title, message text, and flags. If title or msgtext are NULL, then they are omitted from the resultant dialog window. */ ScDialog *dialog; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *msg; GtkWidget *btn; dialog = g_object_new(sc_dialog_get_type(), NULL); g_return_val_if_fail(dialog != NULL, NULL); if(title != NULL) { gtk_window_set_title(GTK_WINDOW(dialog), title); } vbox = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(dialog), 10); gtk_container_add(GTK_CONTAINER(dialog), vbox); if(msgtext != NULL) { msg = gtk_label_new(msgtext); gtk_widget_set_size_request(msg, 350, -1); gtk_label_set_line_wrap(GTK_LABEL(msg), TRUE); gtk_box_pack_start(GTK_BOX(vbox), msg, TRUE, TRUE, 0); } if(flags & SC_DIALOG_NO_GRID) { dialog->grid = NULL; } else { dialog->grid = gtk_table_new(1, 1, FALSE); gtk_box_pack_start(GTK_BOX(vbox), dialog->grid, TRUE, TRUE, 0); } gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 0); hbox = gtk_hbox_new(FALSE, 5); /* This box houses the command buttons and should not rescale vertically */ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); if(flags & SC_DIALOG_CLOSE) { btn = gtk_button_new_with_label(" Close "); g_signal_connect(G_OBJECT(btn), "clicked", (GCallback)_sc_dialog_cancel_clicked, dialog); gtk_box_pack_end(GTK_BOX(hbox), btn, FALSE, FALSE, 5); } if(flags & SC_DIALOG_APPLY) { btn = gtk_button_new_with_label(" Apply "); g_signal_connect(G_OBJECT(btn), "clicked", (GCallback)_sc_dialog_apply_clicked, dialog); gtk_box_pack_end(GTK_BOX(hbox), btn, FALSE, FALSE, 5); } if(flags & SC_DIALOG_NO) { btn = gtk_button_new_with_label(" No "); g_signal_connect(G_OBJECT(btn), "clicked", (GCallback)_sc_dialog_cancel_clicked, dialog); gtk_box_pack_end(GTK_BOX(hbox), btn, FALSE, FALSE, 5); } if(flags & SC_DIALOG_CANCEL) { btn = gtk_button_new_with_label(" Cancel "); g_signal_connect(G_OBJECT(btn), "clicked", (GCallback)_sc_dialog_cancel_clicked, dialog); gtk_box_pack_end(GTK_BOX(hbox), btn, FALSE, FALSE, 5); } if(flags & SC_DIALOG_YES) { btn = gtk_button_new_with_label(" Yes "); g_signal_connect(G_OBJECT(btn), "clicked", (GCallback)_sc_dialog_ok_clicked, dialog); gtk_box_pack_end(GTK_BOX(hbox), btn, FALSE, FALSE, 5); } if(flags & SC_DIALOG_OK) { btn = gtk_button_new_with_label(" Ok "); g_signal_connect(G_OBJECT(btn), "clicked", (GCallback)_sc_dialog_ok_clicked, dialog); gtk_box_pack_end(GTK_BOX(hbox), btn, FALSE, FALSE, 5); } dialog->flags = flags; return(GTK_WIDGET(dialog)); } gboolean sc_dialog_run(ScDialog *dialog) { /* sc_dialog_run Runs the specified dialogue until it is closed. This will set the dialog to modal if it was requested on creation, so other windows will be blocked while this dialog is visible. */ ScDialogState state; dialog->flags |= SC_DIALOG_DELAY_DESTROY; state = SC_DIALOG_WAITING; dialog->state = &state; gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE); gtk_widget_show_all(GTK_WIDGET(dialog)); if(!(dialog->flags & SC_DIALOG_NONMODAL)) { gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); } while(state == SC_DIALOG_WAITING) { do { gtk_main_iteration(); } while(gtk_events_pending()); } dialog->state = NULL; if(state != SC_DIALOG_DESTROYED) { gtk_widget_destroy(GTK_WIDGET(dialog)); } return(state == SC_DIALOG_ACCEPTED); } void sc_dialog_show(ScDialog *dialog) { /* sc_dialog_show Displays the dialog window. */ dialog->flags &= ~SC_DIALOG_DELAY_DESTROY; dialog->state = NULL; gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE); gtk_widget_show_all(GTK_WIDGET(dialog)); if(!(dialog->flags & SC_DIALOG_NONMODAL)) { gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); } } void sc_dialog_grid_attach(ScDialog *dlg, GtkWidget *widget, int row, int col) { /* sc_dialog_grid_attach Attaches a widget to the dialog's grid. */ gtk_table_attach(GTK_TABLE(dlg->grid), widget, col, col + 1, row, row + 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2); if(GTK_IS_MISC(widget)) { gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); } } void sc_dialog_grid_attach_label(ScDialog *dlg, const char *msg, int row, int col) { /* sc_dialog_grid_attach_label Attaches a text label to the dialog's grid. */ GtkWidget *label = sc_label_new(msg); gtk_table_attach(GTK_TABLE(dlg->grid), label, col, col + 1, row, row + 1, GTK_FILL, GTK_FILL, 2, 2); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); } /*** General-purpose dialogs ***/ void sc_dialog_message(const char *title, const char *textmsg) { GtkWidget *dlg; dlg = sc_dialog_new(title, textmsg, SC_DIALOG_OK | SC_DIALOG_NO_GRID); sc_dialog_show(SC_DIALOG(dlg)); } gboolean sc_dialog_query(const char *title, const char *textmsg) { gboolean result; GtkWidget *dlg; dlg = sc_dialog_new(title, textmsg, SC_DIALOG_YES | SC_DIALOG_NO | SC_DIALOG_NO_GRID); result = sc_dialog_run(SC_DIALOG(dlg)); return(result); } void sc_dialog_error(const char *s) { char *err; char *buf; int length; err = strerror(errno); if(err == NULL) { sc_dialog_message("Error", s); return; } length = strlenn(s) + strlenn(err) + 4; buf = (char *)malloc(length); if(buf == NULL) { sc_dialog_message("Error", s); return; } sbprintf(buf, length, "%s: %s", s, err); sc_dialog_message("Error", buf); free(buf); return; } void sc_dialog_text(const char *filename, GdkFont *font_normal, GdkFont *font_italic, GdkFont *font_bold) { ScDialog *dlg; char buf[SC_DIALOG_STRING_BUFFER]; char out[SC_DIALOG_STRING_BUFFER]; char *pin; char *pout; int width; int height; FILE *f; GdkFont *font; GdkFont *lfont; GtkWidget *scroll; GtkWidget *message; GtkTextBuffer *textbuf; GtkTextIter iter; GtkTextTag *tag; if((f = fopen(filename, "r")) == NULL) { sbprintf(buf, sizeof(buf), "Cannot open file %s.\n", filename); sc_dialog_error(buf); return; } dlg = SC_DIALOG(sc_dialog_new(filename, NULL, SC_DIALOG_CLOSE | SC_DIALOG_NONMODAL)); /* Load the needed fonts */ if(font_normal != NULL) gdk_font_ref(font_normal); if(font_italic != NULL) gdk_font_ref(font_italic); if(font_bold != NULL) gdk_font_ref(font_bold); if(font_normal == NULL) { width = 8; height = 16; } else { width = gdk_char_width(font_normal, 'W'); height = (font_normal->ascent + font_normal->descent); } width *= 88; height *= 33; scroll = gtk_scrolled_window_new(NULL, NULL); sc_dialog_grid_attach(dlg, scroll, 0, 0); gtk_widget_set_size_request(scroll, width, height); message = gtk_text_view_new(); textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(message)); gtk_text_view_set_editable(GTK_TEXT_VIEW(message), FALSE); gtk_container_add(GTK_CONTAINER(scroll), message); /* Load in the text data */ g_object_freeze_notify(G_OBJECT(message)); while(fgets(buf, SC_DIALOG_STRING_BUFFER, f)) { pin = buf; pout = out; font = NULL; lfont = font_normal; while(*pin != '\0') { if(*(pin + 1) != 0x08) { font = font_normal; } else { font = (*pin == '_' ? font_italic : font_bold); pin += 2; } if(font != lfont) { if(pout - out > 0) { if(lfont == font_italic) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_ITALIC, NULL); } else if(lfont == font_bold) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_BOLD, "style", PANGO_STYLE_NORMAL, NULL); } else { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_NORMAL, NULL); } gtk_text_buffer_get_end_iter(textbuf, &iter); gtk_text_buffer_insert_with_tags(textbuf, &iter, out, pout - out, tag, NULL); } pout = out; lfont = font; } *(pout++) = *pin; if(*pin == '\n') { *(pout++) = ' '; *(pout++) = ' '; } pin++; } if(pout - out > 0) { if(lfont == font_italic) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_ITALIC, NULL); } else if(lfont == font_bold) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_BOLD, "style", PANGO_STYLE_NORMAL, NULL); } else { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_NORMAL, NULL); } gtk_text_buffer_get_end_iter(textbuf, &iter); gtk_text_buffer_insert_with_tags(textbuf, &iter, out, pout - out, tag, NULL); } } if(font_normal != NULL) { gdk_font_unref(font_normal); } if(font_italic != NULL) { gdk_font_unref(font_italic); } if(font_bold != NULL) { gdk_font_unref(font_bold); } g_object_thaw_notify(G_OBJECT(message)); fclose(f); sc_dialog_show(dlg); return; } void sc_dialog_text_buffer(const char *title, const char *buffer, GdkFont *font_normal, GdkFont *font_italic, GdkFont *font_bold) { ScDialog *dlg; char buf[SC_DIALOG_STRING_BUFFER]; char out[SC_DIALOG_STRING_BUFFER]; char *pin; char *pout; int width; int height; int offset = 0; GdkFont *font; GdkFont *lfont; GtkWidget *scroll; GtkWidget *message; GtkTextBuffer *textbuf; GtkTextIter iter; GtkTextTag *tag; dlg = SC_DIALOG(sc_dialog_new(title, NULL, SC_DIALOG_CLOSE | SC_DIALOG_NONMODAL)); /* Load the needed fonts */ if(font_normal != NULL) gdk_font_ref(font_normal); if(font_italic != NULL) gdk_font_ref(font_italic); if(font_bold != NULL) gdk_font_ref(font_bold); if(font_normal == NULL) { width = 8; height = 16; } else { width = gdk_char_width(font_normal, 'W'); height = (font_normal->ascent + font_normal->descent); } width *= 88; height *= 33; scroll = gtk_scrolled_window_new(NULL, NULL); sc_dialog_grid_attach(dlg, scroll, 0, 0); gtk_widget_set_size_request(scroll, width, height); message = gtk_text_view_new(); textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(message)); gtk_text_view_set_editable(GTK_TEXT_VIEW(message), FALSE); gtk_container_add(GTK_CONTAINER(scroll), message); /* Load in the text data */ g_object_freeze_notify(G_OBJECT(message)); while(sgetline(buf, SC_DIALOG_STRING_BUFFER, buffer, &offset) != NULL) { pin = buf; pout = out; font = NULL; lfont = font_normal; while(*pin != '\0') { if(*(pin + 1) != 0x08) { font = font_normal; } else { font = (*pin == '_' ? font_italic : font_bold); pin += 2; } if(font != lfont) { if(pout - out > 0) { if(lfont == font_italic) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_ITALIC, NULL); } else if(lfont == font_bold) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_BOLD, "style", PANGO_STYLE_NORMAL, NULL); } else { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_NORMAL, NULL); } gtk_text_buffer_get_end_iter(textbuf, &iter); gtk_text_buffer_insert_with_tags(textbuf, &iter, out, pout - out, tag, NULL); } pout = out; lfont = font; } *(pout++) = *pin; if(*pin == '\n') { *(pout++) = ' '; *(pout++) = ' '; } pin++; } if(pout - out > 0) { if(lfont == font_italic) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_ITALIC, NULL); } else if(lfont == font_bold) { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_BOLD, "style", PANGO_STYLE_NORMAL, NULL); } else { tag = gtk_text_buffer_create_tag(textbuf, NULL, "weight", PANGO_WEIGHT_NORMAL, "style", PANGO_STYLE_NORMAL, NULL); } gtk_text_buffer_get_end_iter(textbuf, &iter); gtk_text_buffer_insert_with_tags(textbuf, &iter, out, pout - out, tag, NULL); } } if(font_normal != NULL) { gdk_font_unref(font_normal); } if(font_italic != NULL) { gdk_font_unref(font_italic); } if(font_bold != NULL) { gdk_font_unref(font_bold); } g_object_thaw_notify(G_OBJECT(message)); sc_dialog_show(dlg); return; } xscorch-0.2.1/sgtk/swidgets/sdialog.h0000644000175000001440000000622211175116151014475 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sdialog.h,v 1.11 2009-04-26 17:39:53 jacob Exp $ */ /* xscorch - sdialog.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Dialog widget header This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sdialog_h_included #define __sdialog_h_included #include #include #include /* Dialog string buffer size */ #define SC_DIALOG_STRING_BUFFER 0x1000 /* Dialog typecasts */ #define SC_DIALOG(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_dialog_get_type(), ScDialog) #define SC_DIALOG_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_dialog_get_type(), ScDialogClass) #define IS_SC_DIALOG(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_dialog_get_type()) /* Dialog attributes */ #define SC_DIALOG_OK (1 << 0) #define SC_DIALOG_CANCEL (1 << 1) #define SC_DIALOG_CLOSE (1 << 2) #define SC_DIALOG_YES (1 << 3) #define SC_DIALOG_NO (1 << 4) #define SC_DIALOG_APPLY (1 << 5) #define SC_DIALOG_NONMODAL (1 << 6) #define SC_DIALOG_NO_GRID (1 << 7) /* The following flags should not be used by the caller */ #define SC_DIALOG_DELAY_DESTROY (1 << 8) typedef enum _ScDialogState { SC_DIALOG_WAITING = 0, SC_DIALOG_ACCEPTED, SC_DIALOG_REJECTED, SC_DIALOG_DESTROYED } ScDialogState; /* The ScDialog structure */ typedef struct _ScDialog { GtkWindow parent; GtkWidget *grid; ScDialogState *state; guint flags; } ScDialog; /* ScDialogClass structure */ typedef struct _ScDialogClass { GtkWindowClass parent_class; gboolean (*apply)(ScDialog *dlg); } ScDialogClass; /* Dialog initialisation and execution */ GType sc_dialog_get_type(void); GtkWidget *sc_dialog_new(const char *title, const char *msgtext, guint flags); gboolean sc_dialog_run(ScDialog *dlg); void sc_dialog_show(ScDialog *dlg); void sc_dialog_grid_attach(ScDialog *dlg, GtkWidget *widget, int row, int col); void sc_dialog_grid_attach_label(ScDialog *dlg, const char *msg, int row, int col); /* Special types of dialogs */ void sc_dialog_message(const char *title, const char *msgtext); gboolean sc_dialog_query(const char *title, const char *msgtext); void sc_dialog_error(const char *msgappend); void sc_dialog_text(const char *filename, GdkFont *normal_font, GdkFont *italic_font, GdkFont *bold_font); void sc_dialog_text_buffer(const char *title, const char *buffer, GdkFont *normal_font, GdkFont *italic_font, GdkFont *bold_font); #endif /* __sdialog_h_included */ xscorch-0.2.1/sgtk/swidgets/sdisplay.c0000644000175000001440000001247511551757752014725 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sdisplay.c,v 1.18 2011-04-15 06:04:26 jacob Exp $ */ /* xscorch - sdisplay.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Control for containing a sdisplay with an optional console This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include static void _sc_display_init_obj(ScDisplay *dpy) { assert(IS_SC_DISPLAY(dpy)); dpy->draw = NULL; gtk_widget_set_can_focus(GTK_WIDGET(dpy), FALSE); } GType sc_display_get_type(void) { static GType sc_display_type = 0; if(sc_display_type == 0) { static const GTypeInfo sc_display_info = { sizeof(ScDisplayClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ NULL, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScDisplay), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_display_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_display_type = g_type_register_static(gtk_fixed_get_type(), "ScDisplay", &sc_display_info, 0); } return(sc_display_type); } GtkWidget *sc_display_new(gint width, gint height) { ScDisplay *dpy; g_return_val_if_fail(width > 0 && height > 0, NULL); dpy = g_object_new(sc_display_get_type(), NULL); g_return_val_if_fail(dpy != NULL, NULL); dpy->draw = sc_drawbuf_new(width, height); gtk_fixed_put(GTK_FIXED(dpy), dpy->draw, 0, 0); gtk_widget_show(dpy->draw); return(GTK_WIDGET(dpy)); } void sc_display_console_attach(ScDisplay *dpy, ScConsole *cons) { g_return_if_fail(IS_SC_DISPLAY(dpy)); g_return_if_fail(IS_SC_CONSOLE(cons)); gtk_fixed_put(GTK_FIXED(dpy), GTK_WIDGET(cons), cons->req_alloc.x, cons->req_alloc.y); gtk_widget_show(GTK_WIDGET(cons)); } gboolean sc_display_console_detach(ScDisplay *dpy) { GtkFixedChild *child; GtkWidget *cwidget; GList *children; g_return_val_if_fail(IS_SC_DISPLAY(dpy), FALSE); children = GTK_FIXED(dpy)->children; /* The first entry is the basic drawbuf; never delete it. */ if(children == NULL || children->next == NULL) return(FALSE); while(children->next != NULL) children = children->next; child = children->data; cwidget = child->widget; g_return_val_if_fail(IS_SC_CONSOLE(cwidget), FALSE); gtk_container_remove(GTK_CONTAINER(dpy), cwidget); /* gtk_container_remove destroys the object on its own, apparently. We do not need to call gtk_widget_destroy. */ return(TRUE); } void sc_display_console_detach_all(ScDisplay *dpy) { while(sc_display_console_detach(dpy)) /* Just loop */; } void sc_display_queue_draw(ScDisplay *dpy, gint x, gint y, gint width, gint height) { g_return_if_fail(IS_SC_DISPLAY(dpy)); sc_drawbuf_queue_draw(SC_DRAWBUF(sc_display_get_drawbuf(dpy)), x, y, width, height); } void sc_display_console_set_fonts(ScDisplay *dpy, GdkFont *font, GdkFont *boldfont) { GtkFixedChild *child; GtkWidget *cwidget; ScConsole *cons; GList *children; #if SC_GTK_DEBUG_GTK printf("sc_display_console_set_fonts: installing new console fonts for %p\n", (void *)dpy); #endif /* SC_GTK_DEBUG_GTK */ g_return_if_fail(IS_SC_DISPLAY(dpy)); g_return_if_fail(font != NULL && boldfont != NULL); children = GTK_FIXED(dpy)->children; if(children == NULL) return; children = children->next; while(children != NULL) { child = children->data; cwidget = child->widget; g_return_if_fail(IS_SC_CONSOLE(cwidget)); cons = SC_CONSOLE(cwidget); #if SC_GTK_DEBUG_GTK printf("sc_display_console_set_fonts: installing new console fonts for %p, registered console %p\n", (void *)dpy, (void *)cons); #endif /* SC_GTK_DEBUG_GTK */ sc_console_set_fonts(cons, font, boldfont); /* The font update will automatically adjust the console's requested X/Y position, but we still need to tell the container to adjust the position. */ gtk_fixed_move(GTK_FIXED(dpy), cwidget, cons->req_alloc.x, cons->req_alloc.y); children = children->next; } #if SC_GTK_DEBUG_GTK printf("sc_display_console_set_fonts: finished installing new console fonts for %p\n", (void *)dpy); #endif /* SC_GTK_DEBUG_GTK */ } xscorch-0.2.1/sgtk/swidgets/sdisplay.h0000644000175000001440000000441611175116151014706 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sdisplay.h,v 1.8 2009-04-26 17:39:53 jacob Exp $ */ /* xscorch - sdisplay.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Display code; manages drawing buffers with consoles This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sdisplay_h_included #define __sdisplay_h_included #include #include #include #include #include #define SC_DISPLAY(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_display_get_type(), ScDisplay) #define SC_DISPLAY_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_display_get_type(), ScDisplayClass) #define IS_SC_DISPLAY(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_display_get_type()) typedef struct _ScDisplay { GtkFixed fixed; GtkWidget *draw; } ScDisplay; typedef struct _ScDisplayClass { GtkFixedClass parent_class; } ScDisplayClass; GType sc_display_get_type(void); GtkWidget *sc_display_new(gint width, gint height); #define sc_display_get_drawbuf(dpy) (dpy->draw) #define sc_display_get_buffer(dpy) sc_drawbuf_get_buffer(SC_DRAWBUF(sc_display_get_drawbuf(dpy))) #define sc_display_get_gc(dpy) sc_drawbuf_get_gc(SC_DRAWBUF(sc_display_get_drawbuf(dpy))) void sc_display_queue_draw(ScDisplay *dpy, gint x, gint y, gint width, gint height); void sc_display_console_attach(ScDisplay *dpy, ScConsole *cons); gboolean sc_display_console_detach(ScDisplay *dpy); void sc_display_console_detach_all(ScDisplay *dpy); void sc_display_console_set_fonts(ScDisplay *dpy, GdkFont *font, GdkFont *boldfont); #endif /* __sdisplay_h_included */ xscorch-0.2.1/sgtk/swidgets/sdrawbuf.c0000644000175000001440000001537411615330560014674 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sdrawbuf.c,v 1.20 2011-07-31 19:48:00 jacob Exp $ */ /* xscorch - sdrawbuf.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Drawing area with an offscreen buffer associated with it This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include static GtkDrawingAreaClass *parent_class; static inline void _sc_drawbuf_unref_pixmap_and_gc(ScDrawbuf *draw) { /* Release associated GC, pixmap */ if(sc_drawbuf_get_buffer(draw) != NULL) { g_object_unref(sc_drawbuf_get_buffer(draw)); sc_drawbuf_get_buffer(draw) = NULL; } if(sc_drawbuf_get_gc(draw) != NULL) { g_object_unref(sc_drawbuf_get_gc(draw)); sc_drawbuf_get_gc(draw) = NULL; } } static void _sc_drawbuf_destroy(GtkObject *obj) { ScDrawbuf *draw = SC_DRAWBUF(obj); /* Release associated GC, pixmap */ _sc_drawbuf_unref_pixmap_and_gc(draw); /* Call parent class handler? */ if(GTK_OBJECT_CLASS(parent_class)->destroy != NULL) { GTK_OBJECT_CLASS(parent_class)->destroy(obj); } /* Call parent destroy? */ } static gint _sc_drawbuf_configure(GtkWidget *widget, GdkEventConfigure *event) { ScDrawbuf *draw = SC_DRAWBUF(widget); gint width = widget->allocation.width; gint height= widget->allocation.height; gint pixmap_width = -1; gint pixmap_height= -1; GdkColor black; /* Call parent class handler? */ if(GTK_WIDGET_CLASS(parent_class)->configure_event != NULL) { if(GTK_WIDGET_CLASS(parent_class)->configure_event(widget, event)) { /* We must halt. */ return(TRUE); } /* Can we continue? */ } /* Call parent handler? */ /* Get current pixmap dimensions */ if(sc_drawbuf_get_buffer(draw) != NULL) { gdk_drawable_get_size(sc_drawbuf_get_buffer(draw), &pixmap_width, &pixmap_height); } /* Make sure the size actually changed ... */ if(width != pixmap_width || height != pixmap_height) { /* Has the style been configured? */ if(!draw->style_configured) { gdk_color_black(gtk_widget_get_colormap(widget), &black); gdk_window_set_background(widget->window, &black); } /* Release any existing drawing buffer */ _sc_drawbuf_unref_pixmap_and_gc(draw); /* Construct new offscreen-drawable, and clear it */ draw->screen_buffer = gdk_pixmap_new(widget->window, width, height, -1); gdk_draw_rectangle(draw->screen_buffer, widget->style->black_gc, TRUE, 0, 0, width, height); /* Construct a new offscreen-GC to use */ draw->screen_gc = gdk_gc_new(widget->window); } /* Allow other events */ return(FALSE); } static gint _sc_drawbuf_expose(GtkWidget *widget, GdkEventExpose *event) { ScDrawbuf *draw = SC_DRAWBUF(widget); GdkGC *fg_gc = widget->style->fg_gc[gtk_widget_get_state((GtkWidget *)draw)]; /* Make sure buffer is allocated */ g_return_val_if_fail(sc_drawbuf_get_buffer(draw) != NULL, TRUE); /* Draw from offscreen image to the screen. */ gdk_draw_drawable(widget->window, fg_gc, draw->screen_buffer, event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height); /* Allow other events to process */ return(FALSE); } static void _sc_drawbuf_class_init(ScDrawbufClass *klass) { /* Determine the parent class */ parent_class = g_type_class_peek(gtk_drawing_area_get_type()); /* Latch default hooks */ GTK_WIDGET_CLASS(klass)->configure_event = _sc_drawbuf_configure; GTK_OBJECT_CLASS(klass)->destroy = _sc_drawbuf_destroy; } static void _sc_drawbuf_init_obj(ScDrawbuf *draw) { /* Initialise data members */ draw->screen_buffer = NULL; draw->screen_gc = NULL; draw->style_configured = FALSE; /* Setup widget, and object signals */ gtk_widget_set_can_focus(GTK_WIDGET(draw), FALSE); gtk_widget_add_events(GTK_WIDGET(draw), GDK_EXPOSURE_MASK); gtk_widget_set_app_paintable(GTK_WIDGET(draw), TRUE); /* Install expose event handler. In GTK 2.0, the drawbuf is never drawn if this is installed as the default signal handler, but I do not understand why. */ g_signal_connect(G_OBJECT(draw), "expose_event", (GCallback)_sc_drawbuf_expose, NULL); } GType sc_drawbuf_get_type(void) { static GType sc_drawbuf_type = 0; if(sc_drawbuf_type == 0) { static const GTypeInfo sc_drawbuf_info = { sizeof(ScDrawbufClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_drawbuf_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScDrawbuf), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_drawbuf_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_drawbuf_type = g_type_register_static(gtk_drawing_area_get_type(), "ScDrawbuf", &sc_drawbuf_info, 0); } return(sc_drawbuf_type); } GtkWidget *sc_drawbuf_new(gint width, gint height) { ScDrawbuf *draw; /* Allocate the object */ draw = g_object_new(sc_drawbuf_get_type(), NULL); g_return_val_if_fail(draw != NULL, NULL); /* Set its minimum size allocation */ gtk_widget_set_size_request(GTK_WIDGET(draw), width, height); /* Return the new object */ return(GTK_WIDGET(draw)); } void sc_drawbuf_queue_draw(ScDrawbuf *draw, gint x, gint y, gint width, gint height) { if(x < 0) { width += x; x = 0; } if(y < 0) { height += y; y = 0; } gtk_widget_queue_draw_area((GtkWidget *)draw, x, y, width + 1, height + 1); } xscorch-0.2.1/sgtk/swidgets/sdrawbuf.h0000644000175000001440000000450711175116151014674 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/sdrawbuf.h,v 1.7 2009-04-26 17:39:53 jacob Exp $ */ /* xscorch - drawbuf.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ DrawingArea with an offscreen buffer to draw on. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sdrawbuf_h_included #define __sdrawbuf_h_included /* Include files */ #include #include #include /* ScDrawbuf casts */ #define SC_DRAWBUF(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), sc_drawbuf_get_type(), ScDrawbuf) #define SC_DRAWBUF_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), sc_drawbuf_get_type(), ScDrawbufClass) #define IS_SC_DRAWBUF(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), sc_drawbuf_get_type()) /* ScDrawbuf structure */ typedef struct _ScDrawbuf { GtkDrawingArea drawing_area; /* Parent is a drawing area */ GdkPixmap *screen_buffer; /* OffScreen drawable pixmap */ GdkGC *screen_gc; /* OffScreen drawable GC */ gboolean style_configured; /* True when style has been setup */ } ScDrawbuf; /* ScDrawbufClass structure */ typedef struct _ScDrawbufClass { GtkDrawingAreaClass parent_class;/* Drawing area class data */ } ScDrawbufClass; /* ScDrawbuf initialisation and basic info */ GType sc_drawbuf_get_type(void); GtkWidget *sc_drawbuf_new(gint width, gint height); /* Hooks to get useful information from a drawbuf */ #define sc_drawbuf_get_buffer(draw) ((draw)->screen_buffer) #define sc_drawbuf_get_gc(draw) ((draw)->screen_gc) /* Redraw a drawing buffer */ void sc_drawbuf_queue_draw(ScDrawbuf *draw, gint x, gint y, gint width, gint height); #endif /* __sdrawbuf_h_included */ xscorch-0.2.1/sgtk/swidgets/slabel.c0000644000175000001440000000440511175116151014311 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slabel.c,v 1.13 2009-04-26 17:39:53 jacob Exp $ */ /* xscorch - slabel.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched label widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include GType sc_label_get_type(void) { static GType sc_label_type = 0; if(sc_label_type == 0) { static const GTypeInfo sc_label_info = { sizeof(ScLabelClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ NULL, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScLabel), /* Size of an instance object */ 0, /* Number of preallocs */ NULL, /* Instance initializer */ NULL /* Value table */ }; sc_label_type = g_type_register_static(gtk_label_get_type(), "ScLabel", &sc_label_info, 0); } return(sc_label_type); } GtkWidget *sc_label_new(const char *text) { ScLabel *label; label = g_object_new(sc_label_get_type(), NULL); g_return_val_if_fail(label != NULL, NULL); gtk_label_set_text(GTK_LABEL(label), text); gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); return(GTK_WIDGET(label)); } xscorch-0.2.1/sgtk/swidgets/slabel.h0000644000175000001440000000323211175116152014314 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slabel.h,v 1.7 2009-04-26 17:39:54 jacob Exp $ */ /* xscorch - slabel.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorch label widget This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __slabel_h_included #define __slabel_h_included #include #include #include /* typecasts */ #define SC_LABEL(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_label_get_type(), ScLabel) #define SC_LABEL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_label_get_type(), ScLabelClass) #define IS_SC_LABEL(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_label_get_type()) /* The ScLabel structure */ typedef struct _ScLabel { GtkLabel parent; } ScLabel; /* ScLabelClass structure */ typedef struct _ScLabelClass { GtkLabelClass parent_class; } ScLabelClass; /* Label initialisation and execution */ GType sc_label_get_type(void); GtkWidget *sc_label_new(const char *text); #endif /* __slabel_h_included */ xscorch-0.2.1/sgtk/swidgets/slinkcheck.c0000644000175000001440000001024711175116152015167 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkcheck.c,v 1.14 2009-04-26 17:39:54 jacob Exp $ */ /* xscorch - slinkcheck.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched checkbox widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include static GtkCheckButtonClass *parent_class; enum _ScLinkCheckSignals { MODIFIED_SIGNAL, LAST_SIGNAL }; static guint _sc_link_check_signals[LAST_SIGNAL] = { 0 }; static void _sc_link_check_set(GtkToggleButton *toggle) { ScLinkCheck *check = SC_LINK_CHECK(toggle); if(check->value != NULL) { *check->value = gtk_toggle_button_get_active(toggle); } g_signal_emit(GTK_OBJECT(check), _sc_link_check_signals[MODIFIED_SIGNAL], 0); } static void _sc_link_check_class_init(ScLinkCheckClass *klass) { GtkObjectClass *object_class = (GtkObjectClass *)klass; parent_class = g_type_class_peek(gtk_check_button_get_type()); _sc_link_check_signals[MODIFIED_SIGNAL] = g_signal_new("modified", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScLinkCheckClass, modified), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); klass->modified = NULL; } static void _sc_link_check_init_obj(ScLinkCheck *check) { check->value = NULL; g_signal_connect(G_OBJECT(check), "toggled", (GCallback)_sc_link_check_set, NULL); } GType sc_link_check_get_type(void) { static GType sc_link_check_type = 0; if(sc_link_check_type == 0) { static const GTypeInfo sc_link_check_info = { sizeof(ScLinkCheckClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_link_check_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScLinkCheck), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_link_check_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_link_check_type = g_type_register_static(gtk_check_button_get_type(), "ScLinkCheck", &sc_link_check_info, 0); } return(sc_link_check_type); } GtkWidget *sc_link_check_new(bool *value) { ScLinkCheck *check; check = g_object_new(sc_link_check_get_type(), NULL); g_return_val_if_fail(check != NULL, NULL); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), *value); check->value = value; return(GTK_WIDGET(check)); } xscorch-0.2.1/sgtk/swidgets/slinkcheck.h0000644000175000001440000000351311175116152015172 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkcheck.h,v 1.8 2009-04-26 17:39:54 jacob Exp $ */ /* xscorch - slinkcheck.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorch checkbox widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __slinkcheck_h_included #define __slinkcheck_h_included #include #include #include /* typecasts */ #define SC_LINK_CHECK(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_link_check_get_type(), ScLinkCheck) #define SC_LINK_CHECK_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_link_check_get_type(), ScLinkCheckClass) #define IS_SC_LINK_CHECK(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_link_check_get_type()) /* The ScLinkCheck structure */ typedef struct _ScLinkCheck { GtkCheckButton parent; bool *value; } ScLinkCheck; /* ScLinkCheckClass structure */ typedef struct _ScLinkCheckClass { GtkCheckButtonClass parent_class; void (*modified)(ScLinkCheck *spin, gpointer data); } ScLinkCheckClass; /* LinkCheck initialisation and execution */ GType sc_link_check_get_type(void); GtkWidget *sc_link_check_new(bool *value); #endif /* __slinkcheck_h_included */ xscorch-0.2.1/sgtk/swidgets/slinkcombo.c0000644000175000001440000001216511211153307015204 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkcombo.c,v 1.19 2009-06-02 07:37:43 jacob Exp $ */ /* xscorch - slinkcombo.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2006 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ Scorched combolist widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include enum _ScLinkComboSignals { MODIFIED_SIGNAL, LAST_SIGNAL }; static guint _sc_link_combo_signals[LAST_SIGNAL] = { 0 }; static void _sc_link_combo_set(ScLinkCombo *combo) { ScLinkComboData *combo_data; gint i; combo_data = g_object_get_data(G_OBJECT(combo), "user_data"); if(combo_data == NULL) return; i = gtk_combo_box_get_active(GTK_COMBO_BOX(combo)); if(i >= 0) { if(combo_data->value != NULL) *combo_data->value = i; g_signal_emit(GTK_OBJECT(combo), _sc_link_combo_signals[MODIFIED_SIGNAL], 0); } } static void _sc_link_combo_class_init(ScLinkComboClass *klass) { GtkObjectClass *object_class = (GtkObjectClass *)klass; _sc_link_combo_signals[MODIFIED_SIGNAL] = g_signal_new("modified", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScLinkComboClass, modified), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); klass->modified = NULL; } static void _sc_link_combo_init_obj(ScLinkCombo *combo) { g_signal_connect(G_OBJECT(combo), "changed", (GCallback)_sc_link_combo_set, NULL); } GType sc_link_combo_get_type(void) { static GType sc_link_combo_type = 0; if(sc_link_combo_type == 0) { static const GTypeInfo sc_link_combo_info = { sizeof(ScLinkComboClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_link_combo_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScLinkCombo), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_link_combo_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_link_combo_type = g_type_register_static(gtk_combo_box_get_type(), "ScLinkCombo", &sc_link_combo_info, 0); } return(sc_link_combo_type); } GtkWidget *sc_link_combo_new(int *value, const char **entries) { ScLinkComboData *combo_data; ScLinkCombo *combo; GtkListStore *store; GtkTreeIter iter; GtkCellRenderer *cell; gint i; combo_data = (ScLinkComboData *)malloc(sizeof(ScLinkComboData)); g_return_val_if_fail(combo_data != NULL, NULL); combo_data->entries = entries; combo_data->value = value; combo = g_object_new(sc_link_combo_get_type(), NULL); g_return_val_if_fail(combo != NULL, NULL); store = gtk_list_store_new(1, G_TYPE_STRING); for(i = 0; entries[i] != NULL; ++i) { gtk_list_store_insert_with_values(store, &iter, i, 0, (gchar *)entries[i], -1); } gtk_combo_box_set_model(GTK_COMBO_BOX(combo), GTK_TREE_MODEL(store)); g_object_unref(G_OBJECT(store)); cell = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), cell, "text", 0, NULL); gtk_widget_set_size_request(GTK_WIDGET(combo), 130, -1); g_object_set_data(G_OBJECT(GTK_COMBO_BOX(combo)), "user_data", combo_data); gtk_combo_box_set_active(GTK_COMBO_BOX(combo), *value); return(GTK_WIDGET(combo)); } xscorch-0.2.1/sgtk/swidgets/slinkcombo.h0000644000175000001440000000376011211153307015212 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkcombo.h,v 1.8 2009-06-02 07:37:43 jacob Exp $ */ /* xscorch - slinkcombo.h Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2006 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ Scorch combolist widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __slinkcombo_h_included #define __slinkcombo_h_included #include #include /* typecasts */ #define SC_LINK_COMBO(obj) GTK_COMBO_BOX_CAST(obj, sc_link_combo_get_type(), ScLinkCombo) #define SC_LINK_COMBO_CLASS(klass) GTK_COMBO_BOX_CLASS_CAST(klass, sc_link_combo_get_type(), ScLinkComboClass) #define IS_SC_LINK_COMBO(obj) GTK_COMBO_BOX_TYPE(obj, sc_link_combo_get_type()) /* The ScLinkCombo structure */ typedef struct _ScLinkCombo { GtkComboBox parent; } ScLinkCombo; /* ScLinkComboClass structure */ typedef struct _ScLinkComboClass { GtkComboBoxClass parent_class; void (*modified)(ScLinkCombo *spin, gpointer data); } ScLinkComboClass; /* Utility data struct for GTK to pass around */ typedef struct _ScLinkComboData { const char **entries; int *value; } ScLinkComboData; /* LinkCombo initialisation and execution */ GType sc_link_combo_get_type(void); GtkWidget *sc_link_combo_new(int *value, const char **entries); #endif /* __slinkcombo_h_included */ xscorch-0.2.1/sgtk/swidgets/slinkentry.c0000644000175000001440000001101711175116152015247 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkentry.c,v 1.21 2009-04-26 17:39:54 jacob Exp $ */ /* xscorch - slinkentry.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched entrybox widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include static GtkEntryClass *parent_class; enum _ScLinkEntrySignals { MODIFIED_SIGNAL, LAST_SIGNAL }; static guint _sc_link_entry_signals[LAST_SIGNAL] = { 0 }; static void _sc_link_entry_set(GtkEditable *ed) { ScLinkEntry *entry = SC_LINK_ENTRY(ed); if(entry->value != NULL) { strcopyb(entry->value, gtk_entry_get_text(GTK_ENTRY(ed)), entry->maxlen); } g_signal_emit(GTK_OBJECT(entry), _sc_link_entry_signals[MODIFIED_SIGNAL], 0); } static void _sc_link_entry_class_init(ScLinkEntryClass *klass) { GtkObjectClass *object_class = (GtkObjectClass *)klass; parent_class = g_type_class_peek(gtk_entry_get_type()); _sc_link_entry_signals[MODIFIED_SIGNAL] = g_signal_new("modified", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScLinkEntryClass, modified), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); klass->modified = NULL; } static void _sc_link_entry_init_obj(ScLinkEntry *entry) { entry->value = NULL; entry->maxlen = 0; g_signal_connect(G_OBJECT(entry), "changed", (GCallback)_sc_link_entry_set, NULL); } GType sc_link_entry_get_type(void) { static GType sc_link_entry_type = 0; if(sc_link_entry_type == 0) { static const GTypeInfo sc_link_entry_info = { sizeof(ScLinkEntryClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_link_entry_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScLinkEntry), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_link_entry_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_link_entry_type = g_type_register_static(gtk_entry_get_type(), "ScLinkEntry", &sc_link_entry_info, 0); } return(sc_link_entry_type); } GtkWidget *sc_link_entry_new(char *value, int maxlen) { ScLinkEntry *entry; entry = g_object_new(sc_link_entry_get_type(), NULL); g_return_val_if_fail(entry != NULL, NULL); gtk_widget_set_size_request(GTK_WIDGET(entry), 300, -1); gtk_entry_set_max_length(GTK_ENTRY(entry), maxlen - 1); gtk_entry_set_text(GTK_ENTRY(entry), value); entry->value = value; entry->maxlen = maxlen; return(GTK_WIDGET(entry)); } void sc_link_entry_set_text(ScLinkEntry *entry, const char *value) { strcopyb(entry->value, value, entry->maxlen); gtk_entry_set_text(GTK_ENTRY(entry), entry->value); } xscorch-0.2.1/sgtk/swidgets/slinkentry.h0000644000175000001440000000362511175116152015262 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkentry.h,v 1.9 2009-04-26 17:39:54 jacob Exp $ */ /* xscorch - slinkentry.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorch entry widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __slinkentry_h_included #define __slinkentry_h_included #include #include #include /* typecasts */ #define SC_LINK_ENTRY(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_link_entry_get_type(), ScLinkEntry) #define SC_LINK_ENTRY_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_link_entry_get_type(), ScLinkEntryClass) #define IS_SC_LINK_ENTRY(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_link_entry_get_type()) /* The ScLinkEntry structure */ typedef struct _ScLinkEntry { GtkEntry parent; char *value; int maxlen; } ScLinkEntry; /* ScLinkEntryClass structure */ typedef struct _ScLinkEntryClass { GtkEntryClass parent_class; void (*modified)(ScLinkEntry *spin, gpointer data); } ScLinkEntryClass; /* LinkEntry initialisation and execution */ GType sc_link_entry_get_type(void); GtkWidget *sc_link_entry_new(char *value, int maxlen); void sc_link_entry_set_text(ScLinkEntry *entry, const char *value); #endif /* __slinkentry_h_included */ xscorch-0.2.1/sgtk/swidgets/slinkspin.c0000644000175000001440000001726511175116152015072 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkspin.c,v 1.15 2009-04-26 17:39:54 jacob Exp $ */ /* xscorch - slinkspin.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched label widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include static GtkSpinButtonClass *parent_class; enum _ScLinkSpinSignals { MODIFIED_SIGNAL, LAST_SIGNAL }; static guint _sc_link_spin_signals[LAST_SIGNAL] = { 0 }; static guint _sc_link_spinf_signals[LAST_SIGNAL] = { 0 }; static void _sc_link_spin_set(GtkEditable *ed) { ScLinkSpin *spin = SC_LINK_SPIN(ed); if(spin->value != NULL) { *spin->value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ed)); } g_signal_emit(GTK_OBJECT(spin), _sc_link_spin_signals[MODIFIED_SIGNAL], 0); } static void _sc_link_spin_class_init(ScLinkSpinClass *klass) { GtkObjectClass *object_class = (GtkObjectClass *)klass; parent_class = g_type_class_peek(gtk_spin_button_get_type()); _sc_link_spin_signals[MODIFIED_SIGNAL] = g_signal_new("modified", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScLinkSpinClass, modified), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); klass->modified = NULL; } static void _sc_link_spin_init_obj(ScLinkSpin *spin) { spin->value = NULL; g_signal_connect(G_OBJECT(spin), "changed", (GCallback)_sc_link_spin_set, NULL); } GType sc_link_spin_get_type(void) { static GType sc_link_spin_type = 0; if(sc_link_spin_type == 0) { static const GTypeInfo sc_link_spin_info = { sizeof(ScLinkSpinClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_link_spin_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScLinkSpin), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_link_spin_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_link_spin_type = g_type_register_static(gtk_spin_button_get_type(), "ScLinkSpin", &sc_link_spin_info, 0); } return(sc_link_spin_type); } GtkWidget *sc_link_spin_new(int *value, int min, int max, int step) { GtkAdjustment *spinadjust; ScLinkSpin *spin; spin = g_object_new(sc_link_spin_get_type(), NULL); g_return_val_if_fail(spin != NULL, NULL); spinadjust = (GtkAdjustment *)gtk_adjustment_new(*value, min, max, step, step, step); gtk_spin_button_configure(GTK_SPIN_BUTTON(spin), spinadjust, 1, 0); gtk_widget_set_size_request(GTK_WIDGET(spin), 80, -1); gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(spin), TRUE); spin->value = value; return(GTK_WIDGET(spin)); } static void _sc_link_spinf_set(GtkEditable *ed) { ScLinkSpinF *spin = SC_LINK_SPINF(ed); if(spin->value != NULL) { *spin->value = gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)); } g_signal_emit(GTK_OBJECT(spin), _sc_link_spinf_signals[MODIFIED_SIGNAL], 0); } static void _sc_link_spinf_class_init(ScLinkSpinFClass *klass) { GtkObjectClass *object_class = (GtkObjectClass *)klass; parent_class = g_type_class_peek(gtk_spin_button_get_type()); _sc_link_spinf_signals[MODIFIED_SIGNAL] = g_signal_new("modified", /* Signal name */ G_TYPE_FROM_CLASS(object_class),/* Type of object the signal applies to */ G_SIGNAL_RUN_LAST, /* Signal flags; run this signal last */ offsetof(ScLinkSpinFClass, modified), /* Offset to signal handler in class */ NULL, /* Signal accumulator function */ NULL, /* Signal accumulator data */ g_cclosure_marshal_VOID__VOID, /* Marshal function for this signal */ G_TYPE_NONE, /* Return type for the marshaller */ 0 /* Number of extra parametres to pass */ ); klass->modified = NULL; } static void _sc_link_spinf_init_obj(ScLinkSpinF *spin) { spin->value = NULL; g_signal_connect(G_OBJECT(spin), "changed", (GCallback)_sc_link_spinf_set, NULL); } GType sc_link_spinf_get_type(void) { static GType sc_link_spinf_type = 0; if(sc_link_spinf_type == 0) { static const GTypeInfo sc_link_spinf_info = { sizeof(ScLinkSpinFClass), /* Size of the class object */ NULL, /* Base initializer */ NULL, /* Base finalizer */ (GClassInitFunc)_sc_link_spinf_class_init, /* Class initializer */ NULL, /* Class finalizer */ NULL, /* Class data pointer */ sizeof(ScLinkSpinF), /* Size of an instance object */ 0, /* Number of preallocs */ (GInstanceInitFunc)_sc_link_spinf_init_obj, /* Instance initializer */ NULL /* Value table */ }; sc_link_spinf_type = g_type_register_static(gtk_spin_button_get_type(), "ScLinkSpinF", &sc_link_spinf_info, 0); } return(sc_link_spinf_type); } GtkWidget *sc_link_spinf_new(double *value, double min, double max, double step) { GtkAdjustment *spinadjust; ScLinkSpinF *spin; spin = g_object_new(sc_link_spinf_get_type(), NULL); g_return_val_if_fail(spin != NULL, NULL); spinadjust = (GtkAdjustment *)gtk_adjustment_new(*value, min, max, step, step, step); gtk_spin_button_configure(GTK_SPIN_BUTTON(spin), spinadjust, 1, 3); gtk_widget_set_size_request(GTK_WIDGET(spin), 80, -1); gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(spin), FALSE); spin->value = value; return(GTK_WIDGET(spin)); } xscorch-0.2.1/sgtk/swidgets/slinkspin.h0000644000175000001440000000504611175116152015071 00000000000000/* $Header: /fridge/cvs/xscorch/sgtk/swidgets/slinkspin.h,v 1.7 2009-04-26 17:39:54 jacob Exp $ */ /* xscorch - slinkspin.h Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorch spin widgets This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __slinkspin_h_included #define __slinkspin_h_included #include #include #include /* typecasts */ #define SC_LINK_SPIN(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_link_spin_get_type(), ScLinkSpin) #define SC_LINK_SPIN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_link_spin_get_type(), ScLinkSpinClass) #define IS_SC_LINK_SPIN(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_link_spin_get_type()) #define SC_LINK_SPINF(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, sc_link_spinf_get_type(), ScLinkSpinF) #define SC_LINK_SPINF_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, sc_link_spinf_get_type(), ScLinkSpinFClass) #define IS_SC_LINK_SPINF(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, sc_link_spinf_get_type()) /* The ScLinkSpin structure */ typedef struct _ScLinkSpin { GtkSpinButton parent; int *value; } ScLinkSpin; /* ScLinkSpinClass structure */ typedef struct _ScLinkSpinClass { GtkSpinButtonClass parent_class; void (*modified)(ScLinkSpin *spin, gpointer data); } ScLinkSpinClass; /* The ScLinkSpinF structure */ typedef struct _ScLinkSpinF { GtkSpinButton parent; double *value; } ScLinkSpinF; /* ScLinkSpinFClass structure */ typedef struct _ScLinkSpinFClass { GtkSpinButtonClass parent_class; void (*modified)(ScLinkSpinF *spin, gpointer data); } ScLinkSpinFClass; /* LinkSpin initialisation and execution */ GType sc_link_spin_get_type(void); GType sc_link_spinf_get_type(void); GtkWidget *sc_link_spin_new(int *value, int min, int max, int step); GtkWidget *sc_link_spinf_new(double *value, double min, double max, double step); #endif /* __slinkspin_h_included */ xscorch-0.2.1/snet/0000755000175000001440000000000011615372007011133 500000000000000xscorch-0.2.1/snet/Makefile.am0000644000175000001440000000116307624026733013117 00000000000000## $Header: /fridge/cvs/xscorch/snet/Makefile.am,v 1.7 2003/02/17 00:15:35 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Subdirectories to build in # SUBDIRS = tcpnet # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for network code # if NETWORK noinst_LIBRARIES = libscorch_net.a endif # Network code # libscorch_net_a_SOURCES =\ snet.c \ snet.h \ snetclient.c \ snetconfig.c \ snetcomm.c \ snetconnect.c \ snetint.h \ snetserver.c \ snetstatus.c INCLUDES = -I../libj xscorch-0.2.1/snet/Makefile.in0000644000175000001440000005260411615371716013135 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = snet DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_net_a_AR = $(AR) $(ARFLAGS) libscorch_net_a_LIBADD = am_libscorch_net_a_OBJECTS = snet.$(OBJEXT) snetclient.$(OBJEXT) \ snetconfig.$(OBJEXT) snetcomm.$(OBJEXT) snetconnect.$(OBJEXT) \ snetserver.$(OBJEXT) snetstatus.$(OBJEXT) libscorch_net_a_OBJECTS = $(am_libscorch_net_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_net_a_SOURCES) DIST_SOURCES = $(libscorch_net_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Subdirectories to build in # SUBDIRS = tcpnet # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for network code # @NETWORK_TRUE@noinst_LIBRARIES = libscorch_net.a # Network code # libscorch_net_a_SOURCES = \ snet.c \ snet.h \ snetclient.c \ snetconfig.c \ snetcomm.c \ snetconnect.c \ snetint.h \ snetserver.c \ snetstatus.c INCLUDES = -I../libj all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu snet/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu snet/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_net.a: $(libscorch_net_a_OBJECTS) $(libscorch_net_a_DEPENDENCIES) -rm -f libscorch_net.a $(libscorch_net_a_AR) libscorch_net.a $(libscorch_net_a_OBJECTS) $(libscorch_net_a_LIBADD) $(RANLIB) libscorch_net.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snetclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snetcomm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snetconfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snetconnect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snetserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snetstatus.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-noinstLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/snet/snet.c0000644000175000001440000000773711615366347012220 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snet.c,v 1.13 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snet.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Network main file This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #define _BSD_SOURCE /* Needed for gethostname */ #include #include #include #include #include #include #include #include #define SC_NET_ERROR_LENGTH 0x100 static char _net_error[SC_NET_ERROR_LENGTH] = { '\0' }; void sc_net_set_error(const char *function, const char *errormsg) { /* Write the new error message to the internal error variable */ sbprintf(_net_error, sizeof(_net_error), "(%s) %s", function, errormsg); fprintf(stderr, "network error: %s\n", _net_error); } void sc_net_set_info(const char *function, const char *errormsg) { /* Write the new error message to the internal error variable */ printf("network: (%s) %s\n", function, errormsg); } const char *sc_net_get_error(void) { /* Return a pointer to the internal error variable */ return(_net_error); } int sc_net_get_hostname(char *buf, int size) { if(buf == NULL || size <= 0) return(0); if(gethostname(buf, size) == 0) { buf[size - 1] = '\0'; return(1); } else { strcopyb(buf, "localhost", size); return(0); } } void sc_net_version_info(char *buf, int size) { if(buf == NULL || size <= 0) return; sbprintf(buf, size, "XScorch %s-net%d.%d.%d", VERSION, SC_NET_MAJOR_VERSION, SC_NET_MINOR_VERSION, SC_NET_PATCH_VERSION); } bool sc_net_check_size(const sc_packet *packet, sizea expectedsize, const char *description) { char buffer[SC_NET_BUFFER_SIZE]; if(packet->data_size < expectedsize) { sbprintf(buffer, sizeof(buffer), "Size of data received is too small, %d < %d", packet->data_size, expectedsize); sc_net_set_error(description, buffer); return(false); } return(true); } bool sc_net_check_param(dword actual, dword expected, const char *description, const char *param) { char buffer[SC_NET_BUFFER_SIZE]; if(actual != expected) { sbprintf(buffer, sizeof(buffer), "Data mismatch in expected %s data: %08x != %08x", param, actual, expected); sc_net_set_error(description, buffer); return(false); } return(true); } bool sc_net_packet_init(sc_packet *packet, dword type, dword size) { /* sc_net_packet_init Prepare a packet to have data dumped into it. */ if(packet == NULL) return(false); /* Packets get a small extra data size so the header can be sent easily. */ packet->data = (byte *)malloc((size + SC_PACKET_HEADER_SIZE) * sizeof(byte)); if(packet->data == NULL) return(false); packet->next_rnd = game_rand_peek(); packet->msg_type = type; packet->data_size = size; return(true); } bool sc_net_packet_release(sc_packet *packet) { /* sc_net_packet_release() Free the data from a packet; true on success. */ if(packet == NULL) return(false); free(packet->data); packet->next_rnd = -1; packet->msg_type = 0; packet->data_size = 0; packet->data = NULL; return(true); } xscorch-0.2.1/snet/snet.h0000644000175000001440000001707511615366347012221 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snet.h,v 1.10 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snet.h Copyright(c) 2001,2000 Justin David Smith Copyright(c) 2001,2000 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Network header files This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __snet_h_included #define __snet_h_included /* Get system headers and preprocessor definitions */ #include #include /* Make sure we have the USE_NETWORK definition */ #ifndef USE_NETWORK #error USE_NETWORK must be defined #endif /* Forward declarations. */ struct _tn_connection; /* Shorthand macros */ #if USE_NETWORK #define SC_NETWORK_MODE(c) ((c)->client != NULL) #define SC_NETWORK_AUTH(c) ((c)->server != NULL || (c)->client == NULL) #define SC_NETWORK_SERVER(c) ((c)->server != NULL) #else #define SC_NETWORK_MODE(c) false #define SC_NETWORK_AUTH(c) true #endif /* macros */ #if USE_NETWORK /* allow network support */ /* Check for the headers that we need to use */ #if !HAVE_SYS_TYPES_H #error "Requires for network support" #endif #include #if !HAVE_SYS_SOCKET_H #error "Requires for network support" #endif #include #if !HAVE_NETDB_H #error "Requires for network support" #endif #include #if !HAVE_NETINET_IN_H #error "Requires for network support" #endif #include #if !HAVE_ARPA_INET_H #error "Requires for network support" #endif #include /* Define the default port and server address */ #define SC_NET_LOCALHOST "localhost" /* Assume localhost works */ #define SC_NET_DEFAULT_PORT 8367 /* ``SC'', in decimal :) */ #define SC_NET_DEFAULT_SERVER SC_NET_LOCALHOST /* deja-vu */ /* Define lengths for various ``globals'', e.g. player name */ #define SC_NET_NAME_SIZE 32 /* Player name length */ /* Address shorthand - note, the code assumes IPv4 addresses with this definition. But in theory, this could be changed to the IPv6 address structure, fix a few compile errors, and everything should work. */ typedef struct sockaddr_in addr; /* Much shorter to type */ typedef struct hostent host; /* Also shorter and handy */ /* Connection flags */ #define SC_CONN_OKAY 0 /* Connection is okay/idle */ #define SC_CONN_NEED_ACCEPT 0x00000001 /* Cli or srv: waiting for accept */ #define SC_CONN_NEED_CONFIG 0x00000002 /* Cli: waiting for config */ #define SC_CONN_NEED_PLAYERS 0x00000004 /* Cli: waiting for players */ #define SC_CONN_WAIT_SYNC 0x00000008 /* Cli/Svr: waiting for sync */ /* TEMP - this will eventually stop being a connection killer - JL */ #define SC_CONN_TCPNET_ERROR 0x01000000 /* Cli/Svr: TCP NET needs reset */ #define SC_CONN_DEAD 0xff000000 /* Deadly error states */ #define SC_CONN_LOCAL_ERROR 0x10000000 /* Cli/Svr: local error occurred */ #define SC_CONN_REJECTED 0x20000000 /* Cli: was rejected from server */ #define SC_CONN_QUIT 0x40000000 /* Cli/Svr: remote player quit */ #define SC_CONN_UNKNOWN 0x80000000 /* Cli/Svr: status is unknown. */ #define SC_CONN_SYNC_GAME 0x01 /* Sync'd to begin game */ #define SC_CONN_SYNC_INV 0x02 /* Sync'd to begin inventories */ #define SC_CONN_SYNC_ROUND 0x03 /* Sync'd to begin round */ #define SC_CONN_SYNC_TURN 0x04 /* Sync'd to beign turn */ #define SC_CONN_SYNC_SERV 0x80 /* Bit set if sync is server->server */ /* Connection macros */ #define SC_CONN_IS_OKAY(conn) ((conn).flags == SC_CONN_OKAY) #define SC_CONN_IS_DEAD(conn) ((conn).flags & SC_CONN_DEAD) #define SC_CONN_IS_SYNC(conn) ((conn).flags & SC_CONN_WAIT_SYNC) /* Current player status - this structure is informational only and is sent from the server to other clients as it updates each player's status - it may not be up to date. */ typedef struct _sc_net_status { addr address; /* Player's address */ dword cli_flags; /* Connection flags from client */ dword cli_syncarg; /* Connection arg from client */ dword srv_flags; /* Connection flags from server */ dword srv_syncarg; /* Connection arg from server */ } sc_net_status; /* Connection state */ typedef struct _sc_connection { int socket; /* Remote socket to client */ addr address; /* Remote address for connection */ dword flags; /* Connection flags; 0 == okay. */ dword syncarg; /* Argument associated with flag */ struct _tn_connection *connection;/* Network internal connection. */ } sc_connection; /* Server network structure */ typedef struct _sc_server { int linein; /* Server socket handle */ int connections; /* Number of connects */ int current; /* Current conn to deal with */ sc_connection clients[SC_MAX_PLAYERS]; /* Links to clients */ } sc_server; /* Client network structure */ typedef struct _sc_client { sc_connection server; /* Link to server */ char name[SC_NET_NAME_SIZE]; /* Player name */ sc_net_status status[SC_MAX_PLAYERS]; /* Status structure */ } sc_client; /* Error messages, general info */ const char *sc_net_get_error(void); int sc_net_get_hostname(char *buf, int size); /* Functions to create/release server/client */ sc_client *sc_net_client_new(const char *name, const char *server, int port); sc_server *sc_net_server_new(sc_config *c, int port); void sc_net_client_free(sc_client **cli, const char *msg); void sc_net_server_free(sc_server **srv, const char *msg); /* Functions to run the main loop of svr/cli recvfrom() */ bool sc_net_client_run(sc_config *c, sc_client *cli); bool sc_net_server_run(sc_config *c, sc_server *srv); /* Checks if the client is dead; if so, close and deallocate */ bool sc_net_client_death(sc_client **cli); bool sc_net_server_prune(sc_server *svr); /* Send from client */ bool sc_net_client_chat(sc_client *cli, const char *msg); bool sc_net_client_sync(sc_client *cli, dword flag, bool isserver); bool sc_net_client_send_orders(const sc_config *c, sc_client *cli, int playerid); bool sc_net_client_send_shields(const sc_config *c, sc_client *cli, int playerid); bool sc_net_client_send_battery(const sc_config *c, sc_client *cli, int playerid); bool sc_net_client_send_flags(const sc_config *c, sc_client *cli, int playerid); bool sc_net_client_send_inventory(const sc_config *c, sc_client *cli, int playerid); bool sc_net_client_send_player_state(const sc_config *c, sc_client *cli); /* Server broadcast */ bool sc_net_server_send_config(sc_config *c, sc_server *svr); /* Informational/status messages */ bool sc_net_client_update_status(sc_client *cli); #endif /* Network? */ #endif /* __snet_h_included */ xscorch-0.2.1/snet/snetclient.c0000644000175000001440000010654711615366347013416 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snetclient.c,v 1.28 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snetclient.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Client control loop This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static bool _sc_net_client_send_name(sc_client *cli) { /* _sc_net_client_send_name Send the name of this player to the server. This packet is usually sent out immediately after the ACCEPTED packet is received from the server, when the player connects to the game. This code, fortunately, is very straightforward. Returns true on success. */ sc_packet packet; /* Data packet to send */ /* Construct a simple name packet */ if(!sc_net_packet_init( &packet, SC_NET_CLI_PLAYER_NAME, SC_PLAYER_NAME_LENGTH )) return(false); memcpy(packet.data, cli->name, SC_PLAYER_NAME_LENGTH); /* Attempt to send the packet */ sc_net_set_info("cli_send_name", "Sending our name to the server"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); return(true); } static void _sc_net_cli_missync(sc_config *c) { /* _sc_net_cli_missync Call this function if a missync is detected in what the server has sent us. We will eventually try to do error recovery here, but for now all we can do is display this solemn error message. */ sc_window_message( c->window, "Network Error", "This client is no longer synchronized with the main game server. "\ "This could cause serious problems with the network game in progress. "\ "Unfortunately, there is no recovery code at this time, so it's pretty "\ "much over. Sorry..." ); } static bool _sc_net_cli_recv_sync(sc_config *c, sc_client *cli, sc_packet *packet) { /* _sc_net_cli_recv_sync See sc_net_client_sync() for an overview of the process. This is the tail end to a synchronization from the client to the current game event. On success, the server will respond to us when all players have reached that event, telling us we may now continue with simulation or turn. The server will also remind us what TYPE of sync event we were going through. This will normally agree with the type of sync event we sent in to the server. The server will also send us a copy of its current random value. This should agree with the next random value we expect to get -- if it does then we are okay. If it does not, then something has gone horribly wrong. And I do mean horribly. If that happens, we will have to try to negotiate with the server to see what went wrong. Otherwise, we may now continue with the game. This function returns true if everything worked properly. */ dword randval; /* Random value sanity check */ dword *p; /* Pointer into packet data */ bool missync = false; /* True if we are out of sync */ /* Check data size, etc. */ if(!sc_net_check_size( packet, 2 * sizeof(dword), "cli_recv_sync" )) return(false); /* Update flags, sync was successfully processed */ SC_CONN_CLEAR_FLAGS(cli->server, SC_CONN_WAIT_SYNC); sc_net_set_info("cli_recv_sync", "Received sync authorization from server"); /* Check that the sync message is what we expected */ p = (dword *)packet->data; if(ntohl(*p++) != cli->server.syncarg) { sc_net_set_error("cli_recv_sync", "Sync for wrong event received"); missync = true; } /* Check that random values are still in sync */ randval = ntohl(*p++); if(randval != game_rand_peek()) { sc_net_set_error("cli_recv_sync", "Random values are OUT OF ALIGNMENT!!!"); missync = true; } if(missync) _sc_net_cli_missync(c); return(true); } static bool _sc_net_cli_recv_orders(sc_config *c, sc_packet *packet) { /* _sc_net_cli_recv_orders Receiving orders from another player in the game. We are given our client data structure, and their packet (as relayed from the server). We are generally expected to comply with their orders for their tank but we will not accept server orders for OUR tank -- we will only verify the orders sent to us for our tank. Returns true on success */ sc_player *pl; /* Current player structure */ dword *p; /* Pointer into packet data */ dword x; /* X variable */ dword y; /* Y variable */ int i; /* Iterator */ /* Check size and sequence numbers */ if(!sc_net_check_size( packet, (1 + 7 * c->numplayers) * sizeof(dword), "cli_recv_orders" )) return(false); /* Check that the total player count is accurate */ p = (dword *)packet->data; if(!sc_net_check_param( c->numplayers, ntohl(*p++), "cli_recv_orders", "player count" )) return(false); /* Update each player, in turn */ for(i = 0; i < c->numplayers; ++i) { pl = c->players[i]; if(!sc_net_check_param( i, ntohl(*p++), "cli_recv_orders", "marker" )) return(false); if(pl->aitype == SC_AI_NETWORK) { /* Setting params for a network player */ sc_player_set_turret(c, pl, ntohl(*p++)); sc_player_set_power (c, pl, ntohl(*p++)); sc_player_set_weapon(c, pl, sc_weapon_lookup(c->weapons, ntohl(*p++), SC_WEAPON_LIMIT_NONE)); sc_player_set_shield(c, pl, sc_accessory_lookup(c->accessories, ntohl(*p++), SC_ACCESSORY_LIMIT_NONE)); x = ntohl(*p++); y = ntohl(*p++); sc_player_set_position(c, pl, x, y); } else { /* Verifying orders for a local player -- note, it is possible we are receiving an old (but valid) orders packet here -- which is possible given network latencies if the player is rapidly enter new orders. Therefore no action is taken currently if one of these assertions fails. */ sc_net_check_param(pl->turret, ntohl(*p++), "cli_recv_orders", "turret"); sc_net_check_param(pl->power, ntohl(*p++), "cli_recv_orders", "power"); sc_net_check_param(pl->selweapon->ident, ntohl(*p++), "cli_recv_orders", "weapon"); sc_net_check_param(pl->selshield->ident, ntohl(*p++), "cli_recv_orders", "shield"); sc_net_check_param(pl->x, ntohl(*p++), "cli_recv_orders", "player x"); sc_net_check_param(pl->y, ntohl(*p++), "cli_recv_orders", "player y"); } /* Modifying network or verifying params? */ } /* Loop through all players */ /* Return with success */ sc_net_set_info("cli_recv_orders", "Received orders from server"); return(true); } static bool _sc_net_cli_recv_shields(sc_config *c, sc_packet *packet) { /* _sc_net_cli_recv_shields Similar to the orders packet, except we are receiving a player request to activate their shields. Again, returns true on success. */ sc_accessory_info *info;/* Shield requested for activation */ sc_player *pl; /* Player structure */ sdword playerid; /* Player ID to shield */ dword *p; /* counter */ /* Check the packet size */ if(!sc_net_check_size( packet, 2 * sizeof(dword), "cli_recv_shields" )) return(false); p = (dword *)packet->data; /* Get the player ID */ playerid = ntohl(*p++); if(playerid < 0 || playerid >= c->numplayers) { sc_net_set_error("cli_recv_shields", "Invalid playerid received"); return(false); } pl = c->players[playerid]; /* Test that the shield is in inventory */ info = sc_accessory_lookup(c->accessories, ntohl(*p++), SC_ACCESSORY_LIMIT_NONE); if(info == NULL || info->inventories[playerid] <= 0) { sc_net_set_error("cli_recv_shields", "Shield to activate not in inventory"); return(false); } /* Activate shields if needed */ if(pl->aitype == SC_AI_NETWORK) { /* Setting params for a network player */ sc_player_activate_shield(c, pl); } /* Return with success */ sc_net_set_info("cli_recv_shields", "Received shield status from server"); return(true); } static bool _sc_net_cli_recv_battery(sc_config *c, sc_packet *packet) { /* _sc_net_cli_recv_battery Similar to the orders packet, except we are receiving a player request to activate one of their batteries. Again, returns true on success. */ sc_player *pl; /* Player structure */ sdword playerid; /* Player ID to shield */ /* Check the packet size */ if(!sc_net_check_size( packet, sizeof(dword), "cli_recv_batterys" )) return(false); /* Get the player ID */ playerid = ntohl(*(dword *)packet->data); if(playerid < 0 || playerid >= c->numplayers) { sc_net_set_error("cli_recv_battery", "Invalid playerid received"); return(false); } pl = c->players[playerid]; /* Activate batteries if needed */ if(pl->aitype == SC_AI_NETWORK) { /* Setting params for a network player */ sc_player_activate_battery(c, pl); } /* Return with success */ sc_net_set_info("cli_recv_battery", "Received battery command from server"); return(true); } static bool _sc_net_cli_recv_flags(sc_config *c, sc_packet *packet) { /* _sc_net_cli_recv_flags Similar to the orders packet, except we are receiving a player's set of command flags. Again, returns true on success. */ sc_player *pl; /* Player structure */ sdword playerid; /* Player ID to shield */ dword *p; /* Packet data pointer */ /* Check the packet size */ if(!sc_net_check_size( packet, 3 * sizeof(dword), "cli_recv_flags" )) return(false); /* Get the player ID */ p = (dword *)packet->data; playerid = ntohl(*p++); if(playerid < 0 || playerid >= c->numplayers) { sc_net_set_error("cli_recv_flags", "Invalid playerid received"); return(false); } pl = c->players[playerid]; /* Get command flags */ if(pl->aitype == SC_AI_NETWORK) { /* Setting params for a network player */ pl->contacttriggers = ntohl(*p++); pl->ac_state = ntohl(*p++); } else { /* Verify configuration */ sc_net_check_param(pl->contacttriggers, ntohl(*p++), "cli_recv_flags", "contact triggers"); sc_net_check_param(pl->ac_state, ntohl(*p++), "cli_recv_flags", "accessory state flags"); } /* Local or remote? */ /* Return with success */ sc_net_set_info("cli_recv_flags", "Received command flags from server"); return(true); } /* The following markers are used in an inventory packet */ #define SC_PACKET_INVENTORY_WEAPONS 0xEEEE0001 #define SC_PACKET_INVENTORY_ACCESSORIES 0xEEEE0002 #define SC_PACKET_INVENTORY_MISC 0xEEEE0003 static bool _sc_net_cli_recv_inventory(sc_config *c, sc_packet *packet) { sc_accessory_info *ai; /* A temp pointer into info structs */ sc_weapon_info *wi; /* A temp pointer into info structs */ sc_player *pl; /* Player structure */ sdword playerid; /* Player ident */ dword *p; /* Pointer into packet data */ int acount; /* Accessory count (total) */ int wcount; /* Weapon count (total) */ int size; /* Section size parametre */ int i; /* Iterator */ /* Make sure size is large enough to contain the player ID and individual sizes for each section (3 dwords) */ if(!sc_net_check_size(packet, 3 * sizeof(dword), "cli_recv_inventory")) return(false); /* Get the player ID and section sizes */ p = (dword *)packet->data; playerid = ntohl(*p++); if(playerid < 0 || playerid >= c->numplayers) { sc_net_set_error("cli_recv_inventory", "Invalid playerid received"); return(false); } pl = c->players[playerid]; acount = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_NONE); wcount = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_NONE); if(!sc_net_check_param(ntohl(*p++), wcount, "cli_recv_inventory", "weapon count")) return(false); if(!sc_net_check_param(ntohl(*p++), acount, "cli_recv_inventory", "accessory count")) return(false); /* Make sure packet is large enough to hold additional data. Packets for weapons and accessories look like this: [ integer item_id ], [ integer item_count ] (repeat) */ size = (8 + 2 * (wcount + acount)) * sizeof(dword); if(!sc_net_check_size(packet, size, "cli_recv_inventory")) return(false); /* Process weapons in packet */ if(!sc_net_check_param(ntohl(*p++), SC_PACKET_INVENTORY_WEAPONS, "cli_recv_inventory", "weapon marker")) return(false); size = wcount; if(pl->aitype == SC_AI_NETWORK) { /* Setting weapons for a network player */ for(i = 0; i < size; ++i) { wi = sc_weapon_lookup(c->weapons, ntohl(*p++), SC_WEAPON_LIMIT_NONE); if(wi == NULL) { sc_net_set_error("cli_recv_player_state", "setting inventory of nonexistant weapon"); return(false); } else { wi->inventories[playerid] = ntohl(*p++); } } /* Loop through weapons */ } else { /* Verifying weapons for a local player */ for(i = 0; i < size; ++i) { wi = sc_weapon_lookup(c->weapons, ntohl(*p++), SC_WEAPON_LIMIT_NONE); if(wi == NULL) { sc_net_set_error("cli_recv_player_state", "checking inventory of nonexistant weapon"); return(false); } else { if(!sc_net_check_param(ntohl(*p++), wi->inventories[playerid], "cli_recv_inventory", "weapon")) return(false); } } /* Loop through weapons */ } /* Network or local player? */ /* Process accessories in packet */ if(!sc_net_check_param(ntohl(*p++), SC_PACKET_INVENTORY_ACCESSORIES, "cli_recv_inventory", "accessory marker")) return(false); size = acount; if(pl->aitype == SC_AI_NETWORK) { /* Setting accessories for a network player */ for(i = 0; i < size; ++i) { ai = sc_accessory_lookup(c->accessories, ntohl(*p++), SC_ACCESSORY_LIMIT_NONE); if(ai == NULL) { sc_net_set_error("cli_recv_player_state", "setting inventory of nonexistant accessory"); return(false); } else { ai->inventories[playerid] = ntohl(*p++); } } /* Loop through accessories */ } else { /* Verifying accessories for a local player */ for(i = 0; i < size; ++i) { ai = sc_accessory_lookup(c->accessories, ntohl(*p++), SC_ACCESSORY_LIMIT_NONE); if(ai == NULL) { sc_net_set_error("cli_recv_player_state", "checking inventory of nonexistant accessory"); return(false); } else { if(!sc_net_check_param(ntohl(*p++), ai->inventories[playerid], "cli_recv_inventory", "accessory")) return(false); } } /* Loop through accessories */ } /* Network or local player? */ /* Process miscellaneous section */ if(!sc_net_check_param(ntohl(*p++), SC_PACKET_INVENTORY_MISC, "cli_recv_inventory", "misc marker")) return(false); if(pl->aitype == SC_AI_NETWORK) { pl->money = ntohl(*p++); pl->oldmoney = ntohl(*p++); } else { sc_net_check_param(ntohl(*p++), pl->money, "cli_recv_inventory", "misc: money"); sc_net_check_param(ntohl(*p++), pl->oldmoney, "cli_recv_inventory", "misc: oldmoney"); } /* All went well */ sc_net_set_info("cli_recv_inventory", "Received inventory from server"); return(true); } static bool _sc_net_cli_recv_player_state(sc_config *c, sc_packet *packet) { sc_player *pl; /* Player data structure */ dword *p; /* Pointer into packet data */ sdword x; /* Miscellaneous variable X */ sdword y; /* Miscellaneous variable Y */ bool b; /* Miscellaneous boolean B */ int i; /* Iterator variable */ /* Check that the packet is large enough */ if(!sc_net_check_size(packet, (11 * c->numplayers + 1) * sizeof(dword), "cli_recv_player_state")) return(false); /* Check that the total player count is accurate */ p = (dword *)packet->data; if(!sc_net_check_param(c->numplayers, ntohl(*p++), "cli_recv_player_state", "player count")) return(false); /* For each player ... */ for(i = 0; i < c->numplayers; ++i) { pl = c->players[i]; /* First field is authority flag */ if(ntohl(*p++)) { /* Remote player claims authority on this player */ if(pl->aitype != SC_AI_NETWORK) { sc_net_set_error("cli_recv_player_state", "Remote player authority on locally controlled player"); return(false); } if(!sc_net_check_param(pl->index, ntohl(*p++), "cli_recv_player_state", "index")) return(false); x = ntohl(*p++); y = ntohl(*p++); if(x != pl->x || y != pl->y) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player position"); sc_player_set_position(c, pl, x, y); } x = ntohl(*p++); if(x != pl->fuel) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player fuel level"); pl->fuel = x; } x = ntohl(*p++); y = ntohl(*p++); if(x != pl->turret || y != pl->power) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player turret/power"); sc_player_set_turret(c, pl, x); sc_player_set_power(c, pl, y); } x = ntohl(*p++); b = ntohl(*p++); if(x != pl->life || b != pl->dead) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player life"); pl->life = x; pl->dead = b; } x = ntohl(*p++); if(x != pl->money) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player money"); pl->money = x; } x = ntohl(*p++); if(x != pl->selweapon->ident) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player selected weapon"); sc_player_set_weapon(c, pl, sc_weapon_lookup(c->weapons, x, SC_WEAPON_LIMIT_NONE)); } } else { /* Player does not claim to be authoritative */ if(!sc_net_check_param(pl->index, ntohl(*p++), "cli_recv_player_state", "index")) return(false); x = ntohl(*p++); y = ntohl(*p++); if(x != pl->x || y != pl->y) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player position"); } x = ntohl(*p++); if(x != pl->fuel) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player fuel level"); } x = ntohl(*p++); y = ntohl(*p++); if(x != pl->turret || y != pl->power) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player turret/power"); } x = ntohl(*p++); b = ntohl(*p++); if(x != pl->life || b != pl->dead) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player life"); } x = ntohl(*p++); if(x != pl->money) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player money"); } x = ntohl(*p++); if(x != pl->selweapon->ident) { sc_net_set_error("cli_recv_player_state", "Discrepancy on remote player selected weapon"); } } } /* Okay, we're done with that mess... */ sc_net_set_info("cli_recv_player_state", "Player state received"); return(true); } static bool _sc_net_process_message(sc_config *c, sc_client *cli, sc_packet *packet) { char buffer[SC_NET_BUFFER_SIZE]; /* Temporary output buffer */ char infomsg[SC_NET_BUFFER_SIZE]; /* Text to be displayed to user */ switch(packet->msg_type) { case SC_NET_SVR_ACCEPTED: SC_CONN_CLEAR_FLAGS(cli->server, SC_CONN_NEED_ACCEPT); _sc_net_client_send_name(cli); memcpy(buffer, packet->data + sizeof(dword), packet->data_size - sizeof(dword)); buffer[packet->data_size - sizeof(dword)] = '\0'; sbprintf(infomsg, sizeof(infomsg), "We have connected to server, version \"%s\"", buffer); sc_net_set_info("process_message", infomsg); break; case SC_NET_SVR_REJECTED: SC_CONN_SET_FLAGS(cli->server, SC_CONN_REJECTED); sbprintf(infomsg, sizeof(infomsg), "We were rejected from server: %s", packet->data); sc_net_set_error("process_message", infomsg); sc_window_message(c->window, "Client Rejected", sc_net_get_error()); break; case SC_NET_SVR_QUIT: SC_CONN_SET_FLAGS(cli->server, SC_CONN_QUIT); sc_net_set_info("process_message", "client: server sent QUIT"); break; case SC_NET_CHAT: memcpy(buffer, packet->data, min(packet->data_size, SC_NET_BUFFER_SIZE - 1)); buffer[min(packet->data_size, SC_NET_BUFFER_SIZE - 1)] = '\0'; sc_net_set_info("chat", buffer); #if 0 /* TEMP - Chat is broken in GTK 2. As in, this does not compile. */ sc_chat_window_update(c->window, buffer); #endif break; case SC_NET_SVR_CONFIG_DATA: sc_net_cli_recv_config(c, cli, packet); break; case SC_NET_SVR_PLAYER_DATA: sc_net_cli_recv_players(c, cli, packet); break; case SC_NET_SVR_ORDERS: _sc_net_cli_recv_orders(c, packet); break; case SC_NET_INVENTORY: _sc_net_cli_recv_inventory(c, packet); break; case SC_NET_SHIELDS: _sc_net_cli_recv_shields(c, packet); break; case SC_NET_BATTERY: _sc_net_cli_recv_battery(c, packet); break; case SC_NET_PLFLAGS: _sc_net_cli_recv_flags(c, packet); break; case SC_NET_PLAYER_STATE: _sc_net_cli_recv_player_state(c, packet); break; case SC_NET_SVR_SYNC_RESP: _sc_net_cli_recv_sync(c, cli, packet); break; case SC_NET_CLIENT_STATUS: sc_net_client_recv_status(c, cli, packet); break; default: sbprintf(infomsg, sizeof(infomsg), "invalid packet type (%08x) received by client", packet->msg_type); sc_net_set_error("process_message", infomsg); break; } return(true); } bool sc_net_client_handle_packet(sc_config *c, void *parm, sc_packet *p) { sc_client *cli = (sc_client *)parm; /* Sanity checks */ if(c == NULL || parm == NULL || p == NULL) return(false); /* Compare RNG state with that of the server... */ if(p->next_rnd != game_rand_peek()) { /* TEMP - This area needs a more graceful failure path and a better error message in general. */ printf("warning: server says our next random value is %i but we thought it was %i\n", p->next_rnd, game_rand_peek()); } /* This is an existing connection, process as event */ return(_sc_net_process_message(c, cli, p)); } bool sc_net_client_run(sc_config *c, sc_client *cli) { /* Sanity checks */ if(c == NULL || cli == NULL) return(false); /* Check for incoming packets */ while(sc_net_recv_packet(&cli->server, c, (void *)cli, sc_net_client_handle_packet)) /* just loop */; return(true); } bool sc_net_client_death(sc_client **cli) { /* Check if a client died; if so, then free it. */ if(cli == NULL || *cli == NULL) return(false); if(SC_CONN_IS_DEAD((*cli)->server)) { /* This client has died; free the connection. */ sc_net_client_free(cli, "Connection died"); return(true); } /* No connections to free, this time */ return(false); } bool sc_net_client_chat(sc_client *cli, const char *msg) { char buffer[SC_NET_BUFFER_SIZE]; /* Sanity checks */ if(cli == NULL) return(false); if(!SC_CONN_IS_DEAD(cli->server)) { sbprintf(buffer, sizeof(buffer), "%s: %s", cli->name, msg); return(sc_net_send_message(&cli->server, SC_NET_CHAT, buffer)); } return(false); } bool sc_net_client_sync(sc_client *cli, dword flag, bool isserver) { /* sc_net_client_sync Okay, this is how this works. The sstate.c code calls this function whenever it wants to synchronise with the server (end of inventory, end of turn, or end of round confirmation). When this is called, the client expects to block until server has confirmed they may continue. The flag indicates what type of network sync event the client is waiting for. isserver is relevant because the server is the ``authority'' on sync requests, i.e. the server is always keeping proper game. So if we are the server, we set isserver to true, which munges a special flag into the packet. When the server is damn well ready, they will send us a sync response; if it is at all useful, it will also include the server's next expected random value. This allows us to easily check to see if we are in sync with the server; if we share the same next random value then we are probably okay, whereas if they differ, we know something has gone horribly wrong. Note that if we were syncing on one type of event, and the server was syncing on a different event, something went wrong -- they will send us a bogus random value and from there we will have to play the same ``what went wrong?'' game that we must play if random values normally go out of alignment. */ sc_packet packet; /* Packet to send */ dword *p; /* Pointer to dat */ /* Make sure we have a client socket */ if(cli == NULL) return(false); /* Set state flags; we'll be waiting now */ SC_CONN_SET_FLAGS(cli->server, SC_CONN_WAIT_SYNC); SC_CONN_SET_ARG(cli->server, flag); /* If server, add server sync flag */ if(isserver) flag |= SC_CONN_SYNC_SERV; else flag &= ~SC_CONN_SYNC_SERV; /* Setup the packet */ if(!sc_net_packet_init(&packet, SC_NET_CLI_SYNC_RQST, 2 * sizeof(dword))) return(false); p = (dword *)packet.data; *p++ = htonl(flag); /* Send the sync flag to use */ *p++ = htonl(game_rand_peek()); /* Send our next random value */ /* Attempt to send the packet */ sc_net_set_info("client_sync", "syncing with server on game event"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); /* Send a status update */ sc_net_client_update_status(cli); return(true); } bool sc_net_client_send_orders(const sc_config *c, sc_client *cli, int playerid) { /* sc_net_client_send_orders Send our orders to the server. The server will hopefully accept our orders and send a broadcast packet to all players containing the composite of player orders. I hope. At any rate, if we are able to send the packet, then we'll return true. This packet is not directly relayed to other clients. */ const sc_player *pl; /* Player data structure */ sc_packet packet; /* Packet to send */ dword *p; /* Pointer into data */ /* Sanity checks */ if(c == NULL || cli == NULL) return(false); pl = c->players[playerid]; if(!pl || pl->aitype == SC_AI_NETWORK) return(false); /* Initialise the packet */ if(!sc_net_packet_init( &packet, SC_NET_CLI_ORDERS, 7 * sizeof(dword) )) return(false); p = (dword *)packet.data; *p++ = htonl(playerid); *p++ = htonl(pl->turret); *p++ = htonl(pl->power); *p++ = htonl(pl->selweapon->ident); *p++ = htonl(pl->selshield->ident); *p++ = htonl(pl->x); *p++ = htonl(pl->y); /* Attempt to send the packet */ sc_net_set_info("client_send_orders", "sending our game orders"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); return(true); } bool sc_net_client_send_shields(const sc_config *c, sc_client *cli, int playerid) { /* sc_net_client_send_shields Let the server know that we are activating our shields. This packet may be directly relayed to other clients. Returns true if the packet makes it out the door; from there it's anyone's game... */ sc_packet packet; /* Packet to be sent */ sc_player *pl; dword *p; /* Sanity checks */ if(c == NULL || cli == NULL) return(false); pl = c->players[playerid]; if(pl == NULL || pl->shield == NULL || pl->aitype == SC_AI_NETWORK) return(false); /* Initialise the packet */ if(!sc_net_packet_init(&packet, SC_NET_SHIELDS, 2 * sizeof(dword))) return(false); p = (dword *)packet.data; *p++ = htonl(playerid); *p++ = htonl(pl->shield->info->ident); /* Attempt to send the packet */ sc_net_set_info("client_send_shields", "sending our shield status"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); return(true); } bool sc_net_client_send_battery(const sc_config *c, sc_client *cli, int playerid) { /* sc_net_client_send_battery Let the server know that we are activating a battery. This packet may be directly relayed to other clients. Returns true if the packet makes it out the door; from there it's anyone's game... */ sc_packet packet; /* Packet to be sent */ /* Sanity checks */ if(c == NULL || cli == NULL) return(false); if(c->players[playerid]->aitype == SC_AI_NETWORK) return(false); /* Initialise the packet */ if(!sc_net_packet_init(&packet, SC_NET_BATTERY, sizeof(dword))) return(false); *(dword *)packet.data = htonl(playerid); /* Attempt to send the packet */ sc_net_set_info("client_send_battery", "activating a battery"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); return(true); } bool sc_net_client_send_flags(const sc_config *c, sc_client *cli, int playerid) { /* sc_net_client_send_flags Let the server know what command flags we have set, e.g. contact trigger status. Returns true if the packet makes it out the door; from there it's anyone's game... */ sc_packet packet; /* Packet to be sent */ dword *p; /* Packet data pointer */ /* Sanity checks */ if(c == NULL || cli == NULL) return(false); if(c->players[playerid]->aitype == SC_AI_NETWORK) return(false); /* Initialise the packet */ if(!sc_net_packet_init(&packet, SC_NET_PLFLAGS, 3 * sizeof(dword))) return(false); p = (dword *)packet.data; *p++ = htonl(playerid); *p++ = htonl(c->players[playerid]->contacttriggers); *p++ = htonl(c->players[playerid]->ac_state); /* Attempt to send the packet */ sc_net_set_info("client_send_flags", "sending our command flags"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); return(true); } bool sc_net_client_send_inventory(const sc_config *c, sc_client *cli, int playerid) { const sc_accessory_info *ai; /* Accessory info */ const sc_weapon_info *wi; /* Weapon info */ const sc_player *pl; /* Player data */ sc_packet packet; /* Packet to be sent */ dword *p; /* Pointer into packet data */ int acount; /* Accessory count (total) */ int wcount; /* Weapon count (total) */ int size; /* Expected packet size */ int i; /* Iterator variable */ /* Sanity checks */ if(c == NULL || cli == NULL) return(false); pl = c->players[playerid]; if(pl->aitype == SC_AI_NETWORK) return(false); /* Make sure packet is large enough to hold additional data. Packets for weapons and accessories look like this: [ integer item_id ], [ integer item_count ] (repeat) */ acount = sc_accessory_count(c->accessories, SC_ACCESSORY_LIMIT_NONE); wcount = sc_weapon_count(c->weapons, SC_WEAPON_LIMIT_NONE); size = (8 + 2 * (wcount + acount)) * sizeof(dword); /* Initialise header data */ if(!sc_net_packet_init(&packet, SC_NET_INVENTORY, size)) return(false); p = (dword *)packet.data; *p++ = htonl(playerid); *p++ = htonl(wcount); *p++ = htonl(acount); /* Initialise weapons block */ *p++ = htonl(SC_PACKET_INVENTORY_WEAPONS); wi = sc_weapon_first(c->weapons, SC_WEAPON_LIMIT_NONE); for(i = 0; i < wcount; ++i) { *p++ = htonl(wi->ident); *p++ = htonl(wi->inventories[playerid]); wi = sc_weapon_next(c->weapons, wi, SC_WEAPON_LIMIT_NONE); } /* Initialise accessories block */ *p++ = htonl(SC_PACKET_INVENTORY_ACCESSORIES); ai = sc_accessory_first(c->accessories, SC_ACCESSORY_LIMIT_NONE); for(i = 0; i < acount; ++i) { *p++ = htonl(ai->ident); *p++ = htonl(ai->inventories[playerid]); ai = sc_accessory_next(c->accessories, ai, SC_ACCESSORY_LIMIT_NONE); } /* Intiialise miscellaneous block */ *p++ = htonl(SC_PACKET_INVENTORY_MISC); *p++ = htonl(pl->money); *p++ = htonl(pl->oldmoney); /* Attempt to send the packet */ sc_net_set_info("client_send_inventory", "sending our inventory"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); return(true); } bool sc_net_client_send_player_state(const sc_config *c, sc_client *cli) { const sc_player *pl; /* Player data */ sc_packet packet; /* Packet to send */ dword *p; /* Pointer to packet data */ int size; /* Expected packet size */ int i; /* Iterator variable */ /* Sanity checks */ if(c == NULL || cli == NULL) return(false); /* Initialise packet data */ size = (1 + 11 * c->numplayers) * sizeof(dword); if(!sc_net_packet_init(&packet, SC_NET_PLAYER_STATE, size)) return(false); p = (dword *)packet.data; *p++ = htonl(c->numplayers); for(i = 0; i < c->numplayers; ++i) { /* First field is authority flag */ pl = c->players[i]; *p++ = htonl(pl == SC_AI_HUMAN); *p++ = htonl(pl->index); *p++ = htonl(pl->x); *p++ = htonl(pl->y); *p++ = htonl(pl->fuel); *p++ = htonl(pl->turret); *p++ = htonl(pl->power); *p++ = htonl(pl->life); *p++ = htonl(pl->dead); *p++ = htonl(pl->money); *p++ = htonl(pl->selweapon->ident); } /* Attempt to send */ sc_net_set_info("client_send_player_state", "sending our player state"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); /* Send a status update */ sc_net_client_update_status(cli); return(true); } xscorch-0.2.1/snet/snetconfig.c0000644000175000001440000003115011615366347013370 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snetconfig.c,v 1.18 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snetconfig.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Functions for handling the configuration data This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define SC_NET_CONFIG_OPTIONS 0xFFFF0001 #define SC_NET_CONFIG_GRAPHICS 0xFFFF0002 #define SC_NET_CONFIG_ECONOMY 0xFFFF0004 #define SC_NET_CONFIG_PHYSICS 0xFFFF0008 #define SC_NET_CONFIG_WEAPONS 0xFFFF0010 #define SC_NET_CONFIG_LAND 0xFFFF0020 #define SC_NET_CONFIG_AIC 0xFFFF0040 #define SC_NET_CONFIG_RUNTIME 0xFFFFF000 bool sc_net_svr_send_config(sc_config *c, sc_server *svr) { sc_packet config; /* Data packet to transmit to server broadcast */ sc_packet player; /* player data to transmit to server broadcast */ dword randseed; /* Initial random seed for game */ dword *p; /* Pointer into packet data */ ubyte *pc; /* Char ptr into packet data */ int i; /* Iterator through connections */ int j; /* Inner loop iterator */ /* Sanity checks */ if(c == NULL || svr == NULL) return(false); /* Obtain a new random seed */ randseed = sys_rand(); /* B E G I N C O N F I G P A C K E T */ #define SC_PACKET_CONFIG_SIZE (sizeof(dword) * 55) /* Construct the data area of config packet */ if(!sc_net_packet_init(&config, SC_NET_SVR_CONFIG_DATA, SC_PACKET_CONFIG_SIZE)) return(false); p = (dword *)config.data; *p++ = htonl(SC_NET_CONFIG_OPTIONS); *p++ = htonl(c->options.mode); *p++ = htonl(c->options.team); *p++ = htonl(c->options.order); *p++ = htonl(c->options.talk); *p++ = htonl(c->options.talkprob); *p++ = htonl(c->options.interleave); *p++ = htonl(SC_NET_CONFIG_GRAPHICS); *p++ = htonl(c->graphics.gfxdither); *p++ = htonl(c->graphics.gfxanimate); *p++ = htonl(c->graphics.gfxfast); *p++ = htonl(c->graphics.gfxcompfast); *p++ = htonl(c->fieldwidth); *p++ = htonl(c->fieldheight); *p++ = htonl(c->maxheight); *p++ = htonl(SC_NET_CONFIG_ECONOMY); *p++ = htonl((dword)(c->economics->interestrate / 100 * DWORD_MAX)); *p++ = htonl(c->economics->dynamicinterest); *p++ = htonl(c->economics->initialcash); *p++ = htonl(c->economics->computersbuy); *p++ = htonl(c->economics->computersaggressive); *p++ = htonl(c->economics->freemarket); *p++ = htonl(c->economics->lottery); { /* TEMP HACK - This is so evil I can't believe I'm doing it. */ sc_scoring_info *info = sc_scoring_lookup_by_name(c->economics, c->economics->scoringname); assert(info != NULL); *p++ = htonl(info->ident); } *p++ = htonl(SC_NET_CONFIG_PHYSICS); *p++ = htonl((dword)(c->physics->airviscosity / SC_PHYSICS_VISCOUS_MAX * DWORD_MAX)); *p++ = htonl((dword)(c->physics->gravity / SC_PHYSICS_GRAVITY_MAX * DWORD_MAX)); *p++ = htonl((dword)(c->physics->damping / SC_TRAJ_DAMPING_MAX * DWORD_MAX)); *p++ = htonl((dword)(c->physics->maxwind / SC_PHYSICS_WIND_MAX * DWORD_MAX)); *p++ = htonl(c->physics->dynamicwind); *p++ = htonl(c->physics->suspenddirt); *p++ = htonl(c->physics->tanksfall); *p++ = htonl(c->physics->bordersextend); *p++ = htonl(c->physics->walls); *p++ = htonl(SC_NET_CONFIG_WEAPONS); *p++ = htonl(c->weapons->armslevel); *p++ = htonl(c->weapons->bombiconsize); *p++ = htonl(c->weapons->tunneling); *p++ = htonl((dword)(c->weapons->scaling / SC_WEAPON_SCALING_MAX * DWORD_MAX)); *p++ = htonl(c->weapons->tracepaths); *p++ = htonl(c->weapons->uselessitems); *p++ = htonl(SC_NET_CONFIG_LAND); *p++ = htonl(c->land->sky); *p++ = htonl(c->land->hostileenv); *p++ = htonl(c->land->generator); *p++ = htonl((dword)(c->land->bumpiness / SC_LAND_BUMPINESS_MAX * DWORD_MAX)); *p++ = htonl(SC_NET_CONFIG_AIC); *p++ = htonl(c->aicontrol->humantargets); *p++ = htonl(c->aicontrol->allowoffsets); *p++ = htonl(c->aicontrol->alwaysoffset); *p++ = htonl(c->aicontrol->enablescan); *p++ = htonl(c->aicontrol->nobudget); *p++ = htonl(SC_NET_CONFIG_RUNTIME); *p++ = htonl(randseed); *p++ = htonl(c->numplayers); if((char *)p - (char *)config.data != SC_PACKET_CONFIG_SIZE) { sc_net_set_error("svr_send_config", "Size mismatch on config packet"); return(false); } /* E N D C O N F I G P A C K E T */ /* Send data to each client connection */ for(i = 0; i < svr->connections; ++i) { /* Queue config packet */ sc_net_send_packet(&svr->clients[i], &config); /* B E G I N P L A Y E R P A C K E T */ #define SC_PACKET_PLAYER_SIZE (SC_PLAYER_NAME_LENGTH + sizeof(dword)) if(!sc_net_packet_init(&player, SC_NET_SVR_PLAYER_DATA, SC_PACKET_PLAYER_SIZE * SC_MAX_PLAYERS)) return(false); /* Setup player data packet */ for(j = 0; j < SC_MAX_PLAYERS; ++j) { pc = player.data + SC_PACKET_PLAYER_SIZE * j; memcpy(pc, c->players[j]->name, SC_PLAYER_NAME_LENGTH); if(i == j) { *(dword *)(pc + SC_PLAYER_NAME_LENGTH) = htonl(SC_AI_HUMAN); } else if(c->players[j]->aitype == SC_AI_HUMAN || c->players[j]->aitype == SC_AI_NETWORK) { *(dword *)(pc + SC_PLAYER_NAME_LENGTH) = htonl(SC_AI_NETWORK); } else { *(dword *)(pc + SC_PLAYER_NAME_LENGTH) = htonl(c->players[j]->aitype); } } /* E N D P L A Y E R P A C K E T */ /* Queue player data packet */ sc_net_send_packet(&svr->clients[i], &player); sc_net_packet_release(&player); /* Flush the outgoing packet queue. */ sc_net_flush_packets(&svr->clients[i]); } /* We're all done */ sc_net_packet_release(&config); sc_net_set_info("srv_send_config", "Sent game configuration"); return(true); } bool sc_net_cli_recv_config(sc_config *c, sc_client *cli, sc_packet *packet) { char buffer[SC_NET_BUFFER_SIZE]; /* For info messages */ dword *p; /* Pointer to packet data */ /* Sanity checks */ if(c == NULL || cli == NULL || packet == NULL) return(false); if(!sc_net_check_size(packet, SC_PACKET_CONFIG_SIZE, "cli_recv_config")) return(false); /* Prepare to read data from config packet */ p = (dword *)packet->data; if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_OPTIONS, "cli_recv_config", "options marker")) return(false); c->options.mode = ntohl(*p++); c->options.team = ntohl(*p++); c->options.order = ntohl(*p++); c->options.talk = ntohl(*p++); c->options.talkprob = ntohl(*p++); c->options.interleave = ntohl(*p++); if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_GRAPHICS, "cli_recv_config", "graphics marker")) return(false); c->graphics.gfxdither = ntohl(*p++); c->graphics.gfxanimate = ntohl(*p++); c->graphics.gfxfast = ntohl(*p++); c->graphics.gfxcompfast = ntohl(*p++); c->fieldwidth = ntohl(*p++); c->fieldheight = ntohl(*p++); c->maxheight = ntohl(*p++); if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_ECONOMY, "cli_recv_config", "economy marker")) return(false); c->economics->interestrate = ((double)ntohl(*p++)) * 100 / DWORD_MAX; c->economics->dynamicinterest = ntohl(*p++); c->economics->initialcash = ntohl(*p++); c->economics->computersbuy = ntohl(*p++); c->economics->computersaggressive = ntohl(*p++); c->economics->freemarket = ntohl(*p++); c->economics->lottery = ntohl(*p++); { /* TEMP HACK - More of the same evil. But I know the eventual solution... */ sc_scoring_info *info = sc_scoring_lookup(c->economics, ntohl(*p++)); assert(info != NULL); strcopyb(c->economics->scoringname, info->name, SC_ECONOMY_MAX_NAME_LEN); } if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_PHYSICS, "cli_recv_config", "physics marker")) return(false); c->physics->airviscosity = ((double)ntohl(*p++)) * SC_PHYSICS_VISCOUS_MAX / DWORD_MAX; c->physics->gravity = ((double)ntohl(*p++)) * SC_PHYSICS_GRAVITY_MAX / DWORD_MAX; c->physics->damping = ((double)ntohl(*p++)) * SC_TRAJ_DAMPING_MAX / DWORD_MAX; c->physics->maxwind = ((double)ntohl(*p++)) * SC_PHYSICS_WIND_MAX / DWORD_MAX; c->physics->dynamicwind = ntohl(*p++); c->physics->suspenddirt = ntohl(*p++); c->physics->tanksfall = ntohl(*p++); c->physics->bordersextend = ntohl(*p++); c->physics->walls = ntohl(*p++); if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_WEAPONS, "cli_recv_config", "weapons marker")) return(false); c->weapons->armslevel = ntohl(*p++); c->weapons->bombiconsize = ntohl(*p++); c->weapons->tunneling = ntohl(*p++); c->weapons->scaling = ((double)ntohl(*p++)) * SC_WEAPON_SCALING_MAX / DWORD_MAX; c->weapons->tracepaths = ntohl(*p++); c->weapons->uselessitems = ntohl(*p++); if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_LAND, "cli_recv_config", "land marker")) return(false); c->land->sky = ntohl(*p++); c->land->hostileenv = ntohl(*p++); c->land->generator = ntohl(*p++); c->land->bumpiness = ((double)ntohl(*p++)) * SC_LAND_BUMPINESS_MAX / DWORD_MAX; if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_AIC, "cli_recv_config", "aic marker")) return(false); c->aicontrol->humantargets = ntohl(*p++); c->aicontrol->allowoffsets = ntohl(*p++); c->aicontrol->alwaysoffset = ntohl(*p++); c->aicontrol->enablescan = ntohl(*p++); c->aicontrol->nobudget = ntohl(*p++); /* Pick up runtime data */ if(!sc_net_check_param(ntohl(*p++), SC_NET_CONFIG_RUNTIME, "cli_recv_config", "runtime marker")) return(false); sbprintf(buffer, sizeof(buffer), "Random seed is %08x", ntohl(*p)); sc_net_set_info("cli_recv_config", buffer); game_randomize(ntohl(*p++)); c->numplayers = ntohl(*p++); /* B E G I N C O D E B A S E D O N G R A P H I C S S E T U P */ /* Sloppily reconfigure everything on-the-fly */ /* Colormap MUST be recalculated before land is regenerated! */ sc_color_gradient_init(c, c->colors); /* Attempt to rebuild land */ sc_land_setup(c->land, c->fieldwidth, c->fieldheight, sc_land_flags(c)); sc_land_generate(c, c->land); /* Resize window and redraw everything */ sc_window_resize(c->window); /* E N D C O D E B A S E D O N G R A P H I C S S E T U P */ /* We are done */ sc_net_set_info("cli_recv_config", "config structure received"); SC_CONN_CLEAR_FLAGS(cli->server, SC_CONN_NEED_CONFIG); /* Return with success */ return(true); } bool sc_net_cli_recv_players(sc_config *c, sc_client *cli, sc_packet *packet) { ubyte *p; /* Pointer to packet data */ int i; /* Iterator variable */ /* Sanity checks */ if(c == NULL || cli == NULL || packet == NULL) return(false); if(!sc_net_check_size(packet, SC_PACKET_PLAYER_SIZE * SC_MAX_PLAYERS, "cli_recv_players")) return(false); /* Iterate through player data */ for(i = 0; i < SC_MAX_PLAYERS; ++i) { p = packet->data + SC_PACKET_PLAYER_SIZE * i; memcpy(c->players[i]->name, p, SC_PLAYER_NAME_LENGTH); c->players[i]->aitype = ntohl(*(dword *)(p + SC_PLAYER_NAME_LENGTH)); } /* We are done */ sc_net_set_info("cli_recv_players", "player structure received"); SC_CONN_CLEAR_FLAGS(cli->server, SC_CONN_NEED_PLAYERS); return(true); } bool sc_net_server_send_config(sc_config *c, sc_server *srv) { return(sc_net_svr_send_config(c, srv)); } xscorch-0.2.1/snet/snetcomm.c0000644000175000001440000001242411615366347013061 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snetcomm.c,v 1.15 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snetcomm.c Copyright(c) 2000-2003 Jacob Luna Lundberg Copyright(c) 2000-2003 Justin David Smith jacob(at)gnifty.net http://www.gnifty.net/ justins(at)chaos2.org http://chaos2.org/ Communication functions, packet setup This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include bool sc_net_set_nonblocking(int socket) { /* Setup the socket as nonblocking */ if(fcntl(socket, F_SETFL, O_NONBLOCK) != 0) { sc_net_set_error("set_nonblocking", strerror(errno)); return(false); } return(true); } bool sc_net_shutdown(int *socket) { /* Close down a TCP socket */ if(socket == NULL || *socket < 0) return(true); shutdown(*socket, 2); close(*socket); *socket = -1; return(true); } bool sc_net_recv_packet(sc_connection *conn, sc_config *c, void *parm, packet_handler handler) { /* sc_net_recv_packet() Pull packets off the network stream and tokenize them into the packet queue. Then return a single packet off the top of the queue. */ sc_packet packet; dword *header; size_t size; /* Scan for new packets. */ tn_scan_read(conn->connection, NULL); if(tn_read(conn->connection, &packet.data, &size)) { if(packet.data == NULL || size < SC_PACKET_HEADER_SIZE) { /* Supersmall packets! (This is by definition not possible!) */ sc_net_set_error("recv_packet", "Packet size fields mismatch"); SC_CONN_SET_FLAGS(*conn, SC_CONN_TCPNET_ERROR); sc_net_packet_release(&packet); return(false); } /* We read packet data. Munch it! */ header = (dword *)(packet.data + size); packet.data_size = ntohl(*(--header)); packet.msg_type = ntohl(*(--header)); packet.next_rnd = ntohl(*(--header)); /* This is a little helper to catch buffer overwrites. */ strcopyb((char *)header, "BUFOFLO", 2 * sizeof(dword)); if(size != packet.data_size + SC_PACKET_HEADER_SIZE) { /* A badly damaged packet came in (shouldn't happen). */ sc_net_set_error("recv_packet", "Packet size fields mismatch"); } /* Handle the packet. */ handler(c, parm, &packet); /* Clean up. */ sc_net_packet_release(&packet); /* Ask for a rescan in case there are more packets. */ return(true); } else { /* Check for error conditions. */ if(TN_STATE_IS_ERROR(conn->connection)) { sc_net_set_error("recv_packet", tn_error_string(conn->connection)); if(!TN_CONNECTION_IS_UP(conn->connection)) /* A fatal error killed the connection. */ SC_CONN_SET_FLAGS(*conn, SC_CONN_LOCAL_ERROR); else /* Eventually, the TCP NET library will have error recovery. */ SC_CONN_SET_FLAGS(*conn, SC_CONN_TCPNET_ERROR); } return(false); } } bool sc_net_flush_packets(sc_connection *conn) { /* sc_net_flush_packets Flush the packet queue. */ if(!conn) return(false); return(tn_write_flush(conn->connection)); } bool sc_net_send_packet(sc_connection *conn, sc_packet *packet) { /* sc_net_send_packet() Try to queue a packet; true indicates success. */ dword *header; if(!conn || !packet || !packet->data) return(false); /* Set up the header dwords on the end of the data. */ header = (dword *)(packet->data + packet->data_size); *header++ = htonl(packet->next_rnd); *header++ = htonl(packet->msg_type); *header++ = htonl(packet->data_size); /* Queue the packet data. */ if(tn_write(conn->connection, packet->data, packet->data_size + SC_PACKET_HEADER_SIZE)) return(true); else return(false); } bool sc_net_send_packet_now(sc_connection *conn, sc_packet *packet) { /* sc_net_send_packet_now() Try to transmit a packet; true indicates success. */ if(!conn || !packet || !packet->data) return(false); /* Queue and flush the packet. */ return(sc_net_send_packet(conn, packet) && sc_net_flush_packets(conn)); } bool sc_net_send_message(sc_connection *conn, udword msg_type, const char *msg) { /* sc_net_send_message() Wrapper for send_packet; the data payload will be a text message. */ bool ret; sc_packet packet; if(!sc_net_packet_init(&packet, msg_type, min(strlenn(msg) + 1, SC_NET_BUFFER_SIZE))) return(false); strcopyb((char *)packet.data, msg, packet.data_size); ret = sc_net_send_packet_now(conn, &packet); sc_net_packet_release(&packet); return(ret); } xscorch-0.2.1/snet/snetconnect.c0000644000175000001440000001461011615366347013556 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snetconnect.c,v 1.17 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snetconnect.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2011 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Network connection open, close This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include sc_server *sc_net_server_new(sc_config *c, int port) { addr socket_info; /* Information about us */ sc_server *srv; /* Server object */ int i; /* Iterator */ /* Construct a new server object and initialise it */ srv = (sc_server *)malloc(sizeof(sc_server)); if(srv == NULL) { sc_net_set_error("server_new", "malloc failed"); return(NULL); } srv->connections = 0; /* Open a new TCP socket */ srv->linein = socket(PF_INET, SOCK_STREAM, DEFAULT_PROTOCOL); if(srv->linein == -1) { sc_net_set_error("server_new, socket", strerror(errno)); free(srv); return(NULL); } /* Setup socket information about us; attempt to bind to a port */ memset((char *)&socket_info, '\0', sizeof(socket_info)); socket_info.sin_family = AF_INET; socket_info.sin_port = htons(port); socket_info.sin_addr.s_addr = INADDR_ANY; if(bind(srv->linein, (struct sockaddr *)&socket_info, sizeof(socket_info)) < 0) { sc_net_set_error("server_new, bind", strerror(errno)); free(srv); return(NULL); } /* setup server socket not to block */ sc_net_set_nonblocking(srv->linein); /* Game state initalisation */ c->numplayers = 0; for(i = 0; i < SC_MAX_PLAYERS; ++i) { c->players[i]->aitype = SC_AI_RANDOM; } /* Prepare to listen for incoming packets */ if(listen(srv->linein, 5) < 0) { sc_net_set_error("server_new, listen", strerror(errno)); free(srv); return(NULL); } /* Display informative message */ sc_net_set_info("server_new", "Network server established"); /* Return the new socket object */ return(srv); } void sc_net_server_free(sc_server **srv, const char *msg) { /* sc_net_server_free Clean out a stale server struct. */ int i; if(srv == NULL || *srv == NULL) return; for(i = 0; i < (*srv)->connections; ++i) { sc_net_send_message(&(*srv)->clients[i], SC_NET_SVR_QUIT, msg); tn_terminate(&(*srv)->clients[i].connection); sc_net_shutdown(&(*srv)->clients[i].socket); } sc_net_shutdown(&(*srv)->linein); free(*srv); *srv = NULL; return; } sc_client *sc_net_client_new(const char *name, const char *hostname, int port) { char versionstr[SC_NET_BUFFER_SIZE]; /* version info */ sc_packet packet; /* Transmitted data packet */ host *host_info; /* Remote host information */ sc_client *cli; /* Client object */ /* Get my version data */ sc_net_version_info(versionstr, sizeof(versionstr)); /* Construct a new client object and initialise it */ cli = (sc_client *)malloc(sizeof(sc_client)); if(cli == NULL) { sc_net_set_error("client_new", "malloc failed"); return(NULL); } strcopyb(cli->name, name, sizeof(cli->name)); /* Open a new TCP socket */ cli->server.socket = socket(PF_INET, SOCK_STREAM, DEFAULT_PROTOCOL); if(cli->server.socket == -1) { sc_net_set_error("client_new, socket", strerror(errno)); free(cli); return(NULL); } /* Get information about the remote host */ host_info = gethostbyname(hostname); if(host_info == NULL) { sc_net_set_error("client_new, gethostbyname", "Cannot resolve hostname."); free(cli); return(NULL); } /* setup client destination address */ memset((char *)&cli->server.address, '\0', sizeof(addr)); memcpy((char *)&cli->server.address.sin_addr, host_info->HOSTENT_H_ADDR, host_info->h_length); cli->server.address.sin_family = host_info->h_addrtype; cli->server.address.sin_port = htons(port); /* Below we initiate a connection request to the server */ /* Initialise server-client data */ cli->server.flags = SC_CONN_CLI_IFLAGS; cli->server.syncarg = 0; /* Attempt a connect request. We want this call to block */ if(connect(cli->server.socket, (const struct sockaddr *)&cli->server.address, sizeof(addr)) < 0) { sc_net_set_error("client_new, connect", strerror(errno)); free(cli); return(NULL); } /* setup client socket not to block from now on */ sc_net_set_nonblocking(cli->server.socket); /* Register the new connection with the TCP NET packet engine. */ if(!tn_instantiate(&cli->server.connection, cli->server.socket)) { sc_net_set_error("client_new, TCP NET", strerror(errno)); free(cli); return(NULL); } /* Initiate a connection request to the server */ sc_net_packet_init(&packet, SC_NET_CLI_CONNECT, strlenn(versionstr) + sizeof(dword)); *(dword *)packet.data = htonl(SC_NET_VERSION); memcpy(packet.data + sizeof(dword), versionstr, strlenn(versionstr)); /* Attempt to send the packet */ if(!sc_net_send_packet_now(&cli->server, &packet)) { free(cli); return(NULL); } sc_net_packet_release(&packet); /* Initialise the status data */ sc_net_status_init(cli); /* Return the client connection */ return(cli); } void sc_net_client_free(sc_client **cli, const char *msg) { /* sc_net_client_free Let them run free! */ if(cli == NULL || *cli == NULL) return; sc_net_send_message(&(*cli)->server, SC_NET_CLI_DISCONNECT, msg); sc_net_shutdown(&(*cli)->server.socket); free(*cli); *cli = NULL; return; } xscorch-0.2.1/snet/snetint.h0000644000175000001440000001543011615366347012725 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snetint.h,v 1.14 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snetint.h Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Internal network header files This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __snetint_h_included #define __snetint_h_included /* Get USE_NETWORK and svr/cli structures */ #include #if USE_NETWORK /* Allow network support? */ /* Default buffer size */ #define SC_NET_BUFFER_SIZE 0x400 /* Default size for internal buffers */ /* Define the default protocol for socket() call */ #ifndef DEFAULT_PROTOCOL /* Check if it's already defined */ #define DEFAULT_PROTOCOL 0 /* socket() says this is zero */ #endif /* DEFAULT_PROTOCOL definition */ /* Connection initiation, close packets */ #define SC_NET_CLI_CONNECT 0x4E4E4F43 /* "CONN" - connect request; flag is version, data is version string */ #define SC_NET_SVR_ACCEPTED 0x54504341 /* "ACPT" - connect response; flag is version, data is version string */ #define SC_NET_SVR_REJECTED 0x204A4552 /* "REJ " - connect response; data is text error message */ #define SC_NET_CLI_DISCONNECT 0x43534944 /* "DISC" - client disconnecting; data is text reason */ #define SC_NET_SVR_QUIT 0x54495551 /* "QUIT" - server shutting down; data is text reason */ /* Retransmission control packets. */ #define SC_NET_RETRANSMIT 0x72746572 /* "retr" - packet retransmission request */ #define SC_NET_RETR_FAIL 0x40746572 /* "ret@" - packet retransmission failure */ /* Game configuration data */ #define SC_NET_SVR_CONFIG_DATA 0x666E6F63 /* "conf" - server sending config; data is arbitrary */ #define SC_NET_SVR_PLAYER_DATA 0x72796C70 /* "plyr" - server sending config; data is arbitrary */ #define SC_NET_CLI_PLAYER_NAME 0x656D616E /* "name" - client sending name; data is text name */ /* Game event synchronization */ #define SC_NET_CLI_SYNC_RQST 0x434E5953 /* "SYNC" - client asking to sync; flag is event ID */ #define SC_NET_SVR_SYNC_RESP 0x404E5953 /* "SYN@" - server permitting sync */ /* Player orders */ #define SC_NET_CLI_ORDERS 0x7264726F /* "ordr" - client sending player orders; data */ #define SC_NET_SVR_ORDERS 0x4064726F /* "ord@" - server sending player orders; data */ #define SC_NET_INVENTORY 0x20766E69 /* "inv " - client sending inventory; data */ #define SC_NET_SHIELDS 0x646C6873 /* "shld" - client sending shield status; data */ #define SC_NET_BATTERY 0x74746162 /* "batt" - client sending shield status; data */ #define SC_NET_PLFLAGS 0x676C6670 /* "pflg" - client sending command flags; data */ #define SC_NET_PLAYER_STATE 0x74736C70 /* "plst" - client sending player state; data */ /* Status packets */ #define SC_NET_CLIENT_STATUS 0x74617473 /* "stat" - client sending connection status */ /* Miscellaneous broadcast data */ #define SC_NET_UNKNOWN 0x6E6B6E75 /* "unkn" - unknown packet; don't send this */ #define SC_NET_CHAT 0x74616863 /* "chat" - player chat; data is text message */ /* Network protocol versions */ #define SC_NET_MIN_VERSION 0xD6000210 /* minimum version the server can accept */ #define SC_NET_VERSION 0xD6000210 /* protocol version supported by client */ #define SC_NET_MAJOR_VERSION ((SC_NET_VERSION >> 16) & 0xFF) #define SC_NET_MINOR_VERSION ((SC_NET_VERSION >> 8) & 0xFF) #define SC_NET_PATCH_VERSION ((SC_NET_VERSION) & 0xFF) /* Connection control macros */ #define SC_CONN_SET_FLAGS(conn, flag) ((conn).flags = ((conn).flags | (flag))) #define SC_CONN_CLEAR_FLAGS(conn, flag) ((conn).flags = ((conn).flags & ~(flag))) #define SC_CONN_SET_ARG(conn, arg) ((conn).syncarg = (arg)) #define SC_CONN_GET_ARG(conn) ((conn).syncarg) /* Connection control definitions */ #define SC_CONN_NEED_ALL (SC_CONN_NEED_ACCEPT | SC_CONN_NEED_CONFIG | SC_CONN_NEED_PLAYERS) #define SC_CONN_CLI_IFLAGS SC_CONN_NEED_ALL #define SC_CONN_SVR_IFLAGS SC_CONN_NEED_ACCEPT /* Data Packet Structure */ #define SC_PACKET_HEADER_SIZE (3 * sizeof(dword)) /* Size of the header */ typedef struct _sc_packet { dword next_rnd; /* next expected random value */ dword msg_type; /* 32bit message type */ dword data_size; /* size of data block */ byte *data; /* data block */ } sc_packet; /* Packet handler for received packets */ typedef bool (*packet_handler)(sc_config *, void *, sc_packet *); /* Packet management */ bool sc_net_packet_init(sc_packet *packet, dword type, dword data_size); bool sc_net_packet_release(sc_packet *packet); /* General functionals */ bool sc_net_check_param(dword actual, dword expected, const char *description, const char *param); bool sc_net_check_size(const sc_packet *packet, sizea expectedsize, const char *description); void sc_net_set_error(const char *function, const char *errormsg); void sc_net_set_info(const char *function, const char *errormsg); void sc_net_version_info(char *buf, int size); /* Basic communications */ bool sc_net_shutdown(int *socket); bool sc_net_set_nonblocking(int socket); bool sc_net_flush_packets(sc_connection *conn); bool sc_net_send_packet(sc_connection *conn, sc_packet *packet); bool sc_net_send_packet_now(sc_connection *conn, sc_packet *packet); bool sc_net_send_message(sc_connection *conn, dword msg_type, const char *msg); bool sc_net_recv_packet(sc_connection *conn, sc_config *c, void *parm, packet_handler handler); /* Configuration */ bool sc_net_svr_send_config(sc_config *c, sc_server *svr); bool sc_net_cli_recv_config(sc_config *c, sc_client *cli, sc_packet *packet); bool sc_net_cli_recv_players(sc_config *c, sc_client *cli, sc_packet *packet); /* Informational/status messages */ bool sc_net_client_recv_status(const sc_config *c, sc_client *cli, sc_packet *packet); bool sc_net_server_relay_status(sc_server *srv, sc_packet *packet, int connid); void sc_net_status_init(sc_client *cli); #endif /* Use network? */ #endif /* __snetint_h_included */ xscorch-0.2.1/snet/snetserver.c0000644000175000001440000003120711615366347013434 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snetserver.c,v 1.20 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snetserver.c Copyright(c) 2000-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Server control loop This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static bool _sc_net_sync_all(sc_server *srv) { /* _sc_net_sync_all I think you want to read snetclient.c (search for "_sync") before looking through this function, since it's not entirely obvious what all is going on here. This code is a bit dense, but that's because we have to figure out _what_ the sync event is, then we have to figure out if any clients are not on the same event. Note we will send out the expected next random value for the server, so the client may check and see if they are actually on the correct value. If the client is off, it is up to them to report the discrepancy back to the server and try to negotiate the error with us. Otherwise, their orders will be run with respect to OUR map, and they will probably be very unhappy... This returns true if a sync occurred (all clients were ready) and false if we are still waiting on a client to sync with us. */ sc_packet packet; /* New outgoing packet data */ dword *p; /* Random pointer into data */ dword type = 0; /* Sync event type - 0 == don't know */ int rnd = 0; /* Next random value or bogus == wrong event */ int i; /* Iterate through client connections */ for(i = 0; i < srv->connections; ++i) { /* Make sure every client is ready to sync */ if(!SC_CONN_IS_SYNC(srv->clients[i])) return(false); /* If server, we can find out what the sync type is */ if((SC_CONN_GET_ARG(srv->clients[i]) & SC_CONN_SYNC_SERV) != 0) { /* The server knows what type of event we're syncing */ type = SC_CONN_GET_ARG(srv->clients[i]) & (~SC_CONN_SYNC_SERV); } } for(i = 0; i < srv->connections; ++i) { /* Sanity check to make sure everyone is syncing to the same event */ rnd = game_rand_peek(); if((SC_CONN_GET_ARG(srv->clients[i]) & (~SC_CONN_SYNC_SERV)) != type) { /* This client is not syncing to the right event. We send back an invalid random value so the client will report ``random values out of alignment'' and hopefully call back to us to try to straighten things out. This is a hack of sorts, we'll handle this more gracefully later. */ sc_net_set_error("svr_relay_orders", "Player was waiting for invalid sync"); rnd = -1; } /* Prepare a packet to send out to the client */ if(sc_net_packet_init(&packet, SC_NET_SVR_SYNC_RESP, 2 * sizeof(dword))) { p = (dword *)packet.data; *p++ = htonl(type); *p++ = htonl(rnd); sc_net_send_packet_now(&srv->clients[i], &packet); SC_CONN_CLEAR_FLAGS(srv->clients[i], SC_CONN_WAIT_SYNC); sc_net_packet_release(&packet); } } /* IF we made it here, then something went right... */ sc_net_set_info("svr_sync_all", "All clients sync; advancing state"); return(true); } static bool _sc_net_relay_orders(const sc_config *c, sc_server *srv, const sc_packet *incoming, int connid) { /* _sc_net_relay_orders Push orders from one player to all the other players. */ const sc_player *pl; sdword playerid; dword turret; dword power; dword weapon; dword shield; dword x; dword y; sc_packet packet; dword *p; int size; int i; if(!sc_net_check_size(incoming, 7 * sizeof(dword), "relay_orders")) return(false); p = (dword *)incoming->data; playerid = ntohl(*p++); turret = ntohl(*p++); power = ntohl(*p++); weapon = ntohl(*p++); shield = ntohl(*p++); x = ntohl(*p++); y = ntohl(*p++); if(playerid < 0 || playerid >= c->numplayers) { sc_net_set_error("svr_relay_orders", "PlayerID received was invalid"); return(false); } size = (1 + 7 * c->numplayers) * sizeof(dword); if(!sc_net_packet_init(&packet, SC_NET_SVR_ORDERS, size)) return(false); p = (dword *)packet.data; *p++ = htonl(c->numplayers); for(i = 0; i < c->numplayers; ++i) { *p++ = htonl(i); if(i == playerid) { *p++ = htonl(turret); *p++ = htonl(power); *p++ = htonl(weapon); *p++ = htonl(shield); *p++ = htonl(x); *p++ = htonl(y); } else { pl = c->players[i]; *p++ = htonl(pl->turret); *p++ = htonl(pl->power); *p++ = htonl(pl->selweapon->ident); *p++ = htonl(pl->selshield->ident); *p++ = htonl(pl->x); *p++ = htonl(pl->y); } } for(i = 0; i < srv->connections; ++i) { if(i != connid && !SC_CONN_IS_DEAD(srv->clients[i])) { sc_net_send_packet_now(&srv->clients[i], &packet); } } sc_net_packet_release(&packet); return(true); } static void _sc_net_process_message(sc_config *c, sc_server *srv, sc_packet *incoming, int connid) { sc_connection *client = &srv->clients[connid]; int i; switch(incoming->msg_type) { case SC_NET_CLI_DISCONNECT: SC_CONN_SET_FLAGS(*client, SC_CONN_QUIT); sc_net_set_info("process_message", "server: client has disconnected"); break; case SC_NET_CLI_PLAYER_NAME: memcpy(c->players[connid]->name, incoming->data, SC_PLAYER_NAME_LENGTH); sc_net_set_info("process_message", "server: client gave us their name"); sc_net_svr_send_config(c, srv); break; case SC_NET_CLI_SYNC_RQST: SC_CONN_SET_FLAGS(*client, SC_CONN_WAIT_SYNC); SC_CONN_SET_ARG(*client, ntohl(*(dword *)incoming->data)); _sc_net_sync_all(srv); break; case SC_NET_CHAT: case SC_NET_SHIELDS: case SC_NET_BATTERY: case SC_NET_PLFLAGS: case SC_NET_INVENTORY: case SC_NET_PLAYER_STATE: /* Items that get relayed to the clients by the server. */ for(i = 0; i < srv->connections; ++i) { if(i != connid && !SC_CONN_IS_DEAD(srv->clients[i])) { sc_net_send_packet_now(&srv->clients[i], incoming); } } break; case SC_NET_CLIENT_STATUS: sc_net_server_relay_status(srv, incoming, connid); break; case SC_NET_CLI_ORDERS: _sc_net_relay_orders(c, srv, incoming, connid); break; default: sc_net_set_error("process_message", "invalid packet type received by server"); break; } } static void _sc_net_connect_request(sc_config *c, sc_server *srv, const sc_packet *incoming, int connid) { char versionstr[SC_NET_BUFFER_SIZE]; char infomsg[SC_NET_BUFFER_SIZE]; sc_connection *client; sc_packet reply; dword version; client = &srv->clients[connid]; /* Make sure this actually looks like a connect request */ if(incoming->msg_type != SC_NET_CLI_CONNECT) { sc_net_set_error("connect_request", "Incoming packet from unknown source, not a connect request"); return; } /* From this point, we assume a connection from an xscorch client. Any failures from this point should be sent to them. */ /* Check the version number data (should be in flags) */ version = ntohl(*(dword *)incoming->data); if(version < SC_NET_MIN_VERSION) { sc_net_send_message(client, SC_NET_SVR_REJECTED, "Client version is too old"); sc_net_set_error("connect_request", "Incoming packet had protocol version that was too ancient"); return; } if(version > SC_NET_VERSION) { sc_net_send_message(client, SC_NET_SVR_REJECTED, "Client version is too new"); sc_net_set_error("connect_request", "Incoming packet had protocol version that was too recent"); return; } /* notify client they are on */ sc_net_version_info(versionstr, sizeof(versionstr)); if(!sc_net_packet_init(&reply, SC_NET_SVR_ACCEPTED, strlenn(versionstr) + sizeof(dword))) return; *(dword *)reply.data = htonl(SC_NET_VERSION); memcpy(reply.data + sizeof(dword), versionstr, strlenn(versionstr)); sc_net_send_packet_now(client, &reply); /* Informative */ memcpy(versionstr, incoming->data + sizeof(dword), incoming->data_size - sizeof(dword)); versionstr[incoming->data_size - sizeof(dword)] = '\0'; sbprintf(infomsg, sizeof(infomsg), "Client accepted, version \"%s\"", versionstr); sc_net_set_info("connect_request", infomsg); /* Send the game configuration */ sc_net_svr_send_config(c, srv); /* Update server setup */ sc_net_packet_release(&reply); SC_CONN_CLEAR_FLAGS(*client, SC_CONN_NEED_ACCEPT); } bool sc_net_server_handle_packet(sc_config *c, void *parm, sc_packet *p) { sc_server *srv = (sc_server *)parm; int connid = srv->current; /* Check if this player is officially connected? */ if(srv->clients[connid].flags & SC_CONN_NEED_ACCEPT) { /* This is hopefully a connection request/new player */ _sc_net_connect_request(c, srv, p, connid); } else { /* This is an existing connection, process as event */ _sc_net_process_message(c, srv, p, connid); } /* New player? */ return(true); } static void _sc_net_incoming_connect(sc_config *c, sc_server *srv, int socket, const addr *fromaddr, int fromaddrsize) { sc_connection *client; sc_player *p; /* Make sure socket is nonblocking */ sc_net_set_nonblocking(socket); /* Check that we have space to accept this connection into */ if(srv->connections >= SC_MAX_PLAYERS) { sc_net_shutdown(&socket); sc_net_set_error("connect_request", "Incoming connection rejected because server is full"); return; } /* Check that a game is not in progress */ if((c->game->state & SC_STATE_OPTIONS_FLAG) == 0) { sc_net_shutdown(&socket); sc_net_set_error("connect_request", "Incoming connection rejected because game is already running"); return; } /* Register the connection with the TCP NET packet engine. */ if(!tn_instantiate(&srv->clients[srv->connections].connection, socket)) { sc_net_shutdown(&socket); sc_net_set_error("connect_request", "Unable to register socket with packet engine"); return; } /* Below we set up the connection so we can recieve a configuration packet from the client. */ /* Add this player to the list of active players */ client = &srv->clients[srv->connections++]; client->socket = socket; memcpy(&client->address, fromaddr, fromaddrsize); client->flags = SC_CONN_SVR_IFLAGS; /* Setup player data */ p = c->players[c->numplayers]; sbprintf(p->name, sizeof(p->name), "Network Player %d", c->numplayers); p->aitype = SC_AI_NETWORK; p->tank = sc_tank_profile_lookup(c->tanks, 0); ++c->numplayers; } bool sc_net_server_run(sc_config *c, sc_server *srv) { sc_connection *client; addr address; socklen_t addrsize; int connid; int socket; bool tryagain; /* Sanity checks */ if(c == NULL || srv == NULL) return(false); /* Look for new incoming connections */ do { addrsize = sizeof(addr); socket = accept(srv->linein, (struct sockaddr *)&address, &addrsize); if(socket != -1) _sc_net_incoming_connect(c, srv, socket, &address, addrsize); } while(socket != -1); /* Check for incoming packets from existing clients */ for(connid = 0; connid < srv->connections; ++connid) { srv->current = connid; client = &srv->clients[connid]; tryagain = !SC_CONN_IS_DEAD(*client); while(tryagain) { tryagain = sc_net_recv_packet(client, c, (void *)srv, &sc_net_server_handle_packet); if(SC_CONN_IS_DEAD(*client)) tryagain = false; } } return(true); } xscorch-0.2.1/snet/snetstatus.c0000644000175000001440000001072311615366347013451 00000000000000/* $Header: /fridge/cvs/xscorch/snet/snetstatus.c,v 1.8 2011-08-01 00:01:43 jacob Exp $ */ /* xscorch - snetstatus.c Copyright(c) 2001-2003 Justin David Smith Copyright(c) 2001-2003 Jacob Luna Lundberg justins(at)chaos2.org http://chaos2.org/ jacob(at)gnifty.net http://www.gnifty.net/ Informational and status network messages. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include //#include #include #include #include #include #include #include #include #include #include #include #include bool sc_net_client_update_status(sc_client *cli) { /* sc_net_client_update_status Send current information about our connection to the server. */ sc_packet packet; dword *p; int size; /* Sanity checks */ if(cli == NULL) return(false); /* Initialise packet data */ size = 5 * sizeof(dword) + sizeof(addr); if(!sc_net_packet_init(&packet, SC_NET_CLIENT_STATUS, size)) return(false); p = (dword *)packet.data; /* Write the player ID and client flags */ *p++ = htonl(0); *p++ = htonl(cli->server.flags); *p++ = htonl(cli->server.syncarg); /* Zero the server data and address field */ memset(p, '\0', 2 * sizeof(dword) + sizeof(addr)); /* Attempt to send the packet */ sc_net_set_info("client_update_status", "updating the client status"); if(!sc_net_send_packet_now(&cli->server, &packet)) return(false); sc_net_packet_release(&packet); return(true); } bool sc_net_client_recv_status(const sc_config *c, sc_client *cli, sc_packet *packet) { /* sc_net_client_recv_status Update the client status data. */ sc_net_status *status; dword *p; int playerid; /* Check the packet size */ if(!sc_net_check_size( packet, 6 * sizeof(dword), "client_recv_status" )) return(false); /* Get the player ID */ p = (dword *)packet->data; playerid = ntohl(*p++); if(playerid < 0 || playerid >= c->numplayers) { sc_net_set_error("client_recv_status", "Invalid playerid received"); return(false); } status = &cli->status[playerid]; /* Load in the new data */ status->cli_flags = ntohl(*p++); status->cli_syncarg = ntohl(*p++); status->srv_flags = ntohl(*p++); status->srv_syncarg = ntohl(*p++); /* load in the player's address */ memcpy(&status->address, p, sizeof(addr)); /* Return with success */ sc_net_set_info("client_recv_status", "Received player status from server"); return(true); } bool sc_net_server_relay_status(sc_server *srv, sc_packet *incoming, int connid) { /* sc_net_server_relay_status Relay a status packet from a client to all players currently connected. */ sc_connection *conn; sc_packet packet; dword *p; int i; /* Fill in the blanks in this data structure */ p = (dword *)incoming->data; conn = &srv->clients[connid]; *p++ = htonl(connid); p += 2; *p++ = htonl(conn->flags); *p++ = htonl(conn->syncarg); /* Fill in the client address */ memcpy(p, &conn->address, sizeof(addr)); /* Relay the modified packet to all connected clients */ for(i = 0; i < srv->connections; ++i) { if(!SC_CONN_IS_DEAD(srv->clients[i])) { memcpy(&packet, incoming, sizeof(sc_packet)); sc_net_send_packet_now(&srv->clients[i], &packet); } } /* Return success */ return(true); } void sc_net_status_init(sc_client *cli) { /* sc_net_status_init Initialise the connection status structures. */ memset(cli->status, '\0', sizeof(cli->status)); } xscorch-0.2.1/snet/tcpnet/0000755000175000001440000000000011615372007012430 500000000000000xscorch-0.2.1/snet/tcpnet/Makefile.am0000644000175000001440000000077607327727334014432 00000000000000## $Header: /fridge/cvs/xscorch/snet/tcpnet/Makefile.am,v 1.1 2001/07/26 05:47:08 jacob Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for tcp net. # if NETWORK noinst_LIBRARIES = libtcpnet.a endif # AI code # libtcpnet_a_SOURCES =\ tcpnet.h \ tn_internal.c \ tn_internal.h \ tn_read.c \ tn_setup.c \ tn_write.c INCLUDES = xscorch-0.2.1/snet/tcpnet/Makefile.in0000644000175000001440000003715711615371716014440 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = snet/tcpnet DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libtcpnet_a_AR = $(AR) $(ARFLAGS) libtcpnet_a_LIBADD = am_libtcpnet_a_OBJECTS = tn_internal.$(OBJEXT) tn_read.$(OBJEXT) \ tn_setup.$(OBJEXT) tn_write.$(OBJEXT) libtcpnet_a_OBJECTS = $(am_libtcpnet_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libtcpnet_a_SOURCES) DIST_SOURCES = $(libtcpnet_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for tcp net. # @NETWORK_TRUE@noinst_LIBRARIES = libtcpnet.a # AI code # libtcpnet_a_SOURCES = \ tcpnet.h \ tn_internal.c \ tn_internal.h \ tn_read.c \ tn_setup.c \ tn_write.c INCLUDES = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu snet/tcpnet/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu snet/tcpnet/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libtcpnet.a: $(libtcpnet_a_OBJECTS) $(libtcpnet_a_DEPENDENCIES) -rm -f libtcpnet.a $(libtcpnet_a_AR) libtcpnet.a $(libtcpnet_a_OBJECTS) $(libtcpnet_a_LIBADD) $(RANLIB) libtcpnet.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tn_internal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tn_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tn_setup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tn_write.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/snet/tcpnet/tcpnet.h0000644000175000001440000001046011615366347014031 00000000000000/* $Header: /fridge/cvs/xscorch/snet/tcpnet/tcpnet.h,v 1.8 2011-08-01 00:01:43 jacob Exp $ * * tcpnet.h * File revision 3.xscorch * Externally available declarations for tcp net. * (c) 2001-2003 Jacob Lundberg, jacob(at)gnifty.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* * 2001.07.14 initial revision * 2001.07.24 changed pointless void** * 2001.07.25 added tn_error_string * added GPL notice * 2003.02.24 signedness junk for C99 * 2003.02.24 branch for xscorch */ #ifndef __TCPNET_H__ #define __TCPNET_H__ /* * Acquire local definitions. * When using tcp net in an integrated package, replace this * with a header generated by configure so these values are * correct for the local system (and thus portable). */ /* #include "tn_local.h" */ #define MSG_FLAGS 0 #include /* Forward declaration for struct timeval. */ struct timeval; /* Connection state flags. */ #define TN_STATE_DEFAULT 0x00000000 /* Default state. */ #define TN_STATE_CONNECTED 0x00000001 /* Connection has been made. */ #define TN_STATE_ERROR 0xff000000 /* Connection error flags. */ #define TN_STATE_ERR_CONNLOST 0x01000000 /* Connection has been lost. */ #define TN_STATE_ERR_MALLOC 0x02000000 /* Malloc failure! */ #define TN_STATE_ERR_MISALIGN 0x04000000 /* Packet misalignment. */ #define TN_STATE_ERR_MISORDER 0x08000000 /* Packet out of order. */ #define TN_STATE_ERR_SELECT 0x10000000 /* Something wrong in select. */ #define TN_STATE_ERR_UNKNOWN 0x80000000 /* Something undexpected happened. */ /* Connection state information. */ #define TN_CONNECTION_IS_UP(tnc) (((tnc)->state & TN_STATE_CONNECTED) && \ !((tnc)->state & TN_STATE_ERR_CONNLOST) && \ ((tnc)->socket >= 0)) #define TN_STATE_IS_ERROR(tnc) ((tnc)->state & TN_STATE_ERROR) /* The definition of a packet. */ #define TN_HEADER_SIZE (3 * sizeof(dword)) typedef struct _tn_packet { dword bop; /* Packet divider / marker. */ dword size; /* The size of the data payload. */ dword id; /* The packet's reference ID. */ byte *payload; /* The packet's data payload. */ } tn_packet; /* Lists of packets. */ typedef struct _tn_packet_list { struct _tn_packet_list *next;/* The next packet in the list. */ tn_packet *packet; /* The packet in question. */ size_t size; /* The amount of data written to the packet. */ bool complete; /* Is the packet completed? */ } tn_packet_list; /* The basic IO struct for tcp net. */ typedef struct _tn_connection { int state; /* The connection status. */ int socket; /* The socket we're connecting on. */ dword inc_id; /* The last incoming packet ID queued. */ dword out_id; /* The last outgoing packet ID queued. */ tn_packet_list *incoming; /* The incoming packet chain. */ tn_packet_list *outgoing; /* The outgoing packet chain. */ } tn_connection; /* Exported control functions (tn_setup.c). */ bool tn_instantiate(tn_connection **tnc, int socket); bool tn_terminate(tn_connection **tnc); const char *tn_error_string(tn_connection *tnc); /* Exported read functions (tn_read.c). */ bool tn_scan_read(tn_connection *tnc, struct timeval *timeout); bool tn_read(tn_connection *tnc, byte **payload, size_t *size); /* Exported write functions (tn_write.c). */ bool tn_write_flush(tn_connection *tnc); bool tn_write(tn_connection *tnc, const byte *payload, size_t size); #endif /* ndef __TCPNET_H__ */ xscorch-0.2.1/snet/tcpnet/tn_internal.c0000644000175000001440000001366711615366350015052 00000000000000/* $Header: /fridge/cvs/xscorch/snet/tcpnet/tn_internal.c,v 1.8 2011-08-01 00:01:44 jacob Exp $ * * tn_internal.c * File revision 6.xscorch * Internal methods for tcp net. * (c) 2001-2003 Jacob Lundberg, jacob(at)gnifty.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* * 2001.07.15 initial revision * 2001.07.25 removing void crap * made packet_new allocate buffer * added GPL notice * 2001.07.27 int -> size_t, darnit * 2001.08.15 close packet magic security hole * size_t -> int, we need negative len in buffer_copy * 2002.05.20 make MSG flags portable * 2003.02.24 size_t -> int, for C99 * 2003.02.24 branch for xscorch */ #include "tn_internal.h" #include bool tn_buffer_copy(byte *dst, byte **src, size_t *cur, int *avl, int len) { /* * tn_buffer_copy * Copy src to dst until cur becomes len unless not enough avl. * This has side-effects of increasing src and cur and decreasing avl. */ bool ret = true; int toc = len; /* Although an int, *avl is required to be >= 0. */ assert(*avl >= 0); /* Zero-copy always succeeds. */ if(len <= 0) return(true); /* Check if we can fill the request. */ if(toc > (*avl)) { toc = (*avl); ret = false; } /* Don't try copies on too little src. */ if(toc <= 0) return(false); /* Perform the copy. */ memcpy(dst, (*src), toc); /* Perform side-effects. */ (*src) += toc; (*cur) += toc; (*avl) -= toc; /* Return true if we fully filled the request. */ return(ret); } bool tn_send_buffer(tn_connection *tnc, const byte *buffer, size_t size) { /* * tn_send_buffer * Transmist a buffer with fully blocking IO. */ int sent; while(size) { errno = 0; sent = send(tnc->socket, buffer, size, MSG_FLAGS); if(sent < 0) { switch(errno) { case EAGAIN: /* Wait a bit before we loop. */ usleep(TN_BLOCKING_TIMEOUT); case EINTR: /* Loop around again and try once more. */ break; case ENOBUFS: case ENOMEM: /* Set error to OOM. */ tn_set_state(tnc, TN_STATE_ERR_MALLOC); return(false); case EPIPE: /* Connection state entered shutdown. */ tn_set_state(tnc, TN_STATE_ERR_CONNLOST); return(false); case 0: default: /* Dunno what's wrong. */ tn_set_state(tnc, TN_STATE_ERR_UNKNOWN); return(false); } } else { /* Partial or full transmission. */ size -= sent; buffer += sent; } } return(true); } tn_packet *tn_packet_new(void) { /* * tn_packet_new * Create and default a new packet. */ tn_packet *packet; /* Return NULL if we can't alloc the thing. */ packet = (tn_packet *)malloc(sizeof(tn_packet)); if(packet == NULL) return(NULL); /* Allocate the default buffer chunk. */ packet->payload = (byte *)malloc(TN_BUFFER_SIZE * sizeof(byte)); if(packet->payload == NULL) { free(packet); return(NULL); } memset(packet->payload, 0, TN_BUFFER_SIZE); /* Set defaults. */ packet->bop = TN_ALIGN_MUGGLE; packet->size = 0; packet->id = 0; return(packet); } tn_packet_list *tn_packet_list_new(void) { /* * tn_packet_list_new * Create a new packet list item. */ tn_packet_list *item; /* Allocate memory, failure return NULL. */ item = (tn_packet_list *)malloc(sizeof(tn_packet_list)); if(item == NULL) return(NULL); /* Tack a packet onto the item. */ item->packet = tn_packet_new(); if(item->packet == NULL) { free(item); return(NULL); } /* Set defaults on the item. */ item->next = NULL; item->size = 0; item->complete = false; return(item); } tn_connection *tn_connection_new(void) { /* * tn_connection_new * Create a new connection descriptor. */ tn_connection *tnc; /* Try to snag some mem. */ tnc = (tn_connection *)malloc(sizeof(tn_connection)); if(tnc == NULL) return(NULL); /* Set up defaults. */ tnc->state = TN_STATE_DEFAULT; tnc->socket = -1; tnc->inc_id = 0; tnc->out_id = 0; tnc->incoming = NULL; tnc->outgoing = NULL; return(tnc); } void tn_packet_free(tn_packet **packet) { /* * tn_packet_free * Free a packet. */ if(packet != NULL && (*packet) != NULL) { free((*packet)->payload); free(*packet); (*packet) = NULL; } } void tn_packet_list_free(tn_packet_list **item) { /* * tn_packet_list_free * Free a packet list item. */ if(item != NULL && (*item) != NULL) { tn_packet_free(&((*item)->packet)); free(*item); (*item) = NULL; } } void _tn_packet_chain_free(tn_packet_list **list) { /* * _tn_packet_chain_free * Free a chain of packet list items. */ tn_packet_list *item; if(list == NULL) return; while((*list) != NULL) { item = (*list); (*list) = item->next; tn_packet_list_free(&item); } } void tn_connection_free(tn_connection **tnc) { /* * tn_connection_free * Free a connection struct. */ if(tnc != NULL && (*tnc) != NULL) { _tn_packet_chain_free(&((*tnc)->incoming)); _tn_packet_chain_free(&((*tnc)->outgoing)); free(*tnc); (*tnc) = NULL; } } xscorch-0.2.1/snet/tcpnet/tn_internal.h0000644000175000001440000000567111615366350015053 00000000000000/* $Header: /fridge/cvs/xscorch/snet/tcpnet/tn_internal.h,v 1.6 2011-08-01 00:01:44 jacob Exp $ * * tn_internal.h * File revision 3.xscorch * Internally available declarations for tcp net. * (c) 2001-2003 Jacob Lundberg, jacob(at)gnifty.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* * 2001.07.15 initial revision * 2001.07.25 removing void * added GPL notice * 2001.08.15 security cookie * buffer_copy len must be int * 2003.02.24 define _BSD_SOURCE * allow assert() * larger buffers * size_t -> int, for C99 * 2003.02.24 branch for xscorch */ #ifndef __TN_INTERNAL_H__ #define __TN_INTERNAL_H__ /* Needed for usleep */ #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif /* Need the public declarations and common headers. */ #include #include #include #include #include #include #include #include #include "tcpnet.h" /* Constants. */ #define TN_ALIGN_MAGIC 0x5AD1571C /* Packet alignment cookie. */ #define TN_ALIGN_MUGGLE 0x8057bde1 /* Packet initialization cookie. */ #define TN_BUFFER_SIZE 0x00000400 /* Working buffer size. */ #define TN_BLOCKING_TIMEOUT 1000 /* Timeout in microseconds. */ #define TN_LEN_RETAIN_OLD 16 /* How many old packets to keep. */ #define TN_PROTOCOL_TCP 0 /* The socket() id for TCP. */ /* Functions implemented inline. */ inline static void tn_set_state(tn_connection *tnc, int state) { /* * tn_set_state * Add flags to the connection state. */ tnc->state |= state; } inline static void tn_clr_state(tn_connection *tnc, int state) { /* * tn_clr_state * Remove flags from the connection state. */ tnc->state &= ~state; } /* Various supporting functions. */ bool tn_buffer_copy(byte *dst, byte **src, size_t *cur, int *avl, int len); bool tn_send_buffer(tn_connection *tnc, const byte *buffer, size_t size); /* Constructors. */ tn_packet *tn_packet_new(void); tn_packet_list *tn_packet_list_new(void); tn_connection *tn_connection_new(void); /* Destructors. */ void tn_packet_free(tn_packet **packet); void tn_packet_list_free(tn_packet_list **item); void tn_connection_free(tn_connection **tnc); #endif /* ndef __TN_INTERNAL_H__ */ xscorch-0.2.1/snet/tcpnet/tn_read.c0000644000175000001440000001646511615366350014150 00000000000000/* $Header: /fridge/cvs/xscorch/snet/tcpnet/tn_read.c,v 1.7 2011-08-01 00:01:44 jacob Exp $ * * tn_read.c * File revision 4.xscorch * Packet reading via tcp net. * (c) 2002,2001 Jacob Lundberg, jacob(at)gnifty.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* * 2001.07.14 initial revision * 2001.07.25 removing void * fixed static buffer evilness * added GPL notice * 2001.07.26 formatting changes * fixed bad NULL check * 2001.08.15 slight optimization * protect the BOP from meanies * 2002.05.20 make MSG flags portable * 2002.05.20 branch for xscorch */ #include "tn_internal.h" bool _tn_read_select(tn_connection *tnc, struct timeval *timeout) { /* * tn_read_select * Scan the connection buffer to see if data is waiting. * Returns true if there is any data waiting to be read. * Waits for timeout if one is given. */ fd_set fds; struct timeval maxwait; /* Perpare the descriptor. */ FD_ZERO(&fds); FD_SET(tnc->socket, &fds); /* Set the maximum wait time. */ maxwait.tv_sec = timeout ? timeout->tv_sec : 0; maxwait.tv_usec = timeout ? timeout->tv_usec : 0; /* Find out if there is data to read. */ switch(select(tnc->socket + 1, &fds, NULL, NULL, &maxwait)) { case 1: /* Data is available to read. */ return(true); case 0: /* There was no data to read. */ return(false); case -1: /* There was an error. */ tn_set_state(tnc, TN_STATE_ERR_SELECT); return(false); default: /* Wrong number of selectors modified ... uhh, lol. */ tn_set_state(tnc, TN_STATE_ERR_UNKNOWN); return(false); } } bool tn_scan_read(tn_connection *tnc, struct timeval *timeout) { /* * tn_scan_read * Scan the connection buffer and read in new packets. * Returns true if there are any packets awaiting a read. * Waits for timeout if one is given. */ bool ret; int length; tn_packet_list *pl; byte buffer[TN_BUFFER_SIZE]; byte *bufptr; /* Make sure the connection is up. */ if(tnc == NULL || !TN_CONNECTION_IS_UP(tnc)) return(false); /* Check for data. */ if(!_tn_read_select(tnc, timeout)) return(false); /* Set up the working pointer. */ pl = tnc->incoming; /* There may be no packets at all... */ if(pl == NULL) { pl = tn_packet_list_new(); if(pl == NULL) { tn_set_state(tnc, TN_STATE_ERR_MALLOC); return(false); } tnc->incoming = pl; } /* Find the last packet in the read chain. */ while(pl->next != NULL) pl = pl->next; /* Read the data. */ errno = 0; ret = false; while((length = recv(tnc->socket, buffer, TN_BUFFER_SIZE, MSG_FLAGS))) { /* Check for errors. */ if(length < 0) { switch(errno) { case ENOTCONN: case ENOTSOCK: /* Connection is down. */ tn_set_state(tnc, TN_STATE_ERR_CONNLOST); return(false); case EAGAIN: /* We've seen all there is to see here today. */ return(ret); case EINTR: /* Wait and pick up the rest on the next call. */ return(false); case 0: default: /* Unknown error, whee! */ tn_set_state(tnc, TN_STATE_ERR_UNKNOWN); return(false); } } /* Iterate on new packets until we run out of data. */ bufptr = buffer; while(length) { /* Allocate a new packet, if needed. */ if(pl->complete) { pl->next = tn_packet_list_new(); if(pl->next == NULL) { tn_set_state(tnc, TN_STATE_ERR_MALLOC); return(false); } pl = pl->next; } /* Complete the header. */ if(tn_buffer_copy((pl->packet->payload + pl->size), &(bufptr), &(pl->size), &(length), TN_HEADER_SIZE - pl->size)) { /* Perform tasks that happen once per packet. */ if(pl->packet->bop == TN_ALIGN_MUGGLE) { /* Read the packet control data with proper byte ordering. */ pl->packet->bop = ntohl(((dword *)pl->packet->payload)[0]); pl->packet->size = ntohl(((dword *)pl->packet->payload)[1]); pl->packet->id = ntohl(((dword *)pl->packet->payload)[2]); /* Security measure. Avoid people spoofing incomplete packets. */ if(pl->packet->bop == TN_ALIGN_MUGGLE) pl->packet->bop = 0; /* Allocate space for the payload if necessary. */ if(pl->packet->size > TN_BUFFER_SIZE) { pl->packet->payload = (byte *)realloc(pl->packet->payload, pl->packet->size * sizeof(byte)); if(pl->packet->payload == NULL) { tn_set_state(tnc, TN_STATE_ERR_MALLOC); return(false); } } } /* Test for packet compliance via alignment. */ if(pl->packet->bop != TN_ALIGN_MAGIC) { tn_set_state(tnc, TN_STATE_ERR_MISALIGN); return(false); } /* Test for packet compliance via ordering. */ if(pl->packet->id != tnc->inc_id + 1) { tn_set_state(tnc, TN_STATE_ERR_MISORDER); return(false); } /* Complete the payload. */ if(tn_buffer_copy((pl->packet->payload + pl->size - TN_HEADER_SIZE), &(bufptr), &(pl->size), &(length), pl->packet->size - pl->size + TN_HEADER_SIZE)) { pl->complete = true; ++(tnc->inc_id); ret = true; } } } errno = 0; } return(ret); } bool tn_read(tn_connection *tnc, byte **payload, size_t *size) { /* * tn_read * Read a packet payload into a newly created buffer. * Upon returning, size will be the length of the payload. */ tn_packet_list *pl; /* Basic requirements. */ if(payload == NULL || size == NULL) return(false); /* If the packet exists and is a completed packet: */ if(tnc != NULL && tnc->incoming != NULL && tnc->incoming->complete) { /* Drop it off the incoming packet chain. */ pl = tnc->incoming; tnc->incoming = tnc->incoming->next; /* Extract the packet payload. */ (*payload) = pl->packet->payload; (*size) = pl->packet->size; /* Destroy the packet list item. */ pl->packet->payload = NULL; tn_packet_list_free(&pl); return(true); } else { /* No packets were available. */ (*payload) = NULL; (*size) = 0; return(false); } } xscorch-0.2.1/snet/tcpnet/tn_setup.c0000644000175000001440000000710611615366350014365 00000000000000/* $Header: /fridge/cvs/xscorch/snet/tcpnet/tn_setup.c,v 1.4 2011-08-01 00:01:44 jacob Exp $ * * tn_setup.c * File revision 3.xscorch * Setup and termination functions for tcp net. * (c) 2002,2001 Jacob Lundberg, jacob(at)gnifty.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* * 2001.07.15 initial revision * 2001.07.25 clean up shutdown more * added tn_error_string * added GPL notice * 2002.05.20 cosmetic change * 2002.05.20 branch for xscorch */ #include "tn_internal.h" bool tn_instantiate(tn_connection **tnc, int socket) { /* * tn_initiate * Create a new connection struct. * Will overwrite *tnc so don't pass it something precious! */ /* Only operate on an extant pointer. */ if(tnc == NULL) return(false); /* Allocate the new connection struct. */ (*tnc) = tn_connection_new(); if((*tnc) == NULL) return(false); (*tnc)->socket = socket; tn_set_state((*tnc), TN_STATE_CONNECTED); return(true); } bool tn_terminate(tn_connection **tnc) { /* * tn_terminate * Close out a connection and free up its structs. */ if(tnc == NULL || (*tnc) == NULL) return(true); /* Try and make sure the packet queues are flushed. */ if(!TN_STATE_IS_ERROR(*tnc)) { tn_write_flush(*tnc); tn_scan_read(*tnc, NULL); } /* Shut the socket down. */ if((*tnc)->state & TN_STATE_CONNECTED && (*tnc)->socket >= 0) { shutdown((*tnc)->socket, 2); close((*tnc)->socket); (*tnc)->socket = -1; } /* Free the structs. */ tn_connection_free(tnc); return(true); } const char *tn_error_string(tn_connection *tnc) { /* * tn_error_string * Generate a string describing the connection state. */ int state; const char *ret; static const char *strings[11] = { /* Single-bit errors. */ "Uninitialized", "Connected, no error", "Connection lost", "Malloc failed", "Packet misalignment detected", "Packet received out of order", "Select failed", "Unknown error", /* Other. */ "Multiple errors detected", "Invalid argument to tn_error_string", NULL }; /* Early return. */ if(tnc == NULL) return(strings[9]); state = tnc->state; /* Figure out what's up and tell the user. */ switch(state) { case TN_STATE_DEFAULT: ret = strings[0]; break; case TN_STATE_CONNECTED: ret = strings[1]; break; case TN_STATE_ERR_CONNLOST: ret = strings[2]; break; case TN_STATE_ERR_MALLOC: ret = strings[3]; break; case TN_STATE_ERR_MISALIGN: ret = strings[4]; break; case TN_STATE_ERR_MISORDER: ret = strings[5]; break; case TN_STATE_ERR_SELECT: ret = strings[6]; break; case TN_STATE_ERR_UNKNOWN: ret = strings[7]; break; default: ret = strings[8]; break; } return(ret); } xscorch-0.2.1/snet/tcpnet/tn_write.c0000644000175000001440000001104111615366350014350 00000000000000/* $Header: /fridge/cvs/xscorch/snet/tcpnet/tn_write.c,v 1.4 2011-08-01 00:01:44 jacob Exp $ * * tn_write.c * File revision 2.xscorch * Packet writing via tcp net. * (c) 2001 Jacob Lundberg, jacob(at)gnifty.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* * 2001.07.15 initial revision * 2001.07.25 removing void * added GPL notice * 2001.07.26 fixed slight counting error * slight flushing optimization * 2001.07.26 branch for xscorch */ #include #include "tn_internal.h" bool _tn_write_select(tn_connection *tnc) { /* * tn_write_select * Scan the connection buffer to see if there are errors. * Returns true if there are no errors (it's safe to try and send). */ fd_set fds; struct timeval maxwait; /* Perpare the descriptor. */ FD_ZERO(&fds); FD_SET(tnc->socket, &fds); /* Set the wait time to 0. */ maxwait.tv_sec = 0; maxwait.tv_usec = 0; /* Find out if there are errors. */ switch(select(tnc->socket + 1, NULL, &fds, NULL, &maxwait)) { case 1: case 0: /* There are no errors. */ return(true); case -1: /* There was an error. */ tn_set_state(tnc, TN_STATE_ERR_SELECT); return(false); default: /* Wrong number of selectors modified ... uhh, lol. */ tn_set_state(tnc, TN_STATE_ERR_UNKNOWN); return(false); } } bool tn_write_flush(tn_connection *tnc) { /* * tn_write_flush * Flush the transmit buffer. * Returns true if the buffer is now empty. */ tn_packet_list *pl; byte header[TN_HEADER_SIZE]; /* Make sure the connection is up. */ if(tnc == NULL || !TN_CONNECTION_IS_UP(tnc)) return(false); /* Check for socket errors. */ if(!_tn_write_select(tnc)) return(false); /* Get the top unwritten packet in the write chain. */ pl = tnc->outgoing; while(pl != NULL && pl->complete) pl = pl->next; /* Send any unsent packets on the queue. */ while(pl != NULL) { /* Send the header. */ ((dword *)header)[0] = htonl(pl->packet->bop); ((dword *)header)[1] = htonl(pl->packet->size); ((dword *)header)[2] = htonl(pl->packet->id); if(!tn_send_buffer(tnc, header, TN_HEADER_SIZE)) return(false); /* Send the payload. */ if(!tn_send_buffer(tnc, pl->packet->payload, pl->packet->size)) return(false); /* Advance the packet pointer. */ pl->complete = true; pl = pl->next; } return(true); } bool tn_write(tn_connection *tnc, const byte *payload, size_t size) { /* * tn_write * Write a packet onto the outgoing chain. */ int counter = 0; tn_packet_list *pl; if(tnc == NULL || payload == NULL || size <= 0) return(false); /* Tack the packet onto the chain. */ if(tnc->outgoing == NULL) { /* Starting a new chain. */ tnc->outgoing = tn_packet_list_new(); pl = tnc->outgoing; } else { /* Tack onto a chain. */ pl = tnc->outgoing; while(pl->next != NULL) { if(pl->complete) ++counter; pl = pl->next; } pl->next = tn_packet_list_new(); if(pl->complete) ++counter; pl = pl->next; } /* Make sure the packet list allocation succeeded. */ if(pl == NULL) { tn_set_state(tnc, TN_STATE_ERR_MALLOC); return(false); } /* Allocate the packet data payload. */ pl->packet->payload = (byte *)malloc(size); if(pl->packet->payload == NULL) { tn_packet_list_free(&pl); tn_set_state(tnc, TN_STATE_ERR_MALLOC); return(false); } /* Set up the new outgoing packet. */ memcpy(pl->packet->payload, payload, size); pl->packet->bop = TN_ALIGN_MAGIC; pl->packet->id = ++(tnc->out_id); pl->packet->size = size; /* Drop expired packets. */ pl = tnc->outgoing; while(--counter >= TN_LEN_RETAIN_OLD) { tnc->outgoing = pl->next; tn_packet_list_free(&pl); pl = tnc->outgoing; } return(true); } xscorch-0.2.1/ssound/0000755000175000001440000000000011615372007011475 500000000000000xscorch-0.2.1/ssound/Makefile.am0000644000175000001440000000116107624026733013457 00000000000000## $Header: /fridge/cvs/xscorch/ssound/Makefile.am,v 1.5 2003/02/17 00:15:35 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for sound code # if MIKMOD SOUND_LIBS = libscorch_sound.a else SOUND_LIBS = endif noinst_LIBRARIES = libscorch_sound_null.a $(SOUND_LIBS) # sound code # libscorch_sound_a_SOURCES =\ ssound.c \ ssound.h libscorch_sound_null_a_SOURCES =\ ssoundnull.c INCLUDES = $(LIBMIKMOD_CFLAGS) -I../sutil -I../libj xscorch-0.2.1/ssound/Makefile.in0000644000175000001440000004023011615371716013467 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = ssound DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_sound_a_AR = $(AR) $(ARFLAGS) libscorch_sound_a_LIBADD = am_libscorch_sound_a_OBJECTS = ssound.$(OBJEXT) libscorch_sound_a_OBJECTS = $(am_libscorch_sound_a_OBJECTS) libscorch_sound_null_a_AR = $(AR) $(ARFLAGS) libscorch_sound_null_a_LIBADD = am_libscorch_sound_null_a_OBJECTS = ssoundnull.$(OBJEXT) libscorch_sound_null_a_OBJECTS = $(am_libscorch_sound_null_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_sound_a_SOURCES) \ $(libscorch_sound_null_a_SOURCES) DIST_SOURCES = $(libscorch_sound_a_SOURCES) \ $(libscorch_sound_null_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig @MIKMOD_FALSE@SOUND_LIBS = # Convenience library for sound code # @MIKMOD_TRUE@SOUND_LIBS = libscorch_sound.a noinst_LIBRARIES = libscorch_sound_null.a $(SOUND_LIBS) # sound code # libscorch_sound_a_SOURCES = \ ssound.c \ ssound.h libscorch_sound_null_a_SOURCES = \ ssoundnull.c INCLUDES = $(LIBMIKMOD_CFLAGS) -I../sutil -I../libj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ssound/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu ssound/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_sound.a: $(libscorch_sound_a_OBJECTS) $(libscorch_sound_a_DEPENDENCIES) -rm -f libscorch_sound.a $(libscorch_sound_a_AR) libscorch_sound.a $(libscorch_sound_a_OBJECTS) $(libscorch_sound_a_LIBADD) $(RANLIB) libscorch_sound.a libscorch_sound_null.a: $(libscorch_sound_null_a_OBJECTS) $(libscorch_sound_null_a_DEPENDENCIES) -rm -f libscorch_sound_null.a $(libscorch_sound_null_a_AR) libscorch_sound_null.a $(libscorch_sound_null_a_OBJECTS) $(libscorch_sound_null_a_LIBADD) $(RANLIB) libscorch_sound_null.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssound.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssoundnull.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/ssound/ssound.c0000644000175000001440000001303111175116157013075 00000000000000/* $Header: /fridge/cvs/xscorch/ssound/ssound.c,v 1.9 2009-04-26 17:39:59 jacob Exp $ */ /* xscorch - ssound.c Copyright(c) 2000-2003 Justin David Smith justins(at)chaos2.org http://chaos2.org/ xscorch sound driver This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include /* List of song names */ static const char *_sc_sound_names[] = { "prelude.xm", "inventory.xm", "round.xm", "endround.xm", "endgame.xm", NULL }; static bool _sc_sound_try_load(sc_sound *s, sc_sound_music id) { /* sc_sound_try_load Attempt to load the song given by the ID. On success, true is returned and s->module will refer to the song. On failure, false is returned. Note, Any previously loaded song must be unloaded before this function is called. */ /* Temporary buffer to write filename into */ char filename[SC_SOUND_BUFFER]; /* Construct the suspected filename for the song */ sbprintf(filename, sizeof(filename), "%s/%s/%s", SC_GLOBAL_DIR, SC_SOUND_DIR, _sc_sound_names[id]); /* Attempt to load the song */ s->module = Player_Load(filename, 64, 0); if(s->module == NULL) { /* Failure; see what went wrong, then give up */ /* TEMP TEMP TEMP TEMP TEMP fprintf(stderr, "Could not load module \"%s\": \"%s\"\n", _sc_sound_names[id], MikMod_strerror(MikMod_errno)); */ return(0); } /* Success: set module parametres and exit */ s->module->wrap = 1; s->module->loop = 1; s->module->reppos = SC_SOUND_REVERB; return(!0); } void sc_sound_init(void) { /* sc_sound_init This function must be called _exactly_ once, to initialise the sound driver. This function must be called before sound structures are created; for MikMod we'll just register everything. */ MikMod_RegisterAllDrivers(); MikMod_RegisterAllLoaders(); } static void _sc_sound_mdmode(sc_sound *s, int hqmixer) { /* sc_sound_mdmode Set driver (global) options. */ s->hqmixer = hqmixer; md_mode |= DMODE_SOFT_MUSIC | DMODE_INTERP; if(hqmixer) { md_mode |= DMODE_HQMIXER; } else { md_mode &= (~DMODE_HQMIXER); } md_reverb = 0; } static void _sc_sound_reset(sc_sound *s) { /* sc_sound_reset Reset the mikmod driver - Warning: all sound samples and modules must be reloaded after this call. Otherwise, nasty segfaults will occur. */ /* if(s->playing) Player_Stop(); if(s->module != NULL) Player_Free(s->module); */ #if LIBMIKMOD_VERSION >= 0x030107 if(MikMod_Reset("")) { #else /* Version is old */ if(MikMod_Reset()) { #endif /* Libmikmod ok? */ fprintf(stderr, "Could not reinitialise sound: \"%s\"\n", MikMod_strerror(MikMod_errno)); } s->playing = 0; } sc_sound *sc_sound_new(int enable, int hqmixer) { sc_sound *s; if(!enable) return(NULL); s = (sc_sound *)malloc(sizeof(sc_sound)); if(s == NULL) return(NULL); s->playing = 0; s->module = NULL; _sc_sound_mdmode(s, hqmixer); /* Beware the kludgery */ #if LIBMIKMOD_VERSION >= 0x030107 if(MikMod_Init("")) { #else /* Version is old */ if(MikMod_Init()) { #endif /* Libmikmod ok? */ fprintf(stderr, "Could not initialise sound: \"%s\"\n", MikMod_strerror(MikMod_errno)); sc_sound_free(&s); return(NULL); } return(s); } void sc_sound_config(sc_sound **s, int enable, int hqmixer) { if(s == NULL) return; if(*s == NULL) { *s = sc_sound_new(enable, hqmixer); } else { if(enable) { _sc_sound_mdmode(*s, hqmixer); _sc_sound_reset(*s); } else { sc_sound_free(s); } } } void sc_sound_free(sc_sound **s) { if(s == NULL || *s == NULL) return; Player_Stop(); if((*s)->module != NULL) { Player_Free((*s)->module); } MikMod_Exit(); free(*s); *s = NULL; } void sc_sound_start(sc_sound *s, sc_sound_music id) { /*int voice;*/ if(s == NULL) return; _sc_sound_reset(s); _sc_sound_try_load(s, id); if(s->module == NULL) return; Player_Start(s->module); /* Player_SetPosition(0); for(voice = 0; voice <= 99; ++voice) { Player_Unmute(voice); Voice_SetVolume(voice, 256); Voice_SetPanning(voice, PAN_SURROUND); }*/ s->playing = 1; sc_sound_update(s); } void sc_sound_update(sc_sound *s) { if(s == NULL || s->module == NULL) return; if(s->playing) { MikMod_Update(); if(!Player_Active()) { Player_SetPosition(0); } } } void sc_sound_stop(sc_sound *s) { if(s == NULL || s->module == NULL) return; Player_Stop(); s->playing = 0; } void sc_sound_pause(sc_sound *s) { if(s == NULL || s->module == NULL) return; if(!Player_Paused()) Player_TogglePause(); } void sc_sound_unpause(sc_sound *s) { if(s == NULL || s->module == NULL) return; if(Player_Paused()) Player_TogglePause(); } xscorch-0.2.1/ssound/ssound.h0000644000175000001440000000350711175116157013111 00000000000000/* $Header: /fridge/cvs/xscorch/ssound/ssound.h,v 1.5 2009-04-26 17:39:59 jacob Exp $ */ /* xscorch - ssound.h Copyright(c) 2001,2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ xscorch sound driver This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __ssound_h_included #define __ssound_h_included #include #ifndef USE_SOUND #error USE_SOUND must be defined #endif /* Sanity check */ /* Forward structure declarations */ struct MODULE; #define SC_SOUND_BUFFER 0x1000 #define SC_SOUND_REVERB 0 typedef enum _sc_sound_music { SC_MUSIC_PRELUDE, SC_MUSIC_INVENTORY, SC_MUSIC_ROUND, SC_MUSIC_ENDROUND, SC_MUSIC_ENDGAME } sc_sound_music; typedef struct _sc_sound { struct MODULE *module; int playing; int hqmixer; } sc_sound; void sc_sound_init(void); sc_sound *sc_sound_new(int enable, int hqmixer); void sc_sound_config(sc_sound **s, int enable, int hqmixer); void sc_sound_free(sc_sound **s); void sc_sound_start(sc_sound *s, sc_sound_music id); void sc_sound_update(sc_sound *s); void sc_sound_stop(sc_sound *s); void sc_sound_pause(sc_sound *s); void sc_sound_unpause(sc_sound *s); #endif /* __ssound_h_included */ xscorch-0.2.1/ssound/ssoundnull.c0000644000175000001440000000317111175116157013774 00000000000000/* $Header: /fridge/cvs/xscorch/ssound/ssoundnull.c,v 1.6 2009-04-26 17:39:59 jacob Exp $ */ /* xscorch - ssoundnull.c Copyright(c) 2001,2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ xscorch null sound driver This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include void sc_sound_init(void) { /* sc_sound_init */ } sc_sound *sc_sound_new(__libj_unused int enable, __libj_unused int hqmixer) { return(NULL); } void sc_sound_config(__libj_unused sc_sound **s, __libj_unused int enable, __libj_unused int hqmixer) { } void sc_sound_free(sc_sound **s) { if(s == NULL || *s == NULL) return; free(*s); *s = NULL; } void sc_sound_start(__libj_unused sc_sound *s, __libj_unused sc_sound_music id) { } void sc_sound_update(__libj_unused sc_sound *s) { } void sc_sound_stop(__libj_unused sc_sound *s) { } void sc_sound_pause(__libj_unused sc_sound *s) { } void sc_sound_unpause(__libj_unused sc_sound *s) { } xscorch-0.2.1/sutil/0000755000175000001440000000000011615372007011322 500000000000000xscorch-0.2.1/sutil/Makefile.am0000644000175000001440000000142710000406072013265 00000000000000## $Header: /fridge/cvs/xscorch/sutil/Makefile.am,v 1.15 2003/10/04 17:54:41 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = getopt.c getopt.h getopt1.c CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for utilities # noinst_LIBRARIES = libscorch_util.a if NEED_GETOPT GETOPT_SRCS = getopt.c getopt.h getopt1.c else ## don't need built-in getopt support GETOPT_SRCS = endif # Game code # libscorch_util_a_SOURCES =\ $(GETOPT_SRCS) \ md5.c \ md5.h \ randserv.c \ randserv.h \ sfractal.c \ sfractal.h \ sgetline.h \ shash.c \ shash.h \ shashlist.c \ shashlist.h \ srand.c \ srand.h \ sslink.c \ sslink.h INCLUDES = -I../libj xscorch-0.2.1/sutil/Makefile.in0000644000175000001440000004114411615371716013321 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = sutil DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libscorch_util_a_AR = $(AR) $(ARFLAGS) libscorch_util_a_LIBADD = am__libscorch_util_a_SOURCES_DIST = getopt.c getopt.h getopt1.c md5.c \ md5.h randserv.c randserv.h sfractal.c sfractal.h sgetline.h \ shash.c shash.h shashlist.c shashlist.h srand.c srand.h \ sslink.c sslink.h @NEED_GETOPT_TRUE@am__objects_1 = getopt.$(OBJEXT) getopt1.$(OBJEXT) am_libscorch_util_a_OBJECTS = $(am__objects_1) md5.$(OBJEXT) \ randserv.$(OBJEXT) sfractal.$(OBJEXT) shash.$(OBJEXT) \ shashlist.$(OBJEXT) srand.$(OBJEXT) sslink.$(OBJEXT) libscorch_util_a_OBJECTS = $(am_libscorch_util_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libscorch_util_a_SOURCES) DIST_SOURCES = $(am__libscorch_util_a_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = getopt.c getopt.h getopt1.c CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig # Convenience library for utilities # noinst_LIBRARIES = libscorch_util.a @NEED_GETOPT_FALSE@GETOPT_SRCS = @NEED_GETOPT_TRUE@GETOPT_SRCS = getopt.c getopt.h getopt1.c # Game code # libscorch_util_a_SOURCES = \ $(GETOPT_SRCS) \ md5.c \ md5.h \ randserv.c \ randserv.h \ sfractal.c \ sfractal.h \ sgetline.h \ shash.c \ shash.h \ shashlist.c \ shashlist.h \ srand.c \ srand.h \ sslink.c \ sslink.h INCLUDES = -I../libj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sutil/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sutil/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libscorch_util.a: $(libscorch_util_a_OBJECTS) $(libscorch_util_a_DEPENDENCIES) -rm -f libscorch_util.a $(libscorch_util_a_AR) libscorch_util.a $(libscorch_util_a_OBJECTS) $(libscorch_util_a_LIBADD) $(RANLIB) libscorch_util.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randserv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfractal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shashlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srand.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sslink.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/sutil/getopt.c0000644000175000001440000006774511175116160012730 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/getopt.c,v 1.4 2009-04-26 17:40:00 jacob Exp $ */ /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #if !HAVE_GETOPT_LONG /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO #define _NO_PROTO #endif #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #include #endif /* GNU C library. */ #ifdef VMS #include #if HAVE_STRING_H - 0 #include #endif #endif #if defined (WIN32) && !defined (__CYGWIN32__) /* It's not Unix, really. See? Capital letters. */ #include #define getpid() GetCurrentProcessId() #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H #include #define _(msgid) gettext (msgid) #else #define _(msgid) (msgid) #endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ char *getenv(); static char * my_index(str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen(const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ static const char *nonoption_flags; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void store_args(int argc, char *const *argv) __attribute__((unused)); static void store_args(int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } text_set_element(__libc_subinit, store_args); #endif /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange(char **); #endif static void exchange(argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize(int, char *const *, const char *); #endif static const char * _getopt_initialize(argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind = 1; nextchar = NULL; posixly_correct = getenv("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { /* Bash 2.0 puts a special variable in the environment for each command it runs, specifying which ARGV elements are the results of file name wildcard expansion and therefore should not be considered as options. */ char var[100]; sprintf(var, "_%d_GNU_nonoption_argv_flags_", getpid()); nonoption_flags = getenv(var); if (nonoption_flags == NULL) nonoption_flags_len = 0; else nonoption_flags_len = strlen(nonoption_flags); } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal(argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (!__getopt_initialized || optind == 0) { optstring = _getopt_initialize(argc, argv, optstring); optind = 1; /* Don't scan ARGV[0], the program name. */ __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp(argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index(optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf(stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen(nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf(stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf(stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen(nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf(stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen(nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index(optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf(stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf(stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index(optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf(stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf(stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen(nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf(stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen(nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf(stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen(nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt(argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal(argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main(argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt(argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf("option %c\n", c); break; case 'a': printf("option a\n"); break; case 'b': printf("option b\n"); break; case 'c': printf("option c with value `%s'\n", optarg); break; case '?': break; default: printf("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf("non-option ARGV-elements: "); while (optind < argc) printf("%s ", argv[optind++]); printf("\n"); } exit(0); } #endif /* TEST */ #endif /* HAVE_GETOPT_LONG */ xscorch-0.2.1/sutil/getopt.h0000644000175000001440000001130111175116160012706 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/getopt.h,v 1.3 2009-04-26 17:40:00 jacob Exp $ */ /* Declarations for getopt. Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #if defined (__STDC__) && __STDC__ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt(int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ extern int getopt(); #endif /* __GNU_LIBRARY__ */ extern int getopt_long(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ extern int getopt(); extern int getopt_long(); extern int getopt_long_only(); extern int _getopt_internal(); #endif /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* _GETOPT_H */ xscorch-0.2.1/sutil/getopt1.c0000644000175000001440000001126511175116160012773 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/getopt1.c,v 1.4 2009-04-26 17:40:00 jacob Exp $ */ /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #if !HAVE_GETOPT_LONG #include "getopt.h" #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long(argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal(argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only(argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal(argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main(argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long(argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf("option %s", long_options[option_index].name); if (optarg) printf(" with arg %s", optarg); printf("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf("option %c\n", c); break; case 'a': printf("option a\n"); break; case 'b': printf("option b\n"); break; case 'c': printf("option c with value `%s'\n", optarg); break; case 'd': printf("option d with value `%s'\n", optarg); break; case '?': break; default: printf("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf("non-option ARGV-elements: "); while (optind < argc) printf("%s ", argv[optind++]); printf("\n"); } exit(0); } #endif /* TEST */ #endif /* HAVE_GETOPT_LONG */ xscorch-0.2.1/sutil/md5.c0000644000175000001440000003066211175116417012104 00000000000000/* md5.c - Functions to compute MD5 message digest of files or memory blocks according to the definition of MD5 in RFC 1321 from April 1992. Copyright (C) 1995, 1996 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ulrich Drepper , 1995. */ #ifdef HAVE_CONFIG_H # include #endif #include #if STDC_HEADERS || defined _LIBC # include # include #else # ifndef HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # endif #endif #include "md5.h" #ifdef _LIBC # include # if __BYTE_ORDER == __BIG_ENDIAN # define WORDS_BIGENDIAN 1 # endif #endif #ifdef WORDS_BIGENDIAN # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else # define SWAP(n) (n) #endif /* This array contains the bytes used to pad the buffer to the next 64-byte boundary. (RFC 1321, 3.1: Step 1) */ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ void md5_init_ctx (ctx) struct md5_ctx *ctx; { ctx->A = 0x67452301; ctx->B = 0xefcdab89; ctx->C = 0x98badcfe; ctx->D = 0x10325476; ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } /* Put result from CTX in first 16 bytes following RESBUF. The result must be in little endian byte order. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_read_ctx (ctx, resbuf) const struct md5_ctx *ctx; void *resbuf; { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_finish_ctx (ctx, resbuf) struct md5_ctx *ctx; void *resbuf; { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; size_t pad; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ md5_process_block (ctx->buffer, bytes + pad + 8, ctx); return md5_read_ctx (ctx, resbuf); } /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ int md5_stream (stream, resblock) FILE *stream; void *resblock; { /* Important: BLOCKSIZE must be a multiple of 64. */ #define BLOCKSIZE 4096 struct md5_ctx ctx; char buffer[BLOCKSIZE + 72]; size_t sum; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* Iterate over full file contents. */ while (1) { /* We read the file in blocks of BLOCKSIZE bytes. One call of the computation function processes the whole buffer so that with the next round of the loop another block can be read. */ size_t n; sum = 0; /* Read block. Take care for partial reads. */ do { n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); sum += n; } while (sum < BLOCKSIZE && n != 0); if (n == 0 && ferror (stream)) return 1; /* If end of file is reached, end the loop. */ if (n == 0) break; /* Process buffer with BLOCKSIZE bytes. Note that BLOCKSIZE % 64 == 0 */ md5_process_block (buffer, BLOCKSIZE, &ctx); } /* Add the last bytes if necessary. */ if (sum > 0) md5_process_bytes (buffer, sum, &ctx); /* Construct result in desired memory. */ md5_finish_ctx (&ctx, resblock); return 0; } /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ void * md5_buffer (buffer, len, resblock) const char *buffer; size_t len; void *resblock; { struct md5_ctx ctx; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* Process whole buffer but last len % 64 bytes. */ md5_process_bytes (buffer, len, &ctx); /* Put result in desired memory area. */ return md5_finish_ctx (&ctx, resblock); } void md5_process_bytes (buffer, len, ctx) const void *buffer; size_t len; struct md5_ctx *ctx; { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (left_over + add > 64) { md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx); /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], (left_over + add) & 63); ctx->buflen = (left_over + add) & 63; } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len > 64) { md5_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } /* Move remaining bytes in internal buffer. */ if (len > 0) { memcpy (ctx->buffer, buffer, len); ctx->buflen = len; } } /* These are the four functions used in the four steps of the MD5 algorithm and defined in the RFC 1321. The first function is a little bit optimized (as found in Colin Plumbs public domain implementation). */ /* #define FF(b, c, d) ((b & c) | (~b & d)) */ #define FF(b, c, d) (d ^ (b & (c ^ d))) #define FG(b, c, d) FF (d, b, c) #define FH(b, c, d) (b ^ c ^ d) #define FI(b, c, d) (c ^ (b | ~d)) /* Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 64 == 0. */ void md5_process_block (buffer, len, ctx) const void *buffer; size_t len; struct md5_ctx *ctx; { md5_uint32 correct_words[16]; const md5_uint32 *words = buffer; size_t nwords = len / sizeof (md5_uint32); const md5_uint32 *endp = words + nwords; md5_uint32 A = ctx->A; md5_uint32 B = ctx->B; md5_uint32 C = ctx->C; md5_uint32 D = ctx->D; /* First increment the byte count. RFC 1321 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; /* Process all bytes in the buffer with 64 bytes in each round of the loop. */ while (words < endp) { md5_uint32 *cwp = correct_words; md5_uint32 A_save = A; md5_uint32 B_save = B; md5_uint32 C_save = C; md5_uint32 D_save = D; /* First round: using the given function, the context and a constant the next context is computed. Because the algorithms processing unit is a 32-bit word and it is determined to work on words in little endian byte order we perhaps have to change the byte order before the computation. To reduce the work for the next steps we store the swapped words in the array CORRECT_WORDS. */ #define OP(a, b, c, d, s, T) \ do \ { \ a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ ++words; \ a = rol (a, s); \ a += b; \ } \ while (0) /* Before we start, one word to the strange constants. They are defined in RFC 1321 as T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}' */ /* Round 1. */ OP (A, B, C, D, 7, 0xd76aa478); OP (D, A, B, C, 12, 0xe8c7b756); OP (C, D, A, B, 17, 0x242070db); OP (B, C, D, A, 22, 0xc1bdceee); OP (A, B, C, D, 7, 0xf57c0faf); OP (D, A, B, C, 12, 0x4787c62a); OP (C, D, A, B, 17, 0xa8304613); OP (B, C, D, A, 22, 0xfd469501); OP (A, B, C, D, 7, 0x698098d8); OP (D, A, B, C, 12, 0x8b44f7af); OP (C, D, A, B, 17, 0xffff5bb1); OP (B, C, D, A, 22, 0x895cd7be); OP (A, B, C, D, 7, 0x6b901122); OP (D, A, B, C, 12, 0xfd987193); OP (C, D, A, B, 17, 0xa679438e); OP (B, C, D, A, 22, 0x49b40821); /* For the second to fourth round we have the possibly swapped words in CORRECT_WORDS. Redefine the macro to take an additional first argument specifying the function to use. */ #undef OP #define OP(f, a, b, c, d, k, s, T) \ do \ { \ a += f (b, c, d) + correct_words[k] + T; \ a = rol (a, s); \ a += b; \ } \ while (0) /* Round 2. */ OP (FG, A, B, C, D, 1, 5, 0xf61e2562); OP (FG, D, A, B, C, 6, 9, 0xc040b340); OP (FG, C, D, A, B, 11, 14, 0x265e5a51); OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); OP (FG, A, B, C, D, 5, 5, 0xd62f105d); OP (FG, D, A, B, C, 10, 9, 0x02441453); OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); OP (FG, D, A, B, C, 14, 9, 0xc33707d6); OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); OP (FG, B, C, D, A, 8, 20, 0x455a14ed); OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); OP (FG, C, D, A, B, 7, 14, 0x676f02d9); OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); /* Round 3. */ OP (FH, A, B, C, D, 5, 4, 0xfffa3942); OP (FH, D, A, B, C, 8, 11, 0x8771f681); OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); OP (FH, B, C, D, A, 14, 23, 0xfde5380c); OP (FH, A, B, C, D, 1, 4, 0xa4beea44); OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); OP (FH, B, C, D, A, 6, 23, 0x04881d05); OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); /* Round 4. */ OP (FI, A, B, C, D, 0, 6, 0xf4292244); OP (FI, D, A, B, C, 7, 10, 0x432aff97); OP (FI, C, D, A, B, 14, 15, 0xab9423a7); OP (FI, B, C, D, A, 5, 21, 0xfc93a039); OP (FI, A, B, C, D, 12, 6, 0x655b59c3); OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); OP (FI, C, D, A, B, 10, 15, 0xffeff47d); OP (FI, B, C, D, A, 1, 21, 0x85845dd1); OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); OP (FI, C, D, A, B, 6, 15, 0xa3014314); OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); OP (FI, A, B, C, D, 4, 6, 0xf7537e82); OP (FI, D, A, B, C, 11, 10, 0xbd3af235); OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); OP (FI, B, C, D, A, 9, 21, 0xeb86d391); /* Add the starting values of the context. */ A += A_save; B += B_save; C += C_save; D += D_save; } /* Put checksum in context given as argument. */ ctx->A = A; ctx->B = B; ctx->C = C; ctx->D = D; } xscorch-0.2.1/sutil/md5.h0000644000175000001440000001240711175116374012110 00000000000000/* md5.h - Declaration of functions and data types used for MD5 sum computing library functions. Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _MD5_H #define _MD5_H 1 #include #if defined HAVE_LIMITS_H || _LIBC # include #endif /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but doing that would require that the configure script compile and *run* the resulting executable. Locally running cross-compiled executables is usually not possible. */ #ifdef _LIBC # include typedef u_int32_t md5_uint32; #else # if defined __STDC__ && __STDC__ # define UINT_MAX_32_BITS 4294967295U # else # define UINT_MAX_32_BITS 0xFFFFFFFF # endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ # ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS # endif # if UINT_MAX == UINT_MAX_32_BITS typedef unsigned int md5_uint32; # else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short md5_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long md5_uint32; # else /* The following line is intended to evoke an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif # endif #endif #undef __P #if defined (__STDC__) && __STDC__ #define __P(x) x #else #define __P(x) () #endif /* Structure to save state of computation between the single steps. */ struct md5_ctx { md5_uint32 A; md5_uint32 B; md5_uint32 C; md5_uint32 D; md5_uint32 total[2]; md5_uint32 buflen; char buffer[128]; }; /* * The following three functions are build up the low level used in * the functions `md5_stream' and `md5_buffer'. */ /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ extern void md5_init_ctx __P ((struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ extern void md5_process_block __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void md5_process_bytes __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Process the remaining bytes in the buffer and put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF be correctly aligned for a 32 bits value. */ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); /* Put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ extern int md5_stream __P ((FILE *stream, void *resblock)); /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); /* The following is from gnupg-1.0.2's cipher/bithelp.h. */ /* Rotate a 32 bit integer by n bytes */ #if defined __GNUC__ && defined __i386__ static inline md5_uint32 rol(md5_uint32 x, int n) { __asm__("roll %%cl,%0" :"=r" (x) :"0" (x),"c" (n)); return x; } #else # define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) #endif #endif xscorch-0.2.1/sutil/randserv.c0000644000175000001440000000603311175116160013231 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/randserv.c,v 1.4 2009-04-26 17:40:00 jacob Exp $ */ /*-------------------------------------------------------------------- * * randserv.c -- Random deviate generator * Copyright (C) 2000 Matti Hänninen * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to * * The Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * */ #include #include #include #include static double normal_deviates[2]; static int normal_deviates_left = 0; /*-------------------------------------------------------------------- * rand_uniform() * * Description: * Returns an uniform deviate drawn from the closed * interval [0, 1]. */ inline double rand_uniform(void) { return (double)game_rand() / (double)GAME_RAND_MAX; } /*-------------------------------------------------------------------- * rand_discrete(min, max) * * Description: * Return a discrete deviate bounded between min and max. */ long rand_discrete(long min, long max) { long temp; /* Make sure min is less than max */ if ( min > max ) { temp = min; min = max; max = temp; } return min + (long)((max - min + 1.0) * game_rand() / (GAME_RAND_MAX + 1.0)); } /*-------------------------------------------------------------------- * generate_normal_deviates() * * Description: * Generates two independent standard normal deviates and * stores them in the normal_deviates[] table. * * Note: * This function utilizes the ``polar method'' for generating * normal deviations due to Box, Muller, and Marsaglia as * described in Knuth, D. E. (1981) The Art of Computer * Programming, Vol. 2, pp. 117-8. */ static void generate_normal_deviates(void) { double v_1, v_2, s, t; do { v_1 = 2.0 * (double)game_rand() / (double)GAME_RAND_MAX - 1.0; v_2 = 2.0 * (double)game_rand() / (double)GAME_RAND_MAX - 1.0; s = v_1 * v_1 + v_2 * v_2; } while ( s >= 1 ); t = sqrt((-2.0 * log(s)) / s); normal_deviates[0] = v_1 * t; normal_deviates[1] = v_2 * t; normal_deviates_left = 2; } /*-------------------------------------------------------------------- * rand_normal() * * Description: * Returns a standard normal deviate. */ double rand_normal(void) { if ( !normal_deviates_left ) generate_normal_deviates(); return normal_deviates[--normal_deviates_left]; } /* randserv.c ends */ xscorch-0.2.1/sutil/randserv.h0000644000175000001440000000223311175116161013235 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/randserv.h,v 1.3 2009-04-26 17:40:01 jacob Exp $ */ /*-------------------------------------------------------------------- * * randserv.h -- Random deviate generator * Copyright (C) 2000 Matti Hänninen * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to * * The Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * */ #ifndef RANDSERV_H #define RANDSERV_H double rand_normal(void); double rand_uniform(void); long rand_discrete(long min, long max); #endif /* RANDSERV_H */ /* randserv.h ends */ xscorch-0.2.1/sutil/sfractal.c0000644000175000001440000001027511175116161013210 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/sfractal.c,v 1.5 2009-04-26 17:40:01 jacob Exp $ */ /* xscorch - sfractal.c Copyright(c) 2000 Jake Post Creates fractal plasma clouds This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include /*** Now entering the fractal plasma subsystem ***/ /* Current version of this code based (somewhat) on an algorithm that is discussed at http://patate.virtualave.net/clouds/index.html */ /* ** Should probably just be stuck in sc_fractal_create */ static void _sc_fractal_seeds(unsigned char *data, int size) { int x; int y; int spacing = (1 << SC_FRACTAL_DEFAULT_DEPTH); int ys = size * spacing; int yl = size * size; int xl = size; for(y = 0; y < yl; y += ys) { for(x = y; x < xl; x += spacing) data[x] = sys_lrand(256); xl += ys; } } /* ** Note - Slightly different from the original in that the horiz/vert ** only use 2 neighbors instead of four; this simplifies things. If ** it's not good, I can change it to the 4 point avg.; it takes more ** computation (obviously) and needs a special case for the borders ** (as there's only 3 neighbors), but isn't difficult in any sense. ** Would still be faster than original due to 2^n + 1 board. ** ** May 13 2000 ** Noticed I was being stupid by taking 2D indexes and using multiplication ** to translate them into 1D index within loop - 2D indexes needed as we're ** making a 2D effect but 1D index now used directly, there is only addition ** within loops now */ static void _sc_fractal_average(unsigned char *data, int size, int spacing) { int spacing2 = (spacing >> 1); /*used as offset*/ int basey; /*1D offset of current row*/ int basex; /*...and x/y combo*/ int bases = spacing2 * size; /*distance spacing2 rows away*/ int yinc = (bases << 1); /*similar but with spacing*/ int size2 = size * size; /*first illegal index*/ int xsize = size; /*Last index of current row + 1*/ /*Average horizonal; use "parent" values to left and right*/ for(basey = 0; basey < size2; basey += yinc) { for(basex = basey + spacing2; basex < xsize; basex += spacing) data[basex] = (data[basex - spacing2] + data[basex + spacing2]) >> 1; xsize += yinc; } /*Average vertical; use "parent" values above and below*/ xsize = bases + size; for(basey = bases; basey < size2; basey += yinc) { for(basex = basey; basex < xsize; basex += spacing) data[basex] = (data[basex + bases] + data[basex - bases]) >> 1; xsize += yinc; } /*Average center; use above, below, left, and right*/ xsize = bases + size; for(basey = bases; basey < size2; basey += yinc) { for(basex = basey + spacing2; basex < xsize; basex += spacing) { data[basex] = (data[basex + bases] + data[basex - bases] + data[basex + spacing2] + data[basex - spacing2]) >> 2; } xsize += yinc; } } unsigned char *sc_fractal_create(int *size, int requestedsize) { /*** WARNING::: SIZE MUST BE A POWER OF _2_ + 1 ***/ unsigned char *data; int spacing = *size = (1 << SC_FRACTAL_DEFAULT_DEPTH); /*SC_PROFILE_BEGIN("fr")*/ while(requestedsize > *size + 1) *size = (*size << 1); (*size) |= 1; data = (unsigned char *)malloc((*size) * (*size)); if(data == NULL) return(NULL); _sc_fractal_seeds(data, *size); while(spacing > 1) { _sc_fractal_average(data, *size, spacing); spacing >>= 1; } /*SC_PROFILE_END*/ return(data); } xscorch-0.2.1/sutil/sfractal.h0000644000175000001440000000236211175116161013213 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/sfractal.h,v 1.4 2009-04-26 17:40:01 jacob Exp $ */ /* xscorch - sfractal.h Copyright(c) 2001,2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Creates fractal plasma clouds This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sfractal_h_included #define __sfractal_h_included /* Includes */ #include /* Fractal constants */ #define SC_FRACTAL_DEFAULT_DEPTH 4 #define SC_FRACTAL_DEFAULT_ROUGH 6 /* Functions */ unsigned char *sc_fractal_create(int *size, int requestedsize); #endif /* __sfractal_h_included */ xscorch-0.2.1/sutil/sgetline.h0000644000175000001440000000334011175116161013223 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/sgetline.h,v 1.4 2009-04-26 17:40:01 jacob Exp $ */ /* xscorch - sgetline.h Copyright(c) 2003-2004 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Drop-in replacement for fgets() for functions previously reading data from files, which are now reading from embedded buffers. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sgetline_h_included #define __sgetline_h_included #include static inline char *sgetline(char *buf, int size, const char *inbuf, int *count) { int local_count; char *bufp = buf; assert(buf != NULL); assert(size > 0); assert(count != NULL); local_count = *count; if(inbuf[local_count] == '\0') return(NULL); while(size > 1 && inbuf[local_count] != '\0' && inbuf[local_count] != '\n') { *bufp = inbuf[local_count]; ++local_count; ++bufp; --size; } if(size > 1 && inbuf[local_count] == '\n') { *bufp = '\n'; ++bufp; ++local_count; } *bufp = '\0'; *count = local_count; return(buf); } #endif // __sgetline_h_included xscorch-0.2.1/sutil/shash.c0000644000175000001440000000450111615366350012520 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/shash.c,v 1.14 2011-08-01 00:01:44 jacob Exp $ */ /* xscorch - shash.c Copyright(c) 2001-2003 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ A very slim hashing implementation for xscorch. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include #include /* This is (sqrt(5) - 1), used below. */ #define SQRT5M1 1.23606797749978980505 int shash_string_to_int(const char *item) { /* shash_string_to_int Convert a string to an int suitable for hashing (using md5). */ int quad[4]; /* Take the MD5 sum of the string. */ md5_buffer(item, strlenn(item), quad); /* Compress the MD5 sum to a single integer. */ return(quad[0] ^ quad[1] ^ quad[2] ^ quad[3]); } int shash(int bits, unsigned int item) { /* shash Hash item to a list of 2^bits elements. */ /* rationale - The below is a basic multiplication hash. (1 << (8 * sizeof(int) - 1)) should be 2^(number of bits in an int) / 2 We divide by 2 there to avoid overflow and because the magic number we are using is actually (sqrt(5) - 1) / 2 so all is well. */ /* Casting to double here is to remind us we must use high precision. Which is too bad because it makes for a much slower function... ;) */ item *= (double)((double)(1 << (8 * sizeof(int) - 1)) * (double)SQRT5M1); bits = item >> (8 * sizeof(int) - bits); return(bits); } int shash_string(int bits, const char *item) { /* shash_string Hash a string through the multiplicative hash using MD5. */ return(shash(bits, shash_string_to_int(item))); } xscorch-0.2.1/sutil/shash.h0000644000175000001440000000252111615366350012525 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/shash.h,v 1.9 2011-08-01 00:01:44 jacob Exp $ */ /* xscorch - shash.h Copyright(c) 2001-2003 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ A very slim hashing implementation for xscorch. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __shash_h_included #define __shash_h_included /* Maximum size we've evaluated this hash function's fairness to. */ #define SHASH_MAX_BITS 31 /* Support functions that we export. */ int shash_string_to_int(const char *item); /* Predefined operations on shashes. */ int shash(int bits, unsigned int item); int shash_string(int bits, const char *item); #endif /* __shash_h_included */ xscorch-0.2.1/sutil/shashlist.c0000644000175000001440000002652511615366350013426 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/shashlist.c,v 1.14 2011-08-01 00:01:44 jacob Exp $ */ /* xscorch - shashlist.c Copyright(c) 2003 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Doubly linked hash chain library for xscorch. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include shashlist_item *shashlist_item_new(void *data, int key, const char *keystr, int class) { /* shashlist_item_new Create and initialize a new shashlist_item. */ shashlist_item *item; int len; item = (shashlist_item *)malloc(sizeof(shashlist_item)); if(item == NULL) return(NULL); /* Set the string key, if any. */ if(keystr == NULL) { item->keystr = NULL; } else { len = strblenn(keystr, SHASHLIST_MAX_KEYSTR_LEN) + 1; item->keystr = (char *)malloc(len); if(item->keystr == NULL) { free(item); return(NULL); } strcopyb(item->keystr, keystr, len); } item->class = class; item->data = data; item->key = key; item->chain = NULL; item->next = NULL; item->prev = NULL; return(item); } void shashlist_item_free(shashlist_item **item) { /* shashlist_item_free Deallocate a shashlist_item. */ if(item == NULL || *item == NULL) return; (*item)->data = (void *)0xdeadbeef; if((*item)->keystr != NULL) free((*item)->keystr); free(*item); *item = NULL; } shashlist *shashlist_new(unsigned int hashsize) { /* shashlist_new Create and initialize a new shashlist. */ shashlist *list; int roundup = 0; list = (shashlist *)malloc(sizeof(shashlist)); if(list == NULL) return(NULL); /* The current implementation requires a hash size in 2^n. */ list->hashbits = 0; while(hashsize > 1) { ++list->hashbits; if(hashsize % 2) ++roundup; hashsize = hashsize >> 1; } if(roundup) ++list->hashbits; /* SHASH_MAX_BITS comes from shash.h */ if(list->hashbits > SHASH_MAX_BITS) list->hashbits = SHASH_MAX_BITS; /* Allocate the (possibly large) array of item pointers for the hash. */ list->hash = (shashlist_item **)malloc((1 << list->hashbits) * sizeof(shashlist_item *)); if(list->hash == NULL) { free(list); return(NULL); } list->head = NULL; list->tail = NULL; return(list); } void shashlist_free(shashlist **list) { /* shashlist_free Destroy and deallocate an entire hash list. */ if(list == NULL || *list == NULL) return; /* Destroy the individual items first. */ while((*list)->head != NULL) { (*list)->tail = (*list)->head; (*list)->head = (*list)->head->next; shashlist_item_free(&(*list)->tail); } free((*list)->hash); (*list)->hash = (shashlist_item **)0xdeadbeef; free(*list); *list = NULL; } shashlist_item *shashlist_insert_by_int(shashlist *list, void *data, int class, int key) { /* shashlist_append_by_int Append a new data item onto a hash dll. This will return NULL if the item is a duplicate or if allocation fails. */ int hashindex; shashlist_item *item, *temp; if(list == NULL || data == NULL || key < 0) return(NULL); item = shashlist_item_new(data, key, NULL, class); if(item == NULL) return(NULL); /* Add the def to the dll */ if(list->head == NULL) { /* Empty list */ list->tail = list->head = item; } else { /* Find the proper place in the list. */ temp = list->head; while(temp->next != NULL && temp->next->key <= key) temp = temp->next; /* Cannot insert duplicate keys. */ if(temp->key == key) { shashlist_item_free(&item); return(NULL); } /* Fix up the case where we are appending instead of inserting. */ if(temp == list->tail) { list->tail = item; } else { temp->next->prev = item; item->next = temp->next; } temp->next = item; item->prev = temp; } /* Add the def to the hash chains */ hashindex = shash(list->hashbits, key); if(list->hash[hashindex] == NULL) { /* Nothing on hash chain */ list->hash[hashindex] = item; } else { /* Already an item on the hash chain */ temp = list->hash[hashindex]; while(temp->chain != NULL) temp = temp->chain; temp->chain = item; } /* Return the fully formed shashlist entry. */ return(item); } shashlist_item *shashlist_insert_by_string(shashlist *list, void *data, int class, const char *key) { /* shashlist_insert_by_string Append a new data item onto a hash dll, keyed by string. This will return NULL if the item is a duplicate or if allocation fails. */ int hashindex; shashlist_item *item, *temp; if(list == NULL || data == NULL || key == NULL) return(NULL); item = shashlist_item_new(data, 0, key, class); if(item == NULL) return(NULL); /* Add the def to the dll */ if(list->head == NULL) { /* Empty list */ list->tail = list->head = item; } else { /* Find the proper place in the list. */ temp = list->head; while(temp->next != NULL && strcomp(temp->next->keystr, key) <= 0) temp = temp->next; /* Cannot insert duplicate keys. */ if(strcomp(temp->keystr, key) == 0) { shashlist_item_free(&item); return(NULL); } /* Fix up the case where we are appending instead of inserting. */ if(temp == list->tail) { list->tail = item; } else { temp->next->prev = item; item->next = temp->next; } temp->next = item; item->prev = temp; } /* Add the def to the hash chains */ hashindex = shash_string(list->hashbits, key); if(list->hash[hashindex] == NULL) { /* Nothing on hash chain */ list->hash[hashindex] = item; } else { /* Already an item on the hash chain */ temp = list->hash[hashindex]; while(temp->chain != NULL) temp = temp->chain; temp->chain = item; } /* Return the fully formed shashlist entry. */ return(item); } shashlist_item *shashlist_remove_by_int(shashlist *list, int key) { /* shashlist_remove_item_by_int Remove the shashlist data item referenced by this key. */ int hashindex; shashlist_item *item, *temp; if(list == NULL || key < 0) return(NULL); /* Locate the item using hash lookup. */ hashindex = shash(list->hashbits, key); item = list->hash[hashindex]; if(item == NULL) return(NULL); /* Scan the collision chain as needed and remove the item from the hash. */ if(item->key == key) { list->hash[hashindex] = item->chain; } else { temp = item; while(temp->chain != NULL && temp->chain->key != key) temp = temp->chain; if(temp->chain == NULL) return(NULL); item = temp->chain; temp->chain = temp->chain->chain; } /* Remove the item from the linked list. */ if(item->prev == NULL) { list->head = item->next; } else { item->prev->next = item->next; } if(item->next == NULL) { list->tail = item->prev; } else { item->next->prev = item->prev; } /* Return the orphaned item. */ return(item); } shashlist_item *shashlist_remove_by_string(shashlist *list, const char *key) { /* shashlist_remove_item_by_string Remove the shashlist data item referenced by this key string. */ int hashindex; shashlist_item *item, *temp; if(list == NULL || key == NULL) return(NULL); /* Locate the item using hash lookup. */ hashindex = shash_string(list->hashbits, key); item = list->hash[hashindex]; if(item == NULL) return(NULL); /* Scan the collision chain as needed and remove the item from the hash. */ if(strcomp(item->keystr, key) == 0) { list->hash[hashindex] = item->chain; } else { temp = item; while(temp->chain != NULL && strcomp(temp->chain->keystr, key) != 0) temp = temp->chain; if(temp->chain == NULL) return(NULL); item = temp->chain; temp->chain = temp->chain->chain; } /* Remove the item from the linked list. */ if(item->prev == NULL) { list->head = item->next; } else { item->prev->next = item->next; } if(item->next == NULL) { list->tail = item->prev; } else { item->next->prev = item->prev; } /* Return the orphaned item. */ return(item); } shashlist_item *shashlist_find_by_int(const shashlist *list, int key) { /* shashlist_find_by_int Find a shashlist item by integer key. */ int hashindex; shashlist_item *item; if(list == NULL || key < 0) return(NULL); /* Locate the item using hash lookup. */ hashindex = shash(list->hashbits, key); item = list->hash[hashindex]; /* Scan the hash chain, as needed. */ while(item != NULL && item->key != key) item = item->chain; /* item will be either the right item or NULL, at this point. */ return(item); } shashlist_item *shashlist_find_by_string(const shashlist *list, const char *key) { /* shashlist_find_by_string Find a shashlist item by string key. */ int hashindex; shashlist_item *item; if(list == NULL || key == NULL) return(NULL); /* Locate the item using hash lookup. */ hashindex = shash_string(list->hashbits, key); item = list->hash[hashindex]; /* Scan the hash chain, as needed. */ while(item != NULL && strcomp(item->keystr, key) != 0) item = item->chain; /* item will be either the right item or NULL, at this point. */ return(item); } shashlist_item *shashlist_find_next(const shashlist *list, shashlist_item *item, int class) { /* shashlist_find_next Find the next shashlist_item after item that is in the specified class. Passing item == NULL is a slang way of asking for the first item. */ if(list == NULL) return(NULL); /* Get the first candidate. */ if(item == NULL) item = list->head; else item = item->next; /* Find the first item meeting class requirements. */ while(item != NULL && !(class == SHASHLIST_ALL_CLASSES || item->class == class)) item = item->next; return(item); } shashlist_item *shashlist_find_prev(const shashlist *list, shashlist_item *item, int class) { /* shashlist_find_prev Find the previous shashlist_item after item in the specified class. Passing item == NULL is a slang way of asking for the last item. */ if(list == NULL) return(NULL); /* Get the first candidate. */ if(item == NULL) item = list->tail; else item = item->prev; /* Find the first item meeting class requirements. */ while(item != NULL && !(class == SHASHLIST_ALL_CLASSES || item->class == class)) item = item->prev; return(item); } xscorch-0.2.1/sutil/shashlist.h0000644000175000001440000000476111615366350013431 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/shashlist.h,v 1.6 2011-08-01 00:01:44 jacob Exp $ */ /* xscorch - shashlist.h Copyright(c) 2003 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ Doubly linked hash chain implementation for xscorch. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __shashlist_h_included #define __shashlist_h_included #define SHASHLIST_ALL_CLASSES 0 #define SHASHLIST_UNCLASSIFIED 1 #define SHASHLIST_FIRST_CLASS 2 #define SHASHLIST_MAX_KEYSTR_LEN (1<<8) typedef struct _shashlist_item { struct _shashlist_item *prev; struct _shashlist_item *next; struct _shashlist_item *chain; int class, key; char *keystr; void *data; } shashlist_item; typedef struct _shashlist { shashlist_item **hash; shashlist_item *head; shashlist_item *tail; unsigned int hashbits; } shashlist; /* Hash DLL creation and obliteration. */ shashlist_item *shashlist_item_new(void *data, int key, const char *keystr, int class); void shashlist_item_free(shashlist_item **item); shashlist *shashlist_new(unsigned int hashsize); void shashlist_free(shashlist **list); /* Hash DLL item manipulations. */ shashlist_item *shashlist_insert_by_int(shashlist *list, void *data, int class, int key); shashlist_item *shashlist_insert_by_string(shashlist *list, void *data, int class, const char *key); shashlist_item *shashlist_remove_by_int(shashlist *list, int key); shashlist_item *shashlist_remove_by_string(shashlist *list, const char *key); shashlist_item *shashlist_find_by_int(const shashlist *list, int key); shashlist_item *shashlist_find_by_string(const shashlist *list, const char *key); shashlist_item *shashlist_find_next(const shashlist *list, shashlist_item *item, int class); shashlist_item *shashlist_find_prev(const shashlist *list, shashlist_item *item, int class); #endif /* __shashlist_h_included */ xscorch-0.2.1/sutil/srand.c0000644000175000001440000000351411175116162012517 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/srand.c,v 1.7 2009-04-26 17:40:02 jacob Exp $ */ /* xscorch - srand.c Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched random number generator This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include void sys_randomize(void) { struct timeval t; gettimeofday(&t, NULL); srand(t.tv_sec * 1000 + t.tv_usec / 1000); game_randomize(sys_rand()); } long sys_rand(void) { return(rand()); } double sys_drand(void) { return(sys_rand() / (RAND_MAX + 1.0)); } long sys_lrand(long max) { return((long)(sys_drand() * max)); } static dword _sc_game_random_value; void game_randomize(dword seed) { _sc_game_random_value = seed; } dword game_rand_peek(void) { dword result; result = _sc_game_random_value * 1664525L + 1013904223L; result = result % GAME_RAND_MAX; return(result); } dword game_rand(void) { _sc_game_random_value = game_rand_peek(); return(_sc_game_random_value); } double game_drand(void) { return(game_rand() / (GAME_RAND_MAX + 1.0)); } dword game_lrand(dword max) { return((dword)(game_drand() * max)); } xscorch-0.2.1/sutil/srand.h0000644000175000001440000000250511175116162012523 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/srand.h,v 1.6 2009-04-26 17:40:02 jacob Exp $ */ /* xscorch - srand.h Copyright(c) 2000 Justin David Smith justins(at)chaos2.org http://chaos2.org/ Scorched random numbers This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __srand_h_included #define __srand_h_included #include /* Random functions */ void sys_randomize(void); long sys_rand(void); double sys_drand(void); long sys_lrand(long max); #define GAME_RAND_MAX RAND_MAX void game_randomize(dword seed); dword game_rand(void); dword game_rand_peek(void); double game_drand(void); dword game_lrand(dword max); #endif /* __srand_h_included */ xscorch-0.2.1/sutil/sslink.c0000644000175000001440000000324111615366350012715 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/sslink.c,v 1.6 2011-08-01 00:01:44 jacob Exp $ */ /* xscorch - sslink.c Copyright(c) 2000 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ A very slim slink list library for xscorch. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include slinklist *slink_last(slinklist *head) { /* slink_last() Return a pointer to the last item in an slink list. Please, please, folks, don't call this on a ring buffer... */ if(head == NULL) return(NULL); while(head->next != NULL) head = head->next; return(head); } slinklist *slink_insert(slinklist *head, slinklist *item) { /* slink_insert() Insert a list item at the head of the list. */ if(item == NULL) return(head); item->next = head; return(item); } slinklist *slink_append(slinklist *head, slinklist *item) { /* slink_append() Append a list or item to the tail of the list. */ if(head == NULL) return(item); slink_last(head)->next = item; return(head); } xscorch-0.2.1/sutil/sslink.h0000644000175000001440000000267511615366350012734 00000000000000/* $Header: /fridge/cvs/xscorch/sutil/sslink.h,v 1.6 2011-08-01 00:01:44 jacob Exp $ */ /* xscorch - sslink.h Copyright(c) 2000 Jacob Luna Lundberg jacob(at)gnifty.net http://www.gnifty.net/ A very slim slink list library for xscorch. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ONLY. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __sslink_h_included #define __sslink_h_included /* The basic slink list prototype. */ typedef struct _slinklist { struct _slinklist *next; /* Place the next pointer first, folks */ void *data; /* I recommend placing the data second */ } slinklist; /* Predefined operations on slink lists. */ slinklist *slink_last(slinklist *head); slinklist *slink_insert(slinklist *head, slinklist *item); slinklist *slink_append(slinklist *head, slinklist *item); #endif /* __sslink_h_included */ xscorch-0.2.1/data/0000755000175000001440000000000011615372010011065 500000000000000xscorch-0.2.1/data/Makefile.am0000644000175000001440000000076607625126637013074 00000000000000## $Header: /fridge/cvs/xscorch/data/Makefile.am,v 1.6 2003/02/20 10:27:43 jacob Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = accessories.def profiles.def scorings.def weapons.def CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch for file in $(EXTRA_DIST); do $(INSTALL_DATA) "$$file" "$(DESTDIR)$(datadir)/xscorch/$$file"; done xscorch-0.2.1/data/Makefile.in0000644000175000001440000002610311615371714013066 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = accessories.def profiles.def scorings.def weapons.def CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch for file in $(EXTRA_DIST); do $(INSTALL_DATA) "$$file" "$(DESTDIR)$(datadir)/xscorch/$$file"; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/data/accessories.def0000644000175000001440000001536310001646767014013 00000000000000; $Header: /fridge/cvs/xscorch/data/accessories.def,v 1.16 2004/01/16 02:35:35 jacob Exp $ ; ; accessories.def ; This is the default xscorch accessories definition file. ; NoAccessory = accessories_class { ; DO NOT REMOVE THIS ACCESSORY accessoryName = "No Accessory"; description = "A great big empty void of nothingness." armsLevel = 0; price = 0; bundle = 0; shielding = 0; repulsion = 0; fuel = 0; useless = true; indirect = false; stateFlags = "null"; }; BabyMagnetic = accessories_class { accessoryName = "Baby Magnetic"; description = "A small low-power magnetic shield."; armsLevel = 1; price = 10000; bundle = 3; shielding = 4000; repulsion = 50; useless = false; indirect = false; stateFlags = "consumable, shield, magnetic"; }; Magnetic = accessories_class { accessoryName = "Magnetic"; description = "A medium sized magnetic shield."; armsLevel = 2; price = 15000; bundle = 2; shielding = 8000; repulsion = 75; useless = false; indirect = false; stateFlags = "consumable, shield, magnetic"; }; HeavyMagnetic = accessories_class { accessoryName = "Heavy Magnetic"; description = "A large high-power magnetic shield."; armsLevel = 3; price = 20000; bundle = 1; shielding = 16000; repulsion = 100; useless = false; indirect = false; stateFlags = "consumable, shield, magnetic"; }; BabyShield = accessories_class { accessoryName = "Baby Shield"; description = "A small physical shield layer."; armsLevel = 2; price = 20000; bundle = 3; shielding = 4000; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, shield, standard"; }; Shield = accessories_class { accessoryName = "Shield"; description = "A physical shield layer around the tank."; armsLevel = 3; price = 30000; bundle = 2; shielding = 8000; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, shield, standard"; }; HeavyShield = accessories_class { accessoryName = "Heavy Shield"; description = "A large physical shield layer."; armsLevel = 4; price = 40000; bundle = 1; shielding = 16000; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, shield, standard"; }; BabyForce = accessories_class { accessoryName = "Baby Force"; description = "A small but impregnable force field."; armsLevel = 2; price = 30000; bundle = 3; shielding = 4000; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, shield, force"; }; Force = accessories_class { accessoryName = "Force"; description = "A force field surrounding the tank."; armsLevel = 3; price = 45000; bundle = 2; shielding = 8000; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, shield, force"; }; HeavyForce = accessories_class { accessoryName = "Heavy Force"; description = "A large heavy-duty force field."; armsLevel = 4; price = 60000; bundle = 1; shielding = 16000; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, shield, force"; }; FuelTank = accessories_class { accessoryName = "Fuel Tank"; description = "Some fuel for a tank's motor will allow it to move around."; armsLevel = 3; price = 1000; bundle = 10; shielding = 0; repulsion = 0; fuel = 10; useless = false; indirect = false; stateFlags = "consumable, fuel"; }; TripleTurret = accessories_class { accessoryName = "Triple Turret"; description = "A triple turret can shoot three of some missiles at once."; armsLevel = 2; price = 25000; bundle = 1; shielding = 0; repulsion = 0; fuel = 0; useless = false; indirect = false; stateFlags = "permanent, triple_turret"; }; AutoDefense = accessories_class { accessoryName = "Auto Defense"; description = "This automatic defense system brings up shields very fast."; armsLevel = 3; price = 1500; bundle = 1; shielding = 0; repulsion = 0; fuel = 0; useless = false; indirect = false; stateFlags = "permanent, auto_defense"; }; SolarPanel = accessories_class { accessoryName = "Solar Panel"; description = "Solar Panels recharge shields slightly each turn."; armsLevel = 3; price = 2500; bundle = 1; shielding = 0; repulsion = 0; useless = false; indirect = false; stateFlags = "permanent, recharge"; }; ContactTrigger = accessories_class { accessoryName = "Contact Trigger"; description = "With contact triggers, missiles will explode as soon as they hit anything."; armsLevel = 3; price = 1000; bundle = 25; shielding = 0; repulsion = 0; fuel = 0; useless = false; indirect = false; stateFlags = "consumable, contact_trigger"; }; Batteries = accessories_class { accessoryName = "Batteries"; description = "A tank's self-repair system needs batteries to run."; armsLevel = 2; price = 5000; bundle = 10; shielding = 0; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, battery"; }; Teleporter = accessories_class { ; accessoryName = "Teleporter"; accessoryName = "!Teleporter"; ; Currently, teleporters do NOTHING ; description = "A teleporter moves your tank to a random new location."; ; armsLevel = 3; description = "[unimplemented]"; armsLevel = 5; price = 5000; bundle = 1; shielding = 0; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, teleporter"; }; Parachute = accessories_class { ; accessoryName = "Parachute"; accessoryName = "!Parachute"; ; Currently, parachutes do NOTHING ; description = "Parachutes can save your tank from nasty falls."; ; armsLevel = 1; description = "[unimplemented]"; armsLevel = 5; price = 2000; bundle = 3; shielding = 0; repulsion = 0; useless = false; indirect = false; stateFlags = "consumable, parachute"; }; xscorch-0.2.1/data/profiles.def0000644000175000001440000000254207627651145013334 00000000000000; $Header: /fridge/cvs/xscorch/data/profiles.def,v 1.4 2003/02/28 12:13:25 jacob Exp $ ; ; profiles.def ; This is the default xscorch tank profile definition file. ; Standard = tank_profile_class { radius = 9; turretRadius= 13; shelfSize = 5; mobile = true; row03 = " xxxxx "; row04 = " xxxxxxxxx "; row05 = " xxxxxxxxxxx "; row06 = " xxx xxx "; row07 = " xxxxxxxxxxxxxxx "; row08 = " x x x x "; row09 = " xxxxxxxxxxxxxxx "; }; DoubleTrack = tank_profile_class { radius = 9; turretRadius= 13; shelfSize = 4; efficiency = 115; hardness = 90; mobile = true; row03 = " xxxxxxx "; row04 = " xxxxxxxxxxx "; row05 = " xxxxxxxxxxxxx "; row06 = " x xxxxx x "; row07 = " xxxxx xxxxx "; row08 = " x x x x "; row09 = " xxxxx xxxxx "; }; Fortification = tank_profile_class { radius = 9; turretRadius= 13; shelfSize = 6; hardness = 125; mobile = false; row04 = " xxx "; row05 = " xxxxxxx "; row06 = " xxxxxxxxx "; row07 = " xxxxxxxxx "; row08 = " xxxxxxxxxxx "; row09 = "xxxxxxxxxxxxxxxxxxx"; }; xscorch-0.2.1/data/scorings.def0000644000175000001440000000225007627651145013334 00000000000000; $Header: /fridge/cvs/xscorch/data/scorings.def,v 1.2 2003/02/28 12:13:25 jacob Exp $ ; ; scorings.def ; This is the default xscorch economy scoring definition file. ; It's a rather bad idea to remove all these scorings. ;) ; Basic = scorings_class { scoringName = "Basic"; description = "A scoring method that emphasizes number of kills."; survivalBonus = 100000; damageBonus = 0; killBonus = 40000; damageLoss = 0; deathLoss = 20000; suicideLoss = 100000; fixed = false; }; Standard = scorings_class { scoringName = "Standard"; description = "A scoring method that penalizes and awards based on tank damage."; survivalBonus = 70000; damageBonus = 500; killBonus = 30000; damageLoss = 250; deathLoss = 20000; suicideLoss = 100000; fixed = false; }; Greedy = scorings_class { scoringName = "Greedy"; description = "[unimplemented] A scoring method that pays based on unused inventory."; survivalBonus = 70000; damageBonus = 500; killBonus = 30000; damageLoss = 250; deathLoss = 20000; suicideLoss = 100000; fixed = false; }; xscorch-0.2.1/data/weapons.def0000644000175000001440000004173107630212652013156 00000000000000; $Header: /fridge/cvs/xscorch/data/weapons.def,v 1.28 2003/03/01 20:18:50 jacob Exp $ ; ; weapons.def ; This is the default xscorch weapons definition file. ; NoWeapon = weapons_class { ; DO NOT REMOVE THIS WEAPON weaponName = "No Weapon"; description = "A great big empty void of nothingness." armsLevel = 0; price = 0; bundle = 0; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; angularWidth = 0.0; useless = true; indirect = false; stateFlags = "null"; ; phoenixFlags = ""; ; phoenixChild = ""; }; BabyMissile = weapons_class { ; DO NOT REMOVE THIS WEAPON weaponName = "Baby Missile"; description = "A small triple turret capable missile that tanks have in near infinite supply."; armsLevel = 0; price = 0; bundle = 1; radius = 20; force = 400; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "triple"; }; Missile = weapons_class { weaponName = "Missile"; description = "A fairly large and inexpensive triple turret capable conventional missile."; armsLevel = 0; price = 1875; bundle = 5; radius = 40; force = 800; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "triple"; }; BabyNuke = weapons_class { weaponName = "Baby Nuke"; description = "A missile with a miniature tactical nuclear warhead."; armsLevel = 2; price = 10000; bundle = 3; radius = 80; force = 1600; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "plasma"; }; Nuke = weapons_class { weaponName = "Nuke"; description = "A missile with a tactical nuclear warhead."; armsLevel = 3; price = 12000; bundle = 1; radius = 150; force = 3000; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "plasma"; }; LeapFrog = weapons_class { weaponName = "Leap Frog"; description = "When this missile detonates the first two times, it shoots out a new one."; armsLevel = 2; price = 10000; bundle = 2; radius = 60; force = 1200; liquid = 0; scatter = 0; children = 2; useless = false; indirect = false; phoenixFlags = "chain, at_land"; phoenixChild = "Baby Nuke"; }; FunkyBomb = weapons_class { weaponName = "Funky Bomb"; description = "The funky bomb is a very unpredictable cluster bomb."; armsLevel = 4; price = 7000; bundle = 2; radius = 60; force = 1200; liquid = 0; scatter = 9; children = 12; useless = false; indirect = false; stateFlags = "plasma"; phoenixFlags = "spider, at_land"; phoenixChild = "Missile"; }; MIRV = weapons_class { weaponName = "MIRV"; description = "Multiple Independantly targetable Re-entry Vehicle."; armsLevel = 1; price = 10000; bundle = 3; radius = 40; force = 800; liquid = 0; scatter = 3; children = 5; useless = false; indirect = false; phoenixFlags = "scatter, at_apex"; phoenixChild = "Missile"; }; BMMChild = weapons_class { weaponName = "BMM Child"; description = "[ this weapon exists only as an intermediate form ]"; armsLevel = 4; price = 0; bundle = 0; radius = 50; force = 1000; liquid = 0; scatter = 5; children = 5; useless = false; indirect = true; phoenixFlags = "scatter, at_rand"; phoenixChild = "Missile"; }; BlackMarketMIRV = weapons_class { weaponName = "Black Market MIRV"; description = "A very unpredictable MIRV style bomb."; armsLevel = 4; price = 15000; bundle = 3; radius = 100; force = 2000; liquid = 0; scatter = 3; children = 3; useless = false; indirect = false; stateFlags = "plasma"; phoenixFlags = "scatter, at_rand"; phoenixChild = "BMM Child"; }; DeathsHead = weapons_class { weaponName = "Death's Head"; description = "A very large MIRV with nine nuclear warheads!"; armsLevel = 4; price = 20000; bundle = 1; radius = 80; force = 1600; liquid = 0; scatter = 5; children = 9; useless = false; indirect = false; phoenixFlags = "scatter, at_apex"; phoenixChild = "Baby Nuke"; }; Annihilator = weapons_class { weaponName = "Annihilator"; description = "A missile with a huge tactical nuclear warhead."; armsLevel = 4; price = 24000; bundle = 1; radius = 200; force = 4000; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "plasma"; }; ; This weapon is a debugging weapon only. ; If you really want to use it, enable the ; developer arms level (arms level = 5) by ; editing your ~/.xscorch/config file. TheChaos = weapons_class { weaponName = "The Chaos"; description = "`And the beast shall come forth surrounded by a roiling cloud of vengence...'"; armsLevel = 5; price = 5000000; bundle = 1; radius = 200; force = 4000; liquid = 0; scatter = 15; children = 15; useless = false; indirect = false; phoenixFlags = "scatter, at_apex"; phoenixChild = "Death's Head"; }; ; Don't even _think_ about enabling this one... ; Keep it around though, will delete once done ; with testing, it illustrates an important ; problem in interleave mode. TheChaos2 = weapons_class { weaponName = "The Chaos^2"; description = "We are in the final days. My time is come! Glory glory! What do you think? 5.1?"; ; -- The Master, ``Prophecy Girl'' armsLevel = 6; price = 9999999; bundle = 1; radius = 200; force = 4000; liquid = 0; scatter = 15; children = 15; useless = false; indirect = false; phoenixFlags = "scatter, at_apex"; phoenixChild = "The Chaos"; }; Napalm = weapons_class { weaponName = "Napalm"; description = "A small globe filled with jellied gasoline."; armsLevel = 2; price = 10000; bundle = 10; radius = 13; force = 60; liquid = 256; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "liquid"; }; HotNapalm = weapons_class { weaponName = "Hot Napalm"; description = "A large globe filled with jet fuel."; armsLevel = 3; price = 50000; bundle = 2; radius = 13; force = 160; liquid = 3072; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "liquid"; }; BlackRain = weapons_class { weaponName = "Black Rain"; description = "Looking up, you see a flock of birds. No wait! Those aren't birds..."; armsLevel = 4; price = 30000; bundle = 2; radius = 20; force = 500; liquid = 0; scatter = 7; children = 7; useless = false; indirect = false; phoenixFlags = "scatter, at_apex"; phoenixChild = "Napalm"; }; MrNapalm = weapons_class { weaponName = "Mr. Napalm"; description = "You know, it's like Mr. Fusion... only..."; armsLevel = 6; price = 3000000; bundle = 2; radius = 20; force = 500; liquid = 0; scatter = 15; children = 15; useless = false; indirect = false; phoenixFlags = "scatter, at_apex"; phoenixChild = "Black Rain"; }; Tracer = weapons_class { weaponName = "Tracer"; description = "A missile with no warhead. Pretty useless."; armsLevel = 0; price = 10; bundle = 20; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = true; indirect = false; }; SmokeTracer = weapons_class { weaponName = "Smoke Tracer"; description = "A missile with no warhead that leaves a trail of smoke."; armsLevel = 0; price = 500; bundle = 10; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = true; indirect = false; stateFlags = "smoke"; }; ShieldSapper = weapons_class { weaponName = "Shield Sapper"; description = "A missile with a warhead designed to drain shields it hits directly."; armsLevel = 3; price = 2500; bundle = 5; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "sapper"; }; RollerTest = weapons_class { weaponName = "Roller Tester"; description = "A roller without a warhead, for testing only."; armsLevel = 6; price = 100; bundle = 10; radius = 0; force = 0; liquid = 0; scatter = 0; children = 1; useless = true; indirect = false; stateFlags = "roller"; phoenixFlags = "convert, at_land"; phoenixChild = "Tracer"; }; BabyRoller = weapons_class { weaponName = "Baby Roller"; description = "A weapon that rolls downhill and then detonates a small warhead."; armsLevel = 2; price = 5000; bundle = 10; radius = 20; force = 400; liquid = 0; scatter = 0; children = 1; useless = false; indirect = false; stateFlags = "roller"; phoenixFlags = "convert, at_land"; phoenixChild = "Baby Missile"; }; Roller = weapons_class { weaponName = "Roller"; description = "A weapon that rolls downhill and then detonates a warhead."; armsLevel = 2; price = 6000; bundle = 5; radius = 40; force = 800; liquid = 0; scatter = 0; children = 1; useless = false; indirect = false; stateFlags = "roller"; phoenixFlags = "convert, at_land"; phoenixChild = "Missile"; }; HeavyRoller = weapons_class { weaponName = "Heavy Roller"; description = "A weapon that rolls downhill and then detonates a large warhead."; armsLevel = 3; price = 6750; bundle = 2; radius = 90; force = 1800; liquid = 0; scatter = 0; children = 1; useless = false; indirect = false; stateFlags = "roller"; phoenixFlags = "convert, at_land"; phoenixChild = "Baby Nuke"; }; RiotCharge = weapons_class { weaponName = "Riot Charge"; description = "Clears dirt from a small wedge-shaped area in front of the tank."; armsLevel = 2; price = 2000; bundle = 10; radius = 72; force = 0; liquid = 0; scatter = 0; children = 0; angularWidth = 60.0; useless = false; indirect = false; stateFlags = "riot"; phoenixFlags = "detonate, at_tank"; }; RiotBlast = weapons_class { weaponName = "Riot Blast"; description = "Clears dirt from a large wedge-shaped area in front of the tank."; armsLevel = 3; price = 5000; bundle = 5; radius = 120; force = 0; liquid = 0; scatter = 0; children = 0; angularWidth = 60.0; useless = false; indirect = false; stateFlags = "riot"; phoenixFlags = "detonate, at_tank"; }; RiotBomb = weapons_class { weaponName = "Riot Bomb"; description = "A bomb that clears dirt instead of damaging players."; armsLevel = 3; price = 5000; bundle = 5; radius = 60; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "riot"; }; HeavyRiotBomb = weapons_class { weaponName = "Heavy Riot Bomb"; description = "A bomb that clears lots of dirt instead of damaging players."; armsLevel = 3; price = 4750; bundle = 2; radius = 90; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "riot"; }; BabyDigger = weapons_class { ; weaponName = "Baby Digger"; weaponName = "!Baby Digger"; ; This weapon is currently not supported. ; requires underground digging capability, partially written. ; armsLevel = 0; armsLevel = 5; price = 3000; bundle = 10; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "digger"; phoenixFlags = "convert, at_land"; phoenixChild = "Tracer"; }; Digger = weapons_class { ; weaponName = "Digger"; weaponName = "!Digger"; ; This weapon is currently not supported. ; requires underground digging capability, partially written. ; armsLevel = 0; armsLevel = 5; price = 2500; bundle = 5; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "digger"; phoenixFlags = "convert, at_land"; phoenixChild = "Tracer"; }; HeavyDigger = weapons_class { ; weaponName = "Heavy Digger"; weaponName = "!Heavy Digger"; ; This weapon is currently not supported. ; requires underground digging capability, partially written. ; armsLevel = 1; armsLevel = 5; price = 6750; bundle = 2; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "digger"; phoenixFlags = "convert, at_land"; phoenixChild = "Tracer"; }; BabySandhog = weapons_class { ; weaponName = "Baby Sandhog"; weaponName = "!Baby Sandhog"; ; This weapon is currently not supported. ; requires underground digging capability, partially written. ; armsLevel = 0; armsLevel = 5; price = 10000; bundle = 10; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = true; indirect = false; }; Sandhog = weapons_class { ; weaponName = "Sandhog"; weaponName = "!Sandhog"; ; This weapon is currently not supported. ; requires underground digging capability, partially written. ; armsLevel = 0; armsLevel = 5; price = 16750; bundle = 5; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = true; indirect = false; }; HeavySandhog = weapons_class { ; weaponName = "Heavy Sandhog"; weaponName = "!Heavy Sandhog"; ; This weapon is currently not supported. ; requires underground digging capability, partially written. ; armsLevel = 1; armsLevel = 5; price = 25000; bundle = 2; radius = 0; force = 0; liquid = 0; scatter = 0; children = 0; useless = true; indirect = false; }; DirtClod = weapons_class { weaponName = "Dirt Clod"; description = "Drop a small chunk of dirt on someone."; armsLevel = 0; price = 5000; bundle = 10; radius = 40; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "dirt"; }; DirtBall = weapons_class { weaponName = "Dirt Ball"; description = "Drop a chunk of dirt on someone."; armsLevel = 0; price = 5000; bundle = 5; radius = 70; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "dirt"; }; TonOfDirt = weapons_class { weaponName = "Ton of Dirt"; description = "Drop a large chunk of dirt on someone."; armsLevel = 1; price = 6750; bundle = 2; radius = 140; force = 0; liquid = 0; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "dirt"; }; LiquidDirt = weapons_class { weaponName = "Liquid Dirt"; description = "Drop a bunch of mud on someone."; armsLevel = 2; price = 5000; bundle = 10; radius = 13; force = 0; liquid = 384; scatter = 0; children = 0; useless = false; indirect = false; stateFlags = "dirt, liquid"; }; xscorch-0.2.1/img/0000755000175000001440000000000011615372010010730 500000000000000xscorch-0.2.1/img/Makefile.am0000644000175000001440000000076107263671464012733 00000000000000## $Header: /fridge/cvs/xscorch/img/Makefile.am,v 1.3 2001/04/07 20:06:12 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = xscorch-icon.xpm xscorch-logo.xpm CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch/images for file in $(EXTRA_DIST); do $(INSTALL_DATA) "$$file" "$(DESTDIR)$(datadir)/xscorch/images/$$file"; done xscorch-0.2.1/img/Makefile.in0000644000175000001440000002607211615371714012736 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = img DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = xscorch-icon.xpm xscorch-logo.xpm CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu img/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu img/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch/images for file in $(EXTRA_DIST); do $(INSTALL_DATA) "$$file" "$(DESTDIR)$(datadir)/xscorch/images/$$file"; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xscorch-0.2.1/img/xscorch-icon.xpm0000644000175000001440000000261707263212752014015 00000000000000/* XPM */ static char*xscorch[]={ "32 32 15 1", "g c #008000", "m c #c0c000", "i c #00ff00", "f c #004000", "k c #404000", "l c #800080", "# c #000000", ". c None", "e c #ff8000", "h c #ffff00", "c c #303030", "d c #585858", "b c #00c000", "j c #ffffff", "a c #ff0000", "........#..........#.......##...", ".......#a##.......#a#.....#bb#..", ".......#aaa##....#aa#....#bcdb#.", "###....#aeaaa#..#aaea#..#fb#cb#.", "#aa##..#aaeaea##aaeaa#.#gbgbb#..", "#aaaa###aeheaeaeaeheaa#gbibf#...", ".#aaeaaaeaeheaeheheaa#gbiig#....", "..#aaeaeaehej######e#gbibg#.....", "...#aaehehe##ggbgbg#gbiig#...###", "....#eaeh##kggbfffkgbibg#a###aa#", ".....#ee#l#fgbf##kgbiig#aaaeaa#.", "...##aa#c#kgbf#c#fgibg##eaeaea#.", ".##aaa#lc#ffggf##kggfkg#hehea#..", "#aaae#cc#kfgbgbf#ckfkgbg#jeaa#..", ".#aa#lckcfgfgbgbf###cbigb##a#...", "..##c#kf#kfgggbbb####fhigbb##...", "..#lckfkcfgfgggbbf#c#cihgbibb#..", ".#c#kfkf#kfgfgbgbgc#fihigibigi#.", "#l#kfkfkcfgfgfgbgbfbibibfbigim#.", "####kfkfk#fgfgfgbgbgbibfbigimim#", "..####fgfg#fffgfgggggffbigimimi#", ".###c###gfgc#ffgfgfcfibigimimi#.", ".#lf##c###gfgccccccbibigimimi#..", ".#f#cf##c###fgfgbbbibigimimi#...", ".#lc#kff##c###gbgbibigimimi#....", "..#lfk#cff##c###bibigimimi#.....", "...##lc#k#cf##c###igimimi#......", ".....##lfc#kff##c##imimi#.......", ".......##lfk#cff#c#mimi#........", ".........##lc#k#f###mi#.........", "...........##lfcf#.#i#..........", ".............####...#..........."}; xscorch-0.2.1/img/xscorch-logo.xpm0000644000175000001440000020264007263212752014023 00000000000000/* XPM */ static char * xscorch_logo_xpm[] = { "310 210 65 1", " c None", ". c #020202", "+ c #F8ED0C", "@ c #DD0707", "# c #ABA664", "$ c #8E0202", "% c #F4B20E", "& c #700202", "* c #F07216", "= c #A69E4D", "- c #4A3A3A", "; c #520202", "> c #645954", ", c #968840", "' c #F5600F", ") c #DEDE82", "! c #944643", "~ c #D44138", "{ c #5F2222", "] c #222222", "^ c #2A0202", "/ c #420A0A", "( c #DEDEDE", "_ c #992A29", ": c #422222", "< c #E5DE6F", "[ c #CE322A", "} c #6B3C3A", "| c #D6CE6C", "1 c #1A1212", "2 c #C3C4C6", "3 c #F3220E", "4 c #F3D210", "5 c #7A7A3A", "6 c #EFEFCF", "7 c #FAFA41", "8 c #2A1A1A", "9 c #9E0202", "0 c #F5ED7C", "a c #F7850A", "b c #FE0202", "c c #B84134", "d c #523232", "e c #120202", "f c #B61A12", "g c #B4B3B2", "h c #F4450F", "i c #CEC662", "j c #353232", "k c #79722D", "l c #FEFEB5", "m c #BE3232", "n c #0A0A0A", "o c #7A2222", "p c #6A4A49", "q c #FAFA67", "r c #FEFE12", "s c #BA0202", "t c #C0B85C", "u c #928E8E", "v c #FEFE93", "w c #FC3205", "x c #F7950B", "y c #484443", "z c #F5F5F2", "0p:.e...e.........18n.e}&}j.1:d{].11;ee...............n./{j81:{11n..nnn11{1j-d{]8111..n1/{o11.81....1{&111.1181811.;n1..n...e^&:^...^/.1&f{]81881nnn18{{:.e.8d}d&$;^^.:&o:]]111]]]n1:o_&^./::dj1nn.1/188n118]d[}y-y-}!_:n8.e^.n..................................e.^nn./^.n.......t=i|=t", "=ty:8e..e.........1]..ed&dj].:}{]8.1/..e............e.e1:}-d]{{8111n.111:d]18};18]8881n1n{o8.n81....^&/8.....188111/81.n11...;&:88]jj{]n^_o]88]811..1n:{d1.e.j-d{s;^^n8&o:j]]]1]]1.8:_o;^e::ddj]8../{8188]]]j-m!jy-p}}!/1]8.^.....................................^/.nn/nn........t=|i=t", "=i>}.811ee........11...o&^jj/{{j88811/.ee............e1j-{/1n:{/1811ne18:::88}{.]]]]]]]]:o&1.8]8n.n1.&;e...n8]]/en.//e8..18.e&/:]jj:dd1.e&9/]]]18111..^&{jne1jyd{$$^/11^o{jjj]11...18__d::dd}djj]81.&118]]]jj-!_yyyy}}_{8]j::e.....................................^/n.n/nn.......t=|i=t", "=t>>>-]].e.........18...d&^jj//:]]181/;..e...........ee8jj{d:8]{{81811.8]:;j11}}8]]81]]8j{o&^.888..188&^^..111]8^nne1/11.....e&/18]j:}}n.^&s&jj]]]81n..e&dje.8dd{;&s&8/8/&{1]]1e..n88:c_-:d}}-d:8]]1n/e.]]]]jj-m!}yyy}}_o:]]]/...................................n.nn/nn^/^n.......t=i|=t", "=tpjd>jjnee.........8...:&;jd/;e.8811:/n...............1j:d}j8:do]]81.188:/dee&{-j]]]]]]:}_{en]]8n.11:{{11n188]]1/n.//.nn.....;;e..8;}dj.^&so-j]]]]....^&}1.eejj{;&s&::11o&:1]ne.188]8f_8:}pp}-j]1881;^..]]j]-dc_yyyddo__:188:81..................................n.;/n.n/^nn......t=|i=t", "=i.eje&&>d/18pj88^..........8..1d$;.-{:nnn818{/nn^...........ee]j1}pjjj{{:]]888]]ndd^e;&/j]11]1]dood:]]nn..]]8o/11111n8j;.ee^^^......e;;...^;/:j]:_m_j]j]]88818:{}eee.1:{;&f_:::1&&81...881]]jm!:-pp>p-d:8811{^1...8]j}~!yyyyd{fo:1]]:81n...............................nnnn1/1.1//nn......t=|i=t", "=t^^/1p-]]^e.........1..jd&&e-}}:]818/{11n^e..........e.:j:}p-jj{o::]8]]88n}{:j:&1181..11d_o:]]8...]8n/&:1n.^811j:n.e/^^.n.....;;e..^;^n1jdmm&881..nn...1&/.e^j1:{{o[_:d:8&&/1..18888]j__-pppppyd18888{881n..nj}[}yy-y}of_:1j]:81n......e.........................n.1n;/11n/1nn.....t=|i=t", "=t.ej.&op^^1/>-jne.........1..]]:&&1y}}jj1.8:{n.^n..........enejj/}pyj:{odj]]]]]81dddjd}{8]n11n.^_o:]n8111nnn;&/nnn88]j:{118;^.e.181..^&^.e^&^e.^/s9&..........^&;ee-d8^&{_[_d{:1{o;e..88111.1}m}>pppp>-]81]1{111nn..8!~}yyy}}_of:jj81/1................................nn.1//8n8//.nn.....t=i|=t", "=t^^/jpj8e^...........]]1.&&p-p{j-].]}{811^...........^1j:/d>y]{}}djj8]]].]dddd:}}]]]]]]]/f{j8.n....../&81n18]]jd:]]1{/eee.11.1:oj].^;^..^&ss/e.........^&^.--]^;{_mm_d::8&&;..11118...{_ppp>pp}j8888:{11.nne.^_myyyy}!_m}--]81/.e......e.......................n.nn1/{81n8/1n.n....t=|i=t", "=ie]ee..........8].e^}!y-^{>y]j-d::8.^...........e]j:/{yj-}}}djjj]]11:{{:-d_}j8]]]]jd_{:]]1n..8..^&/8nn]8j:d]8:{{^ee......:o:j]^&..1:_mm{j]]8881...;&{--8e^&{_mm_d{j1o$/n1811181../_!>ppp>>j811]:o:1n1...ef_}yyy!!m!}-j]1^^ee......e.........................n11{/888;:1.n.....t=|i=t", "=te^!!d^;8-pee.^..........].jj{}!^.:}>-8]d}d]811n.........en:j8/-d-p!do--j1j].8j/;;jd}_8n118]8:_{1]8n....n88&/]88]]j:{j]:{:8..11e...;o;nj{//1jd_cfdjj]]8]811n/_}j8e./}__[_dddd:__^118e^88n..^c!}}pp}}d]n18dd:81nne.efmyyy}!!m}-j88.^^n......e...........................n/{1118{/11......t=|i=t", "=t^;_p:;//:}:e]^.ne......8.jjj-__:jpp-]]]:o:j]:n.n........n1j:8{}j>>!}ppjjjj11j:;^^:o}o111]]-]:f;11..n1....^o/8]]8jjjp-j:}:81.88.e1]:$11jdo:]]dcf_dj]]]]]]]1e:}}.^1j}}}_3_}oddj_on18nnen.....f_pppppyj8]]]d}-j1n.nn.om--]:!!cyj81.e^//n......e........................nn1:&888non11.n....t=i|=t", "=t1/_!//{1/d-.e8.n.......1]jj-}m!pp>}j]]]:}:j::.nn........e1::1:p->>!!}j--j8.]j:;;^:d_o111jjj]:$o81n..881..^&/^]]jj->py-}}ydj:]1e.81{_d--}}--j{m[!jjj]]]1]818/!oe1dpp}oc3cdddjd_o8]8e^n....n/_m->ypp}-jjj]d}-jyj8ne.{[}1n:_m!}]1..^/^.n.....ee.......................n.e1/{:]]:{111nn....t=|i=t", "=i8&_d/:}}/:-ee^e.e...n11.]81:{$}>y}}jj]-{{djj:1.n........n88n^}}->>p!py-j].]--{;^:-}_{88]jjj]1oon8nn8]81e.^&&/8jjyy>p>>p}>>pyyjnen]d}dyy}}y--}m~cdj118]]]888:!o.:>ppoof@_{}{]{_oj].e^e..8]j:!cppppp>-jj]1}ddjjyy-j]/3{e]:_m!y]..e//81n.....e........e...............nn18:{8j]:o1811n....t=|i=t", "=ty^&$&^}}pp{-/.e^...nn..n.]8.^&_}::{}jy>yp{:8::8n..........1^8--}>>>!pp-y].1jjj{{{-}oo}:]j-]]]8&_:8]8n]81n.^o;^.]-yyy>>j:{p>>>>pj11d}!d-d}}}yy}c[_11188]]j8]]-_&1>>>p{&$bf{{{1/_o:8..^e.1j-ypccp}yp}->y]]:{{j--jyyy-jfs]jj}m_}j81./:^.n.....ee.......e..............n.118:{::j:{8111n....t=|i=t", "=t.^&$;;p}}/d-:ee^..en.n...]8^^&_&:]{}p>>yp!yd1/1n........ne^8d->>>>>>!!--8njjj]{{}dd__{jj-jj]88{f:]]]188..e{_&/^1]-yypp88}}>>>>>>d-}!!>]:oo:j:om[$^n18111jj]jd$op>p-:&&$@@;//./9&...e^.n8jy-p!cp}}pp>}j]]j}d:jy-j->yj{[}-jdmcpj81^:/^ee.....ee......ee...............1188/{d:j:o88nenn...t=i|=t", "=t>>>pp}y-d1.........nn1jd>k!>>>!!p}j.8j-jj{}}-do_d-yy-]81n{f:]]]]11..n{${1e.]jyy>}88}p>>y>>>y>>!p>pj{{yyd{@b&e.8]]81811]:_!>y>y:&&$@@&;;^^9$^..e^enn]-ypcc}y}-p}>j]dd{{jjyyjj--j}~!-jd!c}j8..{/1n.n....ee......ee..............n1818:{}jj1{:881nn...t=|i=t", "=i^e^&!}}y}p//dd^.:j8nn.118]]jj{&_o:-!>>>>>p}:.1/111......nn1::p>>>5>>>p!pdn]d-jj:}}ddo_}-yyj]188;f/n8j]8..n{_o//^8]-yp>}:8dp>>>>>>>yyo_dyp}!py>}@@$^.]j]]181njd!!y>>py{&$@@s;;^^&s^..e^.nn]j-y!c!:}{}}yd]y-}-djyyjjjj-}c!y-d!c!j1.n{/1/nn.n.ee^......e...............1n88]]}oj:8;{1811n...t=|i=t", "=t^^e^p!}}}d}};dd1ej:1n1nn11]8jd:_c!j>>>>>yyd{^^^n11.n......nn:p>>>>>>>!>!p-.]--jjd}odd__}}jj]]8111f&1]-j]n.8d_d{:j--yy>>d{]:}pp>y>>>y:{_8jj}}--}p~3$e.]]8]]1e]dp!cy>p>}}o$@bs^;;e&9;..e^e..n]-p!c!{{dd}pjjyy}}j--yjd-yy}~!}yy}c~d...{{/1nn.....ee.....ee..............1181]:o}djj:{881.n...t=|i=t", "=tp!}}}}}p/ddned1eennn11]]j-:}!cyy>k>y>jd&^e^{11n.n.n...n8:p>>k!>>>kcpp}.1j---d}}o}d__-j]8]888/_o^]j]]..1{_}::j>yy>>>-}y-!>>>>>>>yjoo;]jo!djjp~[f^..81]n/njjp!!>>yyd}_o@@s;;;^/s&.n1/e...]-pcc_d{d}}}j-yy}d--y>pypyyp~cpyyp![{.e.:{1^en....e^......e^..............n888]:d}}-j:o]881....t=i|=t", "=ty}c}}}}}};}j^ed^..^..11]nj-j>c!p{p>>yyyd&;^::81nnnn...n1]jp>>>55>>>c!>p.njj-j:}}}}}__-d1]8]]1/o9:]]]]...{o}djyyyjy>>>!>>>>>>>>>>>p}_djjd!}-}}~~f]11...enn-dp!pp}>}}o__33f{/;./f&n.1.^..n-y>!c_}do}ppdy->}}-jy>>y>p>!~!}yypc~&^.n^&^^......e^......^e...............8]]8{}}---d}:88.n...t=|i=t", "=i>>yyjo;1jd811.n...nnn8->>>!>>>!kc>p}..]j---}!}}}__d-]]]]]]8&f{n]]....^_;d-jyy]jy>>k>>>!>>>>>>>>!!}--}!pyyp~~md]]8...^n--pc!>>-d}o_33@_^&{8{f_^.e^^..8y-y!cmdd}}}}}y-yp}--y>>>y>p!~cdjy-!~_^n.^;^/......e^......e^...............1]]:o}}y--d_8n1nnn..t=|i=t", "=t&&^py}}c{}}}}{d1e^^.1.^nnn1]]j-p>!!}j_k>>pyd&/;:{:8111nn.nn8j-!>>u>>>ck!p>-n...:jd}}}}}!_{yjjjj]]8{@&1...1n.^$;djjyyjy>5>!>>>>>>>>>y>>!!py>!!}y-p!cc}-j]..e^1jy>!!>}-d___f3f{o{{:}mo8.e^^..]yy>!~_}ddp}}}y-yp_-y>>>>y>>~~_nn8}!~_/111&:88.....^^e.....e^...............8]]{_}ddy-}}111.n...t=|i=t", "=tp!~{jp!>>>y-o;^n:]18811nn.18jp>>>!>>>~!>p>dn..^1jj}_}}!__dj--yj-]:oc&...1]].e&&ddyy>>>>>5!>pp!>>>>>>>>>!>>>pppy-}~~~pyyj...^.--}!!}p}do_33@o&{o:d_mo81e^^.njyyp!~_do}}pp}-yy>}p>>>>>yp!~cd/1n{!~_:]1:{{:1n.nn.n.e.n...e^e.........n...1]8j{}}----d{n11n.n..t=i|=t", "=tpcm}y!>>>>y:&;^^{]]88n1nn11]jy!>>>>>>c>p>pj].e^8j-!}}}!_o:8jy--j8{_f;e.nn]]n.&od>y>>>5>u>>>-}!!>5>>>>>kc>>>!!p>d}~~cyy-j..n^1y-p!!}ddd_o@3f/o{{:d_cd]1e^n1jy--}c~}}}o}}}}-yyy!>>5>5>y>!~co88noccm:jj:d}/^..nnn/^e.n1..^^.1..n.1.n111881]j]{}}-y-o_:111.....t=|i=t", "=i>>>>yj/&;^^/:]]88811n8]j>>>>u!>>~>>pyyj1.^j-}_}}}!c{/1jjyjj]:s$/.....n..&_ypjy>>>>!>!>-}}}p>>>5>>>~py>}!>>domhc>-jj..e^8y-y!c}-}{of@3${&{{d}c~d]8e^:-jjj:}~~}d}}}!}p-yp>>!>k>>>y>!*m{]8n&c~!-j-y}o1n....1.ne118]]:88.n111111.118]]]j]o}}}-}}}81n1..n..t=|i=t", "=tp}11.^;&;^/d:]]888888]]jy!>>>!>>cpp>yy-1^ejd}_}o}c_}/.1]-y-:ffoe........{!p-jjj>>>>k>>-ood-}>>>>>pm}-y!pyddo3~~pyj]1..^jy-y!m}d{{of@3$&{{:{_m!-].^/j]]]j:}~~}}o}}}}pyy>>!>>5>>>y}!*_{81n&~~!pyy}}d{:1..../^..1]]]::1n.111111888]]]jjj{}pyddo{8811...n.t=|i=t", "=td^&^e.e&&;^/{j8]]8]881]]y>pp>>!>p!!pp-yy1^8-y}!}o__cd1^.8jyyd3o/1........{cpd]n.1--!!!>-o}{}->>>>>pm}jd}}-:{o3~m}yj]]11j-yypp~_d{{o9@3f&&{:d_c!-]n^/j]]1]j!c!}}}}!}}>yy>yp!>5>>p>y!*m:811&3~p>yyp}!d:1..n8/nn18]]j:/.n181...8818]]]jjj:_pdjo}:]8811....t=i|=t", "=t!~!1^&^.1^&&^;1::]]]]888]]j-ypppypp>!!}pyyj.^jyp!_{&_mm}/^.n]yy_m{]811111]8.{mpd8...n{}!!ydoo{dy>>>>y}mojd!o::{f3hmpyj8]-d:-y-p!m_:{{/ffwf&o{:}mm}yj1^^jj]]jdc~_{oodp}}y>yy>>!>>>>>y}!'m}:]8$3[}jj-}}!d:..n181^nn1]]j:/e1n81n...8]]]jjjjj:!}::o{:8]8]1..n.t=|i=t", "=i!cc^^$/111&&;^;{jjj]]]1]8]j--p>pyp}>!!p}y-]1/:y}!_&&om!}:^..8j-__d]811n11]]j{_p:8...^:{!>p-o{}}p>>>>>y__8j}_:8&_3w3dyyjj-:8jyyp!m_{:{/fsw3&&{8{m~}yj8^^8-jj-p!~m{&oo!}yjjjp>>!>u>p>yp!'!}-d:&b3o8]j}!}d8e..88n/1188j-d:n1811....18]]jjjjjj}{::{o:]]]11....t=|i=t", "=t!mf/^&/18:{&///{:]]j]]]]]jj-dp}p-}}ypc!}jj8n/8]d_o;&9cmod^e..8:c_-]]888]8n18}!}:1ee1:{}!ppjoodpp>!>>>>__dj}_::{$3h3{]j-]j:.-y>}_m_}:&{9s33o$o:}m[}-y:{^.-jyypp~m{o{o}yyyyy>!u>>>p>>>pc~!}yjjob3&n]-p!!d:e.n88n^en18j--{1n11......j]j-]jjj-}o{:dodj:]81n...t=|i=t", "=te{1..^^.]]]jyj:}}_@s/1{&181{_&//:}-jjj]]]j]jj-p}p-}_-p!!}d11ee^.1_$&&sff}dd...18!!dj8818]]]8:!_{:11]j-}}!!yjoo}p>>>>>y>pm}y}cd:{o3w3o]jjj]/jy-}!cm_{:&:&sbwf&o{{_~}y-j{/e8]jjd}33{&&o}}yyy>>>c>>>>>>>>~*!p}j1&b3&^8-y!}}:ne88n1/n111j---:8n......]jjyjjjj-ydo{dd}}:j]]1....t=i|=t", "=t-;d8.e^e8]1]jy]:{}9@s&1&&1888f&{{}yyjjj]1]jjj-}}}}--_}jcc}{1..^^.^$$&&$f@o}dd8.e8}c}j81188]jjj!_{/]-yppp!!!::oo}pp>!p>py!c}-d_{j{o3h3_:jj8n:jyyp!mm_:{o;&s@'@&o{:_[c>y-d:n.n]jy}c~oo{o}pyy>>>uc>>>>>>>!ucpp-j8$@3&1.j}c}od:j]]11/1n18jy-}-j]1...n1jyj]j-yyy-:fd{do}jj]]8....t=|i=t", "=i>>>!p_}:8oo}}>}>ppy>!cpyd_dddo[~~~}j]]j}y-y}_~m_{:&&&f@h3&_{{}~!}yj:/^n.1j}p!hf{&o}pypy>!>!>>>>>>>!*!!>yj8_3h}d]^dcp}--j]88n;]88]jy-}}--]1..8j-yyyyyyyyy1oo{dd_:j1]1..n.t=|i=t", "=t>>>>!o_{8/_o}y}p!p>yp!c}--mojdom~'[d-jjy-dyy}!~c_{{{&&s@hw_$o{}m~yyd:/n.n.jy}}~wo&$_pyyy>!u>>!>>>>>!a!ppyyd_c'!>y-}_p}djj]]]1::]1]]---o--j]11]yjyyy>ypy>-8o_d:do{8881.n1.t=|i=t", "=t}@djf&{/{&f@f&o_;o}}>;^8]j/:]]1.1]:d{$@@$/^o{;/8{ooo{}ppyj18]jj]d-}}}ojd_}:_m_{{-->}-8/f_&f@f${{}d]ee]!cyj]811]-j:$9;y>>>>!}ff{8:__}}yp}pyy}!~}-dm}j{o3'*~!yyj-----pc~mo{{&{;@@whs_o{{m~}y-://en.]--pm~_{&o}>>y>p!~p>>>>>>!'!p>yypc~*}yy}!!}p}jj]]]1/j]]8]]8/{:---]1yyjyyy>>yy>j]}o{{:&&.e11181.t=i|=t", "=t>>pdd39of[3o{{d-:ee8p~}-]]1n1-:1&s&>>>>>!}_o{:d__o}d}}}}ypc_}jdmd:}oc'*c!}yjjj-yy}!~m_{{o&&@@3hf$o{{m[!ydj{:11.]y}p!'m{$&&{8]j}!!p>!>p-]9ho}}yyp!~'o:->!!}}yj1]]8n::j]8]]1:/{jyyyyy-j>y>>>y>j8]{_&:/&&^ee.111.t=|i=t", "=ip8-y}d:n1jj]]}pofb@$1/f:::d_oo}!}!py]88]jjjj-}}o}:{_{:o[_}}p>>>py:ffof3f{&{d}jee:-!!yjj]8j]1e&@{>>>>>!!m_{8d_o}d-}p}yy![!dj}m:do_'',~!d-jj----y!~m_:&&&&sbw'@_f{{_~cy-jojj]8-}p}m~~oo$&&8]j-!!!>>pd{n$'${jjy}~~ho:j-!!}d--]]118:jj1]8]]{{d:yp>yyjy>>>>>yj:j]{f^{{&&^.e..8net=|i=t", "=tosm1:_o{/&&b@9&_o$_}{}jy-ddj1]jjjn:}of3@&/;f{::-__!}p!p}-]8n]jjj--}}}{:{o{:omm}}p>p>>-jmf_f@fo{}ddj8e8-_mj]jj]81e^;f!!>>ppp!__{]{c_ood}}}--!~_-j__:{_m''~c}yj]]jd:j-!~m_}{_&&@@w*@&ood!~cpj-}djjjyp}pc'[}_{_dj-yp!!!p-::/^&h9/88:}[''o::-!!p}--]8811{j8]yy>}y}pyyyy>y>y>y>>>yj:j1&$;{j&&/n^..81.t=|i=t", "=t>ppp>-_fof3f&{{d--:1^8o3/18]]1..^/m!>p>>}!!_!{1{o_o{do}}-d!~!:j_o:}m'u~c!y-8..18/e:!~~oo{$&&@bw'@_fo{_~~pyy}-jjj>p}!~~~_}_!_pyy>p!!}:/^;^;3s;;1.&@'ho:d}!!!}jyj8]8d-j1y>>>>!>>y>y>y>>>>>>>>-jj]8&$;{}&&81^..11.t=i|=t", "=ty>>p>y_[of3f{{{d:--8^^&b:1.n...ee}~!!ppy}}!__{8:s_oo{}o}--_~_jjco:dm**c!dyj8..n/^ej!~mo{&_&_@bh*s$f{}}~~py-}d8n:-}p!'*m}_}_}pyyyp!}{//^;/^b@&881&b''_}d-c!}}-jjj]8{jj-y>>}!>p>y>>>y>>yyyyp>>yd88;$;{{&&;8^..11.t=|i=t", "=i>>}p>y}[ff3mo{{j---:^^&3{]1....e^}!!ppy--}_m_}]{f_&{:{_}dj_hcjjooj_~ac}}-y]8.n8^^1}c~mooo$&sb3''9foo{m~h}pp}{1.1d}c~*~!____!}y--}m_//^///^@b}:]8o3'*_-y}!cp!yjjj]]ddd>>-:/{}>>>>yyy>>y>>>>>>>-j:o_{^{o&^e^...11t=|i=t", "=t--]8n1]]jjyy}}_d{{_&{{f3_}-}y>p}--}[_f3mod{djd-d8/f3dj1....e^>!modddd}_!_{j{of_$:oo}djo3[{]ocj!~a~}yyjj8n18/^jp!~mo{_$&fbbaw$fo{{ch[}ypp}nn.{}mu*[_}o!_}dj-j}oo/^^;;;es3odj:{@*~!p}-!c}p}jjj8j-dy>>-;;^:y>>>yyy>yy>>>>>>}-j:_o{{{f;^e^1.11.t=|i=t", "=tppyd}3mm[m_odj:dd}}dmm{1n....e8p[f&{::do_m!}:{f_oo:{_o:jo[3dj}mdd~u~}yyj]1n81/ej}~~_oofo$@33xw_s_{o3'~py>pp:1./oc'*m_o____}jjdof&;^^^;;^f~odj:o3**_d-d_m}p}jjj]jj}y>>y&;/jy>>yjyy>yy>>>>y>>jj{fo{{{od:jjj]8n.t=i|=t", "=t!-]1{}[u'm___om_{jj:of&^;^;;;^f'o{j:&3**_dddcm!ppjjj]j-}>>>p}ddyy>yyjjy>y>k>>>yypj]{f{&{o_}-}-j]81.t=|i=t", "=i-o@s&;^/:{f3o{:{f_o$:{fo::}f~m:]__:_='pyyjj1.e;^e8!~~_of$$fb3ha@ffo{c'~!p>pp!p-j{}~*'co_m_modjj:_f&/^;^;;.f~_8j8_3**_d:d_m}!pjjj]---p>>>>>>>>y>y]1jyj>>5>>>>-j1&s&{{_p>yyjj]11nt=|i=t", "=ty>>ppy-d}~*~mo_om_!d:::of{/;^;;;^$h_:18owa'_{dd_m!}}jyj]jyj}->k>!>>>yj]..111>5>>>yd:1e&s&:{mpy}-:]]81.t=|i=t", "=tp!ppyp}~*~m_fo_mm}j::_s&///;;&^$*$;119wa*&{:}m_!py-j]]yy-}:y>k5>p]1n.e]j:]y>5>>y:1.^&f}}}!pyd:]]8n1.t=i|=t", "=tyyj^;;^:!~~m_9f$@3w*x@ff{_~'_pyyp!>>yy}}~a~m_fmom_{:j:$f&////;&^$'9{1^$wx*&/:{m_!p--y88yy-d{->k>!{...]j-j:]y5>>yd:^ee&m!}!!}-dj88111nt=|i=t", "=ipp!pyyp}*uwmofff3m{j::of{{/&/&&;&hs;^e&wx*9/:{mm!}yyyn]jyyd}d>>>!{:8]--j:8]>>k>-j1^eeom!p}c}-}j]11en.t=|i=t", "=t>}!d8]jj]n:-u>>pd:.;e]}c!}}!}y}-j]]81.t=|i=t", "=t>>>}}on]jj::d>>>>}d]e^1-}c!!!!!}djjj]]11t=i|=t", "=t&c~o{/{f@@9$9swws@@s9ffo{ooj:o{1jj]]j-}_3h@/&9@$&&&&&cmc!!y:/8]jj]8]j!!_}{_f&{9ws_;{:&o:8f'3@3'3_o{:d{}}_~~~{8]]-yy}{sb@9&;;/&$@@s/;9@@s&&@9/&h3&/nn&@@o{c*t~yyyy-}}}-dm'hf9sssbhha%@@fo~*m}-y}!}--d-_**3off_f3fo::/o[&{/&&&&;&b3&^e;ba%3&:/f3_pyjyjyy--{!>5>>}_o/:j-dj>>5>ypd1.^dy>!!!!}!p-dj]j]1.t=|i=t", "=i-:dj-jj]]y!__}osf&/&w3$&{/{&:/ohh33~ho_{:-{{dm~*c}::j-y-d;s3s9&/;;&$@bs&/$@@@$&@s/$wb&ne/f3f{{m*#~pyyyy}!}-}m'~ffsssbhh*%h@@&3,~odyp}}}--}_a,mf3ff@ffo/8:$@{&/&{&$/&3b&;e;@*%h${;93_!yyyyyyj{_>>5>5}oo::j-j}5>>yp>}8^/->p!~!p}cp>}jj]11.t=|i=t", "=t!c_}{ff&/&w'$$^{/$:1&hh[3'hfo{:{{}dmc'!:::jyyj{;@3s9&;;/&sb3s&;9b@@$&s@&&w3&e^&@3&{oc*%~pyyyyp}}d{c*hf9@s@bhh*4*f@of*~}ddd_}}-j-o**3o@f@@@f&8/:_@&:/&{&&/$hb&^.;@a%*$/;&bc!yjyyyy:}}>>>>>p__/:]]j>5>-y>>p-8:}>>pc!!pc!-}-]]]1.t=|i=t", "=t{~~{8{f33ss$s@hhsb@ssff{{_d-{c{8j]jjj-}!fhwo&ss&&$&&f3mmc!}y}}y]n1]-y!!_o{ffo&&ww$f&;:&&1&3'w3'*@_o8{{}om*c!{:]j]y-{;@3ss&;;;&sb3s;/9bbbs/s@$;bw&^n&bf&{f[xi~pyyyyp}}-{f*h@f@s@bh'*4asb9_**_ddd}_}djd_~t3f@f3@@@{/:/&@&&{&&_&;s*@&/^{bx%*$&;&bm!dy-jyy{o}>>k>>p}_{n8]y>5p-p>>!yd{>y>p~!}}!!dd-j]81.t=i|=t", "=ty}}-818jyp!!m}_@_&&9'h$9/&/&&/&@'ww'*@fo/{{{_m'm}:/^]-y-d&b3s$;;;&9@b3$;&sbbbs&s39;bh$e^9wf&{f~%t~yyyyy}}}d}3*h@s@s@w''a+as3ff'*m}:dd_}}dj}h#3f[ff@3f/1//f@&&/&&9&/@*s/^^&w%%'9/;;b3cjyjj--{o!>>!>>p!!{/8j>>>}yp>>>>jj>>p!m!__}!d:dy]]1.t=|i=t", "=i>>>>!!!{:j>>>p}p>>!p-d}->}!c}!}c_d;/j-1n.t=|i=t", "=t!>>>!!!}-p>u>pp>>>pp-dd-p!cm!_}_!://e8j1.t=|i=t", "=t>ppp!!!p>>>pyop>>>!}-ddy}!~!__!c_:/:]].]1t=i|=t", "=tpp}}!!!p>>y--}ppy}}pddd-}!m!__}[}1{:]]1e1t=|i=t", "=tp}}/8do}dd}d}_3!m__[{:{n18]]1t=i|=t", "=tp}o{:d}od:}dd_~mc__3o:&11]]1.t=|i=t", "=i>p>do{:doodd{d:o[3ff_3o;{:81n1.t=|i=t", "=t!~~mc3@_sh%'@@9$&$9&@%xa%4%hb@s&&&fm'g[_/18]]}_~''bb@9$$$s3'h$@'x'@sw'b9s'as^/bws$@'<|,_yjyy}!__oo3%4*3'ha%%4rr%ba3@x49{&/fo&{:8&_'4h3w3h*3;&9s3@$&s@s@@@&s''s;$aras993*'c_-yyyy-!_}do&/{@fod-y>-doo{8{oo{:{::o@3ff_f3&{}-jjj]t=i|=t", "=t!~~mf3ff3%%h@@ss&$@9sa%%%r4a3b@$&_ff~a'f&/888{oh=w3bs9999sb'%@$wx4'9bxh@9hx@^^@'f_f'4|=}----}!m}oo344*h'*%+4rrr%ba's'+w&&{fs_&:8&$34xwhhh*'s&s$b@9$@@bb@s$bx'@&&b+r@sff*xm~}--yy}}m}:o${&@@_{{:j:/&&//{oo8{//{s[@@@3fh_{o}yj81t=|i=t", "=tc~hm~3fsh%%b@@ss$&@s@a4%4+4x3b@s&$ffw#%@_;8188_h*~w@ss99$@w*%@$3x4x@bx*b9h%@e^@'@93h4}_@'4+7%+vqrrqqqr4%%*%4x%4x3a+|%'f{1]8f''%7rxw%qvqr+qvvvvq04~_~~}jyy-}~#4<=x4r%*r4*'aa'ba%rvllllvrr4%4xwhx4)2zzz((0vlv4bbb''bs9@3%qvqvqqqqlqvlzzzzzlz(2-jjjjjy2(zzz666z60++'_dj]:6zzzzzz2ujo@@9$@ba3ss@h3ss@s@t6zzz((2uj{}8.1.t=|i=t", "=i[;..$ax4qv7rrlzz>]]]]]]]]]]m_}d1888m)00+0)q07vql6zz(]]8]{pk=tg##uuky]>zz(22v*_:]]:3%0q7rq77vzzzg]]>kf$//&9!p]yz(()7+70v)q3-]j-_3+v))(zzzzzgjk,ii#yy(z(g2zqabbb*abs9b34qvqvvqqvlllzzzz(jjjd>kkcc,,==5>jj(zz(()julvlllqr77r+rq77q070(zu]_^..9x%r7vvqlz]ju2)0,f1]1{3+)v77qvlzz2]y#4xb;;;;&@3@@kj]z(2))vj2z2>=+'m{]]]{*i#2gjdf@3@s$@b''bssba3s@@@wx4)g(2j-d]yy]111t=i|=t", "=tjjhwha4%%quyu2ky4b3w3xx3@sb34qvvvvqvlzzzjjjpxb&&@3$&&^^&$9$s@@s3kyjj!|*o{]1]]{mugj]pssbbs9@3'*3@@3a3s@bbhx47ugjjdj]y]]81nt=|i=t", "=t>juvlllvrq7rr7qqq0l6zz1],@..es%4rvlzz])lvqrx+aa34++%~_{1818n3|)))6(zzzz]]j=ab@&9@bb'xse^sbhha%%''k]]uao:8j{h0qvqqzzz]-*'hw@b&^;^&$b3@@'x4=jy(2u))l<[-jy}'=-dm~i5gjjkwwha4xxrv>5(>jk3whw%%3@sbwrvvvlvvzzzzjj>3ba@&&@39&&^^;&$;;9&&@xyjja4ho:1..1]{ggjjk3s3b@$@3aa3@@3awsbbb*x40gg1]--1j18]net=|i=t", "=i(uu(6|t}--}!m_}_[j}whhh4%3@sbhrvllvllzzuj-#ws@a@;&b3s&$^^;&$;&9&&@*,jo#4w&81...8]g2]j,x@bhb9@3aaw@@3a'@b3b'%4+g2jj-j8j8n881t=|i=t", "=t!~mm3*4qujy>jkzlll7qq7rqvvvl(z]]>4@;e..9%r7l((>r4a4rqr4+x*b4<z(<_-j--p--}[42(-j=awh'+r%47vugujjwhh'+%3b@3hrllllzzz>jyi%@9@ab&&@ws&9;^;&s;;s&&@'kj3x43:]81..n1# j],43@h3@@3a%hb@3*xb@wb'x4+g ]j-j.]8e8n.t=i|=t", "=tq4a@33b&sb3h%a9^&@haa44a3ff-txhf{]]{~ygu>u()'-yyd-y-}m%22jj#xh'a4r4%rvggujjh''a+%wb@wh76llzzzgjj<4'@9@xb&&bhs&9&^;&s&;9&&s'!{_#4@{j]j]nn/g2jj#r*b''bsba%'b@ba%3@h3*%4+22jjdj.111nn.t=|i=t", "=izllqvq77vll(z]]y+*[f&^..&%+72(]yg(t}djyy--}mx2(jjt%''a4rr+r7((u-jw''a+%hb@w'qlzzzzzjj#+3hbs@xb&$bws&s&^;&s$&$9$swwo_a43:jjyyyjd22jjgr%3'a3s3a4'3b3a+hbhh*x4+22]]!1.......t=|i=t", "=t>yullqvvrqll(zy]y|a~3@&^e.;*4r2(]trrqqv7r77+4a'4<)%3{-jj]/*)((zg]]|%%+%w@h3s$bww%%s^&b'x%+%'3@@***'3{]]{hv((6]j(577vvv77q7r+x'+)+twojjj]/*)((z]]5%ha+%abhh@$@ww%%b^;b'x%r4'@@ha**~3{]]:h)((#]yr+4aww'*w33$;;&$@a3w4%%%%r+4>u2j]g6vvvqv6z2]j*%*'~3@$;een@+ruggyyullvv6(z1j3~%**~w@9;e.ns4r#uzku(llvvvvq7r%a<)<4*f:]]1&x22(]]kr'hxr+43w'3s@wha4'$;@'%%r4*@@axax*fo]]{*226]jj>)md-y>y-}mx2(jji4'a%rqvqqv(>-k43'xa%r%h3b*rzz(6jj4%%33'3@b%3$sab&@@;;&sb9&ss9s3*3_@r%_yyjyy!x22jj2q74%r%w3%+%*xa+rx*444+7)2(]-t!].n1...t=|i=t", "=ip)ll6zz]j4ha%*'hh@$;ee.9+r=>ugu#266vllvq744+))|af1]]]{422(]]#4*'%rr4hhaws@w'x4a9;@hx4r+*33x%#a'@{8]:'22#]y7rr4*'axaw'b9&$&9@h*b%++4+r+4|#ggjjt!-yyyyypct2(jj<4ax4rqvvv66jy<%3'xx%r+'3barz6(>-y4%xbwaw@b%3$sab$@@;;$@b9;@s9fw*@_@++_yy]jyc#(2yj)v7++r4w'474%%%0+%xr+r<)q2(]]%!:......t=|i=t", "=tulzzz]])%w%x**'~@&^..^s+rayy>2gg2222(())7<)0)+af81]]&%222j]0**x+rr4h'ahs@h*x4xs;s'x4rrxw3%x%x'@{]]{a22y]kvrr4aa%%''h@9&$$sb'a3%r4+rr+%r#g2jj#cyyyyyy!m%2(jj4%a%rqvlvlzjj#rxw'%%4r+ahb'%6(zjj,44a3hahbb%wssxb$bs;&sb@$9@ss@'a@_34r_yyjjy!i222]2vq777+'a<<4i44<+4+<+)v)((zj]|!j......t=i|=t", "=tg(2((222222)())xc1181{i22>]y+x*4rrr%'axhsb'a%+%s;9'x+rr%w~%%%ahc{]]{= ]]5qrr%ax%%haw@&99ssbaxw%r++rrr4)gg(jj=!yyyyy-pc42(jj4%x4rvllzz5j#r4xhx%%4rrah3'a666jjt4%awhahb34hssx39bs&&@3s&@@@@w**@f34rmyyyy}m422(>g(60v00t4<)<<<0))<]]]]]]pu26622gug))tm1118{#ggj]>4xx+77r%'%xhsbax4ras;s'%rrr4*h%|tx'f:8]{#g2]juvr74ax4x'ab99sssbhxxh%r+rr7+47(g(]jk_ypyyyyp[t2(jj<%x+7llzzzytqr+%w4+4r7rx'whx((z]y<44aw*ahww4h@sx3$b@;&@3s$b@@3'%'3@~r+myjyy-c<226>>u2((66666z6z66zzlzzzzzzz(g]jh}yj.....t=|i=t", "=tgg]]uvll+*4xaa*@&^^e;s+7rbbhcj]]]]]]]]]k(2g5k)%c:n11o#g2]jk4x%rq7rxa4xw@wxx++'s&@a%+r7+*'%4ia~m:]8f#22j]uv7r+x%4xa'@ssss@3'4%w4rrrr7r+<(2(jdkpyyyyyp}~%((jj7%%+vlzzzy)qvr+x*++4r7rxawhx((6jj5yjj3{-y]....t=|i=t", "=t5#m811]{#g ]]>+x%+q7rxa4xw@h%4rrhs&bx4rrqr%*x4%%hfd]:o#g2]]ul77r%%4%a'bs@@@bhar%hrrr7qqr+)(2(jj!pyyyyyyo342(j]q4%+vzzz(yvvv7r%x+r47qr%ah'x2((jj)r+ahax'h'4ab@''@b3&&@wssbbhx4xh@3av+_-yjyj~)g2j]y=#txta'cm!!!!c=,t##=#kkyyj]]3{y-j1n..t=i|=t", "=t]]u6l6v%%i%a*3&^^^$%77%bhhwaa*hb'+)tuj]]5>j]%c8n11o,u2j]k7x%rqqr%x4%wbx%4r+39&3%+r7q+%a%+<%'m:j:[#u2-]5lqqr%%44aabs@@bwa%+%ar7r7qq7r0(2(jjcpyyyyj:{3%((jjq+%+02(z2yulvqr%%rrrqq+%x'*%22(jj)rrx'a%*ha4ab@hab@3s&sw@s33'%4*33'4v4!yyyy-~)g ]]#'_!_}pp-yyj--}}_c3h~[[~#kkjj3d}yy8nn.t=|i=t", "=t)%%rqq7%%+%wba4rr43$9hr+r7vr4%%+|%*fdj:mtugp]kzl7qr%+4a%3@@@b'x4r%xr77qqq0<0(2(jj!pyyyj]8&3%((jjv+%r7u>> kk2lv744rrrqqr%x'ax2((jj)7r%'x%a*%4'3bhxwsw@&$3b$33*44x33*+q%!-yy-}~y>(66)%+%tx'f/^^srv7awa**%xab9ba4+%+6yyu]]>_18]n^~ugk]yq4%+qq7r%r4'3a4rr+39s'+rrqv7+%%<+|a3:j:miugujpzvqqr44+x4h@bb3'xrr%%r77qv77<)((2jjcyyyyj]no3|((jjlr%4r7>jjg5u6v7r4rrrvqr4%'x%22(jj2qr4'x%a*%4a3b*%hswh$$bwsbh'%+%3[a7vx!yjy-pc)2gj]4[}yy-]181......n]jj81]{'g2]y*!pj]811.t=|i=t", "=tu]]y$1]]8.cuggj])4%rqqqr%r4xba+rr+39sarrqqv<+4%+)<%f{]jo%uu ]](lqvq44r+%xbbb3*%rr%%77qqv0qv62(yjypyyyyy]8oh42(jjl74+4%4y-jguu6vr47r7vqr4%axx)2(jjuqrra%4xa44xwbx%h@3hs&@hb@w'4r%whx7q%_yyjj-*)22jj|~}yj]n.....]j]jyyy-yj1{[g ]y#!{]1]881t=i|=t", "=t]j5y#(l<0+%4%wf/^$%qqxw%xa4%xwsb%rr+7l25g]]p&1]]81&uug]]#44+qvq74+r%3*+r7rhssarr7qv7744<+<%*{8]o%uu2]]2lvv7r4+rx4hbb3'%rr447qqvvvv0(((jjppyyyyy-:_~+22jjl04+4hwxyjjguu6q4777vvrr4xxx#g2kj>l7rax4%xr4awh4xh@w'@$sw39h'%r4''x0qi_yjjj}~)22jy|~}yj8.....]]]]]]-yyyy-/[g2j-tm}]8888et=|i=t", "=tuy]>llvvr+rr4+a333'%rrr4rqqlv6))((6jj!pyyyyyyjm'+((jjl7++4bff~yjjgu#6+q7rvv7r4%%x*gg2jj)q7%%r4xr4aha+xwb*ab9s3h@3a%++xharqi~yjj]j~]cyy-y-!d]>>>2)<)+44%3&/n@7l+w44x4+%'sb4777q6(gg]]!}jjyy]/>>55jj)+0v0vq++7ra*+r7rxb@hr7qvvq)r7+q)+0m:]8f|>52-j(llv7rrr++4w33'%+7r%7qvv(lllz(yjd!yyyyyyy:o*)((jj67+rx3{d}mpj-gug0qq7vvqrr%%x[uu2>juvq+%++%rrxh44a3wxx3ss3abba%r0%~xr5(0)++4%'s/^$7lr34r%4r%'@@47q7vl(22]]_}]]]y]n!k>gyyu))0vvqrrqr%a4rq7%3@h+qq0l)q<+))))+~j]1/~5>5>yuz6vqr7rr++'wwh4r774rvqll6z((zjj!-yyyyyyy:f*02(jj67r+'}d-d}_-jjgug06q0lq7r4%x3k5uu>>))74+r4rr%'r4awx4%bss3a3bx4+7r*%r)<~:18]jc<22jy)*{81]jj]1.......n]jyj1o*g2]y)=md8]8e1t=i|=t", "=t5(0)+++*@&^$4l7w4r%4r4a@b47qqll((y]jcp]]]y81->>>u>y))6l0q+rvr%a+7774w@w7q0ll))0))))q+i_..n9,>yu>y(ll0777rrr%hh*4r7747vv66l(6zjjyc-yyyyyyyjo*<2(jjl7q7[}--y-d!}-j2#g))v6q0+4x%@!>525>u6q4++r+r4ar+xa++xbs@haw3x47q+%4q|)*/81]:m)22jy)x_88-j]........n.]jyj/@tg2]y(a~}]8]8.t=|i=t", "=iu(7)+7*@&/&<(q*+r4rr4abb+qqv66((]jk!yjj-yjn.pyy55>5(()v0r7q74%r7qq4w@'7)q)6(0))))(l(5'^..^@>y>u>kzlvv)77+r%*'*4r7qr70v666(z(]jcojyyjjyyy-c'7((jjl)<%c}yj]]]{_pj-(gg0(6)+7<%%3{py>25k2(r+7r+qr%rr4+rrxb@@'%w3%r0)<++)(2!/]18:[)=m88y]......n.nn11]yj{*0g2]yq=~}:8j]nt=|i=t", "=t#)0<+x@&//zgqxrq++r+xb3rqvll(6]]dspyyyjyyj..d]juu5=()7<7)v+r470q04h@*0)66(60)))(z6]k4;.../f]]yu>ullvq07+r4xxx+7qq+ql06(66z]j,c]jy-jjyyypc*<2(jjlv)|c-8]]jjjd_>jj(gg((0)+<%#3{_-j>g5u2)7<0rq+47r+77rxw@3a%'*47q)vqvzgj@:]]j:3)2(]>|i_j1j81.........nn]y}m4(g2]y7*~}]]j].t=|i=t", "=ti~!81118]j1..n:y]j55u))+%3&;&(uv%rqrrrrxw'rvvlzzuj][&yyyjy]-yj.^jjjuuu#(000l)q+r@/]jjyjjyyyym*+(6yj(()ic1jj-jjjj:_!jj(g2())<+|%oj{>jjy2gg2)qv0q7r+q7qqq4hw'x4xx+0)zlzz]5'{-j8j}~)2(]>(ic-]-n..........nn1yy~7(g(]-+*c}]8]1.t=i|=t", "=#||=.1n111{*i<))(z]y*md]8n8111n.8]1.nj]y55t)|%3&/&gg)rrvrr7r4'%7ll6zg]]c&jjy-jjjj-y-.1jjj>g#g|))000<000)q)icj1j]n...........n-yh<( (]j|*~}8]11.t=|i=t", "#=#|t.881.1{%))))(yj!j-881881n1n1]jj]..{]ju5g|%3o:&#zur7lqrqq+x+vzzzy]jc}pyyjjj]]jjjy].&j]j]gg22())v))l(604*~<((((zzz]jp@c!o/en....n88}j]]u#g(lqq770+)))06)((zz2]j_}djn1]j]]jjyy!~#0((5jy,up-8j]]jjyy]]dm,-j5(6))<+*djj{3,-jj52(((6vvq7v666))+44+))0zz(]>k[}e11]jy]}%(26]y(<[.1jj]81....nn1n.n-y[7(gg]j<*!yj]81.t=|i=t", "|#=#k#|[o8o,2utvlv0v0v+0zz(]]ycpyy-jjj8n]]]j-y-8&>]]]]2222(((6)6()<<<)(zzzu]-_o/1j-j]]]]1nn88]:dj]]]u22(lqq7)00)()(zzzjj-}>j]]1.j]n]j-yy!*i)2gjjjj-y-]j]jjjj-j88:m=yjj22g()'d]nn{3,yjjjk2((((0)666z66)()6zzz]j>'co:.1n]jj-]ot2gk]]#i[^.nn...n.....n8nnjym+2k]]]jdd}-]11nt=|i=t", "03$^/_d]>#2())6(zz(]]j!!pyyjjj]n1888]]jjyyypckj]j]j22((z(6(6zzlz2]]joo^8811j-]]]8]]]]]j]jj-}dj]jk22((66l(66zz(]jd!p-yj]nn8]81]jjyyca)(gjjj}}>-j]1]j]]]]j-]j:m'5jj]jyy~:.1jy}c~uyj-jj#(6zzz6z6zzzzzujjk=*!o18n1.]yyjy]{%#y]jj]]oe..........nnn1n8]j{45]j]jpo/]jj81.t=i|=t", "000)#..nn1ef466(]:88n88811e1n111nn]]jj]88^fj]]]j$e/9d]]]y (6(u]]]-!!pyyyyj1nnn1nn111]jjyyypctuy]]j]]]]]]]]]]]j}o_{:11]]..]j8]8818]8]]]]j]-do}jjjjjyg2(25]j]yk_pyy-]]1nn]]81]]j-pci)(jj5!!y-yj]n]]]8181j--jj{3kyyjyj}1]-y-ypp!ckkyjjjj]jj]j]]j]jyk,**c}:j8]j8]yjjjy]:~y]jy_c}d.............n181]j13>yk'~f/1n]j81.t=|i=t", "000q0.n1.1n_t(21/...n8881nn.n.1.nn]]]jj]188fca,~o88{f3c!}}}ddd}!!ppyyyyjjj1n.n1n.n.1n1nn-yy-}~*%t=kkyk>5>kmoo}{:8]]81]]]..]]11]]818n8]]jjj--d_~k,5k>k>5,=,w_!>yyj]]]88]]]]]]jj-}x0(]y#~!>yjjjn]]1.1.111]jj-y}}_oo}!}yyj1]]]]jd}!~=,uky>>>-}doo__!!}p:]]8]jj1jjjjj]j]oo_o&/:jd]............n18]]88/_c!d}::]1n88..t=|i=t", "==i00..1118}xg]f^n1.1118nnnnnnnnn.n1]]]81n11-!!!p---d{;o&{{}}}pyyyyy-jjjj]1n.nnnnn18]nnnnjyyyy}os3~**'~3fo:jj]]j]]8..]jj]..]81n8188118]]j-jy-jd}ff[*'~wbb_}-jyyy]]8]]]]8181]]jj!##j5xcyyyjjj.]8.1118811n181]j-yyy-]881]y]]]]8]]jj}mm**~co{:1njyyyy]]]]1]j-]]]]]]]]j]1:/]]1n]j]1............n81]]n88-y-j]]]]n.11nt=|i=t", "|#=,#nn.11]{>]c&1888n.11...nn.n.nn.11]]18]]j---j-yyyy-:1nnn]jyy-yyyj]]j]]]1nnnn..nn11]]118-j]y-]8^/:d}{{^1j]]jj]]8nn8j]]]].n1111.nn188]]]jjjyyjj:8::dpd}d::]]8]j]]1]]8n1188]]jj-~!c!}y]-yj].n]811111111111.18]jjj]1]jjjj-]j]jj1]]]jjd:::]jjyyyy]]]1888jjj]]]]]]]]n]]18]jj]1]8]1............n18]]n1jjjj]]]]]1.nn.t=i|=t", "0000t1nnn18{:c@:]8]81nnn...n.......n11881n1nn8]jj]]]]-yj818]jy-yjj]]8n1]881nnn.nn.nnn11nnn]j]]j]]..nn.1n8]]]j]n]].nn]]]]88n.n.n...n11n881]jjjjj]]8118]]]n]]]....8]]181nn.1111]8j-----yj-j]n.881nn...11nn......8]818jjj]]]j]]]]]]1]]]]81n-yyyyj]]8.8]]j]1]]]8118111]]11]j]].n]8............n.188]..1]]]]]]]81..n.==|#=t", ",=i)0.n.n1188//8]]81.nnn..........nnn188]]11nn..1jj]]]]-18]]jjjj]]11nn1n11nn......nnn.n..1.8j8]jjj1...n18]]]]]118.1]]181.n.........n.n1111]]111n1e1118811n]].....n111.1.n.118]]]jjjjjjjj]nn111.nnnn...nn..81n.nn1n]]]]..n]]]]]1n11.1n..nj-j]]]8..n]8j]8]1118111.88811n8]]]n181............nn..11n.n8188811n1n...##|t=t", "t=5k,.1..nnnn18]]]nnnnnn..............1118nn11....81n1]]]]]]j]]]1.....11nnn...............n.]]1]]jj]1.en88]1]]n11.1n111n..............n.1181......nn1.1.nn88.nn1nn.nn..n.n.111]]]811]]]]]nnn11n.n...nn.n.n188n..8]]]11n.188]]8.........1jj]811n..81]8.n11nn.n.n1nnnnenn881n.1...............nnn1...1818111nn....=#<#=t", ")000i.nnn.nnn11]811e.nn.............nn..1nn11..........11n8]]]]]8n...n1nn.................n.1]8n8]]]]88881118]81n.nnn.................n.n1nn..nnnn1111nn.nn811nn....n...nnnn111]]1n.]]]11....n...........n11n1.n18n111.11n1181........1]]]n...111]888.....nnn..nnn.nnnn11n...................nn.n....n11.e......=tt=#<", ">k5#)n.n.n.1n888n1nn....................nn.n.nn.......n.118188111.....nn.....................888]1]]]8888n.n111n.n.......................n...en88n1n1111..1111n.n..........n.11n81.11n11n..................n11.nnn11.nnnnnn.1111n.....818..1nnn.11n11nn.................n......................nnnn.....nn......t|#=|0", "t#=k>.nn111118811nnn..n.................n...nn.......n111n111n1.n..............................n11181n.enn..nn...n...........................nnenen18111...n.nn............nn.11...n1811n...................n.n..n.nn.n.nnn.n.n.nn..n181nnnn1.nn.nn...................n.........................................|=#<00", "|0<0t....n.e1.1ennnn.........................n.n......n.nnn..nnnn...........................n....n1.1nn.n....................................n....n1e11n..n.................nn.....nnn..n...................................n.nnn..n.1n..n..nnnnn....................n..........................................=t0000", "k5##0......nnnn.n.......................................nnnn..........................................n.......................................n...n.n.n.........................n......n.........................................n.n.nn.........................................................................<00q0t", "py>k#......n...n................................................................................................................................................................................................................................................................................................00<=,,", ">yyy5...........................................................................................................................................................................................................................................................................................................#=5#<0", ">pyp>...........................................................................................................................................................................................................................................................................................................#|000)", "yy>k,|0#>,05<0,,0t=00##ki005=0t=00=|=t00000t==#ii#==#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttt#ttttttit|||tt===#i=t00|,|0|k5i00qt=5kk>", "5,5#|70=5#0i,0)##|00<#==#|000000<|ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt#tt=##==##tt<0000t,t00=5#00i,k>kk,=t<", "0070<=k,i7#=q<==0qt,#|000<|i#,=,,tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttiti||it#==,,t000#k,|0|5k>,#i<<00it", "555k5=)00=#0)#=00,t00<#====t|)000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000q00q0000|t55,|q0=kk,t<7)", "iti<000#,t00=#00,i0|,5==tttt==,k5k555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555k5kk5k5k5kkk555,#5,|0)i=5k>kyypy"}; xscorch-0.2.1/snd/0000755000175000001440000000000011615372010010740 500000000000000xscorch-0.2.1/snd/README0000644000175000001440000000016107263537772011564 00000000000000There are currently no sound files; if you want to create music or sound effects for xscorch, please contact us! xscorch-0.2.1/snd/Makefile.am0000644000175000001440000000072607263671470012741 00000000000000## $Header: /fridge/cvs/xscorch/snd/Makefile.am,v 1.3 2001/04/07 20:06:16 justins Exp $ ## Require automake 1.3 ## AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = README CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch/sounds for file in $(EXTRA_DIST); do $(INSTALL_DATA) "$$file" "$(DESTDIR)$(datadir)/xscorch/sounds/$$file"; done xscorch-0.2.1/snd/Makefile.in0000644000175000001440000002604611615371716012751 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = snd DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/libj/libj.m4 \ $(top_srcdir)/libj/libjconf.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ ANYGTK = @ANYGTK@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GNOME = @GNOME@ GNOME_DESKTOP = @GNOME_DESKTOP@ GNOME_PIXMAPS = @GNOME_PIXMAPS@ GREP = @GREP@ GTK12 = @GTK12@ GTK20 = @GTK20@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJ_BYTE_TYPE = @LIBJ_BYTE_TYPE@ LIBJ_C99_STANDARD = @LIBJ_C99_STANDARD@ LIBJ_DWORD_TYPE = @LIBJ_DWORD_TYPE@ LIBJ_HAVE_GETTIMEOFDAY = @LIBJ_HAVE_GETTIMEOFDAY@ LIBJ_HAVE_SYS_TIME_H = @LIBJ_HAVE_SYS_TIME_H@ LIBJ_LT_AGE = @LIBJ_LT_AGE@ LIBJ_LT_CURRENT = @LIBJ_LT_CURRENT@ LIBJ_LT_REVISION = @LIBJ_LT_REVISION@ LIBJ_QWORD_TYPE = @LIBJ_QWORD_TYPE@ LIBJ_STANDALONE = @LIBJ_STANDALONE@ LIBJ_TIME_WITH_SYS_TIME = @LIBJ_TIME_WITH_SYS_TIME@ LIBJ_USE_LIBC_STRING = @LIBJ_USE_LIBC_STRING@ LIBJ_VERSION = @LIBJ_VERSION@ LIBJ_VERSION_EXPR = @LIBJ_VERSION_EXPR@ LIBJ_VERSION_MAJOR = @LIBJ_VERSION_MAJOR@ LIBJ_VERSION_MINOR = @LIBJ_VERSION_MINOR@ LIBJ_VERSION_PATCH = @LIBJ_VERSION_PATCH@ LIBJ_WORD_TYPE = @LIBJ_WORD_TYPE@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@ LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@ LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@ LIBOBJS = @LIBOBJS@ LIBREADLINE_LIBS = @LIBREADLINE_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIKMOD = @MIKMOD@ MKDIR_P = @MKDIR_P@ NETWORK = @NETWORK@ NET_LIBS = @NET_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.3 # Extra distribution files, and cleanfiles # EXTRA_DIST = README CLEANFILES = *~ *.bak *.bb *.bbg *.da *.gcov MAINTAINERCLEANFILES = *.orig all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu snd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu snd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/xscorch/sounds for file in $(EXTRA_DIST); do $(INSTALL_DATA) "$$file" "$(DESTDIR)$(datadir)/xscorch/sounds/$$file"; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: