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