projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Guard against nasty surprises when building with -DESERGEEV off.
[super-star-trek.git]
/
sst.c
diff --git
a/sst.c
b/sst.c
index 07b7da5cef805bca47a59a279237eee70611f9c1..9e48a03c7d3f05c3c5e223644b544c877c0b0d89 100644
(file)
--- a/
sst.c
+++ b/
sst.c
@@
-10,8
+10,6
@@
#define SSTDOC "sst.doc"
#endif
#define SSTDOC "sst.doc"
#endif
-static char line[128], *linep = line;
-
/*
Here are Tom Almy's changes:
/*
Here are Tom Almy's changes:
@@
-94,6
+92,9
@@
Eric Raymond's changes:
*/
*/
+/* the input queue */
+static char line[128], *linep = line;
+
static struct
{
char *name;
static struct
{
char *name;
@@
-102,74
+103,77
@@
static struct
commands[] = {
#define SRSCAN 1
{"SRSCAN", SRSCAN},
commands[] = {
#define SRSCAN 1
{"SRSCAN", SRSCAN},
- {"STATUS", SRSCAN},
-#define LRSCAN 2
+#define STATUS 2
+ {"STATUS", STATUS},
+#define REQUEST 3
+ {"REQUEST", REQUEST},
+#define LRSCAN 4
{"LRSCAN", LRSCAN},
{"LRSCAN", LRSCAN},
-#define PHASERS
3
+#define PHASERS
5
{"PHASERS", PHASERS},
{"PHASERS", PHASERS},
-#define TORPEDO
4
+#define TORPEDO
6
{"TORPEDO", TORPEDO},
{"PHOTONS", TORPEDO},
{"TORPEDO", TORPEDO},
{"PHOTONS", TORPEDO},
-#define MOVE
5
+#define MOVE
7
{"MOVE", MOVE},
{"MOVE", MOVE},
-#define SHIELDS
6
+#define SHIELDS
8
{"SHIELDS", SHIELDS},
{"SHIELDS", SHIELDS},
-#define DOCK
7
+#define DOCK
9
{"DOCK", DOCK},
{"DOCK", DOCK},
-#define DAMAGES
8
+#define DAMAGES
10
{"DAMAGES", DAMAGES},
{"DAMAGES", DAMAGES},
-#define CHART
9
+#define CHART
11
{"CHART", CHART},
{"CHART", CHART},
-#define IMPULSE 1
0
+#define IMPULSE 1
2
{"IMPULSE", IMPULSE},
{"IMPULSE", IMPULSE},
-#define REST 1
1
+#define REST 1
3
{"REST", REST},
{"REST", REST},
-#define WARP 1
2
+#define WARP 1
4
{"WARP", WARP},
{"WARP", WARP},
-#define SCORE 1
3
+#define SCORE 1
5
{"SCORE", SCORE},
{"SCORE", SCORE},
-#define SENSORS 1
4
+#define SENSORS 1
6
{"SENSORS", SENSORS},
{"SENSORS", SENSORS},
-#define ORBIT 1
5
+#define ORBIT 1
7
{"ORBIT", ORBIT},
{"ORBIT", ORBIT},
-#define TRANSPORT 1
6
+#define TRANSPORT 1
8
{"TRANSPORT", TRANSPORT},
{"TRANSPORT", TRANSPORT},
-#define MINE 1
7
+#define MINE 1
9
{"MINE", MINE},
{"MINE", MINE},
-#define CRYSTALS
18
+#define CRYSTALS
20
{"CRYSTALS", CRYSTALS},
{"CRYSTALS", CRYSTALS},
-#define SHUTTLE
19
+#define SHUTTLE
21
{"SHUTTLE", SHUTTLE},
{"SHUTTLE", SHUTTLE},
-#define PLANETS 2
0
+#define PLANETS 2
2
{"PLANETS", PLANETS},
{"PLANETS", PLANETS},
-#define REPORT 2
1
+#define REPORT 2
3
{"REPORT", REPORT},
{"REPORT", REPORT},
-#define COMPUTER 2
3
+#define COMPUTER 2
4
{"COMPUTER", COMPUTER},
{"COMPUTER", COMPUTER},
-#define COMMANDS 2
4
+#define COMMANDS 2
5
{"COMMANDS", COMMANDS},
{"COMMANDS", COMMANDS},
-#define EMEXIT 2
5
+#define EMEXIT 2
6
{"EMEXIT", EMEXIT},
{"EMEXIT", EMEXIT},
-#define PROBE 2
6
+#define PROBE 2
7
{"PROBE", PROBE},
{"PROBE", PROBE},
-#define SAVE 2
7
+#define SAVE 2
8
{"SAVE", SAVE},
{"FREEZE", SAVE},
{"SAVE", SAVE},
{"FREEZE", SAVE},
-#define ABANDON 2
8
+#define ABANDON 2
9
{"ABANDON", ABANDON},
{"ABANDON", ABANDON},
-#define DESTRUCT
29
+#define DESTRUCT
30
{"DESTRUCT", DESTRUCT},
{"DESTRUCT", DESTRUCT},
-#define DEATHRAY
30
+#define DEATHRAY
31
{"DEATHRAY", DEATHRAY},
{"DEATHRAY", DEATHRAY},
-#define DEBUGCMD 3
1
+#define DEBUGCMD 3
2
{"DEBUG", DEBUGCMD},
{"DEBUG", DEBUGCMD},
-#define MAYDAY 3
2
+#define MAYDAY 3
3
{"MAYDAY", MAYDAY},
{"SOS", MAYDAY},
{"CALL", MAYDAY},
{"MAYDAY", MAYDAY},
{"SOS", MAYDAY},
{"CALL", MAYDAY},
-#define QUIT 3
3
+#define QUIT 3
4
{"QUIT", QUIT},
{"QUIT", QUIT},
-#define HELP 3
4
+#define HELP 3
5
{"HELP", HELP},
};
{"HELP", HELP},
};
@@
-261,6
+265,10
@@
static void helpme(void) {
fclose(fp);
}
fclose(fp);
}
+void enqueue(char *s) {
+ strcpy(line, s);
+}
+
static void makemoves(void) {
int i, hitme;
clrscr();
static void makemoves(void) {
int i, hitme;
clrscr();
@@
-302,8
+310,14
@@
static void makemoves(void) {
commandhook(commands[i].name, TRUE);
switch (i) { /* command switch */
case SRSCAN: // srscan
commandhook(commands[i].name, TRUE);
switch (i) { /* command switch */
case SRSCAN: // srscan
- srscan(
1
);
+ srscan(
SCAN_FULL
);
break;
break;
+ case STATUS: // status
+ srscan(SCAN_STATUS);
+ break;
+ case REQUEST: // status request
+ srscan(SCAN_REQUEST);
+ break;
case LRSCAN: // lrscan
lrscan();
break;
case LRSCAN: // lrscan
lrscan();
break;