1 /* $Header: a2p.h,v 1.0.1.1 88/01/26 09:52:30 root Exp $
4 * Revision 1.0.1.1 88/01/26 09:52:30 root
5 * patch 5: a2p didn't use config.h.
7 * Revision 1.0 87/12/18 13:06:58 root
13 #include "../config.h"
16 # define bcopy(s1,s2,l) memcpy(s2,s1,l);
17 # define bzero(s,l) memset(s,0,l);
168 extern char *opname[];
174 } ops[50000]; /* hope they have 200k to spare */
183 #include <sys/types.h>
184 #include <sys/stat.h>
186 #include <sys/times.h>
188 typedef struct string STR;
189 typedef struct htbl HASH;
194 /* A string is TRUE if not "" or "0". */
195 #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
196 EXT char *Yes INIT("1");
197 EXT char *No INIT("");
199 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
201 #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
202 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
203 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
206 #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
215 EXT int line INIT(0);
219 EXT char *bufptr INIT(buf);
221 EXT STR *linestr INIT(Nullstr);
223 EXT char tokenbuf[256];
224 EXT int expectterm INIT(TRUE);
227 EXT int debug INIT(0);
228 EXT int dlevel INIT(0);
233 EXT STR *freestrroot INIT(Nullstr);
238 EXT bool do_split INIT(FALSE);
239 EXT bool split_to_array INIT(FALSE);
240 EXT bool set_array_base INIT(FALSE);
241 EXT bool saw_RS INIT(FALSE);
242 EXT bool saw_OFS INIT(FALSE);
243 EXT bool saw_ORS INIT(FALSE);
244 EXT bool saw_line_op INIT(FALSE);
245 EXT bool in_begin INIT(TRUE);
246 EXT bool do_opens INIT(FALSE);
247 EXT bool do_fancy_opens INIT(FALSE);
248 EXT bool lval_field INIT(FALSE);
249 EXT bool do_chop INIT(FALSE);
250 EXT bool need_entire INIT(FALSE);
251 EXT bool absmaxfld INIT(FALSE);
253 EXT char const_FS INIT(0);
254 EXT char *namelist INIT(Nullch);
255 EXT char fswitch INIT(0);
257 EXT int saw_FS INIT(0);
258 EXT int maxfld INIT(0);
259 EXT int arymax INIT(0);