1 /* $Header: a2p.h,v 4.0 91/03/20 01:57:07 lwall Locked $
3 * Copyright (c) 1989, Larry Wall
5 * You may distribute under the terms of the GNU General Public License
6 * as specified in the README file that comes with the perl 3.0 kit.
9 * Revision 4.0 91/03/20 01:57:07 lwall
15 #include "../config.h"
18 # define bcopy(s1,s2,l) memcpy(s2,s1,l)
21 # define bzero(s,l) memset(s,0,l)
210 extern char *opname[];
219 #if defined(iAPX286) || defined(M_I286) || defined(I80286) /* 80286 hack */
220 #define OPSMAX (64000/sizeof(union u_ops)) /* approx. max segment size */
223 #endif /* 80286 hack */
224 union u_ops ops[OPSMAX];
229 typedef struct string STR;
230 typedef struct htbl HASH;
235 /* A string is TRUE if not "" or "0". */
236 #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
237 EXT char *Yes INIT("1");
238 EXT char *No INIT("");
240 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
242 #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
243 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
244 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
247 #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
256 EXT int line INIT(0);
260 EXT char *bufptr INIT(buf);
262 EXT STR *linestr INIT(Nullstr);
264 EXT char tokenbuf[2048];
265 EXT int expectterm INIT(TRUE);
268 EXT int debug INIT(0);
269 EXT int dlevel INIT(0);
274 EXT STR *freestrroot INIT(Nullstr);
279 EXT bool do_split INIT(FALSE);
280 EXT bool split_to_array INIT(FALSE);
281 EXT bool set_array_base INIT(FALSE);
282 EXT bool saw_RS INIT(FALSE);
283 EXT bool saw_OFS INIT(FALSE);
284 EXT bool saw_ORS INIT(FALSE);
285 EXT bool saw_line_op INIT(FALSE);
286 EXT bool in_begin INIT(TRUE);
287 EXT bool do_opens INIT(FALSE);
288 EXT bool do_fancy_opens INIT(FALSE);
289 EXT bool lval_field INIT(FALSE);
290 EXT bool do_chop INIT(FALSE);
291 EXT bool need_entire INIT(FALSE);
292 EXT bool absmaxfld INIT(FALSE);
293 EXT bool saw_altinput INIT(FALSE);
295 EXT char const_FS INIT(0);
296 EXT char *namelist INIT(Nullch);
297 EXT char fswitch INIT(0);
299 EXT int saw_FS INIT(0);
300 EXT int maxfld INIT(0);
301 EXT int arymax INIT(0);
307 EXT HASH *curarghash;
322 #define P_FILETEST 65