1 /* $RCSfile: a2p.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:09 $
3 * Copyright (c) 1991, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
9 * Revision 4.1 92/08/07 18:29:09 lwall
11 * Revision 4.0.1.2 92/06/08 16:12:23 lwall
12 * patch20: hash tables now split only if the memory is available to do so
14 * Revision 4.0.1.1 91/06/07 12:12:27 lwall
15 * patch4: new copyright notice
17 * Revision 4.0 91/03/20 01:57:07 lwall
23 #include "../config.h"
26 # define bcopy(s1,s2,l) memcpy(s2,s1,l)
29 # define bzero(s,l) memset(s,0,l)
218 extern char *opname[];
227 #if defined(iAPX286) || defined(M_I286) || defined(I80286) /* 80286 hack */
228 #define OPSMAX (64000/sizeof(union u_ops)) /* approx. max segment size */
231 #endif /* 80286 hack */
232 union u_ops ops[OPSMAX];
237 typedef struct string STR;
238 typedef struct htbl HASH;
243 /* A string is TRUE if not "" or "0". */
244 #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
245 EXT char *Yes INIT("1");
246 EXT char *No INIT("");
248 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
250 #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
251 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
252 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
255 #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
264 EXT int line INIT(0);
268 EXT char *bufptr INIT(buf);
270 EXT STR *linestr INIT(Nullstr);
272 EXT char tokenbuf[2048];
273 EXT int expectterm INIT(TRUE);
276 EXT int debug INIT(0);
277 EXT int dlevel INIT(0);
282 EXT STR *freestrroot INIT(Nullstr);
287 EXT bool do_split INIT(FALSE);
288 EXT bool split_to_array INIT(FALSE);
289 EXT bool set_array_base INIT(FALSE);
290 EXT bool saw_RS INIT(FALSE);
291 EXT bool saw_OFS INIT(FALSE);
292 EXT bool saw_ORS INIT(FALSE);
293 EXT bool saw_line_op INIT(FALSE);
294 EXT bool in_begin INIT(TRUE);
295 EXT bool do_opens INIT(FALSE);
296 EXT bool do_fancy_opens INIT(FALSE);
297 EXT bool lval_field INIT(FALSE);
298 EXT bool do_chop INIT(FALSE);
299 EXT bool need_entire INIT(FALSE);
300 EXT bool absmaxfld INIT(FALSE);
301 EXT bool saw_altinput INIT(FALSE);
303 EXT bool nomemok INIT(FALSE);
305 EXT char const_FS INIT(0);
306 EXT char *namelist INIT(Nullch);
307 EXT char fswitch INIT(0);
309 EXT int saw_FS INIT(0);
310 EXT int maxfld INIT(0);
311 EXT int arymax INIT(0);
317 EXT HASH *curarghash;
332 #define P_FILETEST 65