1 /* $Header: a2p.h,v 3.0 89/10/18 15:34:14 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 3.0 89/10/18 15:34:14 lwall
15 #include "../config.h"
18 # define bcopy(s1,s2,l) memcpy(s2,s1,l);
19 # define bzero(s,l) memset(s,0,l);
208 extern char *opname[];
217 } ops[OPSMAX]; /* hope they have 200k to spare */
224 typedef struct string STR;
225 typedef struct htbl HASH;
230 /* A string is TRUE if not "" or "0". */
231 #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
232 EXT char *Yes INIT("1");
233 EXT char *No INIT("");
235 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
237 #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
238 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
239 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
242 #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
251 EXT int line INIT(0);
255 EXT char *bufptr INIT(buf);
257 EXT STR *linestr INIT(Nullstr);
259 EXT char tokenbuf[256];
260 EXT int expectterm INIT(TRUE);
263 EXT int debug INIT(0);
264 EXT int dlevel INIT(0);
269 EXT STR *freestrroot INIT(Nullstr);
274 EXT bool do_split INIT(FALSE);
275 EXT bool split_to_array INIT(FALSE);
276 EXT bool set_array_base INIT(FALSE);
277 EXT bool saw_RS INIT(FALSE);
278 EXT bool saw_OFS INIT(FALSE);
279 EXT bool saw_ORS INIT(FALSE);
280 EXT bool saw_line_op INIT(FALSE);
281 EXT bool in_begin INIT(TRUE);
282 EXT bool do_opens INIT(FALSE);
283 EXT bool do_fancy_opens INIT(FALSE);
284 EXT bool lval_field INIT(FALSE);
285 EXT bool do_chop INIT(FALSE);
286 EXT bool need_entire INIT(FALSE);
287 EXT bool absmaxfld INIT(FALSE);
288 EXT bool saw_altinput INIT(FALSE);
290 EXT char const_FS INIT(0);
291 EXT char *namelist INIT(Nullch);
292 EXT char fswitch INIT(0);
294 EXT int saw_FS INIT(0);
295 EXT int maxfld INIT(0);
296 EXT int arymax INIT(0);
302 EXT HASH *curarghash;
317 #define P_FILETEST 65