summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-14 19:54:47 +0000
committerjsm <jsm@NetBSD.org>1999-09-14 19:54:47 +0000
commite4082b033091bf45adfc39902ed6bba7a9759542 (patch)
tree15db98f99a616ea95085fd454624a3643b68c56a
parent3bd46c45bcef32e5f54d70344e4717e8d3b641af (diff)
downloadbsdgames-darwin-e4082b033091bf45adfc39902ed6bba7a9759542.tar.gz
bsdgames-darwin-e4082b033091bf45adfc39902ed6bba7a9759542.tar.zst
bsdgames-darwin-e4082b033091bf45adfc39902ed6bba7a9759542.zip
Declare variables in extern.h as extern, and add non-extern
declarations to globals.c.
-rw-r--r--battlestar/extern.h80
-rw-r--r--battlestar/globals.c40
2 files changed, 78 insertions, 42 deletions
diff --git a/battlestar/extern.h b/battlestar/extern.h
index 0b48dafc..eac81756 100644
--- a/battlestar/extern.h
+++ b/battlestar/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.14 1999/09/14 18:08:46 jsm Exp $ */
+/* $NetBSD: extern.h,v 1.15 1999/09/14 19:54:47 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -237,52 +237,52 @@ struct room {
};
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];
/* current input line */
#define NWORD 20 /* words per line */
-char words[NWORD][15];
-int wordvalue[NWORD];
-int wordtype[NWORD];
-int wordcount, wordnumber;
+extern char words[NWORD][15];
+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];
-char username[9];
+extern char username[9];
struct wlist {
const char *string;
@@ -292,7 +292,7 @@ struct wlist {
#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 {
diff --git a/battlestar/globals.c b/battlestar/globals.c
index 2b00f9af..97653ee3 100644
--- a/battlestar/globals.c
+++ b/battlestar/globals.c
@@ -1,4 +1,4 @@
-/* $NetBSD: globals.c,v 1.8 1999/07/14 17:42:13 hubertf Exp $ */
+/* $NetBSD: globals.c,v 1.9 1999/09/14 19:54:47 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: globals.c,v 1.8 1999/07/14 17:42:13 hubertf Exp $");
+__RCSID("$NetBSD: globals.c,v 1.9 1999/09/14 19:54:47 jsm Exp $");
#endif
#endif /* not lint */
@@ -224,3 +224,39 @@ int win = 1;
int matchcount = 20;
int followgod = -1;
int followfight = -1;
+
+struct room *location;
+
+ /* current input line */
+char words[NWORD][15];
+int wordvalue[NWORD];
+int wordtype[NWORD];
+int wordcount, wordnumber;
+
+ /* state of the game */
+int ourtime;
+int position;
+int direction;
+int left, right, ahead, back;
+int fuel, torps;
+int carrying, encumber;
+int rythmn;
+int ate;
+int snooze;
+int meetgirl;
+int godready;
+int wintime;
+int wiz;
+int tempwiz;
+int matchlight;
+int loved;
+int pleasure, power, ego;
+int notes[NUMOFNOTES];
+unsigned int inven[NUMOFWORDS];
+unsigned int wear[NUMOFWORDS];
+char beenthere[NUMOFROOMS + 1];
+char injuries[NUMOFINJURIES];
+
+char username[9];
+
+struct wlist *hashtab[HASHSIZE];