1 /* $Header: a2p.h,v 2.0 88/06/05 00:15:33 root Exp $
4 * Revision 2.0 88/06/05 00:15:33 root
5 * Baseline version 2.0.
10 #include "../config.h"
13 # define bcopy(s1,s2,l) memcpy(s2,s1,l);
14 # define bzero(s,l) memset(s,0,l);
165 extern char *opname[];
171 } ops[50000]; /* hope they have 200k to spare */
180 typedef struct string STR;
181 typedef struct htbl HASH;
186 /* A string is TRUE if not "" or "0". */
187 #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
188 EXT char *Yes INIT("1");
189 EXT char *No INIT("");
191 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
193 #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
194 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
195 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
198 #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
207 EXT int line INIT(0);
211 EXT char *bufptr INIT(buf);
213 EXT STR *linestr INIT(Nullstr);
215 EXT char tokenbuf[256];
216 EXT int expectterm INIT(TRUE);
219 EXT int debug INIT(0);
220 EXT int dlevel INIT(0);
225 EXT STR *freestrroot INIT(Nullstr);
230 EXT bool do_split INIT(FALSE);
231 EXT bool split_to_array INIT(FALSE);
232 EXT bool set_array_base INIT(FALSE);
233 EXT bool saw_RS INIT(FALSE);
234 EXT bool saw_OFS INIT(FALSE);
235 EXT bool saw_ORS INIT(FALSE);
236 EXT bool saw_line_op INIT(FALSE);
237 EXT bool in_begin INIT(TRUE);
238 EXT bool do_opens INIT(FALSE);
239 EXT bool do_fancy_opens INIT(FALSE);
240 EXT bool lval_field INIT(FALSE);
241 EXT bool do_chop INIT(FALSE);
242 EXT bool need_entire INIT(FALSE);
243 EXT bool absmaxfld INIT(FALSE);
245 EXT char const_FS INIT(0);
246 EXT char *namelist INIT(Nullch);
247 EXT char fswitch INIT(0);
249 EXT int saw_FS INIT(0);
250 EXT int maxfld INIT(0);
251 EXT int arymax INIT(0);