+/* $NetBSD: message.c,v 1.8 2000/07/10 10:19:27 itojun Exp $ */
+
/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Timothy C. Stoehr.
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char sccsid[] = "@(#)message.c 5.3 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)message.c 8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: message.c,v 1.8 2000/07/10 10:19:27 itojun Exp $");
+#endif
#endif /* not lint */
/*
*
*/
-#include <stdio.h>
+#include <signal.h>
+#include <termios.h>
#include "rogue.h"
char msgs[NMESSAGES][DCOLS] = {"", "", "", "", ""};
short msg_col = 0, imsg = -1;
boolean msg_cleared = 1, rmsg = 0;
char hunger_str[8] = "";
-char *more = "-more-";
-
-extern boolean cant_int, did_int, interrupted, save_is_interactive;
-extern short add_strength;
-extern short cur_level;
+const char *more = "-more-";
+void
message(msg, intrpt)
-char *msg;
-boolean intrpt;
+ const char *msg;
+ boolean intrpt;
{
cant_int = 1;
if (did_int) {
did_int = 0;
- onintr();
+ onintr(0);
}
}
+void
remessage(c)
-short c;
+ short c;
{
if (imsg != -1) {
check_message();
}
}
+void
check_message()
{
if (msg_cleared) {
msg_cleared = 1;
}
+int
get_input_line(prompt, insert, buf, if_cancelled, add_blank, do_echo)
-char *prompt, *buf, *insert;
-char *if_cancelled;
-boolean add_blank;
-boolean do_echo;
+ const char *prompt, *insert;
+ char *buf;
+ const char *if_cancelled;
+ boolean add_blank;
+ boolean do_echo;
{
short ch;
short i = 0, n;
return(i);
}
+int
rgetchar()
{
- register ch;
+ int ch;
for(;;) {
ch = getchar();
break;
#ifdef UNIX_BSD4_2
case '\032':
- printf(CL);
+ printf("%s", CL);
fflush(stdout);
tstp();
break;
}
}
}
+
/*
Level: 99 Gold: 999999 Hp: 999(999) Str: 99(99) Arm: 99 Exp: 21/10000000 Hungry
0 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5
*/
+void
print_stats(stat_mask)
-register stat_mask;
+ int stat_mask;
{
char buf[16];
boolean label;
refresh();
}
+void
pad(s, n)
-char *s;
-short n;
+ const char *s;
+ short n;
{
short i;
}
}
+void
save_screen()
{
FILE *fp;
}
}
+void
sound_bell()
{
putchar(7);
boolean
is_digit(ch)
-short ch;
+ short ch;
{
return((ch >= '0') && (ch <= '9'));
}
+int
r_index(str, ch, last)
-char *str;
-int ch;
-boolean last;
+ const char *str;
+ int ch;
+ boolean last;
{
int i = 0;