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