1 /* $Header: a2p.h,v 3.0.1.1 89/11/11 05:07:00 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.1.1 89/11/11 05:07:00 lwall
10 * patch2: Configure may now set -DDEBUGGING
12 * Revision 3.0 89/10/18 15:34:14 lwall
18 #include "../config.h"
21 # define bcopy(s1,s2,l) memcpy(s2,s1,l);
22 # define bzero(s,l) memset(s,0,l);
211 extern char *opname[];
220 } ops[OPSMAX]; /* hope they have 200k to spare */
225 typedef struct string STR;
226 typedef struct htbl HASH;
231 /* A string is TRUE if not "" or "0". */
232 #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
233 EXT char *Yes INIT("1");
234 EXT char *No INIT("");
236 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
238 #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
239 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
240 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
243 #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
252 EXT int line INIT(0);
256 EXT char *bufptr INIT(buf);
258 EXT STR *linestr INIT(Nullstr);
260 EXT char tokenbuf[256];
261 EXT int expectterm INIT(TRUE);
264 EXT int debug INIT(0);
265 EXT int dlevel INIT(0);
270 EXT STR *freestrroot INIT(Nullstr);
275 EXT bool do_split INIT(FALSE);
276 EXT bool split_to_array INIT(FALSE);
277 EXT bool set_array_base INIT(FALSE);
278 EXT bool saw_RS INIT(FALSE);
279 EXT bool saw_OFS INIT(FALSE);
280 EXT bool saw_ORS INIT(FALSE);
281 EXT bool saw_line_op INIT(FALSE);
282 EXT bool in_begin INIT(TRUE);
283 EXT bool do_opens INIT(FALSE);
284 EXT bool do_fancy_opens INIT(FALSE);
285 EXT bool lval_field INIT(FALSE);
286 EXT bool do_chop INIT(FALSE);
287 EXT bool need_entire INIT(FALSE);
288 EXT bool absmaxfld INIT(FALSE);
289 EXT bool saw_altinput INIT(FALSE);
291 EXT char const_FS INIT(0);
292 EXT char *namelist INIT(Nullch);
293 EXT char fswitch INIT(0);
295 EXT int saw_FS INIT(0);
296 EXT int maxfld INIT(0);
297 EXT int arymax INIT(0);
303 EXT HASH *curarghash;
318 #define P_FILETEST 65