Compare commits

..

No commits in common. "35c5e434e658592a0139c7a110c4a323357e1019" and "ca9e48d5f67e0cc638c6c8d75e3ce8be6098d160" have entirely different histories.

69 changed files with 521 additions and 4058 deletions

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -222,8 +222,8 @@ command(void)
when 'W' : wear(); when 'W' : wear();
when 'T' : take_off(); when 'T' : take_off();
when 'o' : option(); when 'o' : option();
when 'c' : after = FALSE; call(FALSE); when 'c' : call(FALSE);
when 'm' : after = FALSE; call(TRUE); when 'm' : call(TRUE);
when '>' : after = FALSE; d_level(); when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level(); when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help(); when '?' : after = FALSE; help();

View file

@ -1,17 +1,18 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([Advanced Rogue],[5.8.2],[elwin@sdf.org],[arogue5]) AC_INIT([ARogue],[5.8.2], [yendor@rogueforge.net], [arogue5])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
# May not be needed for the documentation
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
# Checks for libraries. # Checks for libraries.
MP_WITH_CURSES MP_WITH_CURSES
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h arpa/inet.h]) AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -22,16 +23,17 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT AC_FUNC_STAT
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
AC_PROG_INSTALL AC_PROG_INSTALL
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue5"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue5"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -52,7 +54,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -73,7 +75,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -94,7 +96,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -117,7 +119,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -128,7 +130,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([limitscore],[AS_HELP_STRING([--enable-limitscore],[limit scores to one per class per uid @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([limitscore],[AC_HELP_STRING([--enable-limitscore], [limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if limiting scores]) AC_MSG_CHECKING([if limiting scores])
if test "x$enable_limitscore" = "xno" ; then if test "x$enable_limitscore" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -139,7 +141,7 @@ AC_DEFINE([LIMITSCORE], [], [Define to limit scores to one per class per uid])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)]) AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled]) AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -153,7 +155,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload]) AC_MSG_RESULT([$enable_maxload])
fi fi
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)]) AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled]) AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -61,7 +61,6 @@ main(int argc, char *argv[], char *envp[])
* get home and options from environment * get home and options from environment
*/ */
strncpy(home,md_gethomedir(),LINELEN); strncpy(home,md_gethomedir(),LINELEN);
home[LINELEN-1] = '\0';
#ifdef SAVEDIR #ifdef SAVEDIR
if (argc >= 3 && !strcmp(argv[1], "-n")) { if (argc >= 3 && !strcmp(argv[1], "-n")) {
@ -83,8 +82,8 @@ main(int argc, char *argv[], char *envp[])
} }
#ifdef SCOREFILE #ifdef SCOREFILE
strncpy(score_file, SCOREFILE, PATH_MAX); strncpy(score_file, SCOREFILE, LINELEN);
score_file[PATH_MAX - 1] = '\0'; score_file[LINELEN - 1] = '\0';
#else #else
/* Get default score file */ /* Get default score file */
strcpy(score_file, roguedir); strcpy(score_file, roguedir);

View file

@ -418,7 +418,7 @@ directory_exists(char *dirname)
char * char *
md_getroguedir(void) md_getroguedir(void)
{ {
static char path[PATH_MAX-20]; static char path[1024];
char *end,*home; char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL) if ( (home = getenv("ROGUEHOME")) != NULL)
@ -427,17 +427,13 @@ md_getroguedir(void)
{ {
strncpy(path, home, PATH_MAX - 20); strncpy(path, home, PATH_MAX - 20);
if (path[PATH_MAX-21] == '\0') end = &path[strlen(path)-1];
{
end = &path[strlen(path)-1]; while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
while( (end >= path) && ((*end == '/') || (*end == '\\'))) if (directory_exists(path))
*end-- = '\0'; return(path);
if (directory_exists(path))
return(path);
}
} }
} }

View file

@ -770,12 +770,12 @@ wake_monster(int y, int x)
/* /*
* Every time he sees mean monster, it might start chasing him * Every time he sees mean monster, it might start chasing him
*/ */
if ((on(*tp, ISMEAN) && if (on(*tp, ISMEAN) &&
off(*tp, ISHELD) && off(*tp, ISHELD) &&
off(*tp, ISRUN) && off(*tp, ISRUN) &&
rnd(100) > 33 && rnd(100) > 33 &&
(!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 95)) && (!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 95)) &&
(off(player, ISINVIS) || on(*tp, CANSEE))) || (off(player, ISINVIS) || on(*tp, CANSEE)) ||
(trp != NULL && (trp->r_flags & ISTREAS))) { (trp != NULL && (trp->r_flags & ISTREAS))) {
tp->t_dest = &hero; tp->t_dest = &hero;
turn_on(*tp, ISRUN); turn_on(*tp, ISRUN);

View file

@ -17,7 +17,6 @@
#include "curses.h" #include "curses.h"
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include "rogue.h" #include "rogue.h"
#define NUM_OPTS (sizeof optlist / sizeof (OPTION)) #define NUM_OPTS (sizeof optlist / sizeof (OPTION))
@ -92,7 +91,7 @@ int get_restr(char *optstr, WINDOW *win)
/* For the score file, which must be opened. */ /* For the score file, which must be opened. */
int get_score(char *optstr, WINDOW *win) int get_score(char *optstr, WINDOW *win)
{ {
char old_score_file[PATH_MAX]; char old_score_file[LINELEN];
int status; int status;
if (use_savedir) if (use_savedir)

View file

@ -13,7 +13,6 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include <limits.h>
#include "curses.h" #include "curses.h"
#include "rogue.h" #include "rogue.h"
@ -86,7 +85,7 @@ char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
char *m_guess[MAXMM]; /* Players guess at what MM is */ char *m_guess[MAXMM]; /* Players guess at what MM is */
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
char file_name[256]; /* Save file name */ char file_name[256]; /* Save file name */
char score_file[PATH_MAX]; /* Score file name */ char score_file[LINELEN]; /* Score file name */
char home[LINELEN]; /* User's home directory */ char home[LINELEN]; /* User's home directory */
WINDOW *cw; /* Window that the player sees */ WINDOW *cw; /* Window that the player sees */
WINDOW *hw; /* Used for the help command */ WINDOW *hw; /* Used for the help command */

View file

@ -1046,7 +1046,7 @@ void init_player(void);
void init_stones(void); void init_stones(void);
void init_terrain(void); void init_terrain(void);
void init_things(void); void init_things(void);
void init_weapon(struct object *weap, int type); void init_weapon(struct object *weap, char type);
char *inv_name(struct object *obj, bool drop); char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type); bool inventory(struct linked_list *list, int type);
bool is_current(struct object *obj); bool is_current(struct object *obj);

View file

@ -51,16 +51,7 @@ buy_it(void)
} }
mpos = 0; mpos = 0;
if (curprice > purse) { if (curprice > purse) {
if (!strncmp(curpurch, "a ", 2)) msg("You can't afford to buy that %s !",curpurch);
msg("You can't afford to buy that %s!", curpurch + 2);
else if (!strncmp(curpurch, "an ", 3))
msg("You can't afford to buy that %s!", curpurch + 3);
else if (!strncmp(curpurch, "some ", 5))
msg("You can't afford to buy that %s!", curpurch + 5);
else if (isdigit(curpurch[0]))
msg("You can't afford to buy those %s!", curpurch);
else
msg("You can't afford to buy that %s!", curpurch);
return; return;
} }
/* /*

View file

@ -140,7 +140,7 @@ hit_monster(int y, int x, struct object *obj, struct thing *tp)
*/ */
void void
init_weapon(struct object *weap, int type) init_weapon(struct object *weap, char type)
{ {
register struct init_weps *iwp; register struct init_weps *iwp;

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -285,9 +285,9 @@ command(void)
when C_WEAR : wear(); when C_WEAR : wear();
when C_TAKEOFF : take_off(); when C_TAKEOFF : take_off();
when 'o' : option(); when 'o' : option();
when CTRL('N') : after = FALSE; nameit(); when CTRL('N') : nameit();
when '=' : after = FALSE; display(); when '=' : after = FALSE; display();
when 'm' : after = FALSE; nameitem(NULL, TRUE); when 'm' : nameitem(NULL, TRUE);
when '>' : after = FALSE; d_level(); when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level(); when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help(); when '?' : after = FALSE; help();

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([Advanced Rogue],[7.7.1],[elwin@sdf.org],[arogue7]) AC_INIT([ARogue],[7.7.1], [yendor@rogueforge.net], [arogue7])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
# Checks for libraries. # Checks for libraries.
MP_WITH_CURSES MP_WITH_CURSES
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h arpa/inet.h]) AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -21,6 +21,7 @@ AC_STRUCT_TM
AC_FUNC_FORK AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr _spawnl spawnl getpwuid loadav strerror setgid setuid getuid getgid]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr _spawnl spawnl getpwuid loadav strerror setgid setuid getuid getgid])
AC_PROG_INSTALL AC_PROG_INSTALL
@ -47,11 +48,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF) AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE) AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue7"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue7"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -72,7 +73,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -93,7 +94,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -114,7 +115,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -137,7 +138,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -148,7 +149,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([limitscore],[AS_HELP_STRING([--enable-limitscore],[limit scores to one per class per uid @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([limitscore],[AC_HELP_STRING([--enable-limitscore], [limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if limiting scores]) AC_MSG_CHECKING([if limiting scores])
if test "x$enable_limitscore" = "xno" ; then if test "x$enable_limitscore" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -159,7 +160,7 @@ AC_DEFINE([LIMITSCORE], [], [Define to limit scores to one per class per uid])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)]) AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled]) AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -16,7 +16,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <limits.h>
#include <errno.h> #include <errno.h>
#ifdef BSD #ifdef BSD
#include <sys/time.h> #include <sys/time.h>
@ -60,7 +59,6 @@ main(int argc, char *argv[], char *envp[])
*/ */
strncpy(home, md_gethomedir(), LINELEN); strncpy(home, md_gethomedir(), LINELEN);
home[LINELEN-1] = '\0';
/* Get default save file */ /* Get default save file */
strcpy(file_name, home); strcpy(file_name, home);
@ -68,8 +66,8 @@ main(int argc, char *argv[], char *envp[])
/* Get default score file */ /* Get default score file */
#ifdef SCOREFILE #ifdef SCOREFILE
strncpy(score_file, SCOREFILE, PATH_MAX); strncpy(score_file, SCOREFILE, LINELEN);
score_file[PATH_MAX-1] = '\0'; score_file[LINELEN-1] = '\0';
#else #else
strcpy(score_file, md_getroguedir()); strcpy(score_file, md_getroguedir());

View file

@ -421,7 +421,7 @@ directory_exists(char *dirname)
char * char *
md_getroguedir(void) md_getroguedir(void)
{ {
static char path[PATH_MAX-20]; static char path[1024];
char *end,*home; char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL) if ( (home = getenv("ROGUEHOME")) != NULL)
@ -430,16 +430,13 @@ md_getroguedir(void)
{ {
strncpy(path, home, PATH_MAX - 20); strncpy(path, home, PATH_MAX - 20);
if (path[PATH_MAX-21] == '\0') end = &path[strlen(path)-1];
{
end = &path[strlen(path)-1];
while( (end >= path) && ((*end == '/') || (*end == '\\'))) while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0'; *end-- = '\0';
if (directory_exists(path)) if (directory_exists(path))
return(path); return(path);
}
} }
} }

View file

@ -594,12 +594,12 @@ wake_monster(int y, int x)
/* /*
* Every time he sees mean monster, it might start chasing him * Every time he sees mean monster, it might start chasing him
*/ */
if ((on(*tp, ISMEAN) && if (on(*tp, ISMEAN) &&
off(*tp, ISHELD) && off(*tp, ISHELD) &&
off(*tp, ISRUN) && off(*tp, ISRUN) &&
rnd(100) > 33 && rnd(100) > 33 &&
(!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 50)) && (!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 50)) &&
(off(player, ISINVIS) || on(*tp, CANSEE))) || (off(player, ISINVIS) || on(*tp, CANSEE)) ||
(trp != NULL && (trp->r_flags & ISTREAS))) { (trp != NULL && (trp->r_flags & ISTREAS))) {
runto(tp, &hero); runto(tp, &hero);
} }

View file

@ -132,8 +132,7 @@ be_trapped(struct thing *th, coord *tc)
/* Make sure we were not chasing a monster here */ /* Make sure we were not chasing a monster here */
th->t_dest = &hero; th->t_dest = &hero;
if (on(*th, ISFRIENDLY)) if (on(*th, ISFRIENDLY), turn_off(*th, ISFLEE));
turn_off(*th, ISFLEE);
} }
} }
when BEARTRAP: when BEARTRAP:
@ -407,8 +406,7 @@ be_trapped(struct thing *th, coord *tc)
/* Make sure we were not chasing a monster here */ /* Make sure we were not chasing a monster here */
th->t_dest = &hero; th->t_dest = &hero;
if (on(*th, ISFRIENDLY)) if (on(*th, ISFRIENDLY), turn_off(*th, ISFLEE));
turn_off(*th, ISFLEE);
} }
else else
killed(mitem, FALSE, FALSE, FALSE); killed(mitem, FALSE, FALSE, FALSE);

View file

@ -21,7 +21,6 @@
#include "curses.h" #include "curses.h"
#include <ctype.h> #include <ctype.h>
#include <limits.h>
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
@ -492,7 +491,7 @@ get_str_prot(char *opt, WINDOW *win)
int int
get_score(char *optstr, WINDOW *win) get_score(char *optstr, WINDOW *win)
{ {
char old_score_file[PATH_MAX]; char old_score_file[LINELEN];
int status; int status;
if (use_savedir) if (use_savedir)

View file

@ -216,10 +216,7 @@ conn(int r1, int r2)
offset = abs(spos.y - epos.y); offset = abs(spos.y - epos.y);
} }
else else
{
debug("error in connection tables"); debug("error in connection tables");
return;
}
/* /*
* Draw in the doors on either side of the passage or just put #'s * Draw in the doors on either side of the passage or just put #'s

View file

@ -681,13 +681,12 @@ pick_spell(struct spells spells[], int ability, int num_spells, int power,
} }
else { else {
/* Now display the possible spells */ /* Now display the possible spells */
/* type_cap is a workaround for code that tried to capitalize type by
* temporarily modifying it in place. */
char type_cap = toupper(type[0]);
wclear(hw); wclear(hw);
touchwin(hw); touchwin(hw);
wmove(hw, 2, 0); wmove(hw, 2, 0);
wprintw(hw, " Cost %c%s", type_cap, type + 1); *type = toupper(*type);
wprintw(hw, " Cost %s", type);
*type = tolower(*type);
mvwaddstr(hw, 3, 0, mvwaddstr(hw, 3, 0,
"-----------------------------------------------"); "-----------------------------------------------");
maxlen = 47; /* Maximum width of header */ maxlen = 47; /* Maximum width of header */
@ -734,7 +733,9 @@ pick_spell(struct spells spells[], int ability, int num_spells, int power,
/* Design prompts */ /* Design prompts */
sprintf(label, "Current %s power is %d", type, spell_left); sprintf(label, "Current %s power is %d", type, spell_left);
sprintf(title, " Cost %c%s", type_cap, type + 1); *type = toupper(*type);
sprintf(title, " Cost %s", type);
*type = tolower(*type);
sprintf(prbuf, "Select a %s or press Cancl to continue.", type); sprintf(prbuf, "Select a %s or press Cancl to continue.", type);
/* Set up the main menu structure */ /* Set up the main menu structure */

View file

@ -13,7 +13,6 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include <limits.h>
#include "curses.h" #include "curses.h"
#include "rogue.h" #include "rogue.h"
#ifdef PC7300 #ifdef PC7300
@ -103,7 +102,7 @@ char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
char *m_guess[MAXMM]; /* Players guess at what MM is */ char *m_guess[MAXMM]; /* Players guess at what MM is */
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
char file_name[LINELEN]; /* Save file name */ char file_name[LINELEN]; /* Save file name */
char score_file[PATH_MAX]; /* Score file name */ char score_file[LINELEN]; /* Score file name */
char home[LINELEN]; /* User's home directory */ char home[LINELEN]; /* User's home directory */
WINDOW *cw; /* Window that the player sees */ WINDOW *cw; /* Window that the player sees */
WINDOW *hw; /* Used for the help command */ WINDOW *hw; /* Used for the help command */

View file

@ -1249,7 +1249,7 @@ void init_player(void);
void init_stones(void); void init_stones(void);
void init_terrain(void); void init_terrain(void);
void init_things(void); void init_things(void);
void init_weapon(struct object *weap, int type); void init_weapon(struct object *weap, char type);
char *inv_name(struct object *obj, bool drop); char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type); bool inventory(struct linked_list *list, int type);
bool is_current(struct object *obj); bool is_current(struct object *obj);

View file

@ -2511,7 +2511,6 @@ int
rs_save_file(FILE *savef) rs_save_file(FILE *savef)
{ {
int i; int i;
char temp_buf[LINELEN];
if (write_error) if (write_error)
return(WRITESTAT); return(WRITESTAT);
@ -2584,17 +2583,9 @@ rs_save_file(FILE *savef)
rs_write_misc(savef); rs_write_misc(savef);
rs_write(savef,whoami,LINELEN); rs_write(savef,whoami,LINELEN);
rs_write(savef,huh,LINELEN); rs_write(savef,huh,LINELEN);
/* These path names are no longer used when restoring. They are only rs_write(savef,file_name,LINELEN);
* written here for compatibility. */ rs_write(savef,score_file,LINELEN);
strncpy(temp_buf, file_name, LINELEN); rs_write(savef,home,LINELEN);
temp_buf[LINELEN-1] = '\0';
rs_write(savef, temp_buf, LINELEN);
strncpy(temp_buf, score_file, LINELEN);
temp_buf[LINELEN-1] = '\0';
rs_write(savef, temp_buf, LINELEN);
strncpy(temp_buf, home, LINELEN);
temp_buf[LINELEN-1] = '\0';
rs_write(savef, temp_buf, LINELEN);
rs_write_window(savef, cw); rs_write_window(savef, cw);
rs_write_window(savef, hw); rs_write_window(savef, hw);
rs_write_window(savef, mw); rs_write_window(savef, mw);
@ -2647,7 +2638,6 @@ int
rs_restore_file(FILE *inf) rs_restore_file(FILE *inf)
{ {
int i; int i;
char unused_buf[LINELEN];
if (read_error || format_error) if (read_error || format_error)
return(READSTAT); return(READSTAT);
@ -2725,10 +2715,9 @@ rs_restore_file(FILE *inf)
rs_read_misc(inf); rs_read_misc(inf);
rs_read(inf,whoami,LINELEN); rs_read(inf,whoami,LINELEN);
rs_read(inf,huh,LINELEN); rs_read(inf,huh,LINELEN);
/* These three path names are now ignored. */ rs_read(inf,file_name,LINELEN);
rs_read(inf, unused_buf, LINELEN); /* file_name */ rs_read(inf,score_file,LINELEN);
rs_read(inf, unused_buf, LINELEN); /* score_file */ rs_read(inf,home,LINELEN);
rs_read(inf, unused_buf, LINELEN); /* home */
rs_read_window(inf, cw); rs_read_window(inf, cw);
rs_read_window(inf, hw); rs_read_window(inf, hw);
rs_read_window(inf, mw); rs_read_window(inf, mw);

View file

@ -309,7 +309,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
if (!obj) if (!obj)
dice = zapper->t_stats.s_lvl; dice = zapper->t_stats.s_lvl;
else if (obj->o_type == RELIC) if (obj->o_type == RELIC)
dice = 15; dice = 15;
else if (EQUAL(ws_type[which], "staff")) else if (EQUAL(ws_type[which], "staff"))
dice = 10; dice = 10;

View file

@ -55,14 +55,7 @@ buy_it(void)
} }
mpos = 0; mpos = 0;
if (curprice > purse) { if (curprice > purse) {
if (!strncmp(curpurch, "a ", 2)) msg("You can't afford to buy that %s !",curpurch);
msg("You can't afford to buy that %s!", curpurch + 2);
else if (!strncmp(curpurch, "an ", 3))
msg("You can't afford to buy that %s!", curpurch + 3);
else if (isdigit(curpurch[0]))
msg("You can't afford to buy those %s!", curpurch);
else
msg("You can't afford to buy that %s!", curpurch);
return; return;
} }
/* /*

View file

@ -197,7 +197,7 @@ hit_monster(int y, int x, struct object *obj, struct thing *tp)
*/ */
void void
init_weapon(struct object *weap, int type) init_weapon(struct object *weap, char type)
{ {
register struct init_weps *iwp; register struct init_weps *iwp;

1768
build-aux/config.guess vendored

File diff suppressed because it is too large Load diff

1890
build-aux/config.sub vendored

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
#!/usr/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2020-11-14.01; # UTC scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
@ -69,11 +69,6 @@ posix_mkdir=
# Desired mode of installed file. # Desired mode of installed file.
mode=0755 mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd= chgrpcmd=
chmodcmd=$chmodprog chmodcmd=$chmodprog
chowncmd= chowncmd=
@ -104,28 +99,18 @@ Options:
--version display version info and exit. --version display version info and exit.
-c (ignored) -c (ignored)
-C install only if different (preserve data modification time) -C install only if different (preserve the last data modification time)
-d create directories instead of installing files. -d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP. -g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE. -m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER. -o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files. -s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY. -t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory. -T report an error if DSTFILE is a directory.
Environment variables override the default commands: Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG RMPROG STRIPPROG
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
" "
while test $# -ne 0; do while test $# -ne 0; do
@ -152,13 +137,8 @@ while test $# -ne 0; do
-o) chowncmd="$chownprog $2" -o) chowncmd="$chownprog $2"
shift;; shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;; -s) stripcmd=$stripprog;;
-S) backupsuffix="$2"
shift;;
-t) -t)
is_target_a_directory=always is_target_a_directory=always
dst_arg=$2 dst_arg=$2
@ -275,10 +255,6 @@ do
dstdir=$dst dstdir=$dst
test -d "$dstdir" test -d "$dstdir"
dstdir_status=$? dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@ -295,18 +271,15 @@ do
fi fi
dst=$dst_arg dst=$dst_arg
# If destination is a directory, append the input filename. # If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then if test -d "$dst"; then
if test "$is_target_a_directory" = never; then if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2 echo "$0: $dst_arg: Is a directory" >&2
exit 1 exit 1
fi fi
dstdir=$dst dstdir=$dst
dstbase=`basename "$src"` dst=$dstdir/`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0 dstdir_status=0
else else
dstdir=`dirname "$dst"` dstdir=`dirname "$dst"`
@ -315,16 +288,27 @@ do
fi fi
fi fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false obsolete_mkdir_used=false
if test $dstdir_status != 0; then if test $dstdir_status != 0; then
case $posix_mkdir in case $posix_mkdir in
'') '')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode. # With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask. # Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then if test -n "$dir_arg"; then
@ -334,49 +318,43 @@ do
fi fi
posix_mkdir=false posix_mkdir=false
# The $RANDOM variable is not portable (e.g., dash). Use it case $umask in
# here however when possible just to lower collision chance. *[123567][0-7][0-7])
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ # POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
trap ' if (umask $mkdir_umask &&
ret=$? exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null then
exit $ret if test -z "$dir_arg" || {
' 0 # Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# Because "mkdir -p" follows existing symlinks and we likely work # other-writable bit of parent directory when it shouldn't.
# directly in world-writeable /tmp, make sure that the '$tmpdir' # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
# directory is successfully created first before we actually test ls_ld_tmpdir=`ls -ld "$tmpdir"`
# 'mkdir -p'. case $ls_ld_tmpdir in
if (umask $mkdir_umask && d????-?r-*) different_mode=700;;
$mkdirprog $mkdir_mode "$tmpdir" && d????-?--*) different_mode=755;;
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 *) false;;
then esac &&
if test -z "$dir_arg" || { $mkdirprog -m$different_mode -p -- "$tmpdir" && {
# Check for POSIX incompatibilities with -m. ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
# other-writable bit of parent directory when it shouldn't. }
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory. }
test_tmpdir="$tmpdir/a" then posix_mkdir=:
ls_ld_tmpdir=`ls -ld "$test_tmpdir"` fi
case $ls_ld_tmpdir in rmdir "$tmpdir/d" "$tmpdir"
d????-?r-*) different_mode=700;; else
d????-?--*) different_mode=755;; # Remove any dirs left behind by ancient mkdir implementations.
*) false;; rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
esac && fi
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && { trap '' 0;;
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` esac;;
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac esac
if if
@ -387,7 +365,7 @@ do
then : then :
else else
# mkdir does not conform to POSIX, # The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the # or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go. # directory the slow way, step by step, checking for races as we go.
@ -416,7 +394,7 @@ do
prefixes= prefixes=
else else
if $posix_mkdir; then if $posix_mkdir; then
(umask $mkdir_umask && (umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently. # Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1 test -d "$prefix" || exit 1
@ -449,25 +427,14 @@ do
else else
# Make a couple of temp file names in the proper directory. # Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_ dsttmp=$dstdir/_inst.$$_
rmtmp=${dstdirslash}_rm.$$_ rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit. # Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name. # Copy the file name to the temp name.
(umask $cp_umask && (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits. # and set any options; do chmod last to preserve setuid bits.
# #
@ -493,13 +460,6 @@ do
then then
rm -f "$dsttmp" rm -f "$dsttmp"
else else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination. # Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@ -514,9 +474,9 @@ do
# file should still install successfully. # file should still install successfully.
{ {
test ! -f "$dst" || test ! -f "$dst" ||
$doit $rmcmd "$dst" 2>/dev/null || $doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; } { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} || } ||
{ echo "$0: cannot unlink or rename $dst" >&2 { echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1 (exit 1); exit 1
@ -533,9 +493,9 @@ do
done done
# Local variables: # Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0" # time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC" # time-stamp-end: "; # UTC"
# End: # End:

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -166,7 +166,7 @@ command()
when 'P' : ring_on(); when 'P' : ring_on();
when 'R' : ring_off(); when 'R' : ring_off();
when 'o' : option(); when 'o' : option();
when 'c' : after = FALSE; call(); when 'c' : call();
when '>' : after = FALSE; d_level(); when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level(); when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help(); when '?' : after = FALSE; help();

View file

@ -1,18 +1,20 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([Rogue],[3.6.4],[elwin@sdf.org],[rogue3]) AC_INIT([Rogue],[3.6.4], [yendor@rogueforge.net], [rogue3])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile rogue.6 rogue.r]) AC_CONFIG_FILES([Makefile rogue.6 rogue.r])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
# Checks for libraries. # Checks for libraries.
MP_WITH_CURSES MP_WITH_CURSES
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h]) AC_CHECK_HEADERS([arpa/inet.h pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h])
# WARN: the sources often don't include the headers when needed. That is one
# reason why adding "-Wall" to CFLAGS produces 1246 lines of messages.
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T AC_TYPE_UID_T
@ -23,6 +25,7 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT AC_FUNC_STAT
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
@ -52,11 +55,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF) AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE) AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue3"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue3"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -77,7 +80,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -98,7 +101,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -119,7 +122,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -142,7 +145,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -153,7 +156,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)]) AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled]) AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -167,7 +170,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload]) AC_MSG_RESULT([$enable_maxload])
fi fi
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)]) AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled]) AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -1,18 +1,18 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([Rogue],[5.2.2],[elwin@sdf.org],[rogue4]) AC_INIT([Rogue],[5.2.2], [yendor@rogueforge.net], [rogue4])
AC_CONFIG_SRCDIR([armor.c]) AC_CONFIG_SRCDIR([armor.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile rogue.6 rogue.me]) AC_CONFIG_FILES([Makefile rogue.6 rogue.me])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
# Checks for libraries. # Checks for libraries.
MP_WITH_CURSES MP_WITH_CURSES
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h sys/utsname.h pwd.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmpx.h term.h ncurses/term.h process.h]) AC_CHECK_HEADERS([arpa/inet.h sys/utsname.h pwd.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmpx.h term.h ncurses/term.h process.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -24,6 +24,7 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT AC_FUNC_STAT
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
@ -53,11 +54,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF) AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE) AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue4"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue4"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -78,7 +79,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -99,7 +100,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -120,7 +121,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([lockfile],[AS_HELP_STRING([--enable-lockfile=LOCKFILE],[enable scoreboard lockfile with given filename])],[],[]) AC_ARG_ENABLE([lockfile],[AC_HELP_STRING([--enable-lockfile=LOCKFILE], [enable scoreboard lockfile with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard lockfile file]) AC_MSG_CHECKING([for scoreboard lockfile file])
if test "x$enable_lockfile" = "xno" ; then if test "x$enable_lockfile" = "xno" ; then
LOCKFILE= LOCKFILE=
@ -141,7 +142,7 @@ fi
AC_SUBST(LOCKFILE) AC_SUBST(LOCKFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -164,7 +165,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -178,7 +179,7 @@ fi
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([checktime],[AS_HELP_STRING([--enable-checktime],[enable checktime @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([checktime],[AC_HELP_STRING([--enable-checktime], [enable checktime @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if checktime is enabled]) AC_MSG_CHECKING([if checktime is enabled])
if test "x$enable_checktime" = "xyes" ; then if test "x$enable_checktime" = "xyes" ; then
AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled]) AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled])
@ -187,7 +188,7 @@ else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)]) AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled]) AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -201,7 +202,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload]) AC_MSG_RESULT([$enable_maxload])
fi fi
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)]) AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled]) AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -1,12 +1,11 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([Rogue],[5.4.5],[elwin@sdf.org],[rogue5]) AC_INIT([Rogue],[5.4.5], [yendor@rogueforge.net], [rogue5])
AC_CONFIG_SRCDIR([armor.c]) AC_CONFIG_SRCDIR([armor.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile rogue.6 rogue.me rogue.html]) AC_CONFIG_FILES([Makefile rogue.6 rogue.me rogue.html])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
@ -15,6 +14,7 @@ AC_PROG_INSTALL
# Checks for libraries. # Checks for libraries.
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h sys/utsname.h pwd.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h]) AC_CHECK_HEADERS([arpa/inet.h sys/utsname.h pwd.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -29,6 +29,7 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT AC_FUNC_STAT
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setresgid setregid setgid setresuid setreuid setuid getuid getgid]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setresgid setregid setgid setresuid setreuid setuid getuid getgid])
@ -56,11 +57,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF) AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE) AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue5"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue5"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -81,7 +82,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -102,7 +103,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -123,7 +124,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([lockfile],[AS_HELP_STRING([--enable-lockfile=LOCKFILE],[enable scoreboard lockfile with given filename])],[],[]) AC_ARG_ENABLE([lockfile],[AC_HELP_STRING([--enable-lockfile=LOCKFILE], [enable scoreboard lockfile with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard lockfile file]) AC_MSG_CHECKING([for scoreboard lockfile file])
if test "x$enable_lockfile" = "xno" ; then if test "x$enable_lockfile" = "xno" ; then
LOCKFILE= LOCKFILE=
@ -144,7 +145,7 @@ fi
AC_SUBST(LOCKFILE) AC_SUBST(LOCKFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -167,7 +168,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -181,7 +182,7 @@ fi
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([allscores],[AS_HELP_STRING([--enable-allscores],[enable scoreboard to show top scores, not just top players @<:@default=yes@:>@])],[],[enable_allscores=yes]) AC_ARG_ENABLE([allscores],[AC_HELP_STRING([--enable-allscores], [enable scoreboard to show top scores, not just top players @<:@default=yes@:>@])],[],[enable_allscores=yes])
AC_MSG_CHECKING([if allscores is enabled]) AC_MSG_CHECKING([if allscores is enabled])
if test "x$enable_allscores" = "xyes" ; then if test "x$enable_allscores" = "xyes" ; then
AC_DEFINE([ALLSCORES], [1], [Define if scorefile is top scores, not top players]) AC_DEFINE([ALLSCORES], [1], [Define if scorefile is top scores, not top players])
@ -190,7 +191,7 @@ else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AC_ARG_ENABLE([checktime],[AS_HELP_STRING([--enable-checktime],[enable checktime @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([checktime],[AC_HELP_STRING([--enable-checktime], [enable checktime @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if checktime is enabled]) AC_MSG_CHECKING([if checktime is enabled])
if test "x$enable_checktime" = "xyes" ; then if test "x$enable_checktime" = "xyes" ; then
AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled]) AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled])
@ -199,7 +200,7 @@ else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)]) AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled]) AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -213,7 +214,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload]) AC_MSG_RESULT([$enable_maxload])
fi fi
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)]) AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled]) AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])
@ -227,7 +228,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxusers], [Define if maxusers feature sh
AC_MSG_RESULT([$enable_maxusers]) AC_MSG_RESULT([$enable_maxusers])
fi fi
AC_ARG_ENABLE([numscores],[AS_HELP_STRING([--enable-numscores],[number of scores to store in scoreboard @<:@default=10@:>@])],[],[]) AC_ARG_ENABLE([numscores],[AC_HELP_STRING([--enable-numscores], [number of scores to store in scoreboard @<:@default=10@:>@])],[],[])
AC_MSG_CHECKING([what the number of scores to store in scoreboard is]) AC_MSG_CHECKING([what the number of scores to store in scoreboard is])
if test "x$numscores" = "xyes" ; then if test "x$numscores" = "xyes" ; then
AC_DEFINE([NUMSCORES], [10], [number of scores to store in scoreboard]) AC_DEFINE([NUMSCORES], [10], [number of scores to store in scoreboard])
@ -243,7 +244,7 @@ AC_DEFINE_UNQUOTED([NUMSCORES], [$enable_numscores], [number of scores to store
AC_MSG_RESULT([$enable_numscores]) AC_MSG_RESULT([$enable_numscores])
fi fi
AC_ARG_ENABLE([numname],[AS_HELP_STRING([--enable-numname],[word for number of scores to store in scoreboard @<:@default=Ten@:>@])],[],[]) AC_ARG_ENABLE([numname],[AC_HELP_STRING([--enable-numname], [word for number of scores to store in scoreboard @<:@default=Ten@:>@])],[],[])
AC_MSG_CHECKING([word for the number of scores to store in scoreboard is]) AC_MSG_CHECKING([word for the number of scores to store in scoreboard is])
if test "x$enable_numname" = "xyes" ; then if test "x$enable_numname" = "xyes" ; then
AC_DEFINE([NUMNAME], ["Ten"], [word for the number of scores to store in scoreboard]) AC_DEFINE([NUMNAME], ["Ten"], [word for the number of scores to store in scoreboard])
@ -259,7 +260,7 @@ AC_DEFINE_UNQUOTED([NUMNAME], ["$enable_numname"], [word for the number of score
AC_MSG_RESULT([$enable_numname]) AC_MSG_RESULT([$enable_numname])
fi fi
AC_ARG_ENABLE([loadav],[AS_HELP_STRING([--enable-loadav=NAMELIST],[use program's load average function (unlikely to work) @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([loadav],[AC_HELP_STRING([--enable-loadav=NAMELIST], [use program's load average function (unlikely to work) @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([whether to use program's built in load average function]) AC_MSG_CHECKING([whether to use program's built in load average function])
if test "x$enable_loadav" = "xyes" ; then if test "x$enable_loadav" = "xyes" ; then
AC_DEFINE([LOADAV], [], [define if we should use program's load average function instead of system]) AC_DEFINE([LOADAV], [], [define if we should use program's load average function instead of system])
@ -275,7 +276,7 @@ AC_DEFINE_UNQUOTED([NAMELIST], [$enable_loadav], [kernel file to pass to nlist()
AC_MSG_RESULT([$enable_loadav]) AC_MSG_RESULT([$enable_loadav])
fi fi
AC_ARG_ENABLE([ucount],[AS_HELP_STRING([--enable-ucount=UTMPFILE],[use program's own function to count users (unlikely to work) @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([ucount],[AC_HELP_STRING([--enable-ucount=UTMPFILE], [use program's own function to count users (unlikely to work) @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([whether to use program's built in user counting function]) AC_MSG_CHECKING([whether to use program's built in user counting function])
if test "x$enable_ucount" = "xyes" ; then if test "x$enable_ucount" = "xyes" ; then
AC_DEFINE([UCOUNT], [], [define if we should use program's user counting function instead of system's]) AC_DEFINE([UCOUNT], [], [define if we should use program's user counting function instead of system's])

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -175,7 +175,7 @@ command(void)
when 'P' : ring_on(); when 'P' : ring_on();
when 'R' : ring_off(); when 'R' : ring_off();
when 'O' : option(); when 'O' : option();
when 'c' : after = FALSE; call(); when 'c' : call();
when '>' : after = FALSE; d_level(); when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level(); when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help(); when '?' : after = FALSE; help();

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([Super-Rogue],[9.0],[elwin@sdf.org],[srogue]) AC_INIT([SRogue],[9.0], [yendor@rogueforge.net], [srogue])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
# Checks for libraries. # Checks for libraries.
MP_WITH_CURSES MP_WITH_CURSES
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h term.h ncurses/term.h process.h]) AC_CHECK_HEADERS([arpa/inet.h pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h term.h ncurses/term.h process.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -21,6 +21,7 @@ AC_STRUCT_TM
# Checks for library functions. # Checks for library functions.
AC_FUNC_FORK AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_STAT AC_FUNC_STAT
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid lrand48 random srand48 srandom]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid lrand48 random srand48 srandom])
@ -49,11 +50,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF) AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE) AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -74,7 +75,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -95,7 +96,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -116,7 +117,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -139,7 +140,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])

View file

@ -24,7 +24,7 @@
* Pick a monster to show up. The lower the level, * Pick a monster to show up. The lower the level,
* the meaner the monster. * the meaner the monster.
*/ */
int char
rnd_mon(bool wander, bool baddie) rnd_mon(bool wander, bool baddie)
{ {
/* baddie; TRUE when from a polymorph stick */ /* baddie; TRUE when from a polymorph stick */
@ -85,7 +85,7 @@ lev_mon(void)
* Pick a new monster and add it to the list * Pick a new monster and add it to the list
*/ */
struct linked_list * struct linked_list *
new_monster(int indx, struct coord *cp, bool treas) new_monster(char type, struct coord *cp, bool treas)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct thing *tp; reg struct thing *tp;
@ -97,9 +97,9 @@ new_monster(int indx, struct coord *cp, bool treas)
attach(mlist, item); attach(mlist, item);
tp = THINGPTR(item); tp = THINGPTR(item);
st = &tp->t_stats; st = &tp->t_stats;
mp = &monsters[indx]; /* point to this monsters structure */ mp = &monsters[type]; /* point to this monsters structure */
tp->t_type = mp->m_show; tp->t_type = mp->m_show;
tp->t_indx = indx; tp->t_indx = type;
tp->t_pos = *cp; tp->t_pos = *cp;
tp->t_room = roomin(cp); tp->t_room = roomin(cp);
tp->t_oldch = mvwinch(cw, cp->y, cp->x) & A_CHARTEXT; tp->t_oldch = mvwinch(cw, cp->y, cp->x) & A_CHARTEXT;

View file

@ -199,7 +199,6 @@ conn(int r1, int r2)
} }
else { else {
msg("Error in connection tables."); msg("Error in connection tables.");
return;
} }
/* /*
* Draw in the doors on either side of the passage * Draw in the doors on either side of the passage

View file

@ -154,7 +154,7 @@ void msg(char *fmt, ...);
char *new(int size); char *new(int size);
struct linked_list *new_item(int size); struct linked_list *new_item(int size);
void new_level(int ltype); void new_level(int ltype);
struct linked_list *new_monster(int indx, struct coord *cp, bool treas); struct linked_list *new_monster(char type, struct coord *cp, bool treas);
struct linked_list *new_thing(bool treas, int type, int which); struct linked_list *new_thing(bool treas, int type, int which);
void nohaste(int fromfuse); void nohaste(int fromfuse);
void noteth(int fromfuse); void noteth(int fromfuse);
@ -193,7 +193,7 @@ void ring_on(void);
void ringabil(void); void ringabil(void);
int ringex(int rtype); int ringex(int rtype);
int rnd(int range); int rnd(int range);
int rnd_mon(bool wander, bool baddie); char rnd_mon(bool wander, bool baddie);
struct coord *rnd_pos(struct room *rp); struct coord *rnd_pos(struct room *rp);
int rnd_room(void); int rnd_room(void);
struct coord *rndmove(struct thing *who); struct coord *rndmove(struct thing *who);

View file

@ -230,20 +230,19 @@ do_zap(bool gotdir)
tp = THINGPTR(item); tp = THINGPTR(item);
omonst = tp->t_indx; omonst = tp->t_indx;
if (wh == WS_POLYM && !curse) { if (wh == WS_POLYM && !curse) {
int newmonst;
detach(mlist, item); detach(mlist, item);
discard(item); discard(item);
oldch = tp->t_oldch; oldch = tp->t_oldch;
delta.y = y; delta.y = y;
delta.x = x; delta.x = x;
newmonst = rnd_mon(FALSE, TRUE); monster = rnd_mon(FALSE, TRUE);
item = new_monster(newmonst, &delta, FALSE); item = new_monster(monster, &delta, FALSE);
if (!(tp->t_flags & ISRUN)) if (!(tp->t_flags & ISRUN))
runto(&delta, &hero); runto(&delta, &hero);
if (isalpha(mvwinch(cw, y, x))) if (isalpha(mvwinch(cw, y, x)))
mvwaddch(cw, y, x, monsters[newmonst].m_show); mvwaddch(cw, y, x, monsters[monster].m_show);
tp->t_oldch = oldch; tp->t_oldch = oldch;
ws_know[WS_POLYM] |= (newmonst != omonst); ws_know[WS_POLYM] |= (monster != omonst);
} }
else if (wh == WS_MINVIS && !bless) { else if (wh == WS_MINVIS && !bless) {
tp->t_flags |= ISINVIS; tp->t_flags |= ISINVIS;

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -394,8 +394,8 @@ command(void)
case 'P': ring_on(); break; case 'P': ring_on(); break;
case 'R': ring_off(); break; case 'R': ring_off(); break;
case 'p': prayer(); break; case 'p': prayer(); break;
case 'C': after = FALSE; call(FALSE); break; case 'C': call(FALSE); break;
case 'M': after = FALSE; call(TRUE); break; case 'M': call(TRUE); break;
case 's': search(FALSE); break; case 's': search(FALSE); break;
/* /*

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([UltraRogue],[1.07],[elwin@sdf.org],[urogue]) AC_INIT([UltraRogue],[1.07], [yendor@rogueforge.net], [urogue])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
# Checks for libraries. # Checks for libraries.
MP_WITH_CURSES MP_WITH_CURSES
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h arpa/inet.h]) AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -23,6 +23,7 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT AC_FUNC_STAT
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
@ -51,11 +52,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF) AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE) AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -76,7 +77,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -97,7 +98,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -118,7 +119,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -141,7 +142,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([chardir],[AS_HELP_STRING([--enable-chardir=CHARDIR],[enable systemwide location for character files])],[],[enable_chardir="no"]) AC_ARG_ENABLE([chardir],[AC_HELP_STRING([--enable-chardir=CHARDIR], [enable systemwide location for character files])],[],[enable_chardir="no"])
AC_MSG_CHECKING([for character directory]) AC_MSG_CHECKING([for character directory])
if test "x$enable_chardir" = "xno" ; then if test "x$enable_chardir" = "xno" ; then
CHARDIR= CHARDIR=
@ -164,7 +165,7 @@ fi
AC_SUBST(CHARDIR) AC_SUBST(CHARDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -175,7 +176,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([memdebug],[AS_HELP_STRING([--enable-memdebug],[enable built-in memory checking @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([memdebug],[AC_HELP_STRING([--enable-memdebug], [enable built-in memory checking @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if memory checking is enabled]) AC_MSG_CHECKING([if memory checking is enabled])
if test "x$enable_memdebug" = "xno" ; then if test "x$enable_memdebug" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])

View file

@ -21,6 +21,8 @@
** **
******************/ ******************/
static char sccsid[] = "%W% %G%";
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if !defined(OS2) && !defined(_WIN32) #if !defined(OS2) && !defined(_WIN32)

View file

@ -18,6 +18,8 @@
#ifndef dict_h_included #ifndef dict_h_included
#define dict_h_included #define dict_h_included
static char dict_sccsid[] = "%W% %G%";
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0

View file

@ -12,6 +12,8 @@
** Utilities for Dictionary Maintenence Functions ** Utilities for Dictionary Maintenence Functions
*************************************************************************/ *************************************************************************/
static char sccsid[] = "%W% %G%";
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -15,6 +15,8 @@
#ifndef dictutil_h_included #ifndef dictutil_h_included
#define dictutil_h_included #define dictutil_h_included
static char dictutil_sccsid[] = "%W% %G%";
#include <stdio.h> #include <stdio.h>
#include "dict.h" #include "dict.h"

View file

@ -401,6 +401,54 @@ md_shellescape()
#endif #endif
} }
int
directory_exists(char *dirname)
{
struct stat sb;
if (stat(dirname, &sb) == 0) /* path exists */
return (sb.st_mode & S_IFDIR);
return(0);
}
char *
md_getroguedir()
{
static char path[1024];
char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL)
{
if (*home)
{
strncpy(path, home, PATH_MAX - 20);
end = &path[strlen(path)-1];
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
if (directory_exists(path))
return(path);
}
}
if (directory_exists("/var/games/roguelike"))
return("/var/games/roguelike");
if (directory_exists("/var/lib/roguelike"))
return("/var/lib/roguelike");
if (directory_exists("/var/roguelike"))
return("/var/roguelike");
if (directory_exists("/usr/games/lib"))
return("/usr/games/lib");
if (directory_exists("/games/roguelik"))
return("/games/roguelik");
if (directory_exists(md_gethomedir()))
return(md_gethomedir());
return("");
}
char * char *
md_getrealname(int uid) md_getrealname(int uid)
{ {

View file

@ -19,6 +19,8 @@
#include "config.h" #include "config.h"
#endif #endif
static char sccsid[] = "%W%\t%G%";
/* Debugging memory allocation code that tries to trap common memory problems /* Debugging memory allocation code that tries to trap common memory problems
like overwriting storage and stepping on memory pointer chains. If code like overwriting storage and stepping on memory pointer chains. If code
doesn't use malloc, free, and realloc a lot, these routines can be left in doesn't use malloc, free, and realloc a lot, these routines can be left in

View file

@ -955,9 +955,9 @@ wake_monster(int y, int x)
*/ */
if (off(player, CANTRUESEE) && if (off(player, CANTRUESEE) &&
(on(*tp, ISINWALL) || on(*tp, CANSURPRISE) || on(*tp, ISINWALL) || on(*tp, CANSURPRISE) ||
(on(*tp, ISSHADOW) && rnd(100) < 80) || (on(*tp, ISSHADOW) && rnd(100) < 80) ||
(on(*tp, ISINVIS) && off(player, CANSEE)))) (on(*tp, ISINVIS) && off(player, CANSEE)))
{ {
/* /*
TODO: incomplete - need to finish logic TODO: incomplete - need to finish logic

View file

@ -37,6 +37,7 @@ new_level(LEVTYPE ltype, int special)
struct linked_list *item, *nitem; struct linked_list *item, *nitem;
struct thing *tp; struct thing *tp;
struct linked_list *fpack = NULL; struct linked_list *fpack = NULL;
int going_down = TRUE;
coord stairs; coord stairs;
/* Start player off right */ /* Start player off right */
@ -50,6 +51,8 @@ new_level(LEVTYPE ltype, int special)
if (level >= max_level) if (level >= max_level)
max_level = level; max_level = level;
else
going_down = FALSE;
/* Free up the monsters on the last level */ /* Free up the monsters on the last level */

View file

@ -6,6 +6,8 @@
All rights reserved. All rights reserved.
*/ */
static char sccsid[] = "%W% %G%";
#include "rogue.h" #include "rogue.h"
void verify_function(const char *file, const int line) void verify_function(const char *file, const int line)

View file

@ -6,10 +6,14 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working curses], mp_cv_curses, AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses" [LIBS="$LIBS -lcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
if test "$mp_cv_curses" = yes if test "$mp_cv_curses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses" CURSES_LIB="-lcurses"
fi fi
fi fi
@ -17,7 +21,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses" [LIBS="$mp_save_LIBS -lncurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])]) AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
if test "$mp_cv_ncurses" = yes if test "$mp_cv_ncurses" = yes
then then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested]) AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -28,7 +35,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses, AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses" [LIBS="$mp_save_LIBS -lpdcurses"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
if test "$mp_cv_pdcurses" = yes if test "$mp_cv_pdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -39,7 +49,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur, AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur" [LIBS="$mp_save_LIBS -lpdcur"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])]) AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
if test "$mp_cv_pdcur" = yes if test "$mp_cv_pdcur" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -50,7 +63,10 @@ AC_DEFUN([MP_WITH_CURSES],
then then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses, AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a" [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])]) AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
if test "$mp_cv_lpdcurses" = yes if test "$mp_cv_lpdcurses" = yes
then then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested]) AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -60,10 +76,12 @@ AC_DEFUN([MP_WITH_CURSES],
fi fi
AC_CACHE_CHECK([for ESCDELAY variable], AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay], [mc_cv_ncurses_escdelay],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ [AC_TRY_LINK([], [
extern int ESCDELAY; extern int ESCDELAY;
ESCDELAY = 0; ESCDELAY = 0;
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no]) ],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]) ])
if test "$mc_cv_ncurses_escdelay" = yes; then if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1, AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -320,9 +320,7 @@ command(void)
} }
when 'i' : after = FALSE; inventory(pack, ALL); when 'i' : after = FALSE; inventory(pack, ALL);
when 'I' : after = FALSE; picky_inven(); when 'I' : after = FALSE; picky_inven();
when 'm' : when 'm' : nameitem((struct linked_list *)NULL, TRUE);
after = FALSE;
nameitem((struct linked_list *)NULL, TRUE);
when 'o' : option(); when 'o' : option();
when 'O' : msg("Charactor type: %s Quest item: %s", char_class[char_type].name, rel_magic[quest_item].mi_name); when 'O' : msg("Charactor type: %s Quest item: %s", char_class[char_type].name, rel_magic[quest_item].mi_name);
when ',' : when ',' :
@ -400,7 +398,7 @@ command(void)
food_left); food_left);
when CTRL('L') : after = FALSE; clearok(curscr, TRUE); when CTRL('L') : after = FALSE; clearok(curscr, TRUE);
touchwin(cw); touchwin(cw);
when CTRL('N') : after = FALSE; nameit(); when CTRL('N') : nameit();
when CTRL('O') : after = FALSE; opt_player(); when CTRL('O') : after = FALSE; opt_player();
when CTRL('R') : after = FALSE; msg(huh); when CTRL('R') : after = FALSE; msg(huh);
when CTRL('T') : when CTRL('T') :

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ(2.56)
AC_INIT([XRogue],[8.0.3],[elwin@sdf.org],[xrogue]) AC_INIT([XRogue],[8.0.3], [yendor@rogueforge.net], [xrogue])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
# Checks for libraries. # Checks for libraries.
MP_WITH_CURSES MP_WITH_CURSES
# Checks for header files. # Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h term.h ncurses/term.h process.h arpa/inet.h]) AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -21,14 +21,15 @@ AC_STRUCT_TM
AC_FUNC_FORK AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr _spawnl spawnl getpwuid loadav strerror setgid setuid getuid getgid]) AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr _spawnl spawnl getpwuid loadav strerror setgid setuid getuid getgid])
AC_PROG_INSTALL AC_PROG_INSTALL
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="xrogue"] ) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="xrogue"] )
PROGRAM=$progname PROGRAM=$progname
AC_SUBST(PROGRAM) AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[]) AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit]) AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then if test "x$enable_setgid" = "xno" ; then
GROUPOWNER= GROUPOWNER=
@ -49,7 +50,7 @@ fi
AC_SUBST(GROUPOWNER) AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[]) AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file]) AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then if test "x$enable_scorefile" = "xno" ; then
SCOREFILE= SCOREFILE=
@ -70,7 +71,7 @@ fi
AC_SUBST(SCOREFILE) AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[]) AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file]) AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then if test "x$enable_logfile" = "xno" ; then
LOGFILE= LOGFILE=
@ -91,7 +92,7 @@ fi
AC_SUBST(LOGFILE) AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"]) AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory]) AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then if test "x$enable_savedir" = "xno" ; then
SAVEDIR= SAVEDIR=
@ -114,7 +115,7 @@ fi
AC_SUBST(SAVEDIR) AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled]) AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -125,7 +126,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_ARG_ENABLE([limitscore],[AS_HELP_STRING([--enable-limitscore],[limit scores to one per class per uid @<:@default=no@:>@])],[],[]) AC_ARG_ENABLE([limitscore],[AC_HELP_STRING([--enable-limitscore], [limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if limiting scores]) AC_MSG_CHECKING([if limiting scores])
if test "x$enable_limitscore" = "xno" ; then if test "x$enable_limitscore" = "xno" ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])

View file

@ -20,7 +20,6 @@
#include <string.h> #include <string.h>
#include <curses.h> #include <curses.h>
#include <signal.h> #include <signal.h>
#include <limits.h>
#include <time.h> #include <time.h>
#include "mach_dep.h" #include "mach_dep.h"
@ -45,7 +44,6 @@ main(int argc, char *argv[], char *envp[])
*/ */
strncpy(home, md_gethomedir(), LINELEN); strncpy(home, md_gethomedir(), LINELEN);
home[LINELEN-1] = '\0';
/* Get default save file */ /* Get default save file */
strcpy(file_name, home); strcpy(file_name, home);
@ -53,8 +51,8 @@ main(int argc, char *argv[], char *envp[])
/* Get default score file */ /* Get default score file */
#ifdef SCOREFILE #ifdef SCOREFILE
strncpy(score_file, SCOREFILE, PATH_MAX); strncpy(score_file, SCOREFILE, LINELEN);
score_file[PATH_MAX-1] = '\0'; score_file[LINELEN-1] = '\0';
#else #else
strcpy(score_file, md_getroguedir()); strcpy(score_file, md_getroguedir());

View file

@ -630,12 +630,12 @@ wake_monster(int y, int x)
/* /*
* Every time he sees mean monster, it might start chasing him * Every time he sees mean monster, it might start chasing him
*/ */
if ((on(*tp, ISMEAN) && if (on(*tp, ISMEAN) &&
off(*tp, ISHELD) && off(*tp, ISHELD) &&
off(*tp, ISRUN) && off(*tp, ISRUN) &&
rnd(100) > 35 && rnd(100) > 35 &&
(!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 35)) && (!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 35)) &&
(off(player, ISINVIS) || on(*tp, CANSEE))) || (off(player, ISINVIS) || on(*tp, CANSEE)) ||
(trp != NULL && (trp->r_flags & ISTREAS))) { (trp != NULL && (trp->r_flags & ISTREAS))) {
runto(tp, &hero); runto(tp, &hero);
} }

View file

@ -21,6 +21,7 @@
/* #undef NETCOMMAND "uux - -n '%s!%s -u' >/dev/null 2>&1" */ /* #undef NETCOMMAND "uux - -n '%s!%s -u' >/dev/null 2>&1" */
/* #define NETCOMMAND "usend -s -d%s -uNoLogin -!'%s -u' - 2>/dev/null" */ /* #define NETCOMMAND "usend -s -d%s -uNoLogin -!'%s -u' - 2>/dev/null" */
#define NETCOMMAND ""
/* Networking information -- should not vary among networking machines */ /* Networking information -- should not vary among networking machines */

View file

@ -24,7 +24,6 @@
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include "rogue.h" #include "rogue.h"
#define NUM_OPTS (sizeof optlist / sizeof (OPTION)) #define NUM_OPTS (sizeof optlist / sizeof (OPTION))
@ -525,7 +524,7 @@ get_str_prot(char *opt, WINDOW *win)
int int
get_score(char *optstr, WINDOW *win) get_score(char *optstr, WINDOW *win)
{ {
char old_score_file[PATH_MAX]; char old_score_file[LINELEN];
int status; int status;
if (use_savedir) if (use_savedir)

View file

@ -420,7 +420,6 @@ score(unsigned long amount, int flags, short monst)
(flags == WINNER) ? (short) max_level : (short) level, (flags == WINNER) ? (short) max_level : (short) level,
monst, player.t_ctype, thissys, login) monst, player.t_ctype, thissys, login)
) { ) {
#ifdef NETCOMMAND
/* Send this update to the other systems in the network */ /* Send this update to the other systems in the network */
int i, j; int i, j;
char cmd[256]; /* Command for remote execution */ char cmd[256]; /* Command for remote execution */
@ -473,7 +472,6 @@ score(unsigned long amount, int flags, short monst)
(void) pclose(rmf); (void) pclose(rmf);
} }
} }
#endif
} }
} }
} }

View file

@ -18,7 +18,6 @@
#include <ctype.h> #include <ctype.h>
#include <curses.h> #include <curses.h>
#include <limits.h>
#include "rogue.h" #include "rogue.h"
/* /*
@ -91,7 +90,7 @@ char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
char *m_guess[MAXMM]; /* Players guess at what MM is */ char *m_guess[MAXMM]; /* Players guess at what MM is */
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
char file_name[LINELEN]; /* Save file name */ char file_name[LINELEN]; /* Save file name */
char score_file[PATH_MAX]; /* Score file name */ char score_file[LINELEN]; /* Score file name */
char home[LINELEN]; /* User's home directory */ char home[LINELEN]; /* User's home directory */
WINDOW *cw; /* Window that the player sees */ WINDOW *cw; /* Window that the player sees */
WINDOW *hw; /* Used for the help command */ WINDOW *hw; /* Used for the help command */

View file

@ -1347,7 +1347,7 @@ void init_player(void);
void init_stones(void); void init_stones(void);
void init_terrain(void); void init_terrain(void);
void init_things(void); void init_things(void);
void init_weapon(struct object *weap, int type); void init_weapon(struct object *weap, char type);
char *inv_name(struct object *obj, bool drop); char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type); bool inventory(struct linked_list *list, int type);
bool invisible(struct thing *monst); bool invisible(struct thing *monst);

View file

@ -3301,7 +3301,7 @@ directory_exists(char *dirname)
char * char *
md_getroguedir(void) md_getroguedir(void)
{ {
static char path[PATH_MAX-20]; static char path[1024];
char *end,*home; char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL) if ( (home = getenv("ROGUEHOME")) != NULL)
@ -3310,17 +3310,14 @@ md_getroguedir(void)
{ {
strncpy(path, home, PATH_MAX - 20); strncpy(path, home, PATH_MAX - 20);
if (path[PATH_MAX-21] == '\0') end = &path[strlen(path)-1];
{
end = &path[strlen(path)-1];
while( (end >= path) && ((*end == '/') || (*end == '\\'))) while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0'; *end-- = '\0';
if (directory_exists(path)) if (directory_exists(path))
return(path); return(path);
}
} }
} }

View file

@ -323,7 +323,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
if (!obj) if (!obj)
dice = zapper->t_stats.s_lvl; dice = zapper->t_stats.s_lvl;
else if (obj->o_type == RELIC) if (obj->o_type == RELIC)
dice = 15; dice = 15;
else if (EQUAL(ws_type[which], "staff")) else if (EQUAL(ws_type[which], "staff"))
dice = 10; dice = 10;

View file

@ -198,7 +198,7 @@ hit_monster(int y, int x, struct object *obj, struct thing *tp)
*/ */
void void
init_weapon(struct object *weap, int type) init_weapon(struct object *weap, char type)
{ {
register struct init_weps *iwp; register struct init_weps *iwp;