aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorBill Fumerola <billf@FreeBSD.org>1999-12-10 03:23:01 +0000
committerBill Fumerola <billf@FreeBSD.org>1999-12-10 03:23:01 +0000
commit8d8a5c1ed95df43b04157745cf5982d3af15db17 (patch)
tree544873ba49d5ee5ea598e3db564fb2e763836aaf /games
parent01587728733d703190f2759d69ddc6d94f195e92 (diff)
Notes
Diffstat (limited to 'games')
-rw-r--r--games/hangman/endgame.c3
-rw-r--r--games/hangman/getguess.c8
-rw-r--r--games/hangman/getword.c1
-rw-r--r--games/hangman/hangman.h14
-rw-r--r--games/hangman/main.c6
-rw-r--r--games/hangman/playgame.c1
-rw-r--r--games/hangman/prdata.c1
-rw-r--r--games/hangman/prman.c1
-rw-r--r--games/hangman/prword.c1
-rw-r--r--games/hangman/setup.c1
10 files changed, 30 insertions, 7 deletions
diff --git a/games/hangman/endgame.c b/games/hangman/endgame.c
index 4e13559f7e837..a04908a2cee0d 100644
--- a/games/hangman/endgame.c
+++ b/games/hangman/endgame.c
@@ -45,6 +45,7 @@ static const char rcsid[] =
* endgame:
* Do what's necessary at the end of the game
*/
+void
endgame()
{
char ch;
@@ -65,7 +66,7 @@ endgame()
leaveok(stdscr, FALSE);
refresh();
if ((ch = readch()) == 'n')
- die();
+ die(0);
else if (ch == 'y')
break;
mvaddstr(MESGY + 2, MESGX, "Please type 'y' or 'n'");
diff --git a/games/hangman/getguess.c b/games/hangman/getguess.c
index a338e5ca2fa07..4caaf0e144c3c 100644
--- a/games/hangman/getguess.c
+++ b/games/hangman/getguess.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
* getguess:
* Get another guess
*/
+void
getguess()
{
int i;
@@ -66,7 +67,7 @@ getguess()
break;
}
else if (ch == CTRL('D'))
- die();
+ die(0);
else
mvprintw(MESGY, MESGX, "Not a valid guess: '%s'",
unctrl(ch));
@@ -90,9 +91,10 @@ getguess()
* readch;
* Read a character from the input
*/
+char
readch()
{
- int cnt, r;
+ int cnt;
auto char ch;
cnt = 0;
@@ -100,7 +102,7 @@ readch()
if (read(0, &ch, sizeof ch) <= 0)
{
if (++cnt > 100)
- die();
+ die(0);
}
else if (ch == CTRL('L')) {
wrefresh(curscr);
diff --git a/games/hangman/getword.c b/games/hangman/getword.c
index 041c686611152..00246aa146f75 100644
--- a/games/hangman/getword.c
+++ b/games/hangman/getword.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
* getword:
* Get a valid word out of the dictionary file
*/
+void
getword()
{
FILE *inf;
diff --git a/games/hangman/hangman.h b/games/hangman/hangman.h
index d2d77b75f1271..a0851be844f03 100644
--- a/games/hangman/hangman.h
+++ b/games/hangman/hangman.h
@@ -31,14 +31,17 @@
* SUCH DAMAGE.
*
* @(#)hangman.h 8.1 (Berkeley) 5/31/93
+ * $FreeBSD$
*/
+# include <stdlib.h>
# include <string.h>
# include <curses.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <ctype.h>
# include <signal.h>
+# include <unistd.h>
# include "pathnames.h"
# define MINLEN 6
@@ -77,4 +80,13 @@ extern FILE *Dict;
extern off_t Dict_size;
-void die();
+void die __P((int));
+void endgame __P((void));
+void getguess __P((void));
+void getword __P((void));
+void playgame __P((void));
+void prdata __P((void));
+void prman __P((void));
+void prword __P((void));
+char readch __P((void));
+void setup __P((void));
diff --git a/games/hangman/main.c b/games/hangman/main.c
index 1c48871285152..a948eea7338c4 100644
--- a/games/hangman/main.c
+++ b/games/hangman/main.c
@@ -50,9 +50,9 @@ static const char rcsid[] =
/*
* This game written by Ken Arnold.
*/
+int
main()
{
- void die();
/* revoke */
setgid(getgid());
@@ -66,6 +66,7 @@ main()
Average = (Average * (Wordnum - 1) + Errors) / Wordnum;
}
/* NOTREACHED */
+ exit(EXIT_FAILURE);
}
/*
@@ -73,7 +74,8 @@ main()
* Die properly.
*/
void
-die()
+die(sig)
+int sig;
{
mvcur(0, COLS - 1, LINES - 1, 0);
endwin();
diff --git a/games/hangman/playgame.c b/games/hangman/playgame.c
index 0857a8ceef6ba..2059e392028b8 100644
--- a/games/hangman/playgame.c
+++ b/games/hangman/playgame.c
@@ -45,6 +45,7 @@ static const char rcsid[] =
* playgame:
* play a game
*/
+void
playgame()
{
bool *bp;
diff --git a/games/hangman/prdata.c b/games/hangman/prdata.c
index 3cfe61e287ef8..be9feffce217d 100644
--- a/games/hangman/prdata.c
+++ b/games/hangman/prdata.c
@@ -45,6 +45,7 @@ static const char rcsid[] =
* prdata:
* Print out the current guesses
*/
+void
prdata()
{
bool *bp;
diff --git a/games/hangman/prman.c b/games/hangman/prman.c
index 431d310232d33..8e4f63f944a5a 100644
--- a/games/hangman/prman.c
+++ b/games/hangman/prman.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
* Print out the man appropriately for the give number
* of incorrect guesses.
*/
+void
prman()
{
int i;
diff --git a/games/hangman/prword.c b/games/hangman/prword.c
index 5841586b6bef3..ddc3ed33d15e7 100644
--- a/games/hangman/prword.c
+++ b/games/hangman/prword.c
@@ -45,6 +45,7 @@ static const char rcsid[] =
* prword:
* Print out the current state of the word
*/
+void
prword()
{
move(KNOWNY, KNOWNX + sizeof "Word: ");
diff --git a/games/hangman/setup.c b/games/hangman/setup.c
index b9cd644ca980e..6889f8cc264b2 100644
--- a/games/hangman/setup.c
+++ b/games/hangman/setup.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
* setup:
* Set up the strings on the screen.
*/
+void
setup()
{
char **sp;