From ef4844d5a3538f097c7b81a311c7409172f46107 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Feb 2019 22:29:58 -1100 Subject: [PATCH] _quit --- src/cc/rogue/command.c | 2 +- src/cc/rogue/extern.h | 3 ++- src/cc/rogue/io.c | 2 +- src/cc/rogue/rogue.c | 40 +++++++++++++++++++++++++--------------- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/cc/rogue/command.c b/src/cc/rogue/command.c index d55b93a5b..54d7beb99 100644 --- a/src/cc/rogue/command.c +++ b/src/cc/rogue/command.c @@ -264,7 +264,7 @@ over: when 'Q': after = FALSE; q_comm = TRUE; - if ( quit(0) > 0 ) + if ( _quit() > 0 ) { if ( rs->guiflag != 0 ) { diff --git a/src/cc/rogue/extern.h b/src/cc/rogue/extern.h index ff45e0fee..7fba842f3 100644 --- a/src/cc/rogue/extern.h +++ b/src/cc/rogue/extern.h @@ -141,7 +141,8 @@ void getltchars(void); void leave(int); void my_exit(int st); void playltchars(void); -int32_t quit(int); +void quit(int); +int32_t _quit(); void resetltchars(void); void set_order(int *order, int numthings); void tstp(int ignored); diff --git a/src/cc/rogue/io.c b/src/cc/rogue/io.c index 6e070b2a8..79eadb571 100644 --- a/src/cc/rogue/io.c +++ b/src/cc/rogue/io.c @@ -174,7 +174,7 @@ readchar(struct rogue_state *rs) if (ch == 3) { - quit(0); + _quit(); return(27); } if ( rs != 0 && rs->guiflag != 0 ) diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index dafcf3f01..02feef2ab 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -613,26 +613,13 @@ playit(struct rogue_state *rs) endit(0); } -/* - * quit: - * Have player make certain, then exit. - */ -int32_t quit(int sig) + +int32_t _quit() { struct rogue_state *rs = &globalR; int oy, ox, c; //fprintf(stderr,"inside quit(%d)\n",sig); - if ( rs->guiflag != 0 ) - { - NOOP(sig); - - /* - * Reset the signal in case we got here via an interrupt - */ - if (!q_comm) - mpos = 0; - } getyx(curscr, oy, ox); msg(rs,"really quit?"); sleep(1); @@ -673,6 +660,29 @@ int32_t quit(int sig) } } +/* + * quit: + * Have player make certain, then exit. + */ + +void quit(int sig) +{ + struct rogue_state *rs = &globalR; + int oy, ox, c; + //fprintf(stderr,"inside quit(%d)\n",sig); + if ( rs->guiflag != 0 ) + { + NOOP(sig); + + /* + * Reset the signal in case we got here via an interrupt + */ + if (!q_comm) + mpos = 0; + } + _quit(); +} + /* * leave: * Leave quickly, but curteously