forked from videogamepreservation/zork
-
Notifications
You must be signed in to change notification settings - Fork 11
/
funcs.h
135 lines (123 loc) · 3.28 KB
/
funcs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/* funcs.h -- functions for dungeon */
#ifndef FUNCS_H
#define FUNCS_H
/* If __STDC__ is not defined, don't use function prototypes, void, or
* const.
*/
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#define void int
#define const
#endif
/* Try to guess whether we need "rb" to open files in binary mode.
* If this is unix, it doesn't matter. Otherwise, assume that if
* __STDC__ is defined we can use "rb". Otherwise, assume that we
* had better use "r" or fopen will fail.
*/
#ifdef unix
#define BINREAD "r"
#define BINWRITE "w"
#else /* ! unix */
#ifdef __STDC__
#define BINREAD "rb"
#define BINWRITE "wb"
#else /* ! __STDC__ */
#define BINREAD "r"
#define BINWRITE "w"
#endif /* ! __STDC__ */
#endif /* ! unix */
typedef int integer;
typedef int logical;
#define TRUE_ (1)
#define FALSE_ (0)
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
extern logical
protected P((void)),
wizard P((void));
extern void
more_init P((void)),
more_output P((const char *)),
more_input P((void));
extern void
bug_ P((integer, integer)),
cevapp_ P((integer)),
cpgoto_ P((integer)),
cpinfo_ P((integer, integer)),
encryp_ P((const char *, char *)),
exit_ P((void)),
fightd_ P((void)),
game_ P((void)),
gdt_ P((void)),
gttime_ P((integer *)),
invent_ P((integer)),
itime_ P((integer *, integer *, integer *)),
jigsup_ P((integer)),
newsta_ P((integer, integer, integer, integer, integer)),
orphan_ P((integer, integer, integer, integer, integer)),
princo_ P((integer, integer)),
princr_ P((logical, integer)),
rdline_ P((char *, integer)),
rspeak_ P((integer)),
rspsb2_ P((integer, integer, integer)),
rspsub_ P((integer, integer)),
rstrgm_ P((void)),
savegm_ P((void)),
score_ P((logical)),
scrupd_ P((integer)),
swordd_ P((void)),
thiefd_ P((void)),
valuac_ P((integer));
extern integer
blow_ P((integer, integer, integer, logical, integer)),
fights_ P((integer, logical)),
fwim_ P((integer, integer, integer, integer, integer, logical)),
getobj_ P((integer, integer, integer)),
schlst_ P((integer, integer, integer, integer, integer, integer)),
mrhere_ P((integer)),
oactor_ P((integer)),
rnd_ P((integer)),
robadv_ P((integer, integer, integer, integer)),
robrm_ P((integer, integer, integer, integer, integer)),
sparse_ P((const integer *, integer, logical)),
vilstr_ P((integer)),
weight_ P((integer, integer, integer));
extern logical
aappli_ P((integer)),
ballop_ P((integer)),
clockd_ P((void)),
cyclop_ P((integer)),
drop_ P((logical)),
findxt_ P((integer, integer)),
ghere_ P((integer, integer)),
init_ P((void)),
lightp_ P((integer)),
lit_ P((integer)),
moveto_ P((integer, integer)),
nobjs_ P((integer, integer)),
oappli_ P((integer, integer)),
objact_ P((void)),
opncls_ P((integer, integer, integer)),
parse_ P((char *, logical)),
prob_ P((integer, integer)),
put_ P((logical)),
rappli_ P((integer)),
rappl1_ P((integer)),
rappl2_ P((integer)),
rmdesc_ P((integer)),
sobjs_ P((integer, integer)),
sverbs_ P((integer)),
synmch_ P((void)),
take_ P((logical)),
thiefp_ P((integer)),
trollp_ P((integer)),
qempty_ P((integer)),
qhere_ P((integer, integer)),
vappli_ P((integer)),
walk_ P((void)),
winnin_ P((integer, integer)),
yesno_ P((integer, integer, integer));
#endif