This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 3.0 patch #31 patch #29, continued
[perl5.git] / perl.h
CommitLineData
450a55e4 1/* $Header: perl.h,v 3.0.1.8 90/08/09 04:10:53 lwall Locked $
a687059c
LW
2 *
3 * Copyright (c) 1989, Larry Wall
4 *
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.
8d063cd8
LW
7 *
8 * $Log: perl.h,v $
450a55e4
LW
9 * Revision 3.0.1.8 90/08/09 04:10:53 lwall
10 * patch19: various MSDOS and OS/2 patches folded in
11 * patch19: did preliminary work toward debugging packages and evals
12 * patch19: added -x switch to extract script from input trash
13 *
0f85fab0
LW
14 * Revision 3.0.1.7 90/03/27 16:12:52 lwall
15 * patch16: MSDOS support
16 * patch16: support for machines that can't cast negative floats to unsigned ints
17 *
79a0689e
LW
18 * Revision 3.0.1.6 90/03/12 16:40:43 lwall
19 * patch13: did some ndir straightening up for Xenix
20 *
ac58e20f
LW
21 * Revision 3.0.1.5 90/02/28 17:52:28 lwall
22 * patch9: Configure now determines whether volatile is supported
23 * patch9: volatilized some more variables for super-optimizing compilers
24 * patch9: unused VREG symbol deleted
25 * patch9: perl can now start up other interpreters scripts
26 * patch9: you may now undef $/ to have no input record separator
27 * patch9: nested evals clobbered their longjmp environment
28 *
663a0e37
LW
29 * Revision 3.0.1.4 89/12/21 20:07:35 lwall
30 * patch7: arranged for certain registers to be restored after longjmp()
31 * patch7: Configure now compiles a test program to figure out time.h fiasco
32 * patch7: Configure now detects DG/UX thingies like [sg]etpgrp2 and utime.h
33 * patch7: memcpy() and memset() return void in __STDC__
34 * patch7: errno may now be a macro with an lvalue
35 * patch7: ANSI strerror() is now supported
36 * patch7: Xenix support for sys/ndir.h, cross compilation
37 *
ffed7fef
LW
38 * Revision 3.0.1.3 89/11/17 15:28:57 lwall
39 * patch5: byteorder now is a hex value
40 * patch5: Configure now looks for <time.h> including <sys/time.h>
41 *
ae986130
LW
42 * Revision 3.0.1.2 89/11/11 04:39:38 lwall
43 * patch2: Configure may now set -DDEBUGGING
44 * patch2: netinet/in.h needed sys/types.h some places
45 * patch2: more <sys/time.h> and <time.h> wrangling
46 * patch2: yydebug moved to where type doesn't matter
47 *
03a14243
LW
48 * Revision 3.0.1.1 89/10/26 23:17:08 lwall
49 * patch1: vfork now conditionally defined based on VFORK
50 * patch1: DEC risc machines have a buggy memcmp
51 * patch1: perl.h now includes <netinet/in.h> if it exists
52 *
a687059c
LW
53 * Revision 3.0 89/10/18 15:21:21 lwall
54 * 3.0 baseline
8d063cd8
LW
55 *
56 */
57
ac58e20f
LW
58#define VOIDUSED 1
59#include "config.h"
60
0f85fab0
LW
61#ifdef MSDOS
62/*
63 * BUGGY_MSC:
64 * This symbol is defined if you are the unfortunate owner of a buggy
65 * Microsoft C compiler and want to use intrinsic functions. Versions
66 * up to 5.1 are known conform to this definition. This is not needed
67 * under Unix.
68 */
69#define BUGGY_MSC /**/
70/*
71 * BINARY:
72 * This symbol is defined if you run under an operating system that
73 * distinguishes between binary and text files. If so the function
74 * setmode will be used to set the file into binary mode. Unix
75 * doesn't distinguish.
76 */
77#define BINARY /**/
78
79#else /* !MSDOS */
80
81/*
82 * The following symbols are defined if your operating system supports
83 * functions by that name. All Unixes I know of support them, thus they
84 * are not checked by the configuration script, but are directly defined
85 * here.
86 */
87#define CHOWN
88#define CHROOT
89#define FORK
90#define GETLOGIN
91#define GETPPID
92#define KILL
93#define LINK
94#define PIPE
95#define WAIT
96#define UMASK
97/*
98 * The following symbols are defined if your operating system supports
99 * password and group functions in general. All Unix systems do.
100 */
101#define GROUP
102#define PASSWD
103
104#endif /* !MSDOS */
105
ac58e20f 106#if defined(HASVOLATILE) || defined(__STDC__)
663a0e37 107#define VOLATILE volatile
663a0e37
LW
108#else
109#define VOLATILE
663a0e37
LW
110#endif
111
a687059c
LW
112#ifdef IAMSUID
113# ifndef TAINT
114# define TAINT
115# endif
116#endif
117
03a14243
LW
118#ifndef VFORK
119# define vfork fork
120#endif
121
663a0e37
LW
122#ifdef GETPGRP2
123# ifndef GETPGRP
124# define GETPGRP
125# endif
126# define getpgrp getpgrp2
127#endif
128
129#ifdef SETPGRP2
130# ifndef SETPGRP
131# define SETPGRP
132# endif
133# define setpgrp setpgrp2
134#endif
135
ffed7fef 136#if defined(MEMCMP) && defined(mips) && BYTEORDER == 0x1234
03a14243
LW
137#undef MEMCMP
138#endif
139
378cc40b 140#ifdef MEMCPY
663a0e37 141#ifndef memcpy
450a55e4 142#if defined(__STDC__ ) || defined(MSDOS)
663a0e37
LW
143extern void *memcpy(), *memset();
144#else
378cc40b 145extern char *memcpy(), *memset();
663a0e37 146#endif
450a55e4 147extern int memcmp();
663a0e37 148#endif
a687059c
LW
149#define bcopy(s1,s2,l) memcpy(s2,s1,l)
150#define bzero(s,l) memset(s,0,l)
151#endif
152#ifndef BCMP /* prefer bcmp slightly 'cuz it doesn't order */
153#define bcmp(s1,s2,l) memcmp(s1,s2,l)
8d063cd8
LW
154#endif
155
156#include <stdio.h>
157#include <ctype.h>
158#include <setjmp.h>
378cc40b
LW
159#include <sys/param.h> /* if this needs types.h we're still wrong */
160
161#ifndef _TYPES_ /* If types.h defines this it's easy. */
162#ifndef major /* Does everyone's types.h define this? */
8d063cd8 163#include <sys/types.h>
378cc40b
LW
164#endif
165#endif
166
ae986130
LW
167#ifdef I_NETINET_IN
168#include <netinet/in.h>
169#endif
170
8d063cd8 171#include <sys/stat.h>
135863df 172
663a0e37
LW
173#ifdef I_TIME
174# include <time.h>
ffed7fef 175#endif
663a0e37
LW
176
177#ifdef I_SYSTIME
178# ifdef SYSTIMEKERNEL
179# define KERNEL
180# endif
181# include <sys/time.h>
182# ifdef SYSTIMEKERNEL
183# undef KERNEL
184# endif
a687059c 185#endif
135863df 186
8d063cd8
LW
187#include <sys/times.h>
188
663a0e37
LW
189#if defined(STRERROR) && (!defined(MKDIR) || !defined(RMDIR))
190#undef STRERROR
191#endif
192
193#include <errno.h>
194#ifndef errno
195extern int errno; /* ANSI allows errno to be an lvalue expr */
196#endif
197
198#ifdef STRERROR
199char *strerror();
200#else
201extern int sys_nerr;
202extern char *sys_errlist[];
203#define strerror(e) ((e) < 0 || (e) >= sys_nerr ? "(unknown)" : sys_errlist[e])
204#endif
205
a687059c
LW
206#ifdef I_SYSIOCTL
207#ifndef _IOCTL_
208#include <sys/ioctl.h>
209#endif
210#endif
211
212#if defined(mc300) || defined(mc500) || defined(mc700) /* MASSCOMP */
213#ifdef SOCKETPAIR
214#undef SOCKETPAIR
215#endif
216#ifdef NDBM
217#undef NDBM
218#endif
219#endif
220
221#ifdef NDBM
222#include <ndbm.h>
223#define SOME_DBM
ae986130
LW
224#ifdef ODBM
225#undef ODBM
226#endif
a687059c
LW
227#else
228#ifdef ODBM
229#ifdef NULL
230#undef NULL /* suppress redefinition message */
231#endif
232#include <dbm.h>
233#ifdef NULL
234#undef NULL
235#endif
236#define NULL 0 /* silly thing is, we don't even use this */
237#define SOME_DBM
238#define dbm_fetch(db,dkey) fetch(dkey)
239#define dbm_delete(db,dkey) delete(dkey)
240#define dbm_store(db,dkey,dcontent,flags) store(dkey,dcontent)
241#define dbm_close(db) dbmclose()
242#define dbm_firstkey(db) firstkey()
243#endif /* ODBM */
244#endif /* NDBM */
245#ifdef SOME_DBM
246EXT char *dbmkey;
247EXT int dbmlen;
248#endif
249
250#if INTSIZE == 2
251#define htoni htons
252#define ntohi ntohs
253#else
254#define htoni htonl
255#define ntohi ntohl
256#endif
257
79a0689e 258#if defined(I_DIRENT) && !defined(M_XENIX)
663a0e37
LW
259# include <dirent.h>
260# define DIRENT dirent
ae986130 261#else
79a0689e
LW
262# ifdef I_SYSNDIR
263# include <sys/ndir.h>
663a0e37
LW
264# define DIRENT direct
265# else
79a0689e
LW
266# ifdef I_SYSDIR
267# ifdef hp9000s500
268# include <ndir.h> /* may be wrong in the future */
269# else
270# include <sys/dir.h>
271# endif
663a0e37
LW
272# define DIRENT direct
273# endif
274# endif
a687059c
LW
275#endif
276
450a55e4
LW
277typedef unsigned int STRLEN;
278
8d063cd8
LW
279typedef struct arg ARG;
280typedef struct cmd CMD;
281typedef struct formcmd FCMD;
282typedef struct scanpat SPAT;
8d063cd8 283typedef struct stio STIO;
378cc40b 284typedef struct sub SUBR;
8d063cd8
LW
285typedef struct string STR;
286typedef struct atbl ARRAY;
287typedef struct htbl HASH;
378cc40b 288typedef struct regexp REGEXP;
a687059c
LW
289typedef struct stabptrs STBP;
290typedef struct stab STAB;
8d063cd8 291
378cc40b
LW
292#include "handy.h"
293#include "regexp.h"
8d063cd8 294#include "str.h"
378cc40b 295#include "util.h"
8d063cd8
LW
296#include "form.h"
297#include "stab.h"
298#include "spat.h"
299#include "arg.h"
300#include "cmd.h"
301#include "array.h"
302#include "hash.h"
303
450a55e4 304#if defined(iAPX286) || defined(M_I286) || defined(I80286)
a687059c
LW
305# define I286
306#endif
307
308#ifndef __STDC__
135863df
AB
309#ifdef CHARSPRINTF
310 char *sprintf();
311#else
312 int sprintf();
313#endif
a687059c 314#endif
135863df 315
8d063cd8
LW
316EXT char *Yes INIT("1");
317EXT char *No INIT("");
318
a687059c
LW
319/* "gimme" values */
320
321/* Note: cmd.c assumes that it can use && to produce one of these values! */
322#define G_SCALAR 0
323#define G_ARRAY 1
324
325#ifdef CRIPPLED_CC
326int str_true();
327#else /* !CRIPPLED_CC */
328#define str_true(str) (Str = (str), \
329 (Str->str_pok ? \
330 ((*Str->str_ptr > '0' || \
331 Str->str_cur > 1 || \
332 (Str->str_cur && *Str->str_ptr != '0')) ? 1 : 0) \
333 : \
334 (Str->str_nok ? (Str->str_u.str_nval != 0.0) : 0 ) ))
335#endif /* CRIPPLED_CC */
8d063cd8 336
135863df 337#ifdef DEBUGGING
a687059c
LW
338#define str_peek(str) (Str = (str), \
339 (Str->str_pok ? \
340 Str->str_ptr : \
341 (Str->str_nok ? \
342 (sprintf(tokenbuf,"num(%g)",Str->str_u.str_nval), \
343 (char*)tokenbuf) : \
344 "" )))
135863df
AB
345#endif
346
a687059c
LW
347#ifdef CRIPPLED_CC
348char *str_get();
349#else
350#ifdef TAINT
351#define str_get(str) (Str = (str), tainted |= Str->str_tainted, \
352 (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
353#else
8d063cd8 354#define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
a687059c
LW
355#endif /* TAINT */
356#endif /* CRIPPLED_CC */
357
358#ifdef CRIPPLED_CC
359double str_gnum();
360#else /* !CRIPPLED_CC */
361#ifdef TAINT
362#define str_gnum(str) (Str = (str), tainted |= Str->str_tainted, \
363 (Str->str_nok ? Str->str_u.str_nval : str_2num(Str)))
364#else /* !TAINT */
365#define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_u.str_nval : str_2num(Str)))
366#endif /* TAINT*/
367#endif /* CRIPPLED_CC */
8d063cd8
LW
368EXT STR *Str;
369
370#define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
371
450a55e4 372#ifndef MSDOS
a687059c 373#define STR_GROW(str,len) if ((str)->str_len < (len)) str_grow(str,len)
450a55e4
LW
374#define Str_Grow str_grow
375#else
376/* extra parentheses intentionally NOT placed around "len"! */
377#define STR_GROW(str,len) if ((str)->str_len < (unsigned long)len) \
378 str_grow(str,(unsigned long)len)
379#define Str_Grow(str,len) str_grow(str,(unsigned long)(len))
380#endif /* MSDOS */
a687059c
LW
381
382#ifndef BYTEORDER
ffed7fef 383#define BYTEORDER 0x1234
a687059c
LW
384#endif
385
ae986130
LW
386#if defined(htonl) && !defined(HTONL)
387#define HTONL
388#endif
389#if defined(htons) && !defined(HTONS)
390#define HTONS
391#endif
392#if defined(ntohl) && !defined(NTOHL)
393#define NTOHL
394#endif
395#if defined(ntohs) && !defined(NTOHS)
396#define NTOHS
397#endif
a687059c 398#ifndef HTONL
ffed7fef 399#if (BYTEORDER != 0x4321) && (BYTEORDER != 0x87654321)
a687059c
LW
400#define HTONS
401#define HTONL
402#define NTOHS
403#define NTOHL
404#define MYSWAP
405#define htons my_swap
406#define htonl my_htonl
407#define ntohs my_swap
408#define ntohl my_ntohl
409#endif
410#else
ffed7fef 411#if (BYTEORDER == 0x4321) || (BYTEORDER == 0x87654321)
a687059c
LW
412#undef HTONS
413#undef HTONL
414#undef NTOHS
415#undef NTOHL
416#endif
417#endif
418
0f85fab0
LW
419#ifdef CASTNEGFLOAT
420#define U_S(what) ((unsigned short)(what))
421#define U_I(what) ((unsigned int)(what))
422#define U_L(what) ((unsigned long)(what))
423#else
424unsigned long castulong();
425#define U_S(what) ((unsigned int)castulong(what))
426#define U_I(what) ((unsigned int)castulong(what))
427#define U_L(what) (castulong(what))
428#endif
429
8d063cd8
LW
430CMD *add_label();
431CMD *block_head();
432CMD *append_line();
433CMD *make_acmd();
434CMD *make_ccmd();
a687059c 435CMD *make_icmd();
8d063cd8
LW
436CMD *invert();
437CMD *addcond();
438CMD *addloop();
439CMD *wopt();
378cc40b 440CMD *over();
8d063cd8 441
8d063cd8 442STAB *stabent();
378cc40b 443STAB *genstab();
8d063cd8 444
378cc40b 445ARG *stab2arg();
8d063cd8
LW
446ARG *op_new();
447ARG *make_op();
8d063cd8
LW
448ARG *make_match();
449ARG *make_split();
a687059c 450ARG *rcatmaybe();
378cc40b 451ARG *listish();
a687059c 452ARG *maybelistish();
378cc40b 453ARG *localize();
a687059c
LW
454ARG *fixeval();
455ARG *jmaybe();
378cc40b 456ARG *l();
a687059c 457ARG *fixl();
378cc40b
LW
458ARG *mod_match();
459ARG *make_list();
460ARG *cmd_to_arg();
461ARG *addflags();
462ARG *hide_ary();
463ARG *cval_to_arg();
8d063cd8 464
8d063cd8
LW
465STR *str_new();
466STR *stab_str();
a687059c
LW
467
468int do_each();
469int do_subr();
470int do_match();
471int do_unpack();
472int eval(); /* this evaluates expressions */
473int do_eval(); /* this evaluates eval operator */
474int do_assign();
378cc40b
LW
475
476SUBR *make_sub();
8d063cd8
LW
477
478FCMD *load_format();
479
480char *scanpat();
481char *scansubst();
482char *scantrans();
483char *scanstr();
484char *scanreg();
8d063cd8
LW
485char *str_append_till();
486char *str_gets();
a687059c 487char *str_grow();
8d063cd8 488
8d063cd8
LW
489bool do_open();
490bool do_close();
491bool do_print();
378cc40b
LW
492bool do_aprint();
493bool do_exec();
494bool do_aexec();
8d063cd8
LW
495
496int do_subst();
378cc40b
LW
497int cando();
498int ingroup();
8d063cd8 499
378cc40b
LW
500void str_replace();
501void str_inc();
502void str_dec();
8d063cd8 503void str_free();
a687059c 504void stab_clear();
378cc40b 505void do_join();
378cc40b 506void do_sprintf();
a687059c 507void do_accept();
ac58e20f 508void do_pipe();
a687059c
LW
509void do_vecset();
510void savelist();
511void saveitem();
512void saveint();
513void savelong();
514void savesptr();
515void savehptr();
516void restorelist();
ac58e20f 517void repeatcpy();
a687059c
LW
518HASH *savehash();
519ARRAY *saveary();
378cc40b 520
ac58e20f
LW
521EXT char **origargv;
522EXT int origargc;
a687059c
LW
523EXT line_t subline INIT(0);
524EXT STR *subname INIT(Nullstr);
8d063cd8
LW
525EXT int arybase INIT(0);
526
527struct outrec {
378cc40b
LW
528 line_t o_lines;
529 char *o_str;
530 int o_len;
8d063cd8
LW
531};
532
533EXT struct outrec outrec;
534EXT struct outrec toprec;
535
a687059c 536EXT STAB *stdinstab INIT(Nullstab);
8d063cd8
LW
537EXT STAB *last_in_stab INIT(Nullstab);
538EXT STAB *defstab INIT(Nullstab);
539EXT STAB *argvstab INIT(Nullstab);
540EXT STAB *envstab INIT(Nullstab);
541EXT STAB *sigstab INIT(Nullstab);
542EXT STAB *defoutstab INIT(Nullstab);
543EXT STAB *curoutstab INIT(Nullstab);
544EXT STAB *argvoutstab INIT(Nullstab);
378cc40b 545EXT STAB *incstab INIT(Nullstab);
a687059c
LW
546EXT STAB *leftstab INIT(Nullstab);
547EXT STAB *amperstab INIT(Nullstab);
548EXT STAB *rightstab INIT(Nullstab);
549EXT STAB *DBstab INIT(Nullstab);
550EXT STAB *DBsub INIT(Nullstab);
551
552EXT HASH *defstash; /* main symbol table */
553EXT HASH *curstash; /* symbol table for current package */
554EXT HASH *debstash; /* symbol table for perldb package */
555
556EXT STR *curstname; /* name of current package */
8d063cd8
LW
557
558EXT STR *freestrroot INIT(Nullstr);
378cc40b 559EXT STR *lastretstr INIT(Nullstr);
a687059c
LW
560EXT STR *DBsingle INIT(Nullstr);
561
562EXT int lastspbase;
563EXT int lastsize;
8d063cd8 564
450a55e4 565EXT char *curpack;
378cc40b
LW
566EXT char *filename;
567EXT char *origfilename;
ac58e20f 568EXT FILE * VOLATILE rsfp;
8d063cd8 569EXT char buf[1024];
a687059c
LW
570EXT char *bufptr;
571EXT char *oldbufptr;
572EXT char *oldoldbufptr;
573EXT char *bufend;
8d063cd8
LW
574
575EXT STR *linestr INIT(Nullstr);
576
ac58e20f 577EXT int record_separator INIT('\n');
a687059c 578EXT int rslen INIT(1);
8d063cd8 579EXT char *ofs INIT(Nullch);
a687059c 580EXT int ofslen INIT(0);
8d063cd8 581EXT char *ors INIT(Nullch);
a687059c 582EXT int orslen INIT(0);
8d063cd8
LW
583EXT char *ofmt INIT(Nullch);
584EXT char *inplace INIT(Nullch);
a687059c 585EXT char *nointrp INIT("");
8d063cd8 586
378cc40b
LW
587EXT bool preprocess INIT(FALSE);
588EXT bool minus_n INIT(FALSE);
589EXT bool minus_p INIT(FALSE);
590EXT bool minus_a INIT(FALSE);
591EXT bool doswitches INIT(FALSE);
592EXT bool dowarn INIT(FALSE);
450a55e4 593EXT bool doextract INIT(FALSE);
378cc40b
LW
594EXT bool allstabs INIT(FALSE); /* init all customary symbols in symbol table?*/
595EXT bool sawampersand INIT(FALSE); /* must save all match strings */
596EXT bool sawstudy INIT(FALSE); /* do fbminstr on all strings */
a687059c
LW
597EXT bool sawi INIT(FALSE); /* study must assume case insensitive */
598EXT bool sawvec INIT(FALSE);
ac58e20f 599EXT bool localizing INIT(FALSE); /* are we processing a local() list? */
a687059c 600
ae986130
LW
601#ifdef CSH
602char *cshname INIT(CSH);
603int cshlen INIT(0);
604#endif /* CSH */
a687059c
LW
605
606#ifdef TAINT
607EXT bool tainted INIT(FALSE); /* using variables controlled by $< */
608#endif
378cc40b 609
450a55e4 610#ifndef MSDOS
378cc40b 611#define TMPPATH "/tmp/perl-eXXXXXX"
450a55e4
LW
612#else
613#define TMPPATH "/tmp/plXXXXXX"
614#endif /* MSDOS */
378cc40b
LW
615EXT char *e_tmpname;
616EXT FILE *e_fp INIT(Nullfp);
617
8d063cd8 618EXT char tokenbuf[256];
a687059c 619EXT int expectterm INIT(TRUE); /* how to interpret ambiguous tokens */
ac58e20f 620EXT VOLATILE int in_eval INIT(FALSE); /* trap fatal errors? */
a687059c
LW
621EXT int multiline INIT(0); /* $*--do strings hold >1 line? */
622EXT int forkprocess; /* so do_open |- can return proc# */
623EXT int do_undump INIT(0); /* -u or dump seen? */
624EXT int error_count INIT(0); /* how many errors so far, max 10 */
625EXT int multi_start INIT(0); /* 1st line of multi-line string */
626EXT int multi_end INIT(0); /* last line of multi-line string */
627EXT int multi_open INIT(0); /* delimiter of said string */
628EXT int multi_close INIT(0); /* delimiter of said string */
8d063cd8
LW
629
630FILE *popen();
631/* char *str_get(); */
632STR *interp();
633void free_arg();
634STIO *stio_new();
635
636EXT struct stat statbuf;
a687059c
LW
637EXT struct stat statcache;
638STAB *statstab INIT(Nullstab);
639STR *statname;
8d063cd8 640EXT struct tms timesbuf;
378cc40b
LW
641EXT int uid;
642EXT int euid;
a687059c
LW
643EXT int gid;
644EXT int egid;
378cc40b
LW
645UIDTYPE getuid();
646UIDTYPE geteuid();
647GIDTYPE getgid();
648GIDTYPE getegid();
649EXT int unsafe;
8d063cd8
LW
650
651#ifdef DEBUGGING
ac58e20f 652EXT VOLATILE int debug INIT(0);
8d063cd8 653EXT int dlevel INIT(0);
a687059c
LW
654EXT int dlmax INIT(128);
655EXT char *debname;
656EXT char *debdelim;
d96024cf 657#define YYDEBUG 1
8d063cd8 658#endif
a687059c 659EXT int perldb INIT(0);
8d063cd8 660
378cc40b
LW
661EXT line_t cmdline INIT(NOLINE);
662
a687059c 663EXT STR str_undef;
8d063cd8
LW
664EXT STR str_no;
665EXT STR str_yes;
666
667/* runtime control stuff */
668
669EXT struct loop {
a687059c
LW
670 char *loop_label; /* what the loop was called, if anything */
671 int loop_sp; /* stack pointer to copy stuff down to */
8d063cd8 672 jmp_buf loop_env;
a687059c 673} *loop_stack;
8d063cd8
LW
674
675EXT int loop_ptr INIT(-1);
a687059c 676EXT int loop_max INIT(128);
8d063cd8
LW
677
678EXT jmp_buf top_env;
679
ac58e20f 680EXT char * VOLATILE goto_targ INIT(Nullch); /* cmd_exec gets strange when set */
8d063cd8 681
450a55e4
LW
682struct ufuncs {
683 int (*uf_val)();
684 int (*uf_set)();
685 int uf_index;
686};
687
a687059c
LW
688EXT ARRAY *stack; /* THE STACK */
689
ac58e20f 690EXT ARRAY * VOLATILE savestack; /* to save non-local values on */
378cc40b
LW
691
692EXT ARRAY *tosave; /* strings to save on recursive subroutine */
693
a687059c
LW
694EXT ARRAY *lineary; /* lines of script for debugger */
695
696EXT ARRAY *pidstatary; /* keep pids and statuses by fd for mypopen */
697
ac58e20f
LW
698EXT int *di; /* for tmp use in debuggers */
699EXT char *dc;
700EXT short *ds;
701
8d063cd8 702double atof();
a687059c 703long time();
8d063cd8 704struct tm *gmtime(), *localtime();
378cc40b
LW
705char *mktemp();
706char *index(), *rindex();
707char *strcpy(), *strcat();
8d063cd8 708
8d063cd8 709#ifdef EUNICE
378cc40b
LW
710#define UNLINK unlnk
711int unlnk();
8d063cd8
LW
712#else
713#define UNLINK unlink
714#endif
a687059c
LW
715
716#ifndef SETREUID
717#ifdef SETRESUID
718#define setreuid(r,e) setresuid(r,e,-1)
719#define SETREUID
720#endif
721#endif
722#ifndef SETREGID
723#ifdef SETRESGID
724#define setregid(r,e) setresgid(r,e,-1)
725#define SETREGID
726#endif
727#endif