diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-09-13 01:30:35 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 1998-09-13 01:30:35 +0000 |
commit | b3888d9681fb2a06862951f70b6f5db8182b5ffe (patch) | |
tree | 876612919934f0fdcfa9d4e8cb8ffaac4936bd32 /games/battlestar/extern.h | |
parent | 59960cac708b617a25b3844645eb144553ea4562 (diff) |
NetBSD merge, numerous patches from jsm28@cam.ac.uk, spelling fixes, and
correct gid revoke.
Diffstat (limited to 'games/battlestar/extern.h')
-rw-r--r-- | games/battlestar/extern.h | 181 |
1 files changed, 96 insertions, 85 deletions
diff --git a/games/battlestar/extern.h b/games/battlestar/extern.h index ea65f0a4285..c5b976bafe8 100644 --- a/games/battlestar/extern.h +++ b/games/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.3 1997/12/16 07:54:25 angelos Exp $ */ +/* $OpenBSD: extern.h,v 1.4 1998/09/13 01:30:32 pjanzen Exp $ */ /* $NetBSD: extern.h,v 1.5 1995/04/24 12:22:18 cgd Exp $ */ /* @@ -36,38 +36,35 @@ * @(#)extern.h 8.1 (Berkeley) 5/31/93 */ -/* - * sigh -- this program thinks "time" is an int. It's easier to not load - * <time.h> than try and fix it. - */ -#define _KERNEL #include <sys/time.h> -#undef _KERNEL +#include <ctype.h> #include <err.h> #include <errno.h> #include <limits.h> +#include <pwd.h> #include <signal.h> #include <stdio.h> -#include <string.h> #include <stdlib.h> +#include <string.h> +#include <unistd.h> #define BITS (8 * sizeof (int)) #define OUTSIDE (position > 68 && position < 246 && position != 218) -#define rnd(x) (rand() % (x)) +#define rnd(x) (random() % (x)) #define max(a,b) ((a) < (b) ? (b) : (a)) #define testbit(array, index) (array[index/BITS] & (1 << (index % BITS))) #define setbit(array, index) (array[index/BITS] |= (1 << (index % BITS))) #define clearbit(array, index) (array[index/BITS] &= ~(1 << (index % BITS))) - /* well known rooms */ + /* well known rooms */ #define FINAL 275 #define GARDEN 197 #define POOLS 126 #define DOCK 93 - /* word types */ + /* word types */ #define VERB 0 #define OBJECT 1 #define NOUNS 2 @@ -75,8 +72,8 @@ #define ADJS 4 #define CONJ 5 - /* words numbers */ -#define KNIFE 0 + /* words numbers */ +#define KNIFE 0 #define SWORD 1 #define LAND 2 #define WOODSMAN 3 @@ -140,7 +137,7 @@ #define BAR 62 #define BLOCK 63 #define NUMOFOBJECTS 64 - /* non-objects below */ + /* non-objects below */ #define UP 1000 #define DOWN 1001 #define AHEAD 1002 @@ -191,11 +188,11 @@ #define RIDE 1047 #define DRIVE 1048 #define SCORE 1049 -#define BURY 1050 +#define BURY 1050 #define JUMP 1051 #define KICK 1052 - /* injuries */ + /* injuries */ #define ARM 6 /* broken arm */ #define RIBS 7 /* broken ribs */ #define SPINE 9 /* broken back */ @@ -204,16 +201,16 @@ #define NECK 12 /* broken NECK */ #define NUMOFINJURIES 13 - /* notes */ + /* notes */ #define CANTLAUNCH 0 #define LAUNCHED 1 #define CANTSEE 2 -#define CANTMOVE 3 +#define CANTMOVE 3 #define JINXED 4 #define DUG 5 #define NUMOFNOTES 6 - /* fundamental constants */ + /* fundamental constants */ #define NUMOFROOMS 275 #define NUMOFWORDS ((NUMOFOBJECTS + BITS - 1) / BITS) #define LINELENGTH 81 @@ -222,15 +219,15 @@ #define TONIGHT 1 #define CYCLE 100 - /* initial variable values */ + /* initial variable values */ #define TANKFULL 250 #define TORPEDOES 10 #define MAXWEIGHT 60 #define MAXCUMBER 10 struct room { - char *name; - int link[8]; + char *name; + int link[8]; #define north link[0] #define south link[1] #define east link[2] @@ -239,30 +236,83 @@ struct room { #define access link[5] #define down link[6] #define flyhere link[7] - char *desc; + char *desc; unsigned int objects[NUMOFWORDS]; }; extern struct room dayfile[]; extern struct room nightfile[]; struct room *location; - /* object characteristics */ -extern char *objdes[NUMOFOBJECTS]; -extern char *objsht[NUMOFOBJECTS]; -extern char *ouch[NUMOFINJURIES]; -extern int objwt[NUMOFOBJECTS]; -extern int objcumber[NUMOFOBJECTS]; + /* object characteristics */ +extern char *objdes[NUMOFOBJECTS]; +extern char *objsht[NUMOFOBJECTS]; +extern char *ouch[NUMOFINJURIES]; +extern int objwt[NUMOFOBJECTS]; +extern int objcumber[NUMOFOBJECTS]; + + /* current input line */ +#define NWORD 20 /* words per line */ +char words[NWORD][15]; +int wordvalue[NWORD]; +int wordtype[NWORD]; +int wordcount, wordnumber; + + /* state of the game */ +time_t ourtime; +int position; +int direction; +int left, right, ahead, back; +int ourclock, fuel, torps; +int carrying, encumber; +int rythmn; +extern int followfight; +int ate; +int snooze; +int meetgirl; +extern int followgod; +int godready; +extern int win; +int wintime; +int wiz; +int tempwiz; +int matchlight; +extern int matchcount; +int loved; +int pleasure, power, ego; +extern int WEIGHT; +extern int CUMBER; +int notes[NUMOFNOTES]; +unsigned int inven[NUMOFWORDS]; +unsigned int wear[NUMOFWORDS]; +char beenthere[NUMOFROOMS+1]; +char injuries[NUMOFINJURIES]; + +char uname[9]; + +struct wlist { + char *string; + int value, article; + struct wlist *next; +}; +#define HASHSIZE 256 +#define HASHMUL 81 +#define HASHMASK (HASHSIZE - 1) +struct wlist *hashtab[HASHSIZE]; +extern struct wlist wlist[]; - /* current input line */ -#define NWORD 20 /* words per line */ -char words[NWORD][15]; -int wordvalue[NWORD]; -int wordtype[NWORD]; -int wordcount, wordnumber; +struct objs { + short room; + short obj; +}; +extern struct objs dayobjs[]; +extern struct objs nightobjs[]; +void blast __P((void)); void bury __P((void)); int card __P((char *, int)); +int checkout __P((char *)); void chime __P((void)); +void convert __P((int)); void crash __P((void)); int cypher __P((void)); void die __P((int)); @@ -272,23 +322,30 @@ void drink __P((void)); int drive __P((void)); int drop __P((char *)); int eat __P((void)); +void endfly __P((void)); int fight __P((int, int)); int follow __P((void)); char *getcom __P((char *, int, char *, char *)); char *getword __P((char *, char *, int)); +void getutmp __P((char *)); int give __P((void)); +int hash __P((char *)); void initialize __P((char)); +void install __P((struct wlist *)); int jump __P((void)); void kiss __P((void)); int land __P((void)); int launch __P((void)); void light __P((void)); void live __P((void)); +struct wlist *lookup __P((char *)); void love __P((void)); int move __P((int, int)); +void moveenemy __P((int)); void murder __P((void)); void news __P((void)); void newway __P((int)); +void notarget __P((void)); void parse __P((void)); void post __P((char)); void printobjs __P((void)); @@ -299,9 +356,12 @@ void ravage __P((void)); void restore __P((void)); int ride __P((void)); void save __P((void)); +void screen __P((void)); int shoot __P((void)); +void succumb __P((int)); int take __P((unsigned int[])); int takeoff __P((void)); +void target __P((void)); int throw __P((char *)); char *truedirec __P((int, char)); int ucard __P((unsigned int *)); @@ -309,58 +369,9 @@ int use __P((void)); int visual __P((void)); int wearit __P((void)); void whichway __P((struct room)); +int wizard __P((char *)); void wordinit __P((void)); void writedes __P((void)); int zzz __P((void)); - /* state of the game */ -int btime; -int position; -int direction; -int left, right, ahead, back; -int bclock, fuel, torps; -int carrying, encumber; -int rythmn; -extern int followfight; -int ate; -int snooze; -int meetgirl; -extern int followgod; -int godready; -extern int win; -int wintime; -int wiz; -int tempwiz; -int matchlight; -extern int matchcount; -int loved; -int pleasure, power, ego; -extern int WEIGHT; -extern int CUMBER; -int notes[NUMOFNOTES]; -unsigned int inven[NUMOFWORDS]; -unsigned int wear[NUMOFWORDS]; -char beenthere[NUMOFROOMS+1]; -char injuries[NUMOFINJURIES]; - -char uname[9]; - -struct wlist { - char *string; - int value, article; - struct wlist *next; -}; -#define HASHSIZE 256 -#define HASHMUL 81 -#define HASHMASK (HASHSIZE - 1) -struct wlist *hashtab[HASHSIZE]; -extern struct wlist wlist[]; - -struct objs { - short room; - short obj; -}; -extern struct objs dayobjs[]; -extern struct objs nightobjs[]; - gid_t egid; |