mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
copy in from cvs; cvs2svn fucked up big time
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@9775 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: read_me.nr,v 1.2 1995/04/22 10:59:44 cgd Exp $
|
||||
.\" $NetBSD: read_me.nr,v 1.3 2001/07/22 13:34:01 wiz Exp $
|
||||
.de @h
|
||||
'sp 4
|
||||
'tl 'TREK SETUP INSTRUCTIONS''%'
|
||||
@@ -196,7 +196,7 @@ There are many neat things
|
||||
which could go in,
|
||||
if there were only enough space.
|
||||
However,
|
||||
I have specifically not gone to seperated I/D
|
||||
I have specifically not gone to separated I/D
|
||||
space.
|
||||
The main reason is that I would like future versions
|
||||
of the game
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: trekmanual.nr,v 1.2 1995/04/22 10:59:45 cgd Exp $
|
||||
.\" $NetBSD: trekmanual.nr,v 1.3 2001/06/12 15:17:12 wiz Exp $
|
||||
.br
|
||||
.po 10
|
||||
.if n \!.
|
||||
@@ -692,7 +692,7 @@ with energy, photon torpedoes, and life support reserves.
|
||||
Repairs are also done faster at starbase.
|
||||
Any prisoners you have taken
|
||||
are unloaded.
|
||||
You do not recieve points
|
||||
You do not receive points
|
||||
for taking prisoners
|
||||
until this time.
|
||||
.pp
|
||||
|
||||
@@ -1,4 +1,30 @@
|
||||
# Makefrag - makefile fragment for trek
|
||||
#
|
||||
# Copyright (c) 1997, 1998 Joseph Samuel Myers.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
trek_DIRS := $(GAMESDIR) $(MAN6DIR)
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ the Makefile. You may wish to install it somewhere; if you do,
|
||||
remember to update the reference to /usr/doc/trek in the man page.
|
||||
|
||||
Joseph Myers
|
||||
jsm28@cam.ac.uk
|
||||
jsm@polyomino.org.uk
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.2 1995/04/22 10:59:48 cgd Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2003/01/05 12:34:27 pooka Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/8/93
|
||||
|
||||
DIR= usd/31.trek
|
||||
@@ -6,6 +6,6 @@ SRCS= trek.me
|
||||
MACROS= -me
|
||||
|
||||
paper.ps: ${SRCS}
|
||||
${TBL} ${SRCS} | ${ROFF} > ${.TARGET}
|
||||
${TBL} ${SRCS} | ${ROFF} ${MACROS} > ${.TARGET}
|
||||
|
||||
.include <bsd.doc.mk>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: abandon.c,v 1.4 1997/10/12 21:24:25 christos Exp $ */
|
||||
/* $NetBSD: abandon.c,v 1.5 1999/09/08 21:45:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)abandon.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: abandon.c,v 1.4 1997/10/12 21:24:25 christos Exp $");
|
||||
__RCSID("$NetBSD: abandon.c,v 1.5 1999/09/08 21:45:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -73,7 +73,7 @@ __RCSID("$NetBSD: abandon.c,v 1.4 1997/10/12 21:24:25 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
abandon(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
struct quad *q;
|
||||
int i;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: capture.c,v 1.4 1997/10/12 21:24:29 christos Exp $ */
|
||||
/* $NetBSD: capture.c,v 1.5 1999/09/08 21:45:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)capture.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: capture.c,v 1.4 1997/10/12 21:24:29 christos Exp $");
|
||||
__RCSID("$NetBSD: capture.c,v 1.5 1999/09/08 21:45:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -62,7 +62,7 @@ __RCSID("$NetBSD: capture.c,v 1.4 1997/10/12 21:24:29 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
capture(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int i;
|
||||
struct kling *k;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cgetc.c,v 1.4 1997/10/12 21:24:30 christos Exp $ */
|
||||
/* $NetBSD: cgetc.c,v 1.5 1999/09/08 21:45:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cgetc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: cgetc.c,v 1.4 1997/10/12 21:24:30 christos Exp $");
|
||||
__RCSID("$NetBSD: cgetc.c,v 1.5 1999/09/08 21:45:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: cgetc.c,v 1.4 1997/10/12 21:24:30 christos Exp $");
|
||||
# include "trek.h"
|
||||
|
||||
char cgetc(i)
|
||||
int i __attribute__((unused));
|
||||
int i __attribute__((__unused__));
|
||||
{
|
||||
return ( getchar() );
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: computer.c,v 1.5 1997/10/12 21:24:34 christos Exp $ */
|
||||
/* $NetBSD: computer.c,v 1.8 2000/07/03 03:57:44 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,11 +38,12 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)computer.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: computer.c,v 1.5 1997/10/12 21:24:34 christos Exp $");
|
||||
__RCSID("$NetBSD: computer.c,v 1.8 2000/07/03 03:57:44 matt Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include "trek.h"
|
||||
#include "getpar.h"
|
||||
@@ -113,12 +114,12 @@ static void prkalc __P((int, double));
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
computer(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int ix, iy;
|
||||
int i, j;
|
||||
int tqx, tqy;
|
||||
struct cvntab *r;
|
||||
const struct cvntab *r;
|
||||
int cost;
|
||||
int course;
|
||||
double dist, time;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: damage.c,v 1.4 1997/10/12 21:24:36 christos Exp $ */
|
||||
/* $NetBSD: damage.c,v 1.5 2002/07/20 08:36:23 grant Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)damage.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: damage.c,v 1.4 1997/10/12 21:24:36 christos Exp $");
|
||||
__RCSID("$NetBSD: damage.c,v 1.5 2002/07/20 08:36:23 grant Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -97,5 +97,5 @@ double dam; /* time to repair */
|
||||
reschedule(e, e->date - Now.date + dam);
|
||||
return;
|
||||
}
|
||||
errx(1, "Cannot find old damages %d\n", dev);
|
||||
errx(1, "Cannot find old damages %d", dev);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dcrept.c,v 1.4 1997/10/12 21:24:38 christos Exp $ */
|
||||
/* $NetBSD: dcrept.c,v 1.5 1999/09/08 21:45:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dcrept.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: dcrept.c,v 1.4 1997/10/12 21:24:38 christos Exp $");
|
||||
__RCSID("$NetBSD: dcrept.c,v 1.5 1999/09/08 21:45:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -60,7 +60,7 @@ __RCSID("$NetBSD: dcrept.c,v 1.4 1997/10/12 21:24:38 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
dcrept(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int i, f;
|
||||
double x;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: destruct.c,v 1.4 1997/10/12 21:24:40 christos Exp $ */
|
||||
/* $NetBSD: destruct.c,v 1.6 2000/07/03 03:57:44 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,11 +38,12 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)destruct.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: destruct.c,v 1.4 1997/10/12 21:24:40 christos Exp $");
|
||||
__RCSID("$NetBSD: destruct.c,v 1.6 2000/07/03 03:57:44 matt Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "trek.h"
|
||||
#include "getpar.h"
|
||||
@@ -70,7 +71,7 @@ __RCSID("$NetBSD: destruct.c,v 1.4 1997/10/12 21:24:40 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
destruct(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
char checkpass[15];
|
||||
int i, j;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dock.c,v 1.4 1997/10/12 21:24:41 christos Exp $ */
|
||||
/* $NetBSD: dock.c,v 1.5 1999/09/08 21:45:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dock.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: dock.c,v 1.4 1997/10/12 21:24:41 christos Exp $");
|
||||
__RCSID("$NetBSD: dock.c,v 1.5 1999/09/08 21:45:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -63,7 +63,7 @@ __RCSID("$NetBSD: dock.c,v 1.4 1997/10/12 21:24:41 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
dock(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int i, j;
|
||||
int ok;
|
||||
@@ -137,7 +137,7 @@ dock(v)
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
undock(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
struct event *e;
|
||||
int i;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dumpgame.c,v 1.6 1998/09/11 14:26:19 hubertf Exp $ */
|
||||
/* $NetBSD: dumpgame.c,v 1.7 1999/09/08 21:45:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dumpgame.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: dumpgame.c,v 1.6 1998/09/11 14:26:19 hubertf Exp $");
|
||||
__RCSID("$NetBSD: dumpgame.c,v 1.7 1999/09/08 21:45:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -87,7 +87,7 @@ struct dump Dump_template[] =
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
dumpgame(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int version;
|
||||
int fd;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: events.c,v 1.5 1997/10/13 22:05:26 cjs Exp $ */
|
||||
/* $NetBSD: events.c,v 1.6 2001/06/12 15:17:12 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)events.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: events.c,v 1.5 1997/10/13 22:05:26 cjs Exp $");
|
||||
__RCSID("$NetBSD: events.c,v 1.6 2001/06/12 15:17:12 wiz Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -235,7 +235,7 @@ int warp; /* set if called in a time warp */
|
||||
/* report it if we can */
|
||||
if (!damaged(SSRADIO))
|
||||
{
|
||||
printf("\nUhura: Captain, we have recieved a distress signal\n");
|
||||
printf("\nUhura: Captain, we have received a distress signal\n");
|
||||
printf(" from the starbase in quadrant %d,%d.\n",
|
||||
ix, iy);
|
||||
restcancel++;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: externs.c,v 1.4 1997/10/12 21:24:48 christos Exp $ */
|
||||
/* $NetBSD: externs.c,v 1.7 2001/02/05 01:12:46 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)externs.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: externs.c,v 1.4 1997/10/12 21:24:48 christos Exp $");
|
||||
__RCSID("$NetBSD: externs.c,v 1.7 2001/02/05 01:12:46 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -48,7 +48,7 @@ __RCSID("$NetBSD: externs.c,v 1.4 1997/10/12 21:24:48 christos Exp $");
|
||||
** global variable definitions
|
||||
*/
|
||||
|
||||
struct device Device[NDEV] =
|
||||
const struct device Device[NDEV] =
|
||||
{
|
||||
{ "warp drive", "Scotty" },
|
||||
{ "S.R. scanners", "Scotty" },
|
||||
@@ -68,7 +68,7 @@ struct device Device[NDEV] =
|
||||
{ "*ERR 15*", "Nobody" }
|
||||
};
|
||||
|
||||
char *Systemname[NINHAB] =
|
||||
const char *const Systemname[NINHAB] =
|
||||
{
|
||||
"ERROR",
|
||||
"Talos IV",
|
||||
@@ -103,3 +103,19 @@ char *Systemname[NINHAB] =
|
||||
"Epsilon Eridani IV",
|
||||
"Exo III"
|
||||
};
|
||||
|
||||
struct quad Quad[NQUADS][NQUADS];
|
||||
|
||||
/* current sector map */
|
||||
char Sect[NSECTS][NSECTS];
|
||||
|
||||
struct event Event[MAXEVENTS]; /* dynamic event list; one entry per pending event */
|
||||
|
||||
struct Ship_struct Ship;
|
||||
struct Game_struct Game;
|
||||
struct Move_struct Move;
|
||||
struct Param_struct Param;
|
||||
struct Now_struct Now;
|
||||
struct Etc_struct Etc;
|
||||
|
||||
int Trace;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: getpar.c,v 1.6 1997/10/13 22:12:01 cjs Exp $ */
|
||||
/* $NetBSD: getpar.c,v 1.10 2002/10/18 14:12:14 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,11 +38,12 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: getpar.c,v 1.6 1997/10/13 22:12:01 cjs Exp $");
|
||||
__RCSID("$NetBSD: getpar.c,v 1.10 2002/10/18 14:12:14 itojun Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "getpar.h"
|
||||
#include "trek.h"
|
||||
@@ -55,7 +56,7 @@ static int testterm __P((void));
|
||||
|
||||
int
|
||||
getintpar(s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
int i;
|
||||
int n;
|
||||
@@ -79,7 +80,7 @@ char *s;
|
||||
**/
|
||||
|
||||
double getfltpar(s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
int i;
|
||||
double d;
|
||||
@@ -102,7 +103,7 @@ char *s;
|
||||
** get yes/no parameter
|
||||
**/
|
||||
|
||||
struct cvntab Yntab[] =
|
||||
const struct cvntab Yntab[] =
|
||||
{
|
||||
{ "y", "es", (cmdfun)1, 1 },
|
||||
{ "n", "o", (cmdfun)0, 0 },
|
||||
@@ -111,9 +112,9 @@ struct cvntab Yntab[] =
|
||||
|
||||
int
|
||||
getynpar(s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
struct cvntab *r;
|
||||
const struct cvntab *r;
|
||||
|
||||
r = getcodpar(s, Yntab);
|
||||
return r->value2;
|
||||
@@ -124,14 +125,14 @@ char *s;
|
||||
** get coded parameter
|
||||
**/
|
||||
|
||||
struct cvntab *getcodpar(s, tab)
|
||||
char *s;
|
||||
struct cvntab tab[];
|
||||
const struct cvntab *getcodpar(s, tab)
|
||||
const char *s;
|
||||
const struct cvntab tab[];
|
||||
{
|
||||
char input[100];
|
||||
struct cvntab *r;
|
||||
const struct cvntab *r;
|
||||
int flag;
|
||||
char *p, *q;
|
||||
const char *p, *q;
|
||||
int c;
|
||||
int f;
|
||||
|
||||
@@ -144,7 +145,7 @@ struct cvntab tab[];
|
||||
if (f)
|
||||
cgetc(0); /* throw out the newline */
|
||||
scanf("%*[ \t;]");
|
||||
if ((c = scanf("%[^ \t;\n]", input)) < 0)
|
||||
if ((c = scanf("%99[^ \t;\n]", input)) < 0)
|
||||
exit(1);
|
||||
if (c == 0)
|
||||
continue;
|
||||
@@ -204,10 +205,10 @@ struct cvntab tab[];
|
||||
|
||||
void
|
||||
getstrpar(s, r, l, t)
|
||||
char *s;
|
||||
char *r;
|
||||
int l;
|
||||
char *t;
|
||||
const char *s;
|
||||
char *r;
|
||||
int l;
|
||||
const char *t;
|
||||
{
|
||||
int i;
|
||||
char format[20];
|
||||
@@ -290,7 +291,7 @@ testterm()
|
||||
|
||||
|
||||
/*
|
||||
** TEST FOR SPECIFIED DELIMETER
|
||||
** TEST FOR SPECIFIED DELIMITER
|
||||
**
|
||||
** The standard input is scanned for the parameter. If found,
|
||||
** it is thrown away and non-zero is returned. If not found,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: getpar.h,v 1.4 1997/10/12 21:24:51 christos Exp $ */
|
||||
/* $NetBSD: getpar.h,v 1.6 1999/09/08 21:18:01 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,17 +38,17 @@
|
||||
typedef void (*cmdfun) __P((int));
|
||||
struct cvntab /* used for getcodpar() paramater list */
|
||||
{
|
||||
char *abrev;
|
||||
char *full;
|
||||
const char *abrev;
|
||||
const char *full;
|
||||
cmdfun value;
|
||||
int value2;
|
||||
};
|
||||
|
||||
int getintpar __P((char *));
|
||||
double getfltpar __P((char *));
|
||||
int getynpar __P((char *));
|
||||
struct cvntab *getcodpar __P((char *, struct cvntab[]));
|
||||
void getstrpar __P((char *, char *, int, char *));
|
||||
int getintpar __P((const char *));
|
||||
double getfltpar __P((const char *));
|
||||
int getynpar __P((const char *));
|
||||
const struct cvntab *getcodpar __P((const char *, const struct cvntab[]));
|
||||
void getstrpar __P((const char *, char *, int, const char *));
|
||||
int testnl __P((void));
|
||||
void skiptonl __P((int));
|
||||
int readdelim __P((int));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $ */
|
||||
/* $NetBSD: help.c,v 1.6 1999/09/08 21:45:32 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)help.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $");
|
||||
__RCSID("$NetBSD: help.c,v 1.6 1999/09/08 21:45:32 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -67,13 +67,13 @@ __RCSID("$NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $");
|
||||
** to drop you. After that, it's your problem.
|
||||
*/
|
||||
|
||||
char *Cntvect[3] =
|
||||
const char *const Cntvect[3] =
|
||||
{"first", "second", "third"};
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
help(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int i;
|
||||
double dist, x;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: impulse.c,v 1.4 1997/10/12 21:24:54 christos Exp $ */
|
||||
/* $NetBSD: impulse.c,v 1.5 1999/09/08 21:45:33 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)impulse.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: impulse.c,v 1.4 1997/10/12 21:24:54 christos Exp $");
|
||||
__RCSID("$NetBSD: impulse.c,v 1.5 1999/09/08 21:45:33 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -53,7 +53,7 @@ __RCSID("$NetBSD: impulse.c,v 1.4 1997/10/12 21:24:54 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
impulse(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int course;
|
||||
int power;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kill.c,v 1.5 1998/08/30 09:19:40 veego Exp $ */
|
||||
/* $NetBSD: kill.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)kill.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: kill.c,v 1.5 1998/08/30 09:19:40 veego Exp $");
|
||||
__RCSID("$NetBSD: kill.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -158,7 +158,7 @@ int f; /* f != 0 -- this quad; f < 0 -- Enterprise's fault */
|
||||
{
|
||||
struct quad *q;
|
||||
struct event *e;
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
if (f)
|
||||
{
|
||||
|
||||
10
trek/lose.c
10
trek/lose.c
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lose.c,v 1.4 1997/10/12 21:24:58 christos Exp $ */
|
||||
/* $NetBSD: lose.c,v 1.6 2001/02/05 01:12:46 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)lose.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: lose.c,v 1.4 1997/10/12 21:24:58 christos Exp $");
|
||||
__RCSID("$NetBSD: lose.c,v 1.6 2001/02/05 01:12:46 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -56,7 +56,9 @@ __RCSID("$NetBSD: lose.c,v 1.4 1997/10/12 21:24:58 christos Exp $");
|
||||
** actions which need be taken are taken.
|
||||
*/
|
||||
|
||||
char *Losemsg[] =
|
||||
extern jmp_buf env;
|
||||
|
||||
const char *const Losemsg[] =
|
||||
{
|
||||
"You ran out of time",
|
||||
"You ran out of energy",
|
||||
@@ -77,8 +79,6 @@ void
|
||||
lose(why)
|
||||
int why;
|
||||
{
|
||||
extern jmp_buf env;
|
||||
|
||||
Game.killed = 1;
|
||||
sleep(1);
|
||||
printf("\n%s\n", Losemsg[why - 1]);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lrscan.c,v 1.4 1997/10/12 21:24:59 christos Exp $ */
|
||||
/* $NetBSD: lrscan.c,v 1.5 1999/09/08 21:45:33 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)lrscan.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: lrscan.c,v 1.4 1997/10/12 21:24:59 christos Exp $");
|
||||
__RCSID("$NetBSD: lrscan.c,v 1.5 1999/09/08 21:45:33 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -60,7 +60,7 @@ __RCSID("$NetBSD: lrscan.c,v 1.4 1997/10/12 21:24:59 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
lrscan(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int i, j;
|
||||
struct quad *q;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.6 1997/10/13 22:18:32 cjs Exp $ */
|
||||
/* $NetBSD: main.c,v 1.10 2001/07/22 13:34:01 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.6 1997/10/13 22:18:32 cjs Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.10 2001/07/22 13:34:01 wiz Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -136,7 +136,7 @@ uid_t Mother = 51 + (51 << 8);
|
||||
**
|
||||
** Many things in trek are not as clear as they might be, but are
|
||||
** done to reduce space. I compile with the -f and -O flags. I
|
||||
** am constrained to running with non-seperated I/D space, since
|
||||
** am constrained to running with non-separated I/D space, since
|
||||
** we don't have doubleing point hardware here; even if we did, I
|
||||
** would like trek to be available to the large number of people
|
||||
** who either have an 11/40 or do not have FP hardware. I also
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: out.c,v 1.5 1997/10/13 22:20:35 cjs Exp $ */
|
||||
/* $NetBSD: out.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)out.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: out.c,v 1.5 1997/10/13 22:20:35 cjs Exp $");
|
||||
__RCSID("$NetBSD: out.c,v 1.6 1999/07/21 13:19:11 hubertf Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -54,7 +54,7 @@ void
|
||||
out(dev)
|
||||
int dev;
|
||||
{
|
||||
struct device *d;
|
||||
const struct device *d;
|
||||
|
||||
d = &Device[dev];
|
||||
printf("%s reports %s ", d->person, d->name);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: phaser.c,v 1.5 1997/10/12 21:25:06 christos Exp $ */
|
||||
/* $NetBSD: phaser.c,v 1.8 2000/07/10 10:19:27 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)phaser.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: phaser.c,v 1.5 1997/10/12 21:25:06 christos Exp $");
|
||||
__RCSID("$NetBSD: phaser.c,v 1.8 2000/07/10 10:19:27 itojun Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -99,7 +99,7 @@ struct banks
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
phaser(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
@@ -113,7 +113,7 @@ phaser(v)
|
||||
int n;
|
||||
int hitreqd[NBANKS];
|
||||
struct banks bank[NBANKS];
|
||||
struct cvntab *ptr;
|
||||
const struct cvntab *ptr;
|
||||
|
||||
if (Ship.cond == DOCKED) {
|
||||
printf("Phasers cannot fire through starbase shields\n");
|
||||
@@ -140,13 +140,13 @@ phaser(v)
|
||||
{
|
||||
if (damaged(COMPUTER))
|
||||
{
|
||||
printf(Device[COMPUTER].name);
|
||||
printf("%s", Device[COMPUTER].name);
|
||||
manual++;
|
||||
}
|
||||
else
|
||||
if (damaged(SRSCAN))
|
||||
{
|
||||
printf(Device[SRSCAN].name);
|
||||
printf("%s", Device[SRSCAN].name);
|
||||
manual++;
|
||||
}
|
||||
if (manual)
|
||||
|
||||
13
trek/play.c
13
trek/play.c
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: play.c,v 1.4 1997/10/12 21:25:07 christos Exp $ */
|
||||
/* $NetBSD: play.c,v 1.7 2001/02/05 01:12:46 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)play.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: play.c,v 1.4 1997/10/12 21:25:07 christos Exp $");
|
||||
__RCSID("$NetBSD: play.c,v 1.7 2001/02/05 01:12:46 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -58,7 +58,9 @@ __RCSID("$NetBSD: play.c,v 1.4 1997/10/12 21:25:07 christos Exp $");
|
||||
** on how we are doing after the move.
|
||||
*/
|
||||
|
||||
struct cvntab Comtab[] =
|
||||
extern jmp_buf env;
|
||||
|
||||
const struct cvntab Comtab[] =
|
||||
{
|
||||
{ "abandon", "", abandon, 0 },
|
||||
{ "ca", "pture", capture, 0 },
|
||||
@@ -89,9 +91,8 @@ struct cvntab Comtab[] =
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
myreset(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
extern jmp_buf env;
|
||||
|
||||
longjmp(env, 1);
|
||||
}
|
||||
@@ -99,7 +100,7 @@ myreset(v)
|
||||
void
|
||||
play()
|
||||
{
|
||||
struct cvntab *r;
|
||||
const struct cvntab *r;
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: rest.c,v 1.4 1997/10/12 21:25:10 christos Exp $ */
|
||||
/* $NetBSD: rest.c,v 1.5 1999/09/08 21:45:33 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)rest.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: rest.c,v 1.4 1997/10/12 21:25:10 christos Exp $");
|
||||
__RCSID("$NetBSD: rest.c,v 1.5 1999/09/08 21:45:33 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -63,7 +63,7 @@ __RCSID("$NetBSD: rest.c,v 1.4 1997/10/12 21:25:10 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
rest(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
double t;
|
||||
int percent;
|
||||
|
||||
11
trek/setup.c
11
trek/setup.c
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: setup.c,v 1.5 1997/10/12 21:25:15 christos Exp $ */
|
||||
/* $NetBSD: setup.c,v 1.7 2000/07/03 03:57:44 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,12 +38,13 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: setup.c,v 1.5 1997/10/12 21:25:15 christos Exp $");
|
||||
__RCSID("$NetBSD: setup.c,v 1.7 2000/07/03 03:57:44 matt Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <err.h>
|
||||
@@ -61,7 +62,7 @@ __RCSID("$NetBSD: setup.c,v 1.5 1997/10/12 21:25:15 christos Exp $");
|
||||
** Game restart and tournament games are handled here.
|
||||
*/
|
||||
|
||||
struct cvntab Lentab[] =
|
||||
const struct cvntab Lentab[] =
|
||||
{
|
||||
{ "s", "hort", (cmdfun)1, 0 },
|
||||
{ "m", "edium", (cmdfun)2, 0 },
|
||||
@@ -70,7 +71,7 @@ struct cvntab Lentab[] =
|
||||
{ NULL, NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
struct cvntab Skitab[] =
|
||||
const struct cvntab Skitab[] =
|
||||
{
|
||||
{ "n", "ovice", (cmdfun)1, 0 },
|
||||
{ "f", "air", (cmdfun)2, 0 },
|
||||
@@ -84,7 +85,7 @@ struct cvntab Skitab[] =
|
||||
void
|
||||
setup()
|
||||
{
|
||||
struct cvntab *r;
|
||||
const struct cvntab *r;
|
||||
int i, j;
|
||||
double f;
|
||||
int d;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: setwarp.c,v 1.4 1997/10/12 21:25:16 christos Exp $ */
|
||||
/* $NetBSD: setwarp.c,v 1.5 1999/09/08 21:45:33 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)setwarp.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: setwarp.c,v 1.4 1997/10/12 21:25:16 christos Exp $");
|
||||
__RCSID("$NetBSD: setwarp.c,v 1.5 1999/09/08 21:45:33 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -56,7 +56,7 @@ __RCSID("$NetBSD: setwarp.c,v 1.4 1997/10/12 21:25:16 christos Exp $");
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
setwarp(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
double warpfac;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $ */
|
||||
/* $NetBSD: shield.c,v 1.7 1999/07/21 13:19:11 hubertf Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)shield.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $");
|
||||
__RCSID("$NetBSD: shield.c,v 1.7 1999/07/21 13:19:11 hubertf Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -63,7 +63,7 @@ __RCSID("$NetBSD: shield.c,v 1.6 1998/08/30 09:19:40 veego Exp $");
|
||||
** so you get partial hits.
|
||||
*/
|
||||
|
||||
struct cvntab Udtab[] =
|
||||
const struct cvntab Udtab[] =
|
||||
{
|
||||
{ "u", "p", (cmdfun)1, 0 },
|
||||
{ "d", "own", (cmdfun)0, 0 },
|
||||
@@ -75,9 +75,9 @@ shield(f)
|
||||
int f;
|
||||
{
|
||||
int i;
|
||||
struct cvntab *r;
|
||||
const struct cvntab *r;
|
||||
char s[100];
|
||||
char *device, *dev2, *dev3;
|
||||
const char *device, *dev2, *dev3;
|
||||
int ind;
|
||||
char *stat;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: srscan.c,v 1.4 1997/10/12 21:25:19 christos Exp $ */
|
||||
/* $NetBSD: srscan.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)srscan.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: srscan.c,v 1.4 1997/10/12 21:25:19 christos Exp $");
|
||||
__RCSID("$NetBSD: srscan.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -61,7 +61,7 @@ __RCSID("$NetBSD: srscan.c,v 1.4 1997/10/12 21:25:19 christos Exp $");
|
||||
** The current quadrant is filled in on the computer chart.
|
||||
*/
|
||||
|
||||
char *Color[4] =
|
||||
const char *const Color[4] =
|
||||
{
|
||||
"GREEN",
|
||||
"DOCKED",
|
||||
@@ -75,10 +75,10 @@ int f;
|
||||
{
|
||||
int i, j;
|
||||
int statinfo;
|
||||
char *s;
|
||||
const char *s;
|
||||
int percent;
|
||||
struct quad *q = NULL;
|
||||
struct cvntab *p;
|
||||
const struct cvntab *p;
|
||||
|
||||
if (f >= 0 && check_out(SRSCAN))
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: systemname.c,v 1.4 1997/10/12 21:25:21 christos Exp $ */
|
||||
/* $NetBSD: systemname.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)systemname.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: systemname.c,v 1.4 1997/10/12 21:25:21 christos Exp $");
|
||||
__RCSID("$NetBSD: systemname.c,v 1.5 1999/07/21 13:19:11 hubertf Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -55,10 +55,10 @@ __RCSID("$NetBSD: systemname.c,v 1.4 1997/10/12 21:25:21 christos Exp $");
|
||||
** starsystems, etc.
|
||||
*/
|
||||
|
||||
char *systemname(q1)
|
||||
struct quad *q1;
|
||||
const char *systemname(q1)
|
||||
const struct quad *q1;
|
||||
{
|
||||
struct quad *q;
|
||||
const struct quad *q;
|
||||
int i;
|
||||
|
||||
q = q1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: torped.c,v 1.4 1997/10/12 21:25:22 christos Exp $ */
|
||||
/* $NetBSD: torped.c,v 1.6 2000/07/03 03:57:44 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,11 +38,12 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)torped.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: torped.c,v 1.4 1997/10/12 21:25:22 christos Exp $");
|
||||
__RCSID("$NetBSD: torped.c,v 1.6 2000/07/03 03:57:44 matt Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include "trek.h"
|
||||
#include "getpar.h"
|
||||
@@ -71,7 +72,7 @@ static int randcourse __P((int));
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
torped(v)
|
||||
int v __attribute__((unused));
|
||||
int v __attribute__((__unused__));
|
||||
{
|
||||
int ix, iy;
|
||||
double x, y, dx, dy;
|
||||
|
||||
70
trek/trek.h
70
trek/trek.h
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: trek.h,v 1.5 1997/10/12 21:25:23 christos Exp $ */
|
||||
/* $NetBSD: trek.h,v 1.8 1999/09/17 17:06:08 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -45,12 +45,6 @@
|
||||
**
|
||||
** So far as I know, nothing in here must be preinitialized to
|
||||
** zero.
|
||||
**
|
||||
** You may have problems from the loader if you move this to a
|
||||
** different machine. These things actually get allocated in each
|
||||
** source file, which UNIX allows; however, you may (on other
|
||||
** systems) have to change everything in here to be "extern" and
|
||||
** actually allocate stuff in "externs.c"
|
||||
*/
|
||||
|
||||
/* external function definitions */
|
||||
@@ -90,10 +84,10 @@ struct quad /* definition for each quadrant */
|
||||
*/
|
||||
|
||||
/* ascii names of systems */
|
||||
extern char *Systemname[NINHAB];
|
||||
extern const char *const Systemname[NINHAB];
|
||||
|
||||
/* quadrant definition */
|
||||
struct quad Quad[NQUADS][NQUADS];
|
||||
extern struct quad Quad[NQUADS][NQUADS];
|
||||
|
||||
/* defines for sector map (below) */
|
||||
# define EMPTY '.'
|
||||
@@ -106,7 +100,7 @@ struct quad Quad[NQUADS][NQUADS];
|
||||
# define HOLE ' '
|
||||
|
||||
/* current sector map */
|
||||
char Sect[NSECTS][NSECTS];
|
||||
extern char Sect[NSECTS][NSECTS];
|
||||
|
||||
|
||||
|
||||
@@ -133,11 +127,11 @@ char Sect[NSECTS][NSECTS];
|
||||
/* device names */
|
||||
struct device
|
||||
{
|
||||
char *name; /* device name */
|
||||
char *person; /* the person who fixes it */
|
||||
const char *name; /* device name */
|
||||
const char *person; /* the person who fixes it */
|
||||
};
|
||||
|
||||
struct device Device[NDEV];
|
||||
extern const struct device Device[NDEV];
|
||||
|
||||
/*************************** EVENTS ****************************/
|
||||
|
||||
@@ -177,7 +171,7 @@ struct event
|
||||
|
||||
# define MAXEVENTS 25 /* max number of concurrently pending events */
|
||||
|
||||
struct event Event[MAXEVENTS]; /* dynamic event list; one entry per pending event */
|
||||
extern struct event Event[MAXEVENTS]; /* dynamic event list; one entry per pending event */
|
||||
|
||||
/***************************** KLINGONS *******************************/
|
||||
|
||||
@@ -215,8 +209,8 @@ struct xy
|
||||
};
|
||||
|
||||
|
||||
extern struct cvntab Skitab[];
|
||||
extern struct cvntab Lentab[];
|
||||
extern const struct cvntab Skitab[];
|
||||
extern const struct cvntab Lentab[];
|
||||
|
||||
/*
|
||||
* note that much of the stuff in the following structs CAN NOT
|
||||
@@ -225,7 +219,7 @@ extern struct cvntab Lentab[];
|
||||
|
||||
|
||||
/* information regarding the state of the starship */
|
||||
struct
|
||||
struct Ship_struct
|
||||
{
|
||||
double warp; /* warp factor */
|
||||
double warp2; /* warp factor squared */
|
||||
@@ -245,15 +239,16 @@ struct
|
||||
int secty; /* sector y coord */
|
||||
unsigned char cond; /* condition code */
|
||||
char sinsbad; /* Space Inertial Navigation System condition */
|
||||
char *shipname; /* name of current starship */
|
||||
const char *shipname; /* name of current starship */
|
||||
char ship; /* current starship */
|
||||
int distressed; /* number of distress calls */
|
||||
} Ship;
|
||||
};
|
||||
extern struct Ship_struct Ship;
|
||||
|
||||
/* sinsbad is set if SINS is working but not calibrated */
|
||||
|
||||
/* game related information, mostly scoring */
|
||||
struct
|
||||
struct Game_struct
|
||||
{
|
||||
int killk; /* number of klingons killed */
|
||||
int deaths; /* number of deaths onboard Enterprise */
|
||||
@@ -269,10 +264,11 @@ struct
|
||||
char snap; /* set if snapshot taken */
|
||||
char helps; /* number of help calls */
|
||||
int captives; /* total number of captives taken */
|
||||
} Game;
|
||||
};
|
||||
extern struct Game_struct Game;
|
||||
|
||||
/* per move information */
|
||||
struct
|
||||
struct Move_struct
|
||||
{
|
||||
char free; /* set if a move is free */
|
||||
char endgame; /* end of game flag */
|
||||
@@ -280,10 +276,11 @@ struct
|
||||
char newquad; /* set if just entered this quadrant */
|
||||
char resting; /* set if this move is a rest */
|
||||
double time; /* time used this move */
|
||||
} Move;
|
||||
};
|
||||
extern struct Move_struct Move;
|
||||
|
||||
/* parametric information */
|
||||
struct
|
||||
struct Param_struct
|
||||
{
|
||||
unsigned char bases; /* number of starbases */
|
||||
char klings; /* number of klingons */
|
||||
@@ -314,12 +311,13 @@ struct
|
||||
int klingcrew; /* number of Klingons in a crew */
|
||||
double srndrprob; /* surrender probability */
|
||||
int energylow; /* low energy mark (cond YELLOW) */
|
||||
} Param;
|
||||
};
|
||||
extern struct Param_struct Param;
|
||||
|
||||
/* Sum of damage probabilities must add to 1000 */
|
||||
|
||||
/* other information kept in a snapshot */
|
||||
struct
|
||||
struct Now_struct
|
||||
{
|
||||
unsigned char bases; /* number of starbases */
|
||||
char klings; /* number of klingons */
|
||||
@@ -329,10 +327,11 @@ struct
|
||||
char distressed; /* number of currently distressed quadrants */
|
||||
struct event *eventptr[NEVENTS]; /* pointer to event structs */
|
||||
struct xy base[MAXBASES]; /* locations of starbases */
|
||||
} Now;
|
||||
};
|
||||
extern struct Now_struct Now;
|
||||
|
||||
/* Other stuff, not dumped in a snapshot */
|
||||
struct
|
||||
struct Etc_struct
|
||||
{
|
||||
struct kling klingon[MAXKLQUAD]; /* sorted Klingon list */
|
||||
short nkling; /* number of Klingons in this sector */
|
||||
@@ -341,7 +340,8 @@ struct
|
||||
struct xy starbase; /* starbase in current quadrant */
|
||||
char snapshot[sizeof Quad + sizeof Event + sizeof Now]; /* snapshot for time warp */
|
||||
char statreport; /* set to get a status report on a srscan */
|
||||
} Etc;
|
||||
};
|
||||
extern struct Etc_struct Etc;
|
||||
|
||||
/*
|
||||
* eventptr is a pointer to the event[] entry of the last
|
||||
@@ -375,7 +375,7 @@ struct
|
||||
|
||||
/* Trace info */
|
||||
# define xTRACE 1
|
||||
int Trace;
|
||||
extern int Trace;
|
||||
|
||||
/* abandon.c */
|
||||
void abandon __P((int));
|
||||
@@ -459,7 +459,7 @@ void killd __P((int, int , int));
|
||||
void klmove __P((int));
|
||||
|
||||
/* lose.c */
|
||||
void lose __P((int));
|
||||
void lose __P((int)) __attribute__((__noreturn__));
|
||||
|
||||
/* lrscan.c */
|
||||
void lrscan __P((int));
|
||||
@@ -477,8 +477,8 @@ void out __P((int));
|
||||
void phaser __P((int));
|
||||
|
||||
/* play.c */
|
||||
void myreset __P((int));
|
||||
void play __P((void));
|
||||
void myreset __P((int)) __attribute__((__noreturn__));
|
||||
void play __P((void)) __attribute__((__noreturn__));
|
||||
|
||||
/* ram.c */
|
||||
void ram __P((int, int ));
|
||||
@@ -516,7 +516,7 @@ void snova __P((int, int ));
|
||||
void srscan __P((int));
|
||||
|
||||
/* systemname.c */
|
||||
char *systemname __P((struct quad *));
|
||||
const char *systemname __P((const struct quad *));
|
||||
|
||||
/* torped.c */
|
||||
void torped __P((int));
|
||||
@@ -529,4 +529,4 @@ void dowarp __P((int));
|
||||
void warp __P((int, int, double));
|
||||
|
||||
/* win.c */
|
||||
void win __P((void));
|
||||
void win __P((void)) __attribute__((__noreturn__));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: visual.c,v 1.4 1997/10/12 21:25:26 christos Exp $ */
|
||||
/* $NetBSD: visual.c,v 1.5 1999/09/08 21:45:33 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)visual.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: visual.c,v 1.4 1997/10/12 21:25:26 christos Exp $");
|
||||
__RCSID("$NetBSD: visual.c,v 1.5 1999/09/08 21:45:33 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -74,7 +74,7 @@ struct xy Visdelta[11] =
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
visual(z)
|
||||
int z __attribute__((unused));
|
||||
int z __attribute__((__unused__));
|
||||
{
|
||||
int ix, iy;
|
||||
int co;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: warp.c,v 1.6 1998/09/11 14:28:28 hubertf Exp $ */
|
||||
/* $NetBSD: warp.c,v 1.7 2001/04/25 02:33:10 simonb Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)warp.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: warp.c,v 1.6 1998/09/11 14:28:28 hubertf Exp $");
|
||||
__RCSID("$NetBSD: warp.c,v 1.7 2001/04/25 02:33:10 simonb Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -201,7 +201,7 @@ double d;
|
||||
/* test for just a lot of damage */
|
||||
if (percent < 80)
|
||||
lose(L_TOOFAST);
|
||||
printf("Equilibrium restored -- extreme damage occured to ship systems\n");
|
||||
printf("Equilibrium restored -- extreme damage occurred to ship systems\n");
|
||||
for (i = 0; i < NDEV; i++)
|
||||
damage(i, (3.0 * (franf() + franf()) + 1.0) * Param.damfac[i]);
|
||||
Ship.shldup = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: win.c,v 1.4 1997/10/12 21:25:28 christos Exp $ */
|
||||
/* $NetBSD: win.c,v 1.6 2001/02/05 01:12:46 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)win.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: win.c,v 1.4 1997/10/12 21:25:28 christos Exp $");
|
||||
__RCSID("$NetBSD: win.c,v 1.6 2001/02/05 01:12:46 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -61,12 +61,13 @@ __RCSID("$NetBSD: win.c,v 1.4 1997/10/12 21:25:28 christos Exp $");
|
||||
** pretty off the wall.
|
||||
*/
|
||||
|
||||
extern jmp_buf env;
|
||||
|
||||
void
|
||||
win()
|
||||
{
|
||||
long s;
|
||||
struct cvntab *p = NULL;
|
||||
extern jmp_buf env;
|
||||
const struct cvntab *p = NULL;
|
||||
|
||||
sleep(1);
|
||||
printf("\nCongratulations, you have saved the Federation\n");
|
||||
|
||||
Reference in New Issue
Block a user