X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/a853ec0c0184e284cec20544b4f2c0b36ca875e6..04f4d7044367099914cf1906ae27ac20c24e44cf:/gomoku/bdisp.c diff --git a/gomoku/bdisp.c b/gomoku/bdisp.c index 689b0687..becce6b7 100644 --- a/gomoku/bdisp.c +++ b/gomoku/bdisp.c @@ -1,4 +1,4 @@ -/* $NetBSD: bdisp.c,v 1.4 1997/01/03 01:35:25 cgd Exp $ */ +/* $NetBSD: bdisp.c,v 1.6 1999/09/08 21:17:49 jsm Exp $ */ /* * Copyright (c) 1994 @@ -36,18 +36,18 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)bdisp.c 8.2 (Berkeley) 5/3/95"; #else -static char rcsid[] = "$NetBSD: bdisp.c,v 1.4 1997/01/03 01:35:25 cgd Exp $"; +__RCSID("$NetBSD: bdisp.c,v 1.6 1999/09/08 21:17:49 jsm Exp $"); #endif #endif /* not lint */ -#include "gomoku.h" -#include -#include #include +#include +#include "gomoku.h" #define SCRNH 24 /* assume 24 lines for the moment */ #define SCRNW 80 /* assume 80 chars for the moment */ @@ -58,6 +58,7 @@ static char pcolor[] = "*O.?"; /* * Initialize screen display. */ +void cursinit() { @@ -70,6 +71,7 @@ cursinit() /* * Restore screen display. */ +void cursfini() { @@ -83,9 +85,10 @@ cursfini() /* * Initialize board display. */ +void bdisp_init() { - register int i, j; + int i, j; /* top border */ for (i = 1; i < BSZ1; i++) { @@ -114,6 +117,7 @@ bdisp_init() /* * Update who is playing whom. */ +void bdwho(update) int update; { @@ -137,10 +141,11 @@ bdwho(update) /* * Update the board display after a move. */ +void bdisp() { - register int i, j, c; - register struct spotstr *sp; + int i, j, c; + struct spotstr *sp; for (j = BSZ1; --j > 0; ) { for (i = 1; i < BSZ1; i++) { @@ -165,11 +170,12 @@ bdisp() /* * Dump board display to a file. */ +void bdump(fp) FILE *fp; { - register int i, j, c; - register struct spotstr *sp; + int i, j, c; + struct spotstr *sp; /* top border */ fprintf(fp, " A B C D E F G H J K L M N O P Q R S T\n"); @@ -203,18 +209,17 @@ bdump(fp) /* * Display a transcript entry */ +void dislog(str) - char *str; + const char *str; { if (++lastline >= SCRNH - 1) { /* move 'em up */ lastline = 1; } - if (strlen(str) >= SCRNW - 46) - str[SCRNW - 46 - 1] = '\0'; move(lastline, 46); - addstr(str); + addnstr(str, SCRNW - 46 - 1); clrtoeol(); move(lastline + 1, 46); clrtoeol(); @@ -223,8 +228,10 @@ dislog(str) /* * Display a question. */ + +void ask(str) - char *str; + const char *str; { int len = strlen(str); @@ -235,14 +242,16 @@ ask(str) refresh(); } +int getline(buf, size) char *buf; int size; { - register char *cp, *end; - register int c; + char *cp, *end; + int c; extern int interactive; + c = 0; cp = buf; end = buf + size - 1; /* save room for the '\0' */ while (cp < end && (c = getchar()) != EOF && c != '\n' && c != '\r') {