summaryrefslogtreecommitdiff
path: root/games/trek/play.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
commited884b9fa4509c09f0f7ab71efe57a4e83a2e055 (patch)
treeef9d859a0754785b42ea5cacb27aff54b5000315 /games/trek/play.c
parentf4fc9566a4d35c0cc2bf8c7f1136287d8eec8c44 (diff)
tags, formatting, ANSI-fication, prototypes, de-typos, and the occasional
initialization, removal of unused variable, or other minor fix. Most changes are from or inspired by NetBSD.
Diffstat (limited to 'games/trek/play.c')
-rw-r--r--games/trek/play.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/games/trek/play.c b/games/trek/play.c
index c2815437e61..4996d495a78 100644
--- a/games/trek/play.c
+++ b/games/trek/play.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: play.c,v 1.2 1998/08/19 07:41:55 pjanzen Exp $ */
/* $NetBSD: play.c,v 1.3 1995/04/22 10:59:18 cgd Exp $ */
/*
@@ -37,13 +38,14 @@
#if 0
static char sccsid[] = "@(#)play.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: play.c,v 1.3 1995/04/22 10:59:18 cgd Exp $";
+static char rcsid[] = "$OpenBSD: play.c,v 1.2 1998/08/19 07:41:55 pjanzen Exp $";
#endif
#endif /* not lint */
-# include "trek.h"
-# include "getpar.h"
-# include <setjmp.h>
+#include <stdio.h>
+#include <setjmp.h>
+#include "trek.h"
+#include "getpar.h"
/*
** INSTRUCTION READ AND MAIN PLAY LOOP
@@ -55,46 +57,45 @@ static char rcsid[] = "$NetBSD: play.c,v 1.3 1995/04/22 10:59:18 cgd Exp $";
** attack if the move was not free, and checkcond() to check up
** on how we are doing after the move.
*/
-extern int abandon(), capture(), shield(), computer(), dcrept(),
- destruct(), dock(), help(), impulse(), lrscan(),
- warp(), dumpgame(), rest(), srscan(),
- myreset(), torped(), visual(), setwarp(), undock(), phaser();
struct cvntab Comtab[] =
{
- "abandon", "", abandon, 0,
- "ca", "pture", capture, 0,
- "cl", "oak", shield, -1,
- "c", "omputer", computer, 0,
- "da", "mages", dcrept, 0,
- "destruct", "", destruct, 0,
- "do", "ck", dock, 0,
- "help", "", help, 0,
- "i", "mpulse", impulse, 0,
- "l", "rscan", lrscan, 0,
- "m", "ove", warp, 0,
- "p", "hasers", phaser, 0,
- "ram", "", warp, 1,
- "dump", "", dumpgame, 0,
- "r", "est", rest, 0,
- "sh", "ield", shield, 0,
- "s", "rscan", srscan, 0,
- "st", "atus", srscan, -1,
- "terminate", "", myreset, 0,
- "t", "orpedo", torped, 0,
- "u", "ndock", undock, 0,
- "v", "isual", visual, 0,
- "w", "arp", setwarp, 0,
- 0
+ { "abandon", "", abandon, 0 },
+ { "ca", "pture", capture, 0 },
+ { "cl", "oak", shield, -1 },
+ { "c", "omputer", computer, 0 },
+ { "da", "mages", dcrept, 0 },
+ { "destruct", "", destruct, 0 },
+ { "do", "ck", dock, 0 },
+ { "help", "", help, 0 },
+ { "i", "mpulse", impulse, 0 },
+ { "l", "rscan", lrscan, 0 },
+ { "m", "ove", dowarp, 0 },
+ { "p", "hasers", phaser, 0 },
+ { "ram", "", dowarp, 1 },
+ { "dump", "", dumpgame, 0 },
+ { "r", "est", rest, 0 },
+ { "sh", "ield", shield, 0 },
+ { "s", "rscan", srscan, 0 },
+ { "st", "atus", srscan, -1 },
+ { "terminate", "", myreset, 0 },
+ { "t", "orpedo", torped, 0 },
+ { "u", "ndock", undock, 0 },
+ { "v", "isual", visual, 0 },
+ { "w", "arp", setwarp, 0 },
+ { NULL, NULL, NULL, 0 }
};
-myreset()
+void
+myreset(v)
+ int v;
{
extern jmp_buf env;
longjmp(env, 1);
}
+void
play()
{
struct cvntab *r;