X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/0e57b353967966db0b9a4d68736daaa410eafd24..c027a6e8b72c9245a1fee485844fe5e01cae252c:/rogue/message.c diff --git a/rogue/message.c b/rogue/message.c index 3e12c51c..17af007c 100644 --- a/rogue/message.c +++ b/rogue/message.c @@ -1,4 +1,4 @@ -/* $NetBSD: message.c,v 1.5 1995/04/22 10:27:43 cgd Exp $ */ +/* $NetBSD: message.c,v 1.8 2000/07/10 10:19:27 itojun Exp $ */ /* * Copyright (c) 1988, 1993 @@ -36,11 +36,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)message.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: message.c,v 1.5 1995/04/22 10:27:43 cgd Exp $"; +__RCSID("$NetBSD: message.c,v 1.8 2000/07/10 10:19:27 itojun Exp $"); #endif #endif /* not lint */ @@ -56,24 +57,20 @@ static char rcsid[] = "$NetBSD: message.c,v 1.5 1995/04/22 10:27:43 cgd Exp $"; * */ -#include -#include #include +#include #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; @@ -105,12 +102,13 @@ boolean intrpt; if (did_int) { did_int = 0; - onintr(); + onintr(0); } } +void remessage(c) -short c; + short c; { if (imsg != -1) { check_message(); @@ -125,6 +123,7 @@ short c; } } +void check_message() { if (msg_cleared) { @@ -136,11 +135,13 @@ check_message() 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; @@ -194,9 +195,10 @@ boolean do_echo; return(i); } +int rgetchar() { - register ch; + int ch; for(;;) { ch = getchar(); @@ -207,7 +209,7 @@ rgetchar() break; #ifdef UNIX_BSD4_2 case '\032': - printf(CL); + printf("%s", CL); fflush(stdout); tstp(); break; @@ -220,13 +222,15 @@ rgetchar() } } } + /* 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; @@ -311,9 +315,10 @@ register stat_mask; refresh(); } +void pad(s, n) -char *s; -short n; + const char *s; + short n; { short i; @@ -322,6 +327,7 @@ short n; } } +void save_screen() { FILE *fp; @@ -350,6 +356,7 @@ save_screen() } } +void sound_bell() { putchar(7); @@ -358,15 +365,16 @@ sound_bell() 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;