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