diff --git .gitignore .gitignore new file mode 100644 index 0000000..894076c --- /dev/null +++ .gitignore @@ -0,0 +1,24 @@ +core +*.[ao] +rogue +rogomatic +#Makefile.in +Makefile +config.* +my_log/ +.deps/ +autom4te.cache/ +aclocal.m4 +datesub +gene +histplot +player +rgmplot +stamp-h1 +rogue.6 +rogue.cat +rogue.doc +rogue.html +rogue.me +rogue.scr +debuglog.* diff --git r-o-m r-o-m new file mode 100644 index 0000000..a2f4bb5 --- /dev/null +++ r-o-m @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ ! -z $1 ]; then # コマンド引数はrogomaticを繰り返す回数 + numtry=$1 + #echo $numtry + expr "$numtry" + 1 >/dev/null 2>&1 + if [ $? -ge 2 ]; then + numtry=1 + fi +else + numtry=1 +fi + +for ((i=1;i<=$numtry;i++)) +do + echo -n "Rogue Challenge: $i/$numtry" + for ((j=0;j<3;j++)); do sleep 1; echo -n "."; done ; echo # 起動前には3秒待つ + #rogomatic -e # rogomaticでログを吐かせる + rogomatic # rogomaticでログは吐かない + test $i -ne $numtry && sleep 10 # 待ち時間を変更するならココ + reset + rogue -s +done diff --git rogomatic-r2.0.2/Makefile.in rogomatic-r2.0.2/Makefile.in index 59c812c..8bf2990 100644 --- rogomatic-r2.0.2/Makefile.in +++ rogomatic-r2.0.2/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -78,15 +88,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = subdir = . -DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in COPYING TODO compile depcomp install-sh \ - missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -152,6 +159,9 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ + COPYING ChangeLog INSTALL NEWS README TODO compile depcomp \ + install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -318,7 +328,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 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*) \ @@ -582,15 +591,15 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -626,17 +635,17 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(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 \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -815,6 +824,8 @@ uninstall-am: uninstall-binPROGRAMS pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS +.PRECIOUS: Makefile + installdirs: if test ! -d "$(HOME)/.terminfo/v"; then \ diff --git rogomatic-r2.0.2/aclocal.m4 rogomatic-r2.0.2/aclocal.m4 deleted file mode 100644 index 9905a29..0000000 --- rogomatic-r2.0.2/aclocal.m4 +++ /dev/null @@ -1,1149 +0,0 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- - -# Copyright (C) 1996-2013 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -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'.])]) - -# Copyright (C) 2002-2013 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.14' -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.14.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.14.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-2013 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], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2013 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_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$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-2013 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. - - -# 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", "OBJC", "OBJCXX", "UPC", or "GJC". -# 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 - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" 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". - rm -rf conftest.dir - 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 10 /bin/sh. - echo '/* dummy */' > 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 - ;; - msvc7 | msvc7msys | 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], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2013 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_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf 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"` - # 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'`; 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"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2013 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 macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# 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.65])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], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -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], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [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([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# 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])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro 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 - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -]) - -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-2013 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-2013 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. - -# 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])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2013 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_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 -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2013 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_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 is modern enough. -# If it is, 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 --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2013 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_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])]) - -# Copyright (C) 1999-2013 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_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != 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 -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2013 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_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2013 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_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# 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 ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - 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 - 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 - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - 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]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2013 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_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2013 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-2013 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_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-2013 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_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. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - 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 - diff --git rogomatic-r2.0.2/configure rogomatic-r2.0.2/configure index b417216..bba5c6a 100755 --- rogomatic-r2.0.2/configure +++ rogomatic-r2.0.2/configure @@ -2210,7 +2210,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.14' +am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2431,7 +2431,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2759,8 +2759,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' diff --git rogomatic-r2.0.2/src/Makefile.in rogomatic-r2.0.2/src/Makefile.in index d6f16e1..092bf0c 100644 --- rogomatic-r2.0.2/src/Makefile.in +++ rogomatic-r2.0.2/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -81,12 +91,11 @@ bin_PROGRAMS = player$(EXEEXT) gene$(EXEEXT) rgmplot$(EXEEXT) \ noinst_PROGRAMS = rgmplot$(EXEEXT) datesub$(EXEEXT) histplot$(EXEEXT) \ gene$(EXEEXT) subdir = src -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/install.h.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = install.h @@ -179,6 +188,8 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/install.h.in \ + $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -363,7 +374,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -715,6 +725,8 @@ uninstall-am: uninstall-binPROGRAMS mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS +.PRECIOUS: Makefile + # special case for lex output datesub.c: datesub.l diff --git rogomatic-r2.0.2/src/arms.c rogomatic-r2.0.2/src/arms.c index a0ffced..4fa194d 100644 --- rogomatic-r2.0.2/src/arms.c +++ rogomatic-r2.0.2/src/arms.c @@ -32,6 +32,8 @@ # include "types.h" # include "globals.h" +#include "prototype.h" + /* * havearmor: Return Kth best armor. K should be in the range 1 to invcount. * If K is greater than the number of pieces of armor we have, @@ -42,6 +44,7 @@ # define swap(x,y) {t=(x); (x)=(y); (y)=t;} int havearmor (k, print, rustproof) +int k, print, rustproof; { register int i, j, w, t, n=0; int armind[MAXINV], armval[MAXINV]; @@ -79,7 +82,7 @@ int havearmor (k, print, rustproof) * of remove curse and -2 for when we don't have a remove curse. */ -armorclass (i) +int armorclass (i) int i; { int class; @@ -119,6 +122,7 @@ int i; */ int haveweapon (k, print) +int k, print; { register int i, j, w, t, n=0; int weapind[MAXINV], weapval[MAXINV]; @@ -169,7 +173,7 @@ int haveweapon (k, print) * high numbers. */ -weaponclass (i) +int weaponclass (i) int i; { int class, hitplus = 0, damplus = 0; @@ -238,6 +242,7 @@ int i; */ int havering (k, print) +int k, print; { register int i, j, r, t, n=0; int ringind[MAXINV], ringval[MAXINV]; @@ -284,7 +289,7 @@ int havering (k, print) * value of the ring. */ -ringclass (i) +int ringclass (i) int i; { int class = 0, magicplus = 0; @@ -536,6 +541,7 @@ int i; int havemissile () { register int i, fewest = 9999, obj = NONE; + char msg[256]; if (wielding (thrower)) { /* Wielding bow, use arrows */ for (i=0; i 0 #define FLEX_BETA #endif @@ -47,6 +47,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -54,6 +55,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +86,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -142,15 +142,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -176,7 +168,6 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -365,7 +356,7 @@ static void yy_fatal_error (yyconst char msg[] ); */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (yy_size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -507,7 +498,7 @@ char *yytext; * datesub.l: */ -#line 511 "./lex.yy.c" +#line 502 "./lex.yy.c" #define INITIAL 0 @@ -588,12 +579,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -601,7 +587,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -612,7 +598,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -694,6 +680,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; +#line 30 "./datesub.l" + +#line 686 "./lex.yy.c" + if ( !(yy_init) ) { (yy_init) = 1; @@ -720,11 +710,6 @@ YY_DECL yy_load_buffer_state( ); } - { -#line 30 "./datesub.l" - -#line 727 "./lex.yy.c" - while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -741,7 +726,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -845,7 +830,7 @@ YY_RULE_SETUP #line 43 "./datesub.l" ECHO; YY_BREAK -#line 849 "./lex.yy.c" +#line 834 "./lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -976,7 +961,6 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1039,7 +1023,7 @@ static int yy_get_next_buffer (void) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); @@ -1172,7 +1156,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 35); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) @@ -1260,7 +1244,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1396,6 +1380,10 @@ static void yy_load_buffer_state (void) yyfree((void *) b ); } +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -1600,8 +1588,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -1609,8 +1597,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - yy_size_t i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -1840,7 +1827,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 42 "./datesub.l" +#line 43 "./datesub.l" diff --git rogomatic-r2.0.2/src/debug.c rogomatic-r2.0.2/src/debug.c index f85abb9..eb8de96 100644 --- rogomatic-r2.0.2/src/debug.c +++ rogomatic-r2.0.2/src/debug.c @@ -33,10 +33,13 @@ # include # include # include +#include # include "types.h" # include "globals.h" # include "install.h" +#include "prototype.h" + /* * Debugging wait loop: Handle the usual Rogomatic command chars, and also * allows dumping the flags '^' command. Exits when a non-command char is @@ -45,15 +48,16 @@ */ /* VARARGS2 */ -dwait (msgtype, f, a1, a2, a3, a4, a5, a6, a7, a8) -char *f; -int msgtype, a1, a2, a3, a4, a5, a6, a7, a8; +//int dwait (msgtype, f, a1, a2, a3, a4, a5, a6, a7, a8) +//int dwait (int msgtype, char *f, ...) +int dwait (int msgtype, char *msg) +//int msgtype, a1, a2, a3, a4, a5, a6, a7, a8; { - char msg[128]; + //char msg[128]; int r, c; /* Build the actual message */ - sprintf (msg, f, a1, a2, a3, a4, a5, a6, a7, a8); + // sprintf (msg, f, a1, a2, a3, a4, a5, a6, a7, a8); /* Log the message if the error is severe enough */ if (!replaying && (msgtype & (D_FATAL | D_ERROR | D_WARNING))) { @@ -85,7 +89,10 @@ int msgtype, a1, a2, a3, a4, a5, a6, a7, a8; if (! debug (msgtype | D_INFORM)) { /* If debugoff */ if (msgtype & D_SAY) /* Echo? */ - { saynow (msg); return (1); } /* Yes => win */ + { + saynow (msg); + return (1); + } /* Yes => win */ return (0); /* No => lose */ } @@ -111,13 +118,17 @@ int msgtype, a1, a2, a3, a4, a5, a6, a7, a8; case '^': promptforflags (); break; case '&': - if (getscrpos ("char", &r, &c)) - saynow ("Char at %d,%d '%c'", r, c, screen[r][c]); + if (getscrpos ("char", &r, &c)) { + sprintf(msg, "Char at %d,%d '%c'", r, c, screen[r][c]); + saynow (msg); + } break; case '(': dumpdatabase (); at (row, col); break; case ')': new_mark++; markcycles (DOPRINT); at (row, col); break; - case '~': saynow ("Version %d, quit at %d", version, quitat); break; + case '~': sprintf(msg, "Version %d, quit at %d", version, quitat); + saynow (msg); + break; case '/': dosnapshot (); break; default: at (row, col); return (1); } @@ -256,16 +267,20 @@ char *msg; int *r, *c; { char buf[256]; + char smsg[256]; - saynow ("At %d,%d: enter 'row,col' for %s: ", atrow, atcol, msg); + sprintf(smsg, "At %d,%d: enter 'row,col' for %s: ", atrow, atcol, msg); + saynow (smsg); if (fgets (buf, 256, stdin)) { sscanf (buf, "%d,%d", r, c); if (*r>=1 && *r<23 && *c>=0 && *c<=79) return (1); - else - say ("%d,%d is not on the screen!", *r, *c); + else { + sprintf(smsg, "%d,%d is not on the screen!", *r, *c); + say (smsg); + } } at (row, col); diff --git rogomatic-r2.0.2/src/explore.c rogomatic-r2.0.2/src/explore.c index b466821..cc062ba 100644 --- rogomatic-r2.0.2/src/explore.c +++ rogomatic-r2.0.2/src/explore.c @@ -31,6 +31,7 @@ # include # include "types.h" # include "globals.h" +#include "prototype.h" # define SEARCHES(r,c) \ (onrc(DEADEND,r,c) ? \ @@ -581,6 +582,7 @@ int *val, *avd, *cont; { register int k, nr, nc, l; int a, v = 0, nunseenb = 0, nseenb = 0, nearb = 0; + char msg[256]; a = onrc (SAFE|DOOR|STAIRS|HALL, r, c) ? 0 : onrc (ARROW, r, c) ? 50 : @@ -665,8 +667,11 @@ int *val, *avd, *cont; if (v < 50) *cont = 4; /* Look for something better */ - if (debug (D_SCREEN) && v > 0) - { mvaddch (r, c, 'o'); dwait (D_SCREEN, "Value %d", v); } + if (debug (D_SCREEN) && v > 0) { + mvaddch (r, c, 'o'); + sprintf(msg, "Value %d", v); + dwait (D_SCREEN, msg); + } return (1); } @@ -942,6 +947,7 @@ pinavoid () secret () { int secretinit(), secretvalue(); + char msg[256]; /* Secret passage adjacent to door? */ if (version >= RV53A && on (DOOR) && !blinded && @@ -949,8 +955,8 @@ secret () seerc (' ',atrow,atcol+1) || seerc (' ',atrow,atcol-1)) && SEARCHES (atrow, atcol) < timestosearch+20) { int count = timessearched[atrow][atcol]+1; - saynow ("Searching dead end door (%d,%d) for the %d%s time...", - atrow, atcol, count, ordinal (count)); + sprintf (msg, "Searching dead end door (%d,%d) for the %d%s time...", atrow, atcol, count, ordinal (count)); + saynow (msg); command (T_DOORSRCH, "s"); return (1); } @@ -975,8 +981,8 @@ secret () if ((SEARCHES (atrow, atcol) - timessearched[atrow][atcol]) > 0) { int count = timessearched[atrow][atcol]+1; - saynow ("Searching dead end (%d,%d) for the %d%s time...", - atrow, atcol, count, ordinal (count)); + sprintf(msg, "Searching dead end (%d,%d) for the %d%s time...", atrow, atcol, count, ordinal (count)); + saynow (msg); command (T_DOORSRCH, "s"); return (1); } @@ -1034,6 +1040,7 @@ doorexplore() { static searchcount = 0; int secretinit(), secretvalue(); + char msg[256]; /* If no new squares or read map, dont bother */ if (! new_search || Level == didreadmap) @@ -1047,8 +1054,8 @@ doorexplore() if (ontarget) { /* Moved to a possible secret door, search it */ searchcount++; - saynow ("Searching square (%d,%d) for the %d%s time...", - atrow, atcol, searchcount, ordinal (searchcount)); + sprintf(msg, "Searching square (%d,%d) for the %d%s time...", atrow, atcol, searchcount, ordinal (searchcount)); + saynow (msg); command (T_DOORSRCH, "s"); return (1); } @@ -1124,14 +1131,17 @@ register int trns; /* Minimum number of arrows to make it worthwhile */ { int archeryinit(), archeryvalue(); register int mr, mc; + char msg[256]; - dwait (D_CONTROL | D_BATTLE, "archmonster: m=%d, turns=%d", m, trns); + sprintf(msg, "archmonster: m=%d, turns=%d", m, trns); + dwait (D_CONTROL | D_BATTLE, msg); if (! new_arch) return (0); /* Useless without arrows */ if (havemult (missile, "", trns) < 0) { - dwait (D_BATTLE, "archmonster, fewer than %d missiles", trns); + sprintf(msg, "archmonster, fewer than %d missiles", trns); + dwait (D_BATTLE, msg); return (0); } @@ -1161,7 +1171,8 @@ register int trns; /* Minimum number of arrows to make it worthwhile */ } /* Tell the user about it */ - saynow ("Arching at %s", monname (mlist[m].chr)); + sprintf(msg, "Arching at %s", monname (mlist[m].chr)); + saynow (msg); return (1); } diff --git rogomatic-r2.0.2/src/findscore.c rogomatic-r2.0.2/src/findscore.c index ec79b65..1fe032c 100644 --- rogomatic-r2.0.2/src/findscore.c +++ rogomatic-r2.0.2/src/findscore.c @@ -28,6 +28,7 @@ */ # include +# include # include "install.h" # define TEMPFL "/tmp/RscoreXXXXXX" # define ISDIGIT(c) ((c) >= '0' && (c) <= '9') diff --git rogomatic-r2.0.2/src/gene.c rogomatic-r2.0.2/src/gene.c index 0a7a92c..05e4818 100644 --- rogomatic-r2.0.2/src/gene.c +++ rogomatic-r2.0.2/src/gene.c @@ -32,6 +32,8 @@ # include "types.h" # include "install.h" +#include "prototype.h" + int knob[MAXKNOB]; char *knob_name[MAXKNOB] = { "trap searching: ", diff --git rogomatic-r2.0.2/src/getroguetoken.c rogomatic-r2.0.2/src/getroguetoken.c index 527a079..55a6a8c 100644 --- rogomatic-r2.0.2/src/getroguetoken.c +++ rogomatic-r2.0.2/src/getroguetoken.c @@ -25,6 +25,7 @@ # include "types.h" # include "globals.h" # include "termtokens.h" +#include "prototype.h" # define GETLOGCHAR fgetc(logfile) # define ISPRT(c) ((c) >= ' ' && (c) <= '~') @@ -95,7 +96,7 @@ void rogue_log_write_token (char ch) case CL_TOK: fprintf (fecho, "{ff}"); break; case CM_TOK: fprintf (fecho, "{cm(%d,%d)}", number1, number2); break; case CR_TOK: fprintf (fecho, "{cr}"); break; - case ER_TOK: fprintf (fecho, "{ERRESC}", ch); break; + case ER_TOK: fprintf (fecho, "{ERRESC(%c)}", ch); break; case LF_TOK: fprintf (fecho, "{lf}"); break; case ND_TOK: fprintf (fecho, "{nd(%d)}", number1); break; case SE_TOK: fprintf (fecho, "{se}"); break; diff --git rogomatic-r2.0.2/src/io.c rogomatic-r2.0.2/src/io.c index febaccc..3afb41d 100644 --- rogomatic-r2.0.2/src/io.c +++ rogomatic-r2.0.2/src/io.c @@ -39,6 +39,7 @@ # include "globals.h" # include "termtokens.h" # include "getroguetoken.h" +# include "prototype.h" # define READ 0 @@ -48,6 +49,8 @@ */ # define charonscreen(Y,X) (A_CHARTEXT & mvwinch (stdscr, Y, X)) +void sendcnow (char); + char *month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" @@ -148,19 +151,19 @@ printscreen (void) * implies that we have synchronized with Rogue. */ -getrogue (waitstr, onat) -char *waitstr; /* String to synchronize with */ -int onat; /* 0 ==> Wait for waitstr - 1 ==> Cursor on @ sufficient - 2 ==> [1] + send ';' when ever - we eat a --More-- message */ - +void getrogue (char *waitstr, int onat) +/* waitstr: String to synchronize with */ +/* onat : 0 ==> Wait for waitstr + 1 ==> Cursor on @ sufficient + 2 ==> [1] + send ';' when ever + we eat a --More-- message */ { int botprinted = 0, wasmapped = didreadmap, r, c, pending (); register int i, j; char ch, *s, *m, *q, *d, *call; int *doors; static moved = 0; + char msg[256]; newdoors = doorlist; /* no new doors found yet */ atrow0 = atrow; atcol0 = atcol; /* Save our current posistion */ @@ -235,8 +238,13 @@ int onat; /* 0 ==> Wait for waitstr if (ch == *call) { if (*++call == 0) { /* Send an escape (and possibly a semicolon) to clear the message */ - if (onat == 2) sendnow ("%c;", ESC); - else sendnow ("%c", ESC); + if (onat == 2) { + sprintf(msg, "%c;", ESC); + sendnow (msg); + } else { + sprintf(msg, "%c", ESC); + sendnow (msg); + } } } else call = "Call it:"; @@ -399,7 +407,8 @@ int onat; /* 0 ==> Wait for waitstr default: if (ch < ' ') { - saynow ("Unknown character '\\%o'--more--", ch); + sprintf(msg, "Unknown character '\\%o'--more--", ch); + saynow (msg); waitforspace (); } else if (row) { @@ -446,8 +455,8 @@ int onat; /* 0 ==> Wait for waitstr /* If mapping status has changed */ if (wasmapped != didreadmap) { - dwait (D_CONTROL | D_SEARCH, "wasmapped: %d didreadmap: %d", - wasmapped, didreadmap); + sprintf(msg, "wasmapped: %d didreadmap: %d", wasmapped, didreadmap); + dwait (D_CONTROL | D_SEARCH, msg); mapinfer (); } @@ -457,7 +466,8 @@ int onat; /* 0 ==> Wait for waitstr while (doors != newdoors) { r = *doors++; c = *doors++; - dwait (D_INFORM, "new door at %d, %d", r, c); + sprintf(msg, "new door at %d, %d", r, c); + dwait (D_INFORM, msg); inferhall (r, c); } } @@ -623,16 +633,14 @@ dumpwalls () */ /* VARARGS1 */ -sendnow (f, a1, a2, a3, a4) -char *f; -int a1, a2, a3, a4; +void sendnow (char *m) { char cmd[128]; register char *s = cmd; memset(cmd, '\0', 128); - sprintf (cmd, f, a1, a2, a3, a4); + sprintf (cmd, "%s", m); while (*s) sendcnow (*s++); } @@ -642,8 +650,7 @@ int a1, a2, a3, a4; * the logging of characters in echo mode. */ -sendcnow (c) -char c; +void sendcnow (char c) { if (replaying) return; @@ -674,15 +681,13 @@ char c; # define bump(p,sizeq) (p)=((p)+1)%sizeq /* VARARGS1 */ -rogo_send (f, a1, a2, a3, a4) -char *f; -int a1, a2, a3, a4; +void rogo_send (char *msg) { char cmd[128]; register char *s = cmd; memset (cmd, '\0', 128); - sprintf (s, f, a1, a2, a3, a4); + sprintf (s, "%s", msg); debuglog ("rogo_send (%s)\n",s); @@ -877,15 +882,13 @@ char *mess; */ /* VARARGS1 */ -say (f, a1, a2, a3, a4, a5, a6, a7, a8) -char *f; -int a1, a2, a3, a4, a5, a6, a7, a8; +void say (char *m) { char buf[BUFSIZ], *b; if (!emacs && !terse) { memset (buf, '\0', BUFSIZ); - sprintf (buf, f, a1, a2, a3, a4, a5, a6, a7, a8); + sprintf(buf, "%s", m); at (0,0); for (b=buf; *b; b++) printw ("%s", unctrl (*b)); @@ -901,12 +904,10 @@ int a1, a2, a3, a4, a5, a6, a7, a8; */ /* VARARGS1 */ -saynow (f, a1, a2, a3, a4, a5, a6, a7, a8) -char *f; -int a1, a2, a3, a4, a5, a6, a7, a8; +void saynow (char *m) { if (!emacs && !terse) { - say (f, a1, a2, a3, a4, a5, a6, a7, a8); + say (m); refresh (); } } @@ -1032,9 +1033,11 @@ charsavail () { long n; int retc; + char msg[256]; if (retc = ioctl (READ, FIONREAD, &n)) { - saynow ("Ioctl returns %d, n=%ld.\n", retc, n); + sprintf(msg, "Ioctl returns %d, n=%ld.\n", retc, n); + saynow (msg); n=0; } @@ -1067,8 +1070,10 @@ redrawscreen () * roguelog file. */ -toggleecho () +void toggleecho () { + char msg[256]; + if (replaying) return; logging = !logging; @@ -1076,10 +1081,12 @@ toggleecho () if (logging) { if (! rogue_log_open (ROGUELOG)) { logging = !logging; - saynow ("can't open %s", ROGUELOG); + sprintf(msg, "can't open %s", ROGUELOG); + saynow (msg); } else { - saynow ("Logging to file %s", ROGUELOG); + sprintf(msg, "Logging to file %s", ROGUELOG); + saynow (msg); if (*versionstr) command (T_OTHER, "v"); } @@ -1087,7 +1094,10 @@ toggleecho () else { rogue_log_close (); - if (playing) saynow ("File %s closed", ROGUELOG); + if (playing) { + sprintf(msg, "File %s closed", ROGUELOG); + saynow (msg); + } } if (playing) @@ -1158,7 +1168,7 @@ FILE *f; for (i = 0; i < 24; i++) { for (length = 79; length >= 0 && charonscreen(i,length) == ' '; length--); - for (j=0; j <= length; j++) fprintf (f, "%c", charonscreen(i,j)); + for (j=0; j <= length; j++) fprintf (f, "%ld", charonscreen(i,j)); fprintf (f, "\n"); } @@ -1182,12 +1192,16 @@ FILE *f; dosnapshot () { - if ((snapshot = wopen (SNAPSHOT, "a")) == NULL) - saynow ("Cannot write file %s.", SNAPSHOT); - else { + char msg[256]; + + if ((snapshot = wopen (SNAPSHOT, "a")) == NULL) { + sprintf(msg, "Cannot write file %s.", SNAPSHOT); + saynow (msg); + } else { printsnap (snapshot); fclose (snapshot); - saynow ("Snapshot added to %s.", SNAPSHOT); + sprintf(msg, "Snapshot added to %s.", SNAPSHOT); + saynow (msg); } } @@ -1197,7 +1211,7 @@ dosnapshot () * formfeed not recorded in the log file. MLM */ -clearscreen () +void clearscreen () { register int i, j; diff --git rogomatic-r2.0.2/src/learn.c rogomatic-r2.0.2/src/learn.c index 9724d40..69881dc 100644 --- rogomatic-r2.0.2/src/learn.c +++ rogomatic-r2.0.2/src/learn.c @@ -29,6 +29,7 @@ # include # include +# include # include "types.h" # define TRIALS(g) ((g)->score.count) @@ -46,7 +47,8 @@ extern int knob[]; extern double mean(), stdev(), sqrt(); extern FILE *wopen(); -static int inittime=0, trialno=0, lastid=0; +static time_t inittime=(time_t)0; +static int trialno=0, lastid=0; static int crosses=0, shifts=0, mutations=0; static statistic g_score = ZEROSTAT; static statistic g_level = ZEROSTAT; @@ -63,7 +65,7 @@ static int summgene (register FILE *f, register genotype *gene); static int parsegene (register char *buf, register genotype *gene); static int writegene (register FILE *gfil, register genotype *g); static int initgene (register genotype *gene); -static int birth (register FILE *f, register genotype *gene); +static void birth (register FILE *f, register genotype *gene); static int cross (register int father, register int mother, register int new); static int mutate (register int father, register int new); static int shift (register int father, register int new); @@ -83,8 +85,7 @@ initpool (k, m) { inittime = time (0); - if (glog) fprintf (glog, "Gene pool initalized, k %d, m %d, %s", - k, m, ctime (&inittime)); + if (glog) fprintf (glog, "Gene pool initalized, k %d, m %d, %s", k, m, ctime (&inittime)); randompool (m); } @@ -167,8 +168,7 @@ int *newid, *knb, *best, *avg; * evalknobs: Add a data point to the gene pool */ -evalknobs (gid, score, level) -int gid, score, level; +void evalknobs (int gid, int score, int level) { register int g; @@ -372,8 +372,7 @@ register char *genepool; quit (1, "Cannot open file '%s'\n", genepool); /* Write the header line */ - fprintf (gfil, "%d %d %d %d %d %d", - inittime, trialno, lastid, crosses, shifts, mutations); + fprintf (gfil, "%d %d %d %d %d %d", (int)inittime, trialno, lastid, crosses, shifts, mutations); fprintf (gfil, "|"); writestat (gfil, &g_score); fprintf (gfil, "|"); @@ -472,7 +471,7 @@ register genotype *gene; * Birth: Summarize Record the birth of a genotype. */ -static birth (f, gene) +static void birth (f, gene) register FILE *f; register genotype *gene; { diff --git rogomatic-r2.0.2/src/ltm.c rogomatic-r2.0.2/src/ltm.c index c6e517b..6c9e95a 100644 --- rogomatic-r2.0.2/src/ltm.c +++ rogomatic-r2.0.2/src/ltm.c @@ -35,6 +35,11 @@ # include "globals.h" # include "install.h" +#include "prototype.h" + + +void parsemonster (char *); + static int nosave = 0; /* True ==> dont write ltm back out */ static char ltmnam[100]; /* Long term memory file name */ @@ -45,7 +50,9 @@ static char ltmnam[100]; /* Long term memory file name */ mapcharacter (ch, str) char ch, *str; { - dwait (D_CONTROL, "mapcharacter called: '%c' ==> '%s'", ch, str); + char msg[256]; + sprintf(msg, "mapcharacter called: '%c' ==> '%s'", ch, str); + dwait (D_CONTROL, msg); /* Ancient versions of Rogue had no wands or staves */ if (ch == '/' && stlmatch (str, "unknown")) @@ -106,24 +113,26 @@ char *monster; * access to the output file. */ -saveltm (score) -int score; +void saveltm (int score) { register int m; register FILE *ltmfil; + char msg[256]; if (nextmon < 1 || nosave) return; - dwait (D_CONTROL, "Saveltm called, writing file '%s'", ltmnam); + sprintf(msg, "Saveltm called, writing file '%s'", ltmnam); + dwait (D_CONTROL, msg); /* Disable interrupts and open the file for writing */ critical (); /* Only write out the new results if we can get write access */ if (lock_file (getLockFile (), MAXLOCK)) { - if ((ltmfil = wopen (ltmnam, "w")) == NULL) - { dwait (D_WARNING, "Can't write long term memory file '%s'...", ltmnam); } - else { + if ((ltmfil = wopen (ltmnam, "w")) == NULL) { + sprintf(msg, "Can't write long term memory file '%s'...", ltmnam); + dwait (D_WARNING, msg); + } else { /* Write the ltm file header */ fprintf (ltmfil, "Count %d, sum %d, start %d, saved %d\n", ltm.gamecnt+1, ltm.gamesum+score, @@ -157,8 +166,10 @@ int score; restoreltm () { + char msg[256]; sprintf (ltmnam, "%s/ltm%d", getRgmDir (), version); - dwait (D_CONTROL, "Restoreltm called, reading file '%s'", ltmnam); + sprintf (msg, "Restoreltm called, reading file '%s'", ltmnam); + dwait (D_CONTROL, msg); clearltm (monhist); /* Clear the original sums */ nextmon = 0; /* Zero the list of monsters */ @@ -172,8 +183,8 @@ restoreltm () if (fexists (ltmnam)) readltm (); else { - dwait (D_CONTROL | D_SAY, - "Starting long term memory file '%s'...", ltmnam); + sprintf(msg, "Starting long term memory file '%s'...", ltmnam); + dwait (D_CONTROL | D_SAY, msg); ltm.gamecnt = ltm.gamesum = ltm.timeswritten = 0; ltm.inittime = time (0); } @@ -197,11 +208,12 @@ readltm () { char buf[BUFSIZ]; register FILE *ltmfil; + char msg[256]; if ((ltmfil = fopen (ltmnam, "r")) == NULL) { nosave = 1; - dwait (D_WARNING | D_SAY, - "Could not read long term memory file '%s'...", ltmnam); + sprintf(msg, "Could not read long term memory file '%s'...", ltmnam); + dwait (D_WARNING | D_SAY, msg); } else { /* Read the ltm file header */ @@ -222,8 +234,7 @@ readltm () * parsemonster: parse one line from the ltm file. */ -parsemonster (monster) -char *monster; +void parsemonster (char *monster) { register char *attrs; char *index(); diff --git rogomatic-r2.0.2/src/main.c rogomatic-r2.0.2/src/main.c index 0a17c25..0da0862 100644 --- rogomatic-r2.0.2/src/main.c +++ rogomatic-r2.0.2/src/main.c @@ -106,6 +106,7 @@ # include "termtokens.h" # include "install.h" +#include "prototype.h" /* FIXME: get rid of this prototype in the correct way */ FILE *rogo_openlog (char *genelog); @@ -343,13 +344,21 @@ jmp_buf commandtop; * Main program */ -main (argc, argv) +int main (argc, argv) int argc; char *argv[]; { - char ch, *s, *getenv(), *statusline(), msg[128]; + char ch, *s, *getenv(), *statusline(); int startingup = 1; register int i; + char msg[256]; + +#ifdef notdef + for (i=0; i 125) && (morecount < 150)) { - dwait(D_WARNING, "More Loop ->%s<-.", mess); + sprintf(msg, "More Loop ->%s<-.", mess); + dwait(D_WARNING, msg); } else if (morecount >= 150) { - dwait(D_FATAL, "More Loop Exit ->%s<-.", mess); + sprintf(msg, "More Loop Exit ->%s<-.", mess); + dwait(D_FATAL, msg); + } + else if (unknown) { + sprintf(msg, "Unknown message '%s'", mess); + dwait (D_WARNING, msg); } - else if (unknown) - dwait (D_WARNING, "Unknown message '%s'", mess); /* Send it to dwait; if dwait doesnt print it (and echo is on) echo it */ if (echoit & !dwait (D_MESSAGE, mess)) @@ -750,11 +767,11 @@ char *name; int obj; char id = '*'; /* Default is "* for list" */ stuff item_type = none; char lookup_name[NAMSIZ]; + char msg[256]; - if (!replaying && version < RV53A && - (nextid < LETTER (0) || nextid > LETTER (invcount))) { - dwait (D_FATAL, "Readident: nextid %d, afterid %d, invcount %d.", - nextid, afterid, invcount); + if (!replaying && version < RV53A && (nextid < LETTER (0) || nextid > LETTER (invcount))) { + sprintf(msg, "Readident: nextid %d, afterid %d, invcount %d.", nextid, afterid, invcount); + dwait (D_FATAL, msg); } infer (name, Scroll); /* Record what kind of scroll this is */ @@ -767,13 +784,15 @@ char *name; if (version < RV53A) { /* Rogue 3.6, Rogue 5.2 */ deleteinv (OBJECT (afterid)); /* Assume object gone */ - sendnow (" %c", nextid); /* Identify it */ + sprintf(msg, " %c", nextid); /* Identify it */ + sendnow (msg); /* Identify it */ if (!replaying) /* FIXME: without removing the rogo_send call during * replay, replay will core dump - NYM */ { - rogo_send ("I%c", afterid); /* Generate a message about it */ + sprintf(msg, "I%c", afterid); /* Generate a message about it */ + rogo_send (msg); /* Generate a message about it */ } knowident = identifying = 1; /* Set variables */ @@ -832,7 +851,8 @@ char *name; } waitfor ("not a valid item"); - sendnow (" %c;", id); /* Pick an object to identify */ + sprintf(msg, " %c;", id); /* Pick an object to identify */ + sendnow (msg); /* Pick an object to identify */ if (id == '*') memset (lastname, '\0', NAMSIZ); usesynch = 0; justreadid=1; /* Must reset inventory */ @@ -848,6 +868,7 @@ char *name; rampage () { char monc; + char msg[256]; /* Check the next monster in the list, we may not fear him */ while (monc = *genocide) { @@ -869,8 +890,10 @@ rampage () /* If we found a monster, send his character, else send ESC */ if (monc) { - saynow ("About to rampage against %s", monname (monc)); - sendnow (" %c;", monc); /* Send the monster */ + sprintf(msg, "About to rampage against %s", monname (monc)); + saynow (msg); + sprintf(msg, " %c;", monc); /* Send the monster */ + sendnow (msg); /* Send the monster */ /* Add to the list of 'gone' monsters */ sprintf (genocided, "%s%c", genocided, monc); @@ -878,7 +901,8 @@ rampage () } else { dwait (D_ERROR, "Out of monsters to genocide!"); - sendnow (" %c;", ESC); /* Cancel the command */ + sprintf(msg, " %c;", ESC); /* Cancel the command */ + sendnow (msg); /* Cancel the command */ } } @@ -889,12 +913,15 @@ rampage () * Good rings we have identified, so don't bother marking rings. */ -curseditem () +void curseditem () { + char msg[256]; + usesynch = 0; /* Force a reset inventory */ clearsendqueue(); - sendnow ("%c", ESC); + sprintf(msg, "%c", ESC); + sendnow (msg); /* lastdrop is index of last item we tried to use which could be cursed */ if (lastdrop != NONE && lastdrop < invcount) { @@ -948,6 +975,7 @@ killed (monster) register char *monster; { register int m = 0, mh = 0; + char msg[256]; /* Find out what we really killed */ if (!cosmic && !blinded && targetmonster>0 && streq (monster, "it")) @@ -957,7 +985,8 @@ register char *monster; { monster = monhist[mh].m_name; m = monsternum (monster); } /* Tell the user what we killed */ - dwait (D_BATTLE | D_MONSTER, "Killed '%s'", monster); + sprintf(msg, "Killed '%s'", monster); + dwait (D_BATTLE | D_MONSTER, msg); /* If cheating against Rogue 3.6, check out our arrow */ if (version < RV52A && cheat) { @@ -969,9 +998,10 @@ register char *monster; } /* Echo the number arrows we pumped into him */ - if (mh >=0 && mhit+mmiss > 0 && mtarget == mh) - dwait (D_BATTLE | D_MONSTER, "%d out of %d missiles hit the %s", - mhit, mhit+mmiss, monster); + if (mh >=0 && mhit+mmiss > 0 && mtarget == mh) { + sprintf(msg, "%d out of %d missiles hit the %s", mhit, mhit+mmiss, monster); + dwait (D_BATTLE | D_MONSTER, msg); + } /* If we killed it by hacking, add the result to long term memory */ if (hitstokill > 0 && mh != NONE) @@ -1005,12 +1035,14 @@ washit (monster) char *monster; { register int mh = 0, m = 0; + char msg[256]; /* Find out what really hit us */ if ((mh = getmonhist (monster, 1)) != NONE) { monster = monhist[mh].m_name; m = monsternum (monster); } - dwait (D_MONSTER, "Was hit by a '%s'", monster); + sprintf (msg, "Was hit by a '%s'", monster); + dwait (D_MONSTER, msg); timeshit++; /* Bump global count */ @@ -1034,12 +1066,14 @@ wasmissed (monster) char *monster; { register int mh = 0, m = 0; + char msg[256]; /* Find out what really missed us */ if ((mh = getmonhist (monster, 1)) != NONE) { monster = monhist[mh].m_name; m = monsternum (monster); } - dwait (D_MONSTER, "Was missed by a '%s'", monster); + sprintf(msg, "Was missed by a '%s'", monster); + dwait (D_MONSTER, msg); timesmissed++; /* Bump global count */ @@ -1092,8 +1126,7 @@ didmiss () * mshit: Record hitting a monster with a missile. */ -mshit (monster) -char *monster; +void mshit (char *monster) { register int mh; @@ -1116,8 +1149,7 @@ char *monster; * msmiss: Record missing a monster with a missile. */ -msmiss (monster) -char *monster; +void msmiss (char *monster) { register int mh; diff --git rogomatic-r2.0.2/src/monsters.c rogomatic-r2.0.2/src/monsters.c index 56e9f39..23e2d6c 100644 --- rogomatic-r2.0.2/src/monsters.c +++ rogomatic-r2.0.2/src/monsters.c @@ -126,11 +126,12 @@ dumpmonster () sleepmonster () { register int m; + char msg[256]; for (m = 0; m < mlistlen; ++m) { if (mlist[m].q == 0 && ! ADJACENT (m)) { - dwait (D_MONSTER, "Found a sleeping %s at %d,%d", - monname (mlist[m].chr), mlist[m].mrow, mlist[m].mcol); + sprintf(msg, "Found a sleeping %s at %d,%d", monname (mlist[m].chr), mlist[m].mrow, mlist[m].mcol); + dwait (D_MONSTER, msg); mlist[m].q = ASLEEP; } @@ -144,13 +145,14 @@ sleepmonster () holdmonsters () { register int m; + char msg[256]; for (m = 0; m < mlistlen; ++m) { if (mlist[m].q == 0 && (max (abs (mlist[m].mrow - atrow), abs (mlist[m].mcol - atcol)) < 3)) { - dwait (D_MONSTER, "Holding %s at %d,%d", - monname (mlist[m].chr), mlist[m].mrow, mlist[m].mcol); + sprintf(msg, "Holding %s at %d,%d", monname (mlist[m].chr), mlist[m].mrow, mlist[m].mcol); + dwait (D_MONSTER, msg); mlist[m].q = HELD; } @@ -170,6 +172,7 @@ wakemonster (dir) int dir; { register int m; + char msg[256]; for (m = 0; m < mlistlen; ++m) { if (mlist[m].q != AWAKE && @@ -177,8 +180,8 @@ int dir; (dir < 0 && ADJACENT(m) && mlist[m].chr == -dir + 'A' - 1) || (dir >= 0 && dir < 8 && mlist[m].mrow == atdrow(dir) && mlist[m].mcol == atdcol(dir)))) { - dwait (D_MONSTER, "Waking up %s at %d,%d", - monname (mlist[m].chr), mlist[m].mrow, mlist[m].mcol); + sprintf(msg, "Waking up %s at %d,%d", monname (mlist[m].chr), mlist[m].mrow, mlist[m].mcol); + dwait (D_MONSTER, msg); mlist[m].q = AWAKE; setrc (EVERCLR, mlist[m].mrow, mlist[m].mcol); diff --git rogomatic-r2.0.2/src/pack.c rogomatic-r2.0.2/src/pack.c index 2ebd237..4886903 100644 --- rogomatic-r2.0.2/src/pack.c +++ rogomatic-r2.0.2/src/pack.c @@ -32,6 +32,12 @@ # include "types.h" # include "globals.h" +# include "prototype.h" + +void clearpack (int); +void rollpackup (register int); +void rollpackdown (register int); + static char *stuffmess [] = { "strange", "food", "potion", "scroll", "wand", "ring", "hitter", "thrower", @@ -154,8 +160,7 @@ int pos; * clearpack: zero out slot in pack. DR UTexas 01/05/84 */ -clearpack (pos) -int pos; +void clearpack (int pos) { if (pos >= MAXINV) return; @@ -180,8 +185,7 @@ int pos; * the pack. */ -rollpackup (pos) -register int pos; +void rollpackup (register int pos) { register char *savebuf; register int i; @@ -215,8 +219,7 @@ register int pos; * objects behind that position. */ -rollpackdown (pos) -register int pos; +void rollpackdown (register int pos) { register char *savebuf; register int i; @@ -306,9 +309,11 @@ char *msgstart, *msgend; int plushit = UNKNOWN, plusdam = UNKNOWN, charges = UNKNOWN; stuff what; char *xbeg, *xend, *codenamebeg, *codenameend; + char msg[256]; xbeg = xend = codenamebeg = codenameend = ""; - dwait (D_PACK, "inv: message %s", mess); + sprintf(msg, "inv: message %s", mess); + dwait (D_PACK, msg); if (debug(D_MESSAGE)) { at (30,0); @@ -332,14 +337,8 @@ char *msgstart, *msgend; if ((ipos < 0) || (ipos > MAXINV)) { len = msgend - msgstart; - dwait (D_ERROR, - "inv: ipos out of range, 0 - MAXINV(%d) ipos %d invcount %d\nmsgs: %s\n mess: %s\n", - MAXINV, ipos, invcount, msgstart, mess); - return(printed); - } - else { - deletestuff (atrow, atcol); - unsetrc (USELESS, atrow, atcol); + sprintf(msg, "inv: ipos out of range, 0 - MAXINV(%d) ipos %d invcount %d\nmsgs: %s\n mess: %s\n", MAXINV, ipos, invcount, msgstart, mess); + dwait (D_ERROR, msg); } if (ISDIGIT(*mess)) @@ -477,10 +476,10 @@ char *msgstart, *msgend; if (version >= RV53A && what == ring && charges != UNKNOWN) { plushit = charges; charges = UNKNOWN; } - dwait (D_PACK, "inv %s '%s'", - stuffmess[(int) what], objname); - dwait (D_PACK, "inv ht %d dm %d ch %d kn %d", - plushit, plusdam, charges, xknow); + sprintf(msg, "inv %s '%s'", stuffmess[(int) what], objname); + dwait (D_PACK, msg); + sprintf(msg, "inv ht %d dm %d ch %d kn %d", plushit, plusdam, charges, xknow); + dwait (D_PACK, msg); /* make sure all unknown potion, Scroll, wand, rings are in dbase */ @@ -598,8 +597,8 @@ char *msgstart, *msgend; strcpy (inven[ipos].str, objname); } else if (!replaying) { - dwait (D_ERROR, "inv: null inven[%d].str, invcount %d.", - ipos, invcount); + sprintf(msg, "inv: null inven[%d].str, invcount %d.", ipos, invcount); + dwait (D_ERROR, msg); } /* Set cursed attribute for weapon and armor */ diff --git rogomatic-r2.0.2/src/prototype.h rogomatic-r2.0.2/src/prototype.h new file mode 100644 index 0000000..135eec1 --- /dev/null +++ rogomatic-r2.0.2/src/prototype.h @@ -0,0 +1,48 @@ +#include "types.h" + +const char * getRgmDir(); + +void clearscreen(); + +int willrust(int); + +int armorclass(int); +int weaponclass(int); + +int stlmatch(char *, char *); + +int havenamed(stuff, char *name); + +int havering(int, int); +int ringclass(int); + +int havearmor (int, int, int); + +int havefood(int); + +int worth(int); + +const char * getLockFile (); + +char *getname (); + +int dwait(int, char *); + +void command (int , char *); + +void toggleecho(); +void getrogue (char *, int); +void evalknobs (int , int , int); +void saveltm (int); +void positionreplay (); + +void inferhall (register int, register int); +void updateat(); +void nametrap (int, int); + +void add_score (char *, char *, int); + +void say(char *); +void saynow(char *); +void sendnow(char *); +void rogo_send(char *); diff --git rogomatic-r2.0.2/src/replay.c rogomatic-r2.0.2/src/replay.c index c9d4ad2..4960909 100644 --- rogomatic-r2.0.2/src/replay.c +++ rogomatic-r2.0.2/src/replay.c @@ -45,13 +45,15 @@ struct levstruct { } levpos[MAXNUMLEV]; int numlev = 0; +void fillstruct (FILE *, struct levstruct *); + /* * positionreplay: Called when user has typed the 'R' command, it fills * the level table by calling findlevel if necessary, and then positions * the log file to the level requested by the user. */ -positionreplay () +void positionreplay () { int curlev; long curpos; @@ -160,10 +162,10 @@ int *nmlev, maxnum; * fields of a levstruct. */ -fillstruct (f, lev) -FILE *f; -struct levstruct *lev; +void fillstruct (FILE *f, struct levstruct *lev) { + char msg[256]; + lev->level = 0; lev->gold = 0; lev->hp = 0; @@ -198,7 +200,8 @@ struct levstruct *lev; fscanf (f, "%d/%d", &lev->explev, &lev->exp); - saynow ("Found level %d, has %d gold...", lev->level, lev->gold); + sprintf(msg, "Found level %d, has %d gold...", lev->level, lev->gold); + saynow (msg); } /* diff --git rogomatic-r2.0.2/src/rooms.c rogomatic-r2.0.2/src/rooms.c index 752982f..ec07042 100644 --- rogomatic-r2.0.2/src/rooms.c +++ rogomatic-r2.0.2/src/rooms.c @@ -161,8 +161,7 @@ register int r,c; * nametrap: look around for a trap and set its type. */ -nametrap (traptype, standingonit) -int traptype, standingonit; +void nametrap (int traptype, int standingonit) { register int i, r, c, tdir = NONE, monsteradj = 0; @@ -411,11 +410,12 @@ clearcurrect() * Bug if teleported horiz or vert. Infers cango */ -updateat () +void updateat () { register int dr = atrow - atrow0, dc = atcol - atcol0; register int i, r, c; int dist, newzone, sum; + char msg[256]; /* * Record passage from one zone to the next @@ -487,7 +487,8 @@ updateat () else return; - dwait (D_INFORM, "Inferring %s at %d,%d.", terrain, atrow, atcol); + sprintf(msg, "Inferring %s at %d,%d.", terrain, atrow, atcol); + dwait (D_INFORM, msg); } else if (on (DOOR | ROOM) && !isexplored (atrow, atcol) && !darkroom ()) { markexplored (atrow, atcol); @@ -709,6 +710,7 @@ register int row, col; teleport () { register int r = atrow0, c = atcol0; + char msg[256]; goalr = goalc = NONE; setnewgoal (); @@ -721,8 +723,10 @@ teleport () if (onrc (WALL | DOOR | HALL, r, c)) break; if (onrc (TRAP, r, c)) { - if (!onrc (ARROW|DARTRAP|GASTRAP|BEARTRP|TRAPDOR|TELTRAP, r, c)) - saynow ("Assuming teleport trap at %d, %d", r, c); + if (!onrc (ARROW|DARTRAP|GASTRAP|BEARTRP|TRAPDOR|TELTRAP, r, c)) { + sprintf(msg, "Assuming teleport trap at %d, %d", r, c); + saynow (msg); + } break; } @@ -769,12 +773,15 @@ markexplored (row, col) int row, col; { register int rm = whichroom (row, col); + char msg[256]; if (rm != NONE && !(levelmap[rm] & EXPLORED)) { levelmap[rm] |= EXPLORED; - if (!(levelmap[rm] & HASROOM)) - saynow ("Assuming room %d is gone.", zone); + if (!(levelmap[rm] & HASROOM)) { + sprintf(msg, "Assuming room %d is gone.", zone); + saynow (msg); + } } } @@ -853,8 +860,7 @@ printexplored () * space. */ -inferhall (r, c) -register int r, c; +void inferhall (register int r, register int c) { register int i, j, k; @@ -862,6 +868,8 @@ register int r, c; char dirch = ' '; + char msg[256]; + for (k = 0; k < 8; k += 2) { if (onrc (HALL, r + deltr[k], c + deltc[k])) /* Hall has been seen */ return; @@ -869,7 +877,8 @@ register int r, c; dir = k; } - dwait (D_SEARCH, "Room direction %d", dir); + sprintf(msg, "Room direction %d", dir); + dwait (D_SEARCH, msg); if (dir < 0) return; @@ -961,8 +970,10 @@ register int r1, c1, r2, c2; { register int r, c; int endr = max (r1, r2), endc = max (c1, c2); + char msg[256]; - dwait (D_INFORM, "Inferring hall (%d,%d) to (%d,%d)", r1, c1, r2, c2); + sprintf(msg, "Inferring hall (%d,%d) to (%d,%d)", r1, c1, r2, c2); + dwait (D_INFORM, msg); for (r = min (r1, r2); r <= endr; r++) for (c = min (c1, c2); c <= endc; c++) diff --git rogomatic-r2.0.2/src/scorefile.c rogomatic-r2.0.2/src/scorefile.c index fa42846..cf41343 100644 --- rogomatic-r2.0.2/src/scorefile.c +++ rogomatic-r2.0.2/src/scorefile.c @@ -39,6 +39,8 @@ # include "globals.h" # include "install.h" +#include "prototype.h" + # define LINESIZE 2048 # define SCORE(s,p) (atoi (s+p)) @@ -51,9 +53,7 @@ static char lokfil[100]; * score file and catching interrupts and things. */ -add_score (new_line, vers, ntrm) -char *new_line, *vers; -int ntrm; +void add_score (char *new_line, char *vers, int ntrm) { int wantscore = 1; char ch; diff --git rogomatic-r2.0.2/src/search.c rogomatic-r2.0.2/src/search.c index 5aa9f9e..d941137 100644 --- rogomatic-r2.0.2/src/search.c +++ rogomatic-r2.0.2/src/search.c @@ -31,6 +31,7 @@ # include # include "types.h" # include "globals.h" +#include "prototype.h" # define QSIZE (4000) @@ -118,20 +119,21 @@ register int movetype; { register int dir, dr, dc, r, c; int timemode, searchit, count=1; + char msg[256]; dir=mvdir[atrow][atcol]-FROM; dr=deltr[dir]; dc=deltc[dir]; if (dir > 7 || dir < 0) { if (dir < 0) { - dwait (D_ERROR, "Followmap: direction invalid! < 0 dir %d, atr %d atc %d", - dir, atrow, atcol); + sprintf(msg, "Followmap: direction invalid! < 0 dir %d, atr %d atc %d", dir, atrow, atcol); + dwait (D_ERROR, msg); return (0); /* Something Broke */ } else if (dir >= TARGET) { dir = dir - TARGET; if (dir > 7) { - dwait (D_ERROR, "Followmap: adjusted direction still invalid! dir %d, atr %d atc %d", - dir, atrow, atcol); + sprintf(msg, "Followmap: adjusted direction still invalid! dir %d, atr %d atc %d", dir, atrow, atcol); + dwait (D_ERROR, msg); return (0); /* Something Broke still */ } } @@ -202,8 +204,10 @@ int movetype, (*evalinit)(), (*evaluate)(); { register int thedir, dir, r, c; int val, avd, cont; + char msg[256]; - dwait (D_CONTROL | D_SEARCH, "Validatemap: type %d", movetype); + sprintf(msg, "Validatemap: type %d", movetype); + dwait (D_CONTROL | D_SEARCH, msg); if (mvtype != movetype) { dwait (D_SEARCH, "Validatemap: move type mismatch, map invalid."); @@ -362,6 +366,7 @@ char dir[24][80]; static int sdirect[8] = {4, 6, 0, 2, 5, 7, 1, 3}, sdeltr[8] = {0,-1, 0, 1,-1,-1, 1, 1}, sdeltc[8] = {1, 0,-1, 0, 1,-1,-1, 1}; + char msg[256]; head = tail = begin; end = begin + QSIZE; @@ -450,7 +455,8 @@ char dir[24][80]; if (debug (D_SCREEN | D_SEARCH | D_INFORM)) { mvprintw (r, c, "="); - dwait (D_SEARCH, "Searchto: target value %d.", moveval[r][c]); + sprintf(msg, "Searchto: target value %d.", moveval[r][c]); + dwait (D_SEARCH, msg); } searchcontinue = movecont[r][c]; diff --git rogomatic-r2.0.2/src/setup.c rogomatic-r2.0.2/src/setup.c index 3af0dbd..d1617a7 100644 --- rogomatic-r2.0.2/src/setup.c +++ rogomatic-r2.0.2/src/setup.c @@ -33,6 +33,8 @@ # include # include "install.h" +# include "prototype.h" + # define READ 0 # define WRITE 1 @@ -54,6 +56,8 @@ char *argv[]; char *rfile = "", *rfilearg = "", options[32]; char ropts[128], roguename[128]; + int st; + while (--argc > 0 && (*++argv)[0] == '-') { while (*++(*argv)) { switch (**argv) { @@ -163,11 +167,22 @@ char *argv[]; if (!author ()) nice (4); - execl ("player", "player", ft, rp, options, roguename, 0); -# ifdef PLAYER - execl (PLAYER, "player", ft, rp, options, roguename, 0); -# endif - printf ("Rogomatic not available, 'player' binary missing.\n"); + char *exec_args[6]; +#ifdef PLAYER + exec_args[0] = PLAYER; +#else + exec_args[0] = "player"; +#endif + exec_args[1] = ft; + exec_args[2] = rp; + exec_args[3] = options; + exec_args[4] = roguename; + exec_args[5] = NULL; + st = execv(exec_args[0], exec_args); + //st = execl (PLAYER, "player", ft, rp, options, roguename, '\0'); + //st = execl ("/bin/echo", "echo", ft, rp, options, roguename, '\0'); + printf ("Rogomatic not available, '%s' binary missing. (%d)\n", exec_args[0], st); + printf("\tft=%s, rp=%s, options=%s, roguename=%s\n", ft, rp, options, roguename); kill (child, SIGKILL); } } @@ -182,11 +197,13 @@ char *argv[]; replaylog (fname, options) char *fname, *options; { - execl ("player", "player", "ZZ", "0", options, fname, 0); -# ifdef PLAYER +#ifdef PLAYER execl (PLAYER, "player", "ZZ", "0", options, fname, 0); -# endif + printf ("Replay not available, '%s' binary missing.\n", PLAYER); +#else + execl ("player", "player", "ZZ", "0", options, fname, 0); printf ("Replay not available, 'player' binary missing.\n"); +#endif exit (1); } diff --git rogomatic-r2.0.2/src/strategy.c rogomatic-r2.0.2/src/strategy.c index 6ccd5ac..b931185 100644 --- rogomatic-r2.0.2/src/strategy.c +++ rogomatic-r2.0.2/src/strategy.c @@ -34,6 +34,7 @@ # include "types.h" # include "globals.h" # include "install.h" +#include "prototype.h" /* * foughtmonster records whether we engaged in battle recently. This @@ -223,9 +224,11 @@ int strategize () int callitpending () { + char msg[256]; if (pending_call_letter != ' ') { - command (T_OTHER, "c%c%s\n", pending_call_letter, pending_call_name); + sprintf(msg, "c%c%s\n", pending_call_letter, pending_call_name); + command (T_OTHER, msg); pending_call_letter = ' '; memset (pending_call_name, '\0', NAMSIZ); return (1); @@ -245,6 +248,7 @@ int fightmonster () int melee = 0, adjacent = 0, alertmonster = 0; int wanddir = NONE, m = NONE, howmean; char mon, monc = ':', *monster; + char msg[256]; /* Check for adjacent monsters */ for (i = 0; i < mlistlen; i++) { @@ -296,9 +300,8 @@ int fightmonster () { wanddir = direc (rr-atrow, cc-atcol); } /* Debugging breakpoint */ - dwait (D_BATTLE, "%c <%d,%d>, danger %d, worst %c(%d,%d), total %d", - screen[rr][cc], rr-atrow, cc-atcol, - danger, monc, mdir, mbad, adjacent); + sprintf(msg, "%c <%d,%d>, danger %d, worst %c(%d,%d), total %d", screen[rr][cc], rr-atrow, cc-atcol, danger, monc, mdir, mbad, adjacent); + dwait (D_BATTLE, msg); } } @@ -345,8 +348,8 @@ int fightmonster () if (danger >= Hp) display ("In trouble..."); /* Well, nothing better than to hit the beast! Tell dwait about it */ - dwait (D_BATTLE, "Attacking %s(%d) direction %d (total danger %d)...", - monster, mbad, mdir, danger); + sprintf(msg, "Attacking %s(%d) direction %d (total danger %d)...", monster, mbad, mdir, danger); + dwait (D_BATTLE, msg); /* Record the monster type */ lastmonster = monc-'A'+1; @@ -371,6 +374,7 @@ int tomonster () register int i, dist, rr, cc, mdir = NONE, mbad = NONE; int closest, which, danger = 0, adj = 0, alert = 0; char monc = ':', monchar = ':', *monster; + char msg[256]; /* If no monsters, fail */ if (mlistlen==0) @@ -408,9 +412,8 @@ int tomonster () /* Or if he is meaner than another equally close monster, save him */ else if (dist == closest && avghit(i) > avghit(which)) { - dwait (D_BATTLE, "Chasing %c(%d) rather than %c(%d) at distance %d.", - mlist[i].chr, avghit(i), mlist[which].chr, - avghit(which), dist); + sprintf(msg, "Chasing %c(%d) rather than %c(%d) at distance %d.", mlist[i].chr, avghit(i), mlist[which].chr, avghit(which), dist); + dwait (D_BATTLE, msg); closest = dist; which = i; monc = mlist[i].chr; mbad = avghit(i); } @@ -498,10 +501,13 @@ char c; aftermelee () { + char msg[256]; + if (foughtmonster > 0) { lyinginwait = 1; command (T_RESTING, "s"); - dwait (D_BATTLE, "Aftermelee: waiting for %d rounds.", foughtmonster); + sprintf(msg, "Aftermelee: waiting for %d rounds.", foughtmonster); + dwait (D_BATTLE, msg); return (1); } @@ -537,6 +543,7 @@ int adj; /* How many attackers are there? */ { int obj, turns; static int stepback = 0; + char msg[256]; /* Ascertain whether we have a clear path to this monster */ if (mdir != NONE && !checkcango (mdir, mdist)) @@ -564,9 +571,8 @@ int adj; /* How many attackers are there? */ if (beingstalked > INVPRES) { turns = 0; danger += INVDAM; } /* Debugging breakpoint */ - dwait (D_BATTLE, - "Battlestations: %s(%d), total danger %d, dir %d, %d turns, %d adj.", - monster, mbad, danger, mdir, turns, adj); + sprintf(msg, "Battlestations: %s(%d), total danger %d, dir %d, %d turns, %d adj.", monster, mbad, danger, mdir, turns, adj); + dwait (D_BATTLE, msg); /* * Switch back to our mace or sword? @@ -1078,6 +1084,7 @@ int tostuff () fightinvisible () { char cmd[20]; register int dir, liberties = 0, lastdir, obj; + char msg[256]; /* Count down the time since we were last hit by a stalker */ if (--beingstalked < 0) @@ -1135,7 +1142,8 @@ fightinvisible () /* If can only go two ways, then go back and forth (will hit) */ if (liberties == 1 || liberties == 2) { - command (T_FIGHTING, "%c%c", keydir[lastdir], keydir[(lastdir+4)&7]); + sprintf(msg, "%c%c", keydir[lastdir], keydir[(lastdir+4)&7]); + command (T_FIGHTING, msg); return (1); } @@ -1150,8 +1158,10 @@ fightinvisible () break; if (dir > 7) command (T_FIGHTING, "hjlk"); - else command (T_FIGHTING, "%c%c%c", keydir[dir], - keydir[dir], keydir[(dir+4)&7]); + else { + sprintf(msg, "%c%c%c", keydir[dir], keydir[dir], keydir[(dir+4)&7]); + command (T_FIGHTING, msg); + } return (1); } @@ -1170,6 +1180,7 @@ archery () { register int m, mtk; char *monster; + char msg[256]; for (m=0; m < mlistlen; m++) { /* Find a sleeping monster */ monster = monname (mlist[m].chr); @@ -1198,8 +1209,8 @@ archery () larder > 0 || ((streq (monster, "leprechaun") && !hungry ()) || streq (monster, "nymph"))) { - dwait (D_BATTLE, "Arching at %c at (%d,%d)", - mlist[m].chr, mlist[m].mrow, mlist[m].mcol); + sprintf(msg, "Arching at %c at (%d,%d)", mlist[m].chr, mlist[m].mrow, mlist[m].mcol); + dwait (D_BATTLE, msg); if (archmonster (m, mtk)) return (1); diff --git rogomatic-r2.0.2/src/tactics.c rogomatic-r2.0.2/src/tactics.c index 51ab9a0..6acc519 100644 --- rogomatic-r2.0.2/src/tactics.c +++ rogomatic-r2.0.2/src/tactics.c @@ -33,6 +33,7 @@ # include "types.h" # include "globals.h" # include "install.h" +#include "prototype.h" /* * handlearmor: This routine is called to determine whether we should @@ -50,6 +51,7 @@ handlearmor () { int obj; + char msg[256]; /* Only check when armor status is different */ if (!newarmor || cursedarmor) return (0); @@ -86,7 +88,8 @@ handlearmor () { newarmor = 0; return (0); } /* Debugging */ - dwait (D_PACK, "handlearmor: obj %d, currentarmor %d", obj, currentarmor); + sprintf(msg, "handlearmor: obj %d, currentarmor %d", obj, currentarmor); + dwait (D_PACK, msg); /* Take off the wrong armor */ if (currentarmor != NONE && takeoff ()) @@ -346,14 +349,15 @@ readscroll () handlering () { int ring1, ring2; + char msg[256]; if (!newring && !beingstalked) return (0); ring1 = havering (1, NOPRINT); ring2 = havering (2, NOPRINT); - dwait (D_PACK, "Handlering: ring1 %d, ring2 %d, left %d, right %d", - ring1, ring2, leftring, rightring); + sprintf(msg, "Handlering: ring1 %d, ring2 %d, left %d, right %d", ring1, ring2, leftring, rightring); + dwait (D_PACK, msg); if ((leftring == ring1 && rightring == ring2) || (rightring == ring1 && leftring == ring2)) { @@ -423,9 +427,11 @@ grope (turns) register int turns; { register int k, moves; + char msg[256]; if (atrow < 2 || atcol < 1) { - command (T_GROPING, "%ds", (turns > 0) ? turns : 1); + sprintf(msg, "%ds", (turns > 0) ? turns : 1); + command (T_GROPING, msg); return (1); } @@ -441,10 +447,13 @@ register int turns; if ((onrc(CANGO|TRAP, atdrow(blindir), atdcol(blindir)) == CANGO)) break; - if (turns) command (T_GROPING, "%c%c%ds", keydir[blindir], - keydir[(blindir+4)&7], turns); - else command (T_GROPING, "%c%c", keydir[blindir], - keydir[(blindir+4)&7]); + if (turns) { + sprintf(msg, "%c%c%ds", keydir[blindir], keydir[(blindir+4)&7], turns); + command (T_GROPING, msg); + } else { + sprintf(msg, "%c%c", keydir[blindir], keydir[(blindir+4)&7]); + command (T_GROPING, msg); + } blindir = (blindir+2) % 8; return (1); @@ -728,6 +737,7 @@ int running; restup () { register int obj, turns; + char msg[256]; /* If we are confused, sit still so we don't bump into anything bad */ if (confused) { command (T_RESTING, "s"); return (1); } @@ -779,7 +789,8 @@ restup () if ((!darkroom () && ammo) || Hp < Level*2+8 || Level > 15) turns = 1; - command (T_RESTING, "%ds", turns); + sprintf(msg, "%ds", turns); + command (T_RESTING, msg); return (1); } @@ -915,9 +926,11 @@ trywand () eat () { int obj; + char msg[256]; if ((obj = have (food)) != NONE) { - command (T_HANDLING, "e%c", LETTER (obj)); + sprintf(msg, "e%c", LETTER (obj)); + command (T_HANDLING, msg); return (1); } diff --git rogomatic-r2.0.2/src/things.c rogomatic-r2.0.2/src/things.c index 92427f0..9570439 100644 --- rogomatic-r2.0.2/src/things.c +++ rogomatic-r2.0.2/src/things.c @@ -31,6 +31,7 @@ # include # include "types.h" # include "globals.h" +#include "prototype.h" /* * wear: This primitive function issues a command to put on armor. @@ -39,6 +40,8 @@ wear (obj) int obj; { + char msg[256]; + if (currentarmor != NONE) { dwait (D_FATAL, "Trying to put on a second coat of armor"); return (0); @@ -46,7 +49,8 @@ int obj; if (cursedarmor) return (0); - command (T_HANDLING, "W%c", LETTER (obj)); + sprintf(msg, "W%c", LETTER (obj)); + command (T_HANDLING, msg); usesynch = 0; return (1); } @@ -76,6 +80,8 @@ takeoff () wield (obj) int obj; { + char msg[256]; + if (cursedweapon) return (0); if (version >= RV54A) { @@ -85,23 +91,27 @@ int obj; return (0); } else if (currentweapon == NONE) { - command (T_HANDLING, "w%c", LETTER (obj)); + sprintf(msg, "w%c", LETTER (obj)); + command (T_HANDLING, msg); } else if (itemis(currentweapon, UNCURSED)) { cursedweapon=0; - command (T_HANDLING, "w%c", LETTER (obj)); + sprintf(msg, "w%c", LETTER (obj)); + command (T_HANDLING, msg); } else if (itemis(currentweapon, ENCHANTED)) { remember(currentweapon, UNCURSED); cursedweapon=0; - command (T_HANDLING, "w%c", LETTER (obj)); + sprintf(msg, "w%c", LETTER (obj)); + command (T_HANDLING, msg); } else { /* current weapon might be cursed */ if (currentweapon != NONE) { lastdrop = currentweapon; - command (T_HANDLING, "w%c", ESC); + sprintf(msg, "w%c", ESC); + command (T_HANDLING, msg); } return (0); } @@ -110,10 +120,13 @@ int obj; /* send 2 escapes because I needed to patch the new rogue to not hang * momentatirily on the first escape */ - else if (version == RV53A) - command (T_HANDLING, "w%cw%c%c", LETTER (obj), ESC, ctrl('p')); - else - command (T_HANDLING, "w%cw%c%c", LETTER (obj), ESC, ctrl('r')); + else if (version == RV53A) { + sprintf(msg, "w%cw%c%c", LETTER (obj), ESC, ctrl('p')); + command (T_HANDLING, msg); + } else { + sprintf(msg, "w%cw%c%c", LETTER (obj), ESC, ctrl('r')); + command (T_HANDLING, msg); + } return (1); } @@ -142,6 +155,7 @@ int obj; drop (obj) int obj; { + char msg[256]; /* Can't if not there, in use, or on something else or dropped something else already */ if (inven[obj].count < 1 || @@ -183,7 +197,8 @@ int obj; quaff (obj)) { return (1); } - command (T_HANDLING, "d%c", LETTER (obj)); + sprintf(msg, "d%c", LETTER (obj)); + command (T_HANDLING, msg); return (1); } @@ -194,13 +209,16 @@ int obj; quaff (obj) int obj; { + char msg[256]; if (inven[obj].type != potion) { - dwait (D_ERROR, "Trying to quaff %c", LETTER (obj)); + sprintf(msg, "Trying to quaff %c", LETTER (obj)); + dwait (D_ERROR, msg); usesynch = 0; return (0); } - command (T_HANDLING, "q%c", LETTER (obj)); + sprintf(msg, "q%c", LETTER (obj)); + command (T_HANDLING, msg); return (1); } @@ -211,13 +229,17 @@ int obj; reads (obj) int obj; { + char msg[256]; + if (inven[obj].type != Scroll) { - dwait (D_ERROR, "Trying to read %c", LETTER (obj)); + sprintf(msg, "Trying to read %c", LETTER (obj)); + dwait (D_ERROR, msg); usesynch = 0; return (0); } - command (T_HANDLING, "r%c", LETTER (obj)); + sprintf(msg, "r%c", LETTER (obj)); + command (T_HANDLING, msg); return (1); } @@ -228,17 +250,19 @@ int obj; point (obj, dir) int obj, dir; { + char msg[256]; + if (inven[obj].type != wand) { - dwait (D_ERROR, "Trying to point %c", LETTER (obj)); + sprintf(msg, "Trying to point %c", LETTER (obj)); + dwait (D_ERROR, msg); return (0); } if (itemis (obj, USELESS)) return (0); else { - command (T_HANDLING, "%c%c%c", - (version < RV52A) ? 'p' : 'z', /* R5.2 MLM */ - keydir[dir], LETTER (obj)); + sprintf(msg, "%c%c%c", (version < RV52A) ? 'p' : 'z', /* R5.2 MLM */ keydir[dir], LETTER (obj)); + command (T_HANDLING, msg); return (1); } } @@ -250,12 +274,16 @@ int obj, dir; throw (obj, dir) int obj, dir; { + char msg[256]; + if (obj < 0 || obj >= invcount) { - dwait (D_ERROR, "Trying to throw %c", LETTER (obj)); + sprintf(msg, "Trying to throw %c", LETTER (obj)); + dwait (D_ERROR, msg); return (0); } - command (T_HANDLING, "t%c%c", keydir[dir], LETTER (obj)); + sprintf(msg, "t%c%c", keydir[dir], LETTER (obj)); + command (T_HANDLING, msg); return (1); } @@ -266,11 +294,19 @@ int obj, dir; puton (obj) int obj; { - if (leftring == NONE && rightring == NONE) - { command (T_HANDLING, "P%cl", LETTER (obj)); return (1); } + char msg[256]; - if (leftring == NONE || rightring == NONE) - { command (T_HANDLING, "P%c", LETTER (obj)); return (1); } + if (leftring == NONE && rightring == NONE) { + sprintf(msg, "P%cl", LETTER (obj)); + command (T_HANDLING, msg); + return (1); + } + + if (leftring == NONE || rightring == NONE) { + sprintf(msg, "P%c", LETTER (obj)); + command (T_HANDLING, msg); + return (1); + } return (0); } @@ -662,7 +698,7 @@ int haveuseless () * willrust: return true if a suit of armor can rust */ -willrust (obj) +int willrust (obj) int obj; { return (! (protected || diff --git rogomatic-r2.0.2/src/titlepage.c rogomatic-r2.0.2/src/titlepage.c index 1e1caf3..9061782 100644 --- rogomatic-r2.0.2/src/titlepage.c +++ rogomatic-r2.0.2/src/titlepage.c @@ -34,6 +34,8 @@ # include "types.h" # include "globals.h" +void animate (char **); + static char *titlepage[]= { /* The static part of the display */ " @ !@ \"@ #@ K@! @!$@!K@!P@\" @\"$@\"(@\")@\"*@\"/@\"0@\"1@\"6@\"7@\"8@", @@ -90,8 +92,7 @@ static char *titlepage[]= { * greater than 2400). */ -animate (movie) -char *movie[]; +void animate (char *movie[]) { int baud; register int r, c, count = 0, delaychars; diff --git rogomatic-r2.0.2/src/types.h rogomatic-r2.0.2/src/types.h index 3a87ad5..da99d16 100644 --- rogomatic-r2.0.2/src/types.h +++ rogomatic-r2.0.2/src/types.h @@ -27,6 +27,9 @@ * Miscellaneous Macros and Constants */ +#ifndef TYPE_H +#define TYPE_H + /* Global Preprocessor constants */ # define ill ";'" @@ -359,3 +362,5 @@ typedef struct { int activity[T_LISTLEN]; int timestamp; } timerec; + +#endif diff --git rogomatic-r2.0.2/src/utility.c rogomatic-r2.0.2/src/utility.c index a85f019..b61b819 100644 --- rogomatic-r2.0.2/src/utility.c +++ rogomatic-r2.0.2/src/utility.c @@ -39,6 +39,7 @@ # include # include # include +#include # include # include "install.h" diff --git rogomatic-r2.0.2/src/worth.c rogomatic-r2.0.2/src/worth.c index 6760d30..cd8cf05 100644 --- rogomatic-r2.0.2/src/worth.c +++ rogomatic-r2.0.2/src/worth.c @@ -53,7 +53,7 @@ int objval[] = { /* none */ 0 }; -worth (obj) +int worth (obj) int obj; { int value, w;