summaryrefslogtreecommitdiffstats
path: root/hunt
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2014-03-30 05:44:55 +0000
committerdholland <dholland@NetBSD.org>2014-03-30 05:44:55 +0000
commitb8ff27859a7e560d13fd0f5afff72ca00cd1b2f8 (patch)
treedd2066b49b8ad3f8ef380a986ef7be07e21437a8 /hunt
parentc860b74604f19b4b34a8f2fa731593038a0b4816 (diff)
downloadbsdgames-darwin-b8ff27859a7e560d13fd0f5afff72ca00cd1b2f8.tar.gz
bsdgames-darwin-b8ff27859a7e560d13fd0f5afff72ca00cd1b2f8.tar.zst
bsdgames-darwin-b8ff27859a7e560d13fd0f5afff72ca00cd1b2f8.zip
don't use the preprocessor to rename curses functions, just call them
Diffstat (limited to 'hunt')
-rw-r--r--hunt/hunt/hunt.c23
-rw-r--r--hunt/hunt/playit.c43
2 files changed, 30 insertions, 36 deletions
diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c
index 9396d3f4..174c1d5e 100644
--- a/hunt/hunt/hunt.c
+++ b/hunt/hunt/hunt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hunt.c,v 1.55 2014/03/30 05:30:28 dholland Exp $ */
+/* $NetBSD: hunt.c,v 1.56 2014/03/30 05:44:55 dholland Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.55 2014/03/30 05:30:28 dholland Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.56 2014/03/30 05:44:55 dholland Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -53,9 +53,6 @@ __RCSID("$NetBSD: hunt.c,v 1.55 2014/03/30 05:30:28 dholland Exp $");
#include "pathnames.h"
#include "hunt_private.h"
-#define clear_eol() clrtoeol()
-#define put_ch addch
-#define put_str addstr
#ifdef OVERRIDE_PATH_HUNTD
static const char Driver[] = OVERRIDE_PATH_HUNTD;
@@ -407,17 +404,17 @@ find_driver(void)
} else {
clear_the_screen();
move(1, 0);
- put_str("Pick one:");
+ addstr("Pick one:");
for (i = 0; i < HEIGHT - 4 && i < (int)num; i++) {
move(3 + i, 0);
host = serverlist_gethost(i, &hostlen);
(void) snprintf(buf, sizeof(buf),
"%8c %.64s", 'a' + i,
lookuphost(host, hostlen));
- put_str(buf);
+ addstr(buf);
}
move(4 + i, 0);
- put_str("Enter letter: ");
+ addstr("Enter letter: ");
refresh();
while (1) {
c = getchar();
@@ -481,7 +478,7 @@ start_driver(void)
#endif
move(HEIGHT, 0);
- put_str("Starting...");
+ addstr("Starting...");
refresh();
procid = fork();
if (procid == -1) {
@@ -505,7 +502,7 @@ start_driver(void)
_exit(1);
}
move(HEIGHT, 0);
- put_str("Connecting...");
+ addstr("Connecting...");
refresh();
}
@@ -583,8 +580,8 @@ intr(int dummy __unused)
(void) signal(SIGINT, SIG_IGN);
getyx(stdscr, y, x);
move(HEIGHT, 0);
- put_str("Really quit? ");
- clear_eol();
+ addstr("Really quit? ");
+ clrtoeol();
refresh();
explained = false;
for (;;) {
@@ -605,7 +602,7 @@ intr(int dummy __unused)
return;
}
if (!explained) {
- put_str("(Yes or No) ");
+ addstr("(Yes or No) ");
refresh();
explained = true;
}
diff --git a/hunt/hunt/playit.c b/hunt/hunt/playit.c
index 1f26ae83..0b364e01 100644
--- a/hunt/hunt/playit.c
+++ b/hunt/hunt/playit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: playit.c,v 1.23 2014/03/30 05:41:50 dholland Exp $ */
+/* $NetBSD: playit.c,v 1.24 2014/03/30 05:44:55 dholland Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: playit.c,v 1.23 2014/03/30 05:41:50 dholland Exp $");
+__RCSID("$NetBSD: playit.c,v 1.24 2014/03/30 05:44:55 dholland Exp $");
#endif /* not lint */
#include <sys/file.h>
@@ -53,9 +53,6 @@ __RCSID("$NetBSD: playit.c,v 1.23 2014/03/30 05:41:50 dholland Exp $");
#define FREAD 1
#endif
-#define clear_eol() clrtoeol()
-#define put_ch addch
-#define put_str addstr
static int nchar_send;
#ifdef OTTO
@@ -132,10 +129,10 @@ playit(void)
break;
}
#endif
- put_ch(ch);
+ addch(ch);
break;
case CLRTOEOL:
- clear_eol();
+ clrtoeol();
break;
case CLEAR:
clear_the_screen();
@@ -187,7 +184,7 @@ playit(void)
break;
}
#endif
- put_ch(ch);
+ addch(ch);
break;
}
}
@@ -295,8 +292,8 @@ quit(int old_status)
return Q_CLOAK;
#endif
move(HEIGHT, 0);
- put_str("Re-enter game [ynwo]? ");
- clear_eol();
+ addstr("Re-enter game [ynwo]? ");
+ clrtoeol();
explain = false;
for (;;) {
refresh();
@@ -311,8 +308,8 @@ quit(int old_status)
return Q_QUIT;
#else
move(HEIGHT, 0);
- put_str("Write a parting message [yn]? ");
- clear_eol();
+ addstr("Write a parting message [yn]? ");
+ clrtoeol();
refresh();
for (;;) {
if (isupper(ch = getchar()))
@@ -332,8 +329,8 @@ quit(int old_status)
get_message:
c = ch; /* save how we got here */
move(HEIGHT, 0);
- put_str("Message: ");
- clear_eol();
+ addstr("Message: ");
+ clrtoeol();
refresh();
cp = buf;
for (;;) {
@@ -346,7 +343,7 @@ get_message:
getyx(stdscr, y, x);
move(y, x - 1);
cp -= 1;
- clear_eol();
+ clrtoeol();
}
continue;
}
@@ -355,13 +352,13 @@ get_message:
getyx(stdscr, y, x);
move(y, x - (cp - buf));
cp = buf;
- clear_eol();
+ clrtoeol();
continue;
} else if (!isprint(ch)) {
beep();
continue;
}
- put_ch(ch);
+ addch(ch);
*cp++ = ch;
if (cp + 1 >= buf + sizeof buf)
break;
@@ -373,18 +370,18 @@ get_message:
#endif
beep();
if (!explain) {
- put_str("(Yes, No, Write message, or Options) ");
+ addstr("(Yes, No, Write message, or Options) ");
explain = true;
}
}
move(HEIGHT, 0);
#ifdef FLY
- put_str("Scan, Cloak, Flying, or Quit? ");
+ addstr("Scan, Cloak, Flying, or Quit? ");
#else
- put_str("Scan, Cloak, or Quit? ");
+ addstr("Scan, Cloak, or Quit? ");
#endif
- clear_eol();
+ clrtoeol();
refresh();
explain = false;
for (;;) {
@@ -403,9 +400,9 @@ get_message:
beep();
if (!explain) {
#ifdef FLY
- put_str("[SCFQ] ");
+ addstr("[SCFQ] ");
#else
- put_str("[SCQ] ");
+ addstr("[SCQ] ");
#endif
explain = true;
}