| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef BIF_INCLUDED |
| 24 |
#define BIF_INCLUDED |
| 25 |
|
| 26 |
#ifndef OS_INCLUDED |
| 27 |
# include "os.h" |
| 28 |
#endif |
| 29 |
#ifndef ERR_INCLUDED |
| 30 |
# include "err.h" |
| 31 |
#endif |
| 32 |
#ifndef RUN_INCLUDED |
| 33 |
# include "run.h" |
| 34 |
#endif |
| 35 |
#ifndef TIO_INCLUDED |
| 36 |
# include "tio.h" |
| 37 |
#endif |
| 38 |
#ifndef REGEX_H |
| 39 |
#include "regex.h" |
| 40 |
#endif |
| 41 |
|
| 42 |
#ifdef __cplusplus |
| 43 |
extern "C" { |
| 44 |
#endif |
| 45 |
|
| 46 |
|
| 47 |
struct vocidef; |
| 48 |
struct voccxdef; |
| 49 |
|
| 50 |
|
| 51 |
#define BIFFILMAX 10 |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
struct biffildef |
| 56 |
{ |
| 57 |
osfildef *fp; |
| 58 |
uint flags; |
| 59 |
#define BIFFIL_F_BINARY 0x01 |
| 60 |
}; |
| 61 |
typedef struct biffildef biffildef; |
| 62 |
|
| 63 |
|
| 64 |
struct bifcxdef |
| 65 |
{ |
| 66 |
errcxdef *bifcxerr; |
| 67 |
runcxdef *bifcxrun; |
| 68 |
tiocxdef *bifcxtio; |
| 69 |
long bifcxrnd; |
| 70 |
int bifcxseed1; |
| 71 |
int bifcxseed2; |
| 72 |
int bifcxseed3; |
| 73 |
int bifcxrndset; |
| 74 |
biffildef bifcxfile[BIFFILMAX]; |
| 75 |
int bifcxsafetyr; |
| 76 |
int bifcxsafetyw; |
| 77 |
char *bifcxsavext; |
| 78 |
struct appctxdef *bifcxappctx; |
| 79 |
re_context bifcxregex; |
| 80 |
}; |
| 81 |
typedef struct bifcxdef bifcxdef; |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
#ifdef RUNFAST |
| 95 |
# define bifcntargs(ctx, parmcnt, argcnt) |
| 96 |
# define bifchkarg(ctx, typ) |
| 97 |
#else |
| 98 |
# define bifcntargs(ctx, parmcnt, argcnt) \ |
| 99 |
(parmcnt == argcnt ? DISCARD 0 : \ |
| 100 |
(runsig(ctx->bifcxrun, ERR_BIFARGC), DISCARD 0)) |
| 101 |
# define bifchkarg(ctx, typ) \ |
| 102 |
(runtostyp(ctx->bifcxrun) == typ ? DISCARD 0 : \ |
| 103 |
(runsig(ctx->bifcxrun, ERR_INVTBIF), DISCARD 0)) |
| 104 |
#endif |
| 105 |
|
| 106 |
|
| 107 |
int bifinh(struct voccxdef *voc, struct vocidef *v, objnum cls); |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
void bifyon(bifcxdef *ctx, int argc); |
| 112 |
void bifsfs(bifcxdef *ctx, int argc); |
| 113 |
void bifrfs(bifcxdef *ctx, int argc); |
| 114 |
void bifsdm(bifcxdef *ctx, int argc); |
| 115 |
void bifrdm(bifcxdef *ctx, int argc); |
| 116 |
void bifinc(bifcxdef *ctx, int argc); |
| 117 |
void bifqui(bifcxdef *ctx, int argc); |
| 118 |
void bifsav(bifcxdef *ctx, int argc); |
| 119 |
void bifrso(bifcxdef *ctx, int argc); |
| 120 |
void biflog(bifcxdef *ctx, int argc); |
| 121 |
void bifres(bifcxdef *ctx, int argc); |
| 122 |
void bifinp(bifcxdef *ctx, int argc); |
| 123 |
void bifnfy(bifcxdef *ctx, int argc); |
| 124 |
void bifunn(bifcxdef *ctx, int argc); |
| 125 |
void biftrc(bifcxdef *ctx, int argc); |
| 126 |
void bifsay(bifcxdef *ctx, int argc); |
| 127 |
void bifcar(bifcxdef *ctx, int argc); |
| 128 |
void bifcdr(bifcxdef *ctx, int argc); |
| 129 |
void bifcap(bifcxdef *ctx, int argc); |
| 130 |
void biflen(bifcxdef *ctx, int argc); |
| 131 |
void biffnd(bifcxdef *ctx, int argc); |
| 132 |
void bifsit(bifcxdef *ctx, int argc); |
| 133 |
void bifsrn(bifcxdef *ctx, int argc); |
| 134 |
void bifrnd(bifcxdef *ctx, int argc); |
| 135 |
void bifask(bifcxdef *ctx, int argc); |
| 136 |
void bifssc(bifcxdef *ctx, int argc); |
| 137 |
void bifsub(bifcxdef *ctx, int argc); |
| 138 |
void bifcvs(bifcxdef *ctx, int argc); |
| 139 |
void bifcvn(bifcxdef *ctx, int argc); |
| 140 |
void bifupr(bifcxdef *ctx, int argc); |
| 141 |
void biflwr(bifcxdef *ctx, int argc); |
| 142 |
void biffob(bifcxdef *ctx, int argc); |
| 143 |
void bifnob(bifcxdef *ctx, int argc); |
| 144 |
void bifsvn(bifcxdef *ctx, int argc); |
| 145 |
void bifarg(bifcxdef *ctx, int argc); |
| 146 |
void biftyp(bifcxdef *ctx, int argc); |
| 147 |
void bifisc(bifcxdef *ctx, int argc); |
| 148 |
void bifund(bifcxdef *ctx, int argc); |
| 149 |
void bifdef(bifcxdef *ctx, int argc); |
| 150 |
void bifpty(bifcxdef *ctx, int argc); |
| 151 |
void bifoph(bifcxdef *ctx, int argc); |
| 152 |
void bifgfu(bifcxdef *ctx, int argc); |
| 153 |
void bifruf(bifcxdef *ctx, int argc); |
| 154 |
void bifrud(bifcxdef *ctx, int argc); |
| 155 |
void biftim(bifcxdef *ctx, int argc); |
| 156 |
void bifsct(bifcxdef *ctx, int argc); |
| 157 |
void bifink(bifcxdef *ctx, int argc); |
| 158 |
void bifwrd(bifcxdef *ctx, int argc); |
| 159 |
void bifadw(bifcxdef *ctx, int argc); |
| 160 |
void bifdlw(bifcxdef *ctx, int argc); |
| 161 |
void bifgtw(bifcxdef *ctx, int argc); |
| 162 |
void bifnoc(bifcxdef *ctx, int argc); |
| 163 |
void bifskt(bifcxdef *ctx, int argc); |
| 164 |
void bifcls(bifcxdef *ctx, int argc); |
| 165 |
void bif1sc(bifcxdef *ctx, int argc); |
| 166 |
void bifvin(bifcxdef *ctx, int argc); |
| 167 |
void bifcapture(bifcxdef *ctx, int argc); |
| 168 |
|
| 169 |
void biffopen(bifcxdef *ctx, int argc); |
| 170 |
void biffclose(bifcxdef *ctx, int argc); |
| 171 |
void biffwrite(bifcxdef *ctx, int argc); |
| 172 |
void biffread(bifcxdef *ctx, int argc); |
| 173 |
void biffseek(bifcxdef *ctx, int argc); |
| 174 |
void biffseekeof(bifcxdef *ctx, int argc); |
| 175 |
void bifftell(bifcxdef *ctx, int argc); |
| 176 |
|
| 177 |
void bifsysinfo(bifcxdef *ctx, int argc); |
| 178 |
void bifmore(bifcxdef *ctx, int argc); |
| 179 |
void bifsetme(bifcxdef *ctx, int argc); |
| 180 |
void bifgetme(bifcxdef *ctx, int argc); |
| 181 |
|
| 182 |
void bifresearch(bifcxdef *ctx, int argc); |
| 183 |
void bifregroup(bifcxdef *ctx, int argc); |
| 184 |
|
| 185 |
void bifinpevt(bifcxdef *ctx, int argc); |
| 186 |
void bifdelay(bifcxdef *ctx, int argc); |
| 187 |
|
| 188 |
void bifsetoutfilter(bifcxdef *ctx, int argc); |
| 189 |
void bifexec(bifcxdef *ctx, int argc); |
| 190 |
void bifgetobj(bifcxdef *ctx, int argc); |
| 191 |
void bifparsenl(bifcxdef *ctx, int argc); |
| 192 |
void bifprstok(bifcxdef *ctx, int argc); |
| 193 |
void bifprstoktyp(bifcxdef *ctx, int argc); |
| 194 |
void bifprsdict(bifcxdef *ctx, int argc); |
| 195 |
void bifprsrslv(bifcxdef *ctx, int argc); |
| 196 |
void bifprsrplcmd(bifcxdef *ctx, int argc); |
| 197 |
void bifexitobj(bifcxdef *ctx, int argc); |
| 198 |
void bifinpdlg(bifcxdef *ctx, int argc); |
| 199 |
void bifresexists(bifcxdef *ctx, int argc); |
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
void bifgrp(bifcxdef *ctx, int argc); |
| 206 |
void bifgsp(bifcxdef *ctx, int argc); |
| 207 |
void bifgsh(bifcxdef *ctx, int argc); |
| 208 |
void bifgin(bifcxdef *ctx, int argc); |
| 209 |
void bifgco(bifcxdef *ctx, int argc); |
| 210 |
void bifgov(bifcxdef *ctx, int argc); |
| 211 |
void bifgmd(bifcxdef *ctx, int argc); |
| 212 |
void bifgmu(bifcxdef *ctx, int argc); |
| 213 |
void bifgpa(bifcxdef *ctx, int argc); |
| 214 |
void bifgef(bifcxdef *ctx, int argc); |
| 215 |
void bifgsn(bifcxdef *ctx, int argc); |
| 216 |
|
| 217 |
#ifdef __cplusplus |
| 218 |
} |
| 219 |
#endif |
| 220 |
|
| 221 |
#endif |