1 /* $Header: a2p.h,v 1.0.1.2 88/02/01 17:33:40 root Exp $
4 * Revision 1.0.1.2 88/02/01 17:33:40 root
5 * patch12: forgot to fix #define YYDEBUG; bug in a2p.
7 * Revision 1.0.1.1 88/01/26 09:52:30 root
8 * patch 5: a2p didn't use config.h.
10 * Revision 1.0 87/12/18 13:06:58 root
16 #include "../config.h"
19 # define bcopy(s1,s2,l) memcpy(s2,s1,l);
20 # define bzero(s,l) memset(s,0,l);
171 extern char *opname[];
177 } ops[50000]; /* hope they have 200k to spare */
186 #include <sys/types.h>
187 #include <sys/stat.h>
189 #include <sys/times.h>
191 typedef struct string STR;
192 typedef struct htbl HASH;
197 /* A string is TRUE if not "" or "0". */
198 #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
199 EXT char *Yes INIT("1");
200 EXT char *No INIT("");
202 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
204 #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
205 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
206 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
209 #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
218 EXT int line INIT(0);
222 EXT char *bufptr INIT(buf);
224 EXT STR *linestr INIT(Nullstr);
226 EXT char tokenbuf[256];
227 EXT int expectterm INIT(TRUE);
230 EXT int debug INIT(0);
231 EXT int dlevel INIT(0);
236 EXT STR *freestrroot INIT(Nullstr);
241 EXT bool do_split INIT(FALSE);
242 EXT bool split_to_array INIT(FALSE);
243 EXT bool set_array_base INIT(FALSE);
244 EXT bool saw_RS INIT(FALSE);
245 EXT bool saw_OFS INIT(FALSE);
246 EXT bool saw_ORS INIT(FALSE);
247 EXT bool saw_line_op INIT(FALSE);
248 EXT bool in_begin INIT(TRUE);
249 EXT bool do_opens INIT(FALSE);
250 EXT bool do_fancy_opens INIT(FALSE);
251 EXT bool lval_field INIT(FALSE);
252 EXT bool do_chop INIT(FALSE);
253 EXT bool need_entire INIT(FALSE);
254 EXT bool absmaxfld INIT(FALSE);
256 EXT char const_FS INIT(0);
257 EXT char *namelist INIT(Nullch);
258 EXT char fswitch INIT(0);
260 EXT int saw_FS INIT(0);
261 EXT int maxfld INIT(0);
262 EXT int arymax INIT(0);