source: trunk/minix/commands/advent/advent.h@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 9.1 KB
Line 
1/* header ADVENT.H *
2 * WARNING: HEADER file for all adventure modules */
3
4#ifndef EXIT_FAILURE
5#define EXIT_FAILURE 1
6#define EXIT_SUCCESS (!(EXIT_FAILURE))
7#endif
8
9#define INPUTBUFLEN 80 /* Max input line length */
10
11typedef int boolean;
12#define FALSE (0)
13#define TRUE (!FALSE)
14
15#define MAXOBJ 123 /* max # of objects in cave */
16#define MAXLOC 248 /* max # of cave locations */
17#define WORDSIZE 20 /* max # of chars in commands */
18#define MAXMSG 408 /* max # of long location descr */
19#define HNTMAX 18 /* max # of hints */
20#define HNTMIN 7 /* hints starting count */
21
22#define MAXWORDS 25
23#define MAXITEMS 45
24
25#define CLASS(word) ((word)<0 ? -((-(word)) / 1000) : (word) / 1000)
26#define VAL(word) ((word)<0 ? -((-(word)) % 1000) : (word) % 1000)
27#define MAXTRAV (23+1) /* max # of travel directions from loc */
28 /* +1 for terminator travel[x].tdest=-1 */
29#define DWARFMAX 6 /* max # of nasty dwarves */
30#define MAXDIE 3 /* max # of deaths before close */
31#define MAXTRS 79 /* max # of */
32
33#define Y2 33
34/*
35 Object definitions
36*/
37#define ANVIL 91
38#define AXE 28
39#define BATTERIES 39
40#define BEAR 35
41#define BEES 87
42#define BILLBD 116
43#define BIRD 101
44#define BOAT 48
45#define BOOK 110
46#define BOOK2 BOOK + 1
47#define BOOTH 93
48#define BOTTLE 20
49#define BRUSH 114
50#define CAGE 4
51#define CAKES 107
52#define CARVNG 115
53#define CASK 71
54#define CHAIN 64
55#define CHASM 21
56#define CHASM2 CHASM + 1
57#define CHEST 55
58#define CLAM 14
59#define CLOAK 47
60#define COINS 54
61#define CROWN 66
62#define DOG 98
63#define DOOR 41 /* giant door */
64#define DRAGON 31
65#define DWARF 17
66#define EGGS 56
67#define EMERALD 59
68#define FISSURE 12
69#define FLOWER 46
70#define FLY 69
71#define FOOD 19
72#define GNOME 105
73#define GRAIL 70
74#define GRATE 3
75#define HIVE 97
76#define HONEY 96
77#define HORN 52
78#define JEWELS 53
79#define KEYS 102
80#define KNIFE 18
81#define LAMP 2
82#define LYRE 68
83#define MAGAZINE 16
84#define MESSAGE 36
85#define MIRROR 23
86#define MUSHRM 106
87#define NUGGET 50
88#define OIL 83
89#define OIL2 OIL + 1
90#define OYSTER 15
91#define PLAGUE 125
92#define PEARL 61
93#define PHONE 94
94#define PILLOW 10
95#define PLANT 24
96#define PLANT2 PLANT + 1
97#define POLE 9
98#define POSTER 113
99#define PYRAMID 60
100#define RADIUM 119
101#define RING 72
102#define ROCKS 92
103#define ROD 5
104#define ROD2 ROD + 1
105#define RUG 62
106#define SAFE 112
107#define SAPPHIRE 69
108#define SHIELD 118
109#define SHOES 67
110#define SKEY 90
111#define SLUGS 95
112#define SNAKE 11
113#define SPHERE 120
114#define SPICES 63
115#define SPIDER 121
116#define STEPS 7
117#define STICKS 49
118#define SWORD 65
119#define TABLET 13
120#define TDOOR 42 /* tiny door */
121#define TDOOR2 TDOOR + 1 /* wrought-iron door */
122#define PDOOR TDOOR2 + 1 /* door to phone booth */
123#define TRIDENT 57
124#define TROLL 33
125#define TROLL2 TROLL + 1
126#define VASE 58
127#define VEND 38
128#define WALL 88
129#define WALL2 WALL + 1
130#define WATER 81 /* in bottle */
131#define WATER2 WATER + 1 /* in cask */
132#define WINE 85 /* in bottle */
133#define WINE2 WINE + 1 /* in cask */
134#define WUMPUS 99
135
136/*
137 Verb definitions
138*/
139#define BACK 8
140#define CAVE 67
141#define DEPRESSION 63
142#define ENTRANCE 64
143#define EXIT 11
144#define NULLX 21
145
146/*
147 Action verb definitions
148*/
149#define TAKE 1
150#define DROP 2
151#define SAY 3
152#define OPEN 4
153#define NOTHING 5
154#define CLOSE 6
155#define ON 7
156#define OFF 8
157#define WAVE 9
158#define CALM 10
159#define WALK 11
160#define KILL 12
161#define POUR 13
162#define EAT 14
163#define DRINK 15
164#define RUB 16
165#define THROW 17
166#define QUIT 18
167#define FIND 19
168#define INVENTORY 20
169#define FEED 21
170#define FILL 22
171#define BLAST 23
172#define SCORE 24
173#define FOO 25
174#define BRIEF 26
175#define READ 27
176#define BREAK 28
177#define WAKE 29
178#define SUSPEND 30
179#define RESTORE 31
180#define YANK 32
181#define WEAR 33
182#define HIT 34
183#define ANSWER 35
184#define BLOW 36
185#define LEAVE 37
186#define YELL 38
187#define DIAL 39
188#define PLAY 40
189#define PICK 41
190#define PUT 42
191#define TURN 43
192#define GET 44
193#define INSRT 45
194#define REMOVE 46
195#define BURN 47
196#define GRIPE 48
197#define LOCK 49
198#define UNLOCK 50
199#define HEALTH 51
200#define LOOK 52
201#define COMBO 53
202#define SWEEP 54
203#define TERSE 55
204#define WIZ 56
205#define MAP 57
206#define GATE 58
207#define PIRLOC 59
208
209#define GO 11
210#define SHUT 6
211#define LOG 33
212
213#define MOTION 0 /* CLASSD */
214#define NOUN 1 /* CLASSN */
215#define ACTION 2 /* CLASSA */
216#define MISC 3 /* CLASSM */
217#define PREPOSITION 4 /* CLASSP */
218#define ADJACTIVE 5 /* CLASSJ */
219#define CONJUNCTION 6 /* CLASSC */
220
221/*
222 and a few preposition. prefix PREP to distinguish them from
223 verbs or nouns
224 */
225#define PREPAT 9
226#define PREPDN 8
227#define PREPIN 1
228#define PREPFR 5
229#define PREPOF 6
230#define PREPOFF 6
231#define PREPON 2
232
233/*
234 BIT mapping of "cond" array which indicates location status
235*/
236#define LIGHT 1
237#define WATOIL 2
238#define LIQUID 4
239#define NOPIRAT 16
240
241/* Object condition bit functions */
242#define OPENBT 2
243#define LOCKBT 4
244#define BURNBT 6
245#define DEADBT 10
246#define WEARBT 12
247/*
248 Structure definitions
249*/
250struct wac {
251 char *aword;
252 int acode;
253};
254
255struct trav {
256 int tdest;
257 int tverb;
258 int tcond;
259};
260
261/* Function prototypes.
262 "#if (__STDC__)" should have been be enough,
263 but some compilers are stupid, so allow Makefile to say -DHAS_STDC=whatever.
264*/
265#if defined(HAS_STDC) ? (HAS_STDC) : (__STDC__)
266#undef HAS_STDC
267#define HAS_STDC 1
268#define _PROTOTYPE(function, params) function params
269#define _CONST const
270#else
271#define _PROTOTYPE(function, params) function ()
272#define _CONST
273#endif
274
275/* Advent.c */
276
277_PROTOTYPE(void saveadv, (char *username));
278_PROTOTYPE(void restore, (char *username));
279
280/* Initialize.c */
281
282_PROTOTYPE(void initialize, (void));
283
284/* Database.c */
285
286_PROTOTYPE(int yes, (int msg1, int msg2, int msg3));
287_PROTOTYPE(void rspeak, (int msg));
288_PROTOTYPE(void pspeak, (int item, int state));
289_PROTOTYPE(void desclg, (int loc));
290_PROTOTYPE(void descsh, (int loc));
291
292/* English.c */
293
294_PROTOTYPE(int english, (void));
295_PROTOTYPE(int analyze, (char *word, int *type, int *value));
296
297/* Itverb.c */
298
299_PROTOTYPE(void itverb, (void));
300_PROTOTYPE(void ivblast, (void));
301_PROTOTYPE(void ivlook, (void));
302
303/* Turn.c */
304
305_PROTOTYPE(void turn, (void));
306_PROTOTYPE(void describe, (void));
307_PROTOTYPE(void descitem, (void));
308_PROTOTYPE(void dwarfend, (void));
309_PROTOTYPE(void normend, (void));
310_PROTOTYPE(void score, (int));
311_PROTOTYPE(void death, (void));
312_PROTOTYPE(char *probj, (void));
313_PROTOTYPE(void trobj, (void));
314_PROTOTYPE(void dwarves, (void));
315_PROTOTYPE(void dopirate, (void));
316_PROTOTYPE(int stimer, (void));
317
318/* Verb.c */
319
320_PROTOTYPE(void trverb, (void));
321_PROTOTYPE(void vtake, (void));
322_PROTOTYPE(void vdrop, (void));
323_PROTOTYPE(void vopen, (void));
324_PROTOTYPE(void vsay, (void));
325_PROTOTYPE(void von, (void));
326_PROTOTYPE(void voff, (void));
327_PROTOTYPE(void vwave, (void));
328_PROTOTYPE(void vkill, (void));
329_PROTOTYPE(void vpour, (void));
330_PROTOTYPE(void veat, (void));
331_PROTOTYPE(void vdrink, (void));
332_PROTOTYPE(void vthrow, (void));
333_PROTOTYPE(void vfind, (void));
334_PROTOTYPE(void vfill, (void));
335_PROTOTYPE(void vfeed, (void));
336_PROTOTYPE(void vread, (void));
337_PROTOTYPE(void vbreak, (void));
338_PROTOTYPE(void vwake, (void));
339_PROTOTYPE(void actspk, (int verb));
340_PROTOTYPE(void vyank, (void));
341_PROTOTYPE(void vwear, (void));
342_PROTOTYPE(void vlock, (void));
343_PROTOTYPE(void vunlock, (void));
344_PROTOTYPE(void vclose, (void));
345
346/* Utility.c */
347
348_PROTOTYPE(boolean ajar, (int));
349_PROTOTYPE(boolean at, (int item));
350_PROTOTYPE(boolean athand, (int));
351_PROTOTYPE(void bitoff, (int, int));
352_PROTOTYPE(void biton, (int, int));
353_PROTOTYPE(boolean bitset, (long, int));
354_PROTOTYPE(boolean blind, (void));
355_PROTOTYPE(int burden, (int));
356_PROTOTYPE(void carry, (int obj, int where));
357_PROTOTYPE(int confuz, (void));
358_PROTOTYPE(boolean dark, (void));
359_PROTOTYPE(boolean dcheck, (void));
360_PROTOTYPE(boolean dead, (int));
361_PROTOTYPE(void drop, (int obj, int where));
362_PROTOTYPE(void destroy, (int obj));
363_PROTOTYPE(boolean edible, (int));
364_PROTOTYPE(boolean enclosed, (int));
365_PROTOTYPE(void extract, (int));
366_PROTOTYPE(boolean forced, (int atloc));
367_PROTOTYPE(boolean here, (int item));
368_PROTOTYPE(boolean hinged, (int));
369_PROTOTYPE(boolean holding, (int));
370_PROTOTYPE(void insert, (int, int));
371_PROTOTYPE(boolean inside, (int));
372_PROTOTYPE(void juggle, (int loc));
373_PROTOTYPE(int liq, (int));
374_PROTOTYPE(int liqloc, (int loc));
375_PROTOTYPE(int liq2, (int pbottle));
376_PROTOTYPE(boolean living, (int));
377_PROTOTYPE(boolean locked, (int));
378_PROTOTYPE(boolean locks, (int));
379_PROTOTYPE(void lookin, (int));
380_PROTOTYPE(void move, (int obj, int where));
381_PROTOTYPE(int noway, (void));
382_PROTOTYPE(boolean opaque, (int));
383_PROTOTYPE(boolean outside, (int));
384_PROTOTYPE(boolean pct, (int x));
385_PROTOTYPE(boolean plural, (int));
386_PROTOTYPE(boolean portal, (int));
387_PROTOTYPE(boolean printed, (int));
388_PROTOTYPE(int put, (int obj, int where, int pval));
389_PROTOTYPE(int ranz, (int));
390_PROTOTYPE(boolean small, (int));
391_PROTOTYPE(boolean toting, (int item));
392_PROTOTYPE(boolean treasr, (int));
393_PROTOTYPE(boolean vessel, (int));
394_PROTOTYPE(boolean wearng, (int));
395_PROTOTYPE(boolean worn, (int));
396_PROTOTYPE(void bug, (unsigned int n));
397_PROTOTYPE(char *ask, (char *prompt, char *buf, int buflen));
398_PROTOTYPE(void panic, (char *msg, boolean save));
399
400/* travel.c */
401_PROTOTYPE(void domove, (void));
402_PROTOTYPE(void gettrav, (int loc, struct trav *travel));
403
404/* vocab.c */
405_PROTOTYPE(int vocab, (char *word, int val));
Note: See TracBrowser for help on using the repository browser.