hangup revamp (trunk only)
[See cvs log for src/cmd.c for more complete description.]
This turns clearlocks() into a no-op during the period when the UNIX
port is asking the user to confirm whether to overwrite an existing game.
Also, this removes the duplication of code and function between hangup()
and end_of_input(), and it simplifies the check for whether hangups are
supported by adding new macro HANGUPHANDLING. (I don't think global.h is
the best place to be defining that but I couldn't figure out where else
it would fit, other than repeating for individual xxxconf.h files.) And
adds a couple more done_hup checks to try to cope with situations where
rhack() is being bypassed. Lastly, having readchar() return EOF was
ignored for non-UNIX configs; now everybody gets ESC instead of letting
EOF be seen further inside the core.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)decl.h 3.5 2005/11/19 */
|
||||
/* SCCS Id: @(#)decl.h 3.5 2007/01/12 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -145,9 +145,10 @@ E struct linfo level_info[MAXLINFO];
|
||||
E NEARDATA struct sinfo {
|
||||
int gameover; /* self explanatory? */
|
||||
int stopprint; /* inhibit further end of game disclosure */
|
||||
#if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32)
|
||||
#ifdef HANGUPHANDLING
|
||||
volatile int done_hup; /* SIGHUP or moral equivalent received
|
||||
* -- no more screen output */
|
||||
int preserve_locks; /* don't remove level files prior to exit */
|
||||
#endif
|
||||
int something_worth_saving; /* in case of panic */
|
||||
int panicking; /* `panic' is in progress */
|
||||
|
||||
@@ -197,6 +197,10 @@ E void NDECL(confdir);
|
||||
E int FDECL(isok, (int,int));
|
||||
E int FDECL(get_adjacent_loc, (const char *, const char *, XCHAR_P, XCHAR_P, coord *));
|
||||
E const char *FDECL(click_to_cmd, (int,int,int));
|
||||
#ifdef HANGUPHANDLING
|
||||
E void FDECL(hangup, (int));
|
||||
E void NDECL(end_of_input);
|
||||
#endif
|
||||
E char NDECL(readchar);
|
||||
#ifdef WIZARD
|
||||
E void NDECL(sanity_check);
|
||||
@@ -1937,9 +1941,6 @@ E void NDECL(rumor_check);
|
||||
/* ### save.c ### */
|
||||
|
||||
E int NDECL(dosave);
|
||||
#if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
|
||||
E void FDECL(hangup, (int));
|
||||
#endif
|
||||
E int NDECL(dosave0);
|
||||
#ifdef INSURANCE
|
||||
E void NDECL(savestateinlock);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)global.h 3.5 2006/10/17 */
|
||||
/* SCCS Id: @(#)global.h 3.5 2007/01/12 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -269,6 +269,13 @@ typedef char nhptext;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
|
||||
# define HANGUPHANDLING
|
||||
#endif
|
||||
#if defined(SAFERHANGUP) && !defined(HANGUPHANDLING)
|
||||
# undef SAFERHANGUP
|
||||
#endif
|
||||
|
||||
|
||||
#define Sprintf (void) sprintf
|
||||
#define Strcat (void) strcat
|
||||
|
||||
Reference in New Issue
Block a user