Commit 333e3c27 authored by Markus Koschany's avatar Markus Koschany

Import Upstream version 0.90

parents
24 April 1999
Fixed build for Cygwin32 platform - thanks to Alan de Smet
<chaos@null.net>
22 July 1999
Changed strings.h to string.h , and added maintainer-clean to
Makefile.in - thanks to Antti-Juhani Kaijanaho <gaia@iki.fi>
Fixed the output for usage.
######################################################################
# $Id: Makefile.in,v 1.52 2002/12/24 04:23:57 hartmann Exp $
######################################################################
TARGET = freesweep
VERSION = 0.90
SRCS = clear.c drawing.c error.c fgui.c files.c game.c gpl.c main.c pbests.c\
play.c sl.c stats.c tick.c utils.c image.c
HEADS = sweep.h defaults.h acconfig.h
MISC = README Makefile sweeprc install-sh configure.in Makefile.in\
config.guess configure config.sub sweep.h.in freesweep.6.in CHANGES\
config.h.in
CLEANUP = a.out $(TARGET) core made $(OBJS) config.cache config.log\
config.status
srcdir = .
prefix = /usr/local
exec_prefix = ${prefix}
#bindir = $(exec_prefix)/bin
bindir = ${exec_prefix}/bin
CC = gcc
CFLAGS = -Wall -DVERSION=\"$(VERSION)\" -g -O2
LIBS = -lm -lncurses
LDFLAGS =
OBJS = $(SRCS:.c=.o)
TARGET_DIR = $(TARGET)-$(VERSION)
FILES = $(SRCS) $(MISC) $(HEADS)
# for systems that have purify
PURE_ARGS = /s/purify/bin/purify -collector=/s/purify/bin/collect2
.SUFFIXES: .c .o
.PHONY: clean sterile lines distclean maintainer-clean mrproper
#######################################################################
%.o: %.c $(HEADS) Makefile
@/bin/rm -f $*.o
$(CC) $(CFLAGS) -c $<
$(TARGET): $(OBJS) $(HEADS) $(MISC)
@/bin/rm -f $(TARGET)
$(PURIFY) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $(TARGET)
configure: configure.in
autoconf
#config.h.in: acconfig.h
# autoheader
clean:
@-/bin/rm -rf $(CLEANUP)
pure:
@make clean
@make "PURIFY=$(PURE_ARGS)"
install: $(TARGET) $(TARGET).6
touch sweeptimes
./install-sh -c -m 2555 -o root -g games -s $(TARGET) $(bindir)/$(TARGET)
./install-sh -c -m 0664 -o root -g games sweeptimes /sweeptimes
./install-sh -c -m 0644 -o root -g games sweeprc /usr/local/share/sweeprc
./install-sh -c -m 0444 -o root -g games $(TARGET).6 ${prefix}/man/man6/$(TARGET).6
distclean:
@make sterile
maintainer-clean:
@make sterile
mrproper:
@make sterile
sterile:
-make clean
@-/bin/rm -f *.o core made $(TARGET) a.out sweep.h configure Makefile freesweep.6 debug.log
tar: $(SRCS) $(MISC)
(cd ../ ; ln -s sweep $(TARGET_DIR))
(cd ../ ; /bin/tar cvfh $(TARGET_DIR).tar $(FILES:%=$(TARGET_DIR)/%))
(cd ../ ; rm $(TARGET_DIR))
tags: $(SRCS) $(HEADS) $(MISC)
@ctags $(SRCS) $(HEADS)
lines: $(SRCS) $(HEADS)
@echo 'Total lines of code:'
@wc -l $(SRCS) $(HEADS) | sort -rn
######################################################################
# $Id: Makefile.in,v 1.52 2002/12/24 04:23:57 hartmann Exp $
######################################################################
TARGET = freesweep
VERSION = 0.90
SRCS = clear.c drawing.c error.c fgui.c files.c game.c gpl.c main.c pbests.c\
play.c sl.c stats.c tick.c utils.c image.c
HEADS = sweep.h defaults.h acconfig.h
MISC = README Makefile sweeprc install-sh configure.in Makefile.in\
config.guess configure config.sub sweep.h.in freesweep.6.in CHANGES\
config.h.in
CLEANUP = a.out $(TARGET) core made $(OBJS) config.cache config.log\
config.status
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
#bindir = $(exec_prefix)/bin
bindir = @bindir@
CC = @CC@
CFLAGS = -Wall -DVERSION=\"$(VERSION)\" @CFLAGS@
LIBS = @LIBS@
LDFLAGS = @LDFLAGS@
OBJS = $(SRCS:.c=.o)
TARGET_DIR = $(TARGET)-$(VERSION)
FILES = $(SRCS) $(MISC) $(HEADS)
# for systems that have purify
PURE_ARGS = /s/purify/bin/purify -collector=/s/purify/bin/collect2
.SUFFIXES: .c .o
.PHONY: clean sterile lines distclean maintainer-clean mrproper
#######################################################################
%.o: %.c $(HEADS) Makefile
@@RM@ -f $*.o
$(CC) $(CFLAGS) -c $<
$(TARGET): $(OBJS) $(HEADS) $(MISC)
@@RM@ -f $(TARGET)
$(PURIFY) $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $(TARGET)
configure: configure.in
autoconf
#config.h.in: acconfig.h
# autoheader
clean:
@-@RM@ -rf $(CLEANUP)
pure:
@make clean
@make "PURIFY=$(PURE_ARGS)"
install: $(TARGET) $(TARGET).6
touch sweeptimes
./install-sh -c -m 2555 -o root -g games -s $(TARGET) $(bindir)/$(TARGET)
./install-sh -c -m 0664 -o root -g games sweeptimes @SCORESDIR@/sweeptimes
./install-sh -c -m 0644 -o root -g games sweeprc @PREFSDIR@/sweeprc
./install-sh -c -m 0444 -o root -g games $(TARGET).6 @mandir@/man6/$(TARGET).6
distclean:
@make sterile
maintainer-clean:
@make sterile
mrproper:
@make sterile
sterile:
-make clean
@-@RM@ -f *.o core made $(TARGET) a.out sweep.h configure Makefile freesweep.6 debug.log
tar: $(SRCS) $(MISC)
(cd ../ ; @LN_S@ sweep $(TARGET_DIR))
(cd ../ ; @TAR@ cvfh $(TARGET_DIR).tar $(FILES:%=$(TARGET_DIR)/%))
(cd ../ ; rm $(TARGET_DIR))
tags: $(SRCS) $(HEADS) $(MISC)
@ctags $(SRCS) $(HEADS)
lines: $(SRCS) $(HEADS)
@echo 'Total lines of code:'
@wc -l $(SRCS) $(HEADS) | sort -rn
This will eventually be a readme file. For now, just a list of notes.
Freesweep is licensed under the GNU GPL, version 2 or above. See
the file COPYING, run freesweep with the -g flag, or hit 'g' while playing
the game to see it. The code is copyright Gus Hartmann and Peter Keller.
We need to have some sort of standard header in all the files
the mentions the copyright and GNU GPL.
Bugs should be mailed to sweep@cs.wisc.edu, if it works, or
hartmann@cs.wisc.edu otherwise.
Color works, but right now the values are not customizable. Sorry.
If no file locking mechanism is found, group-writable best times
will be disabled.
While the game is playable on any terminal supported by curses/ncurses,
the help and high scores windows are designed to use a screen 80 columns wide.
On most X keymaps, both the left arrow and the down arrow don't
work, reporting "Unknown keystroke." Unfortunately, somehow this leaves an
extra 'o' lying around, leading to a saved game getting loaded. Really
fucking bizarre- Sun's curses doesn't have the arrows-under-X problem.
Fix up the error condition for what happens when you can't write to the
best times file and shit. Just quitting doesn't seem to good.
Also, fix the creation permissions of the group file. Like either the client
can make a new one with 666 perms, or the installer makes one with the
correct permissions.
See if purify bitches about what I wrote with the reconfig shit.
See what purify is bitching about in the load/save game code.
Sun's curses doesn't do standout() correctly on a Linux term.
Special thanks to Pete Keller for lots of help.
Thanks to the FSF for the license and certain chunks of code.
Thanks to the Undergraduate Project Lab at the University of Wisconsin
/* acconfig.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
/* Comment this out to have a debug log file. */
#undef DEBUG_LOG
/* Set this blah blah blah. */
#undef SCORESDIR
/* Comment this out to use a shared best times file. */
#undef USE_GROUP_BEST_FILE
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */
This diff is collapsed.
This diff is collapsed.
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* acconfig.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
/* Set this to be blah blah blah. */
/* #ifndef DEBUG_LOG
#define DEBUG_LOG debug.log
#endif */
#undef DEBUG_LOG
/* Set this blah blah blah. */
#undef SCORESDIR
/* Comment this out to use a shared best times file. */
#undef USE_GROUP_BEST_FILE
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */
/* Define if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define if you have the `fileno' function. */
#undef HAVE_FILENO
/* Define if you have the `flock' function. */
#undef HAVE_FLOCK
/* Define if you have the `getopt' function. */
#undef HAVE_GETOPT
/* Define if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
/* Define if you have the `get_current_dir_name' function. */
#undef HAVE_GET_CURRENT_DIR_NAME
/* Define if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the `curses' library (-lcurses). */
#undef HAVE_LIBCURSES
/* Define if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the `lockf' function. */
#undef HAVE_LOCKF
/* Define if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define if you have the `sprintf' function. */
#undef HAVE_SPRINTF
/* Define if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define if you have the `vsprintf' function. */
#undef HAVE_VSPRINTF
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
This diff is collapsed.
This diff is collapsed.
dnl
dnl $Id: configure.in,v 1.43 2002/12/24 03:54:26 hartmann Exp $
dnl
dnl IU_LIB_NCURSES -- check for, and configure, ncurses
dnl
dnl If libncurses is found to exist on this system and the --disable-ncurses
dnl flag wasn't specified, defines LIBNCURSES with the appropriate linker
dnl specification, and possibly defines NCURSES_INCLUDE with the appropriate
dnl -I flag to get access to ncurses include files.
dnl
AC_DEFUN([IU_LIB_NCURSES], [
AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses],
, enable_ncurses=yes)
if test "$enable_ncurses" = yes; then
AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")
if test "$LIBNCURSES"; then
# Use ncurses header files instead of the ordinary ones, if possible;
# is there a better way of doing this, that avoids looking in specific
# directories?
AC_ARG_WITH(ncurses-include-dir,
[ --with-ncurses-include-dir=DIR
Set directory containing the include files for
use with -lncurses, when it isn't installed as
the default curses library. If DIR is "none",
then no special ncurses include files are used.
--without-ncurses-include-dir
Equivalent to --with-ncurses-include-dir=none])dnl
if test "${with_ncurses_include_dir+set}" = set; then
AC_MSG_CHECKING(for ncurses include dir)
case "$with_ncurses_include_dir" in
no|none)
freesweep_cv_includedir_ncurses=none;;
*)
freesweep_cv_includedir_ncurses="$with_ncurses_include_dir";;
esac
AC_MSG_RESULT($freesweep_cv_includedir_ncurses)
else
AC_CACHE_CHECK(for ncurses include dir,
freesweep_cv_includedir_ncurses,
for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do
if test -d $D/ncurses; then
freesweep_cv_includedir_ncurses="$D/ncurses"
break
fi
test "$freesweep_cv_includedir_ncurses" \
|| freesweep_cv_includedir_ncurses=none
done)
fi
if test "$freesweep_cv_includedir_ncurses" = none; then
NCURSES_INCLUDE=""
else
NCURSES_INCLUDE="-I$freesweep_cv_includedir_ncurses"
fi
fi
fi
AC_SUBST(NCURSES_INCLUDE)
AC_SUBST(LIBNCURSES)])dnl
dnl IU_LIB_TERMCAP -- check for various termcap libraries
dnl
dnl Checks for various common libraries implementing the termcap interface,
dnl including ncurses (unless --disable ncurses is specified), curses (which
dnl does on some systems), termcap, and termlib. If termcap is found, then
dnl LIBTERMCAP is defined with the appropriate linker specification.
dnl
AC_DEFUN([IU_LIB_TERMCAP], [
AC_REQUIRE([IU_LIB_NCURSES])
if test "$LIBNCURSES"; then
LIBTERMCAP="$LIBNCURSES"
else
AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses)
if test "$ac_cv_lib_curses_tgetent" = no; then
AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap)
fi
if test "$ac_cv_lib_termcap_tgetent" = no; then
AC_CHECK_LIB(termlib, tgetent, LIBTERMCAP=-ltermlib)
fi
fi
AC_SUBST(LIBTERMCAP)])dnl
dnl IU_LIB_CURSES -- checke for curses, and associated libraries
dnl
dnl Checks for varions libraries implementing the curses interface, and if
dnl found, defines LIBCURSES to be the appropriate linker specification,
dnl *including* any termcap libraries if needed (some versions of curses
dnl don't need termcap).
dnl
AC_DEFUN([IU_LIB_CURSES], [
AC_REQUIRE([IU_LIB_TERMCAP])
AC_REQUIRE([IU_LIB_NCURSES])
if test "$LIBNCURSES"; then
LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap
else
_IU_SAVE_LIBS="$LIBS"
LIBS="$LIBTERMCAP"
AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses")
if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then
AC_CACHE_CHECK(whether curses needs $LIBTERMCAP,
freesweep_cv_curses_needs_termcap,
LIBS="$LIBCURSES"
AC_TRY_LINK([#include <curses.h>], [initscr ();],
[freesweep_cv_curses_needs_termcap=no],
[freesweep_cv_curses_needs_termcap=yes]))
if test $freesweep_cv_curses_needs_termcap = yes; then
LIBCURSES="$LIBCURSES $LIBTERMCAP"
fi
fi
LIBS="$_IU_SAVE_LIBS"
fi
AC_SUBST(LIBCURSES)])dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT(sweep.h.in)dnl
AC_CONFIG_HEADER(config.h)dnl
dnl Find out where we're building
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PATH_PROG(TAR, tar)dnl
AC_PATH_PROG(GZIP, gzip)dnl
AC_PATH_PROG(RM, rm)dnl
dnl Set the prefsdir to something
AC_ARG_WITH(prefsdir, [ --with-prefsdir=DIR put the shared best time file in DIR [/usr/local/share]], PREFSDIR=$with_prefsdir, PREFSDIR='/usr/local/share')dnl
AC_SUBST(PREFSDIR)dnl
dnl Set the scoresdir to something
dnl AC_ARG_WITH(scoresdir, [ --with-scoresdir=DIR put the shared best time file in DIR [/usr/local/share]], SCORESDIR=$with_scoresdir, SCORESDIR='/usr/local/share')dnl
AC_ARG_WITH(scoresdir, [ --with-scoresdir=DIR put the shared best time file in DIR [/usr/local/share]], SCORESDIR=$with_scoresdir)dnl
AC_SUBST(SCORESDIR)dnl
if test X$SCORESDIR != X ; then
AC_DEFINE_UNQUOTED(SCORESDIR, $SCORESDIR)dnl
fi
dnl Look for ncurses in a variable.
dnl Check for debugging file
AC_ARG_ENABLE(debug-log,
[ --enable-debug-log Enables debugging file, debug.log.], enable_debug_log=yes)
if test "$enable_debug_log" = 'yes' ; then
AC_DEFINE(DEBUG_LOG)dnl
fi
dnl Check for curses and ncurses.
IU_LIB_NCURSES
IU_LIB_CURSES
if test "X${LIBNCURSES}" != "X" ; then
LIBS="${LIBNCURSES} ${LIBS}"
HAVE_LIBNCURSES=1
AC_SUBST(HAVE_LIBNCURSES)dnl
else
dnl Look for curses
AC_CHECK_LIB(curses,main)dnl
fi
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m,main)dnl
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h string.h unistd.h sys/file.h getopt.h errno.h sys/types.h)dnl
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strdup memset memmove fileno lockf flock get_current_dir_name)dnl
# Look for lesser but similar functions.
AC_DEFUN([AC_FUNC_SNPRINTF],
[AC_CACHE_CHECK(for working snprintf, ac_cv_func_snprintf,
[AC_TRY_RUN([#include <stdio.h>
int main () { exit (!(3 <= snprintf(NULL,0,"%d",100))); }
], ac_cv_func_snprintf=yes, ac_cv_func_snprintf=no,
ac_cv_func_snprintf=no)])
if test $ac_cv_func_snprintf = yes; then
AC_DEFINE(HAVE_SNPRINTF)
fi
])
AC_CHECK_FUNCS(snprintf)dnl
if test "${ac_cv_func_snprintf}" = 'no' ; then
AC_MSG_WARN([Consider getting a system with snprintf.])
AC_CHECK_FUNCS(sprintf)dnl
fi
AC_CHECK_FUNCS(vsnprintf)dnl
if test "${ac_cv_func_vsnprintf}" = 'no' ; then
AC_MSG_WARN([Consider getting a system with vsnprintf.])
AC_CHECK_FUNCS(vsprintf)dnl
fi
AC_CHECK_FUNCS(getopt_long)dnl
if test "${ac_cv_func_getopt_long}" = 'no' ; then
AC_MSG_WARN([Consider getting a system with getopt_long.])
AC_CHECK_FUNCS(getopt)dnl
fi
dnl If neither locking mechanism is there, disable group scores.
if test "${with_scoresdir}" != '' ; then
if test "${ac_cv_func_flock}" = 'no' && test "${ac_cv_func_lockf}" = 'no' ; then
AC_MSG_WARN([Neither lockf nor flock was found. Best times files will be risky.])dnl
else
AC_DEFINE(USE_GROUP_BEST_FILE)dnl
fi
fi
AC_OUTPUT(Makefile sweep.h freesweep.6)dnl
/*********************************************************************
* $Id: defaults.h,v 1.9 1999/08/06 07:25:26 hartmann Exp $
*********************************************************************/
#ifndef __DEFAULTS_H__
#define __DEFAULTS_H__
#define DEFAULT_HEIGHT 15
#define DEFAULT_WIDTH 15
#define DEFAULT_PERCENT 20
#define DEFAULT_COLOR 1
#define DEFAULT_NUMMINES 0
#define DEFAULT_FASTSTART 0
#define DEFAULT_ALERT 0
#endif /* __DEFAULTS_H__ */
This diff is collapsed.
/**********************************************************************
* This source code is copyright 1999 by Gus Hartmann & Peter Keller *
* It may be distributed under the terms of the GNU General Purpose *
* License, version 2 or above; see the file COPYING for more *
* information. *
* *
* $Id: error.c,v 1.8 2000/11/07 05:34:17 hartmann Exp $
* *
**********************************************************************/
#include "sweep.h"
static WINDOW* ErrFrame;
static WINDOW* ErrWin;
/* Although the alert preference is set by the user, SweepAlert() needs to
not take an argument. So it gets set into a static variable. Gross, but
effective. */
static int ErrAlert;
/* SweepError() is the method for putting erros into the console window
at the bottom of the screen. Passing a null pointer as the message will
invoke a call to ClearError(). */
void SweepError(char* format, ...)
{
char NewErrMsg[42];
va_list args;
if (format==NULL)
{
ClearError();
}
else
{
ClearError();
va_start(args, format);
#if defined HAVE_VSNPRINTF
vsnprintf(NewErrMsg,41,format,args);
#elif HAVE_VSPRINTF
vsprintf(NewErrMsg,format,args);
#else
#error "Need either vsnprintf() (preferred) or vsprintf()"
#endif
va_end(args);
mvwprintw(ErrWin,0,0,NewErrMsg);
SweepAlert();
}
wnoutrefresh(ErrWin);
move(0,0);
noutrefresh();
return;
}
int InitErrorWin(GameStats* Game)
{
if ((ErrFrame=newwin(3,42,LINES-4,(COLS/2)-21))==NULL)
{
return 1;
}
else if ((ErrWin=derwin(ErrFrame,1,40,1,1))==NULL)
{
return 1;
}
wborder(ErrFrame,CharSet.VLine,CharSet.VLine,CharSet.HLine,CharSet.HLine,
CharSet.ULCorner, CharSet.URCorner,CharSet.LLCorner,CharSet.LRCorner);
wnoutrefresh(ErrWin);
wnoutrefresh(ErrFrame);
ErrAlert=Game->Alert;
return 0;
}
void ClearError()
{
wmove(ErrWin,0,0);
wclrtoeol(ErrWin);
wnoutrefresh(ErrWin);
move(0,0);
noutrefresh();
return;
}
int RedrawErrorWin()
{
return ((wborder(ErrFrame,CharSet.VLine,CharSet.VLine,CharSet.HLine,
CharSet.HLine,CharSet.ULCorner,CharSet.URCorner,CharSet.LLCorner,
CharSet.LRCorner)!=OK)?ERR:wnoutrefresh(ErrFrame));
}
void SweepAlert()
{
switch (ErrAlert)
{
case NO_ALERT:
break;
case FLASH:
flash();
break;
case BEEP: default:
/* No preference gets a beep. */
beep();
break;
}
return;
}
void SweepMessage(char* format, ...)
{
char NewErrMsg[42];
va_list args;
ClearError();
if ( format == NULL)
{
return;
}
va_start(args, format);
#if defined HAVE_VSNPRINTF
vsnprintf(NewErrMsg,41,format,args);
#elif HAVE_VSPRINTF
vsprintf(NewErrMsg,format,args);
#else
#error "Need either vsnprintf() (preferred) or vsprintf()"
#endif
va_end(args);
mvwprintw(ErrWin,0,0,NewErrMsg);
wnoutrefresh(ErrWin);
move(0,0);
noutrefresh();
return;
}
void ChangeSweepAlert(int NewAlert)
{