-/* $NetBSD: extern.h,v 1.14 1999/09/14 18:08:46 jsm Exp $ */
+/* $NetBSD: extern.h,v 1.23 2000/09/24 09:44:28 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
#define BURY 1050
#define JUMP 1051
#define KICK 1052
+#define OPEN 1053
+#define VERBOSE 1054
+#define BRIEF 1055
/* injuries */
#define ARM 6 /* broken arm */
#define DUG 5
#define NUMOFNOTES 6
+/* Number of times room description shown. */
+#define ROOMDESC 3
+
/* fundamental constants */
#define NUMOFROOMS 275
#define NUMOFWORDS ((NUMOFOBJECTS + BITS - 1) / BITS)
#define MAXWEIGHT 60
#define MAXCUMBER 10
+/* Flags for objects. */
+#define OBJ_PLURAL 1
+
struct room {
const char *name;
int link[8];
};
extern struct room dayfile[];
extern struct room nightfile[];
-struct room *location;
+extern struct room *location;
/* object characteristics */
-const char *const objdes[NUMOFOBJECTS];
-const char *const objsht[NUMOFOBJECTS];
-const char *const ouch[NUMOFINJURIES];
-const int objwt[NUMOFOBJECTS];
-const int objcumber[NUMOFOBJECTS];
+extern const char *const objdes[NUMOFOBJECTS];
+extern const char *const objsht[NUMOFOBJECTS];
+extern const char *const ouch[NUMOFINJURIES];
+extern const int objwt[NUMOFOBJECTS];
+extern const int objcumber[NUMOFOBJECTS];
+extern const int objflags[NUMOFOBJECTS];
+#define is_plural_object(n) (objflags[(n)] & OBJ_PLURAL)
/* current input line */
+#define WORDLEN 15
#define NWORD 20 /* words per line */
-char words[NWORD][15];
-int wordvalue[NWORD];
-int wordtype[NWORD];
-int wordcount, wordnumber;
+extern char words[NWORD][WORDLEN];
+extern int wordvalue[NWORD];
+extern int wordtype[NWORD];
+extern int wordcount, wordnumber;
/* state of the game */
-int ourtime;
-int position;
-int direction;
-int left, right, ahead, back;
-int ourclock, fuel, torps;
-int carrying, encumber;
-int rythmn;
-int followfight;
-int ate;
-int snooze;
-int meetgirl;
-int followgod;
-int godready;
-int win;
-int wintime;
-int wiz;
-int tempwiz;
-int matchlight, matchcount;
-int loved;
-int pleasure, power, ego;
-int WEIGHT;
-int CUMBER;
-int notes[NUMOFNOTES];
-unsigned int inven[NUMOFWORDS];
-unsigned int wear[NUMOFWORDS];
-char beenthere[NUMOFROOMS + 1];
-char injuries[NUMOFINJURIES];
+extern int ourtime;
+extern int position;
+extern int direction;
+extern int left, right, ahead, back;
+extern int ourclock, fuel, torps;
+extern int carrying, encumber;
+extern int rythmn;
+extern int followfight;
+extern int ate;
+extern int snooze;
+extern int meetgirl;
+extern int followgod;
+extern int godready;
+extern int win;
+extern int wintime;
+extern int wiz;
+extern int tempwiz;
+extern int matchlight, matchcount;
+extern int loved;
+extern int pleasure, power, ego;
+extern int WEIGHT;
+extern int CUMBER;
+extern int notes[NUMOFNOTES];
+extern unsigned int inven[NUMOFWORDS];
+extern unsigned int wear[NUMOFWORDS];
+extern char beenthere[NUMOFROOMS + 1];
+extern char injuries[NUMOFINJURIES];
+extern int verbose;
-char username[9];
+extern const char *username;
struct wlist {
const char *string;
#define HASHSIZE 256
#define HASHMUL 81
#define HASHMASK (HASHSIZE - 1)
-struct wlist *hashtab[HASHSIZE];
+extern struct wlist *hashtab[HASHSIZE];
extern struct wlist wlist[];
struct objs {
#define DEFAULT_SAVE_FILE ".Bstar"
-void blast __P((void));
void bury __P((void));
int card __P((const char *, int));
-int checkout __P((const char *));
void chime __P((void));
void convert __P((int));
void crash __P((void));
void die __P((void)) __attribute__((__noreturn__));
void diesig __P((int)) __attribute__((__noreturn__));
void dig __P((void));
+void dooropen __P((void));
int draw __P((void));
void drink __P((void));
int drive __P((void));
int drop __P((const char *));
int eat __P((void));
-void endfly __P((void));
int fight __P((int, int));
int follow __P((void));
-void getutmp __P((char *));
+char *getcom __P((char *, int, const char *, const char *));
+char *getword __P((char *, char *, int));
int give __P((void));
int hash __P((const char *));
void initialize __P((const char *));
int launch __P((void));
void light __P((void));
void live __P((void)) __attribute__((__noreturn__));
+struct wlist *lookup __P((const char *));
void love __P((void));
-int move __P((int, int));
-void moveenemy __P((int));
+int moveplayer __P((int, int));
void murder __P((void));
void news __P((void));
void newway __P((int));
-void notarget __P((void));
void open_score_file __P((void));
void parse __P((void));
void post __P((char));
void printobjs __P((void));
int put __P((void));
int puton __P((void));
+const char *rate __P((void));
void ravage __P((void));
void restore __P((const char *));
int ride __P((void));
void save __P((const char *));
char *save_file_name __P((const char *, size_t));
-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((const char *));
+const char *truedirec __P((int, char));
int ucard __P((const unsigned int *));
int use __P((void));
int visual __P((void));
int wearit __P((void));
void whichway __P((struct room));
-int wizard __P((const char *));
void wordinit __P((void));
void writedes __P((void));
int zzz __P((void));
-char *getcom __P((char *, int, const char *, const char *));
-char *getword __P((char *, char *, int));
-const char *rate __P((void));
-const char *truedirec __P((int, char));
-struct wlist *lookup __P((const char *));