2
$Header: d:/cvsroot/tads/TADS2/BIF.H,v 1.3 1999/07/11 00:46:29 MJRoberts Exp $
6
* Copyright (c) 1991, 2002 Michael J. Roberts. All Rights Reserved.
8
* Please see the accompanying license file, LICENSE.TXT, for information
9
* on using and copying this software.
13
bif.h - built-in functions interface
15
interface to run-time intrinsic function implementation
19
12/16/92 MJRoberts - add TADS/Graphic functions
20
12/26/91 MJRoberts - creation
46
/* forward definitions */
50
/* maximum number of file handles available */
54
/* file contexts for the built-in file handling functions */
57
osfildef *fp; /* underyling system file handle */
58
uint flags; /* flags */
59
#define BIFFIL_F_BINARY 0x01 /* file is binary */
61
typedef struct biffildef biffildef;
63
/* built-in execution context */
66
errcxdef *bifcxerr; /* error-handling context */
67
runcxdef *bifcxrun; /* code execution context */
68
tiocxdef *bifcxtio; /* text I/O context */
69
long bifcxrnd; /* random number seed */
70
int bifcxseed1; /* first seed for new generator */
71
int bifcxseed2; /* second seed for new generator */
72
int bifcxseed3; /* third seed for new generator */
73
int bifcxrndset; /* randomize() has been called */
74
biffildef bifcxfile[BIFFILMAX]; /* file handles for fopen, etc */
75
uint bifcxsafety; /* file I/O safety level */
76
char *bifcxsavext; /* saved game extension (null by default) */
77
struct appctxdef *bifcxappctx; /* host application context */
78
re_context bifcxregex; /* regular expression searching context */
80
typedef struct bifcxdef bifcxdef;
83
* argument list checking routines - can be disabled for faster
87
/* check for proper number of arguments */
88
/* void bifcntargs(bifcxdef *ctx, int argcnt) */
90
/* check that next argument has proper type */
91
/* void bifchkarg(bifcxdef *ctx, dattyp typ); */
94
# define bifcntargs(ctx, parmcnt, argcnt)
95
# define bifchkarg(ctx, typ)
97
# define bifcntargs(ctx, parmcnt, argcnt) \
98
(parmcnt == argcnt ? DISCARD 0 : \
99
(runsig(ctx->bifcxrun, ERR_BIFARGC), DISCARD 0))
100
# define bifchkarg(ctx, typ) \
101
(runtostyp(ctx->bifcxrun) == typ ? DISCARD 0 : \
102
(runsig(ctx->bifcxrun, ERR_INVTBIF), DISCARD 0))
105
/* determine if one object is a subclass of another */
106
int bifinh(struct voccxdef *voc, struct vocidef *v, objnum cls);
109
/* enumerate the built-in functions */
110
void bifyon(bifcxdef *ctx, int argc); /* yorn - yes or no */
111
void bifsfs(bifcxdef *ctx, int argc); /* setfuse */
112
void bifrfs(bifcxdef *ctx, int argc); /* remfuse */
113
void bifsdm(bifcxdef *ctx, int argc); /* setdaemon */
114
void bifrdm(bifcxdef *ctx, int argc); /* remdaemon */
115
void bifinc(bifcxdef *ctx, int argc); /* incturn */
116
void bifqui(bifcxdef *ctx, int argc); /* quit */
117
void bifsav(bifcxdef *ctx, int argc); /* save */
118
void bifrso(bifcxdef *ctx, int argc); /* restore */
119
void biflog(bifcxdef *ctx, int argc); /* logging */
120
void bifres(bifcxdef *ctx, int argc); /* restart */
121
void bifinp(bifcxdef *ctx, int argc); /* input - get line from kb */
122
void bifnfy(bifcxdef *ctx, int argc); /* notify */
123
void bifunn(bifcxdef *ctx, int argc); /* unnotify */
124
void biftrc(bifcxdef *ctx, int argc); /* trace on/off */
125
void bifsay(bifcxdef *ctx, int argc); /* say */
126
void bifcar(bifcxdef *ctx, int argc); /* car */
127
void bifcdr(bifcxdef *ctx, int argc); /* cdr */
128
void bifcap(bifcxdef *ctx, int argc); /* caps */
129
void biflen(bifcxdef *ctx, int argc); /* length */
130
void biffnd(bifcxdef *ctx, int argc); /* find */
131
void bifsit(bifcxdef *ctx, int argc); /* setit - set current 'it' */
132
void bifsrn(bifcxdef *ctx, int argc); /* randomize: seed rand */
133
void bifrnd(bifcxdef *ctx, int argc); /* rand - get a random number */
134
void bifask(bifcxdef *ctx, int argc); /* askfile */
135
void bifssc(bifcxdef *ctx, int argc); /* setscore */
136
void bifsub(bifcxdef *ctx, int argc); /* substr */
137
void bifcvs(bifcxdef *ctx, int argc); /* cvtstr: convert to string */
138
void bifcvn(bifcxdef *ctx, int argc); /* cvtnum: convert to number */
139
void bifupr(bifcxdef *ctx, int argc); /* upper */
140
void biflwr(bifcxdef *ctx, int argc); /* lower */
141
void biffob(bifcxdef *ctx, int argc); /* firstobj */
142
void bifnob(bifcxdef *ctx, int argc); /* nextobj */
143
void bifsvn(bifcxdef *ctx, int argc); /* setversion */
144
void bifarg(bifcxdef *ctx, int argc); /* getarg */
145
void biftyp(bifcxdef *ctx, int argc); /* datatype */
146
void bifisc(bifcxdef *ctx, int argc); /* isclass */
147
void bifund(bifcxdef *ctx, int argc); /* undo */
148
void bifdef(bifcxdef *ctx, int argc); /* defined */
149
void bifpty(bifcxdef *ctx, int argc); /* proptype */
150
void bifoph(bifcxdef *ctx, int argc); /* outhide */
151
void bifgfu(bifcxdef *ctx, int argc); /* getfuse */
152
void bifruf(bifcxdef *ctx, int argc); /* runfuses */
153
void bifrud(bifcxdef *ctx, int argc); /* rundaemons */
154
void biftim(bifcxdef *ctx, int argc); /* gettime */
155
void bifsct(bifcxdef *ctx, int argc); /* intersect */
156
void bifink(bifcxdef *ctx, int argc); /* inputkey */
157
void bifwrd(bifcxdef *ctx, int argc); /* objwords */
158
void bifadw(bifcxdef *ctx, int argc); /* addword */
159
void bifdlw(bifcxdef *ctx, int argc); /* delword */
160
void bifgtw(bifcxdef *ctx, int argc); /* getwords */
161
void bifnoc(bifcxdef *ctx, int argc); /* nocaps */
162
void bifskt(bifcxdef *ctx, int argc); /* skipturn */
163
void bifcls(bifcxdef *ctx, int argc); /* clearscreen */
164
void bif1sc(bifcxdef *ctx, int argc); /* firstsc */
165
void bifvin(bifcxdef *ctx, int argc); /* verbinfo */
166
void bifcapture(bifcxdef *ctx, int argc); /* outcapture */
168
void biffopen(bifcxdef *ctx, int argc); /* fopen */
169
void biffclose(bifcxdef *ctx, int argc); /* fclose */
170
void biffwrite(bifcxdef *ctx, int argc); /* fwrite */
171
void biffread(bifcxdef *ctx, int argc); /* fread */
172
void biffseek(bifcxdef *ctx, int argc); /* fseek */
173
void biffseekeof(bifcxdef *ctx, int argc); /* fseekeof */
174
void bifftell(bifcxdef *ctx, int argc); /* ftell */
176
void bifsysinfo(bifcxdef *ctx, int argc); /* systemInfo */
177
void bifmore(bifcxdef *ctx, int argc); /* morePrompt */
178
void bifsetme(bifcxdef *ctx, int argc); /* parserSetMe */
179
void bifgetme(bifcxdef *ctx, int argc); /* parserGetMe */
181
void bifresearch(bifcxdef *ctx, int argc); /* reSearch */
182
void bifregroup(bifcxdef *ctx, int argc); /* reGetGroup */
184
void bifinpevt(bifcxdef *ctx, int argc); /* inputevent */
185
void bifdelay(bifcxdef *ctx, int argc); /* timeDelay */
187
void bifsetoutfilter(bifcxdef *ctx, int argc); /* setOutputFilter */
188
void bifexec(bifcxdef *ctx, int argc); /* execCommand */
189
void bifgetobj(bifcxdef *ctx, int argc); /* parserGetObj */
190
void bifparsenl(bifcxdef *ctx, int argc); /* parserParseNounList */
191
void bifprstok(bifcxdef *ctx, int argc); /* parserTokenize */
192
void bifprstoktyp(bifcxdef *ctx, int argc); /* parserGetTokTypes */
193
void bifprsdict(bifcxdef *ctx, int argc); /* parserDictLookup */
194
void bifprsrslv(bifcxdef *ctx, int argc); /* parserResolveObjects */
195
void bifprsrplcmd(bifcxdef *ctx, int argc); /* parserReplaceCommand */
196
void bifexitobj(bifcxdef *ctx, int argc); /* exitobj */
197
void bifinpdlg(bifcxdef *ctx, int argc); /* inputdialog */
198
void bifresexists(bifcxdef *ctx, int argc); /* resourceExists */
201
* TADS/graphic functions - these are present in the text system, but
204
void bifgrp(bifcxdef *ctx, int argc); /* g_readpic: read picture */
205
void bifgsp(bifcxdef *ctx, int argc); /* g_showpic: show picture */
206
void bifgsh(bifcxdef *ctx, int argc); /* g_sethot: set hot list */
207
void bifgin(bifcxdef *ctx, int argc); /* g_inventory */
208
void bifgco(bifcxdef *ctx, int argc); /* g_compass */
209
void bifgov(bifcxdef *ctx, int argc); /* g_overlay */
210
void bifgmd(bifcxdef *ctx, int argc); /* g_mode */
211
void bifgmu(bifcxdef *ctx, int argc); /* g_music */
212
void bifgpa(bifcxdef *ctx, int argc); /* g_pause */
213
void bifgef(bifcxdef *ctx, int argc); /* g_effect */
214
void bifgsn(bifcxdef *ctx, int argc); /* g_sound */
220
#endif /* BIF_INCLUDED */