sh.h revision 1.22 1 /* $NetBSD: sh.h,v 1.22 2017/06/22 23:37:00 kamil Exp $ */
2
3 /*
4 * Public Domain Bourne/Korn shell
5 */
6
7 /* $Id: sh.h,v 1.22 2017/06/22 23:37:00 kamil Exp $ */
8
9 #include "config.h" /* system and option configuration info */
10
11 #ifdef HAVE_PROTOTYPES
12 # define ARGS(args) args /* prototype declaration */
13 #else
14 # define ARGS(args) () /* K&R declaration */
15 #endif
16
17 /* Start of common headers */
18
19 #include <stdio.h>
20 #include <sys/types.h>
21 #include <setjmp.h>
22 #include <stddef.h>
23 #include <stdlib.h>
24 #include <unistd.h>
25 #include <string.h>
26
27 #ifdef HAVE_PROTOTYPES
28 # include <stdarg.h>
29 # define SH_VA_START(va, argn) va_start(va, argn)
30 #else
31 # include <varargs.h>
32 # define SH_VA_START(va, argn) va_start(va)
33 #endif /* HAVE_PROTOTYPES */
34
35 #include <errno.h>
36 #include <fcntl.h>
37
38 #ifndef O_ACCMODE
39 # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
40 #endif /* !O_ACCMODE */
41
42 #ifndef F_OK /* access() arguments */
43 # define F_OK 0
44 # define X_OK 1
45 # define W_OK 2
46 # define R_OK 4
47 #endif /* !F_OK */
48
49 #ifndef SEEK_SET
50 # ifdef L_SET
51 # define SEEK_SET L_SET
52 # define SEEK_CUR L_INCR
53 # define SEEK_END L_XTND
54 # else /* L_SET */
55 # define SEEK_SET 0
56 # define SEEK_CUR 1
57 # define SEEK_END 2
58 # endif /* L_SET */
59 #endif /* !SEEK_SET */
60
61 /* Some machines (eg, FreeBSD 1.1.5) define CLK_TCK in limits.h
62 * (ksh_limval.h assumes limits has been included, if available)
63 */
64 #ifdef HAVE_LIMITS_H
65 # include <limits.h>
66 #endif /* HAVE_LIMITS_H */
67
68 #include <signal.h>
69 #ifdef NSIG
70 # define SIGNALS NSIG
71 #else
72 # ifdef _MINIX
73 # define SIGNALS (_NSIG+1) /* _NSIG is # of signals used, excluding 0. */
74 # else
75 # ifdef _SIGMAX /* QNX */
76 # define SIGNALS _SIGMAX
77 # else /* _SIGMAX */
78 # define SIGNALS 32
79 # endif /* _SIGMAX */
80 # endif /* _MINIX */
81 #endif /* NSIG */
82 #ifndef SIGCHLD
83 # define SIGCHLD SIGCLD
84 #endif
85 /* struct sigaction.sa_flags is set to KSH_SA_FLAGS. Used to ensure
86 * system calls are interrupted
87 */
88 #ifdef SA_INTERRUPT
89 # define KSH_SA_FLAGS SA_INTERRUPT
90 #else /* SA_INTERRUPT */
91 # define KSH_SA_FLAGS 0
92 #endif /* SA_INTERRUPT */
93
94 typedef RETSIGTYPE (*handler_t) ARGS((int)); /* signal handler */
95
96 #ifdef USE_FAKE_SIGACT
97 # include "sigact.h" /* use sjg's fake sigaction() */
98 #endif
99
100 #ifdef HAVE_PATHS_H
101 # include <paths.h>
102 #endif /* HAVE_PATHS_H */
103 #ifdef _PATH_DEFPATH
104 # define DEFAULT__PATH _PATH_DEFPATH
105 #else /* _PATH_DEFPATH */
106 # define DEFAULT__PATH DEFAULT_PATH
107 #endif /* _PATH_DEFPATH */
108
109 #ifndef offsetof
110 # define offsetof(type,id) ((size_t)&((type*)NULL)->id)
111 #endif
112
113 #ifndef HAVE_KILLPG
114 # define killpg(p, s) kill(-(p), (s))
115 #endif /* !HAVE_KILLPG */
116
117 /* Special cases for execve(2) */
118 # if defined(OS_ISC) && defined(_POSIX_SOURCE)
119 /* Kludge for ISC 3.2 (and other versions?) so programs will run correctly. */
120 # define ksh_execve(p, av, ev, flags) \
121 do { \
122 __setostype(0); \
123 execve(p, av, ev); \
124 __setostype(1); \
125 } while (0)
126 # else /* OS_ISC && _POSIX */
127 # define ksh_execve(p, av, ev, flags) execve(p, av, ev)
128 # endif /* OS_ISC && _POSIX */
129
130 /* this is a hang-over from older versions of the os2 port */
131 #define ksh_dupbase(fd, base) fcntl(fd, F_DUPFD, base)
132
133 #ifdef HAVE_SIGSETJMP
134 # define ksh_sigsetjmp(env,sm) sigsetjmp((env), (sm))
135 # define ksh_siglongjmp(env,v) siglongjmp((env), (v))
136 # define ksh_jmp_buf sigjmp_buf
137 #else /* HAVE_SIGSETJMP */
138 # ifdef HAVE__SETJMP
139 # define ksh_sigsetjmp(env,sm) _setjmp(env)
140 # define ksh_siglongjmp(env,v) _longjmp((env), (v))
141 # else /* HAVE__SETJMP */
142 # define ksh_sigsetjmp(env,sm) setjmp(env)
143 # define ksh_siglongjmp(env,v) longjmp((env), (v))
144 # endif /* HAVE__SETJMP */
145 # define ksh_jmp_buf jmp_buf
146 #endif /* HAVE_SIGSETJMP */
147
148 #ifndef HAVE_DUP2
149 extern int dup2 ARGS((int, int));
150 #endif /* !HAVE_DUP2 */
151
152 /* Find a integer type that is at least 32 bits (or die) - SIZEOF_* defined
153 * by autoconf (assumes an 8 bit byte, but I'm not concerned).
154 * NOTE: INT32 may end up being more than 32 bits.
155 */
156 #if SIZEOF_INT >= 4
157 # define INT32 int
158 #else /* SIZEOF_INT */
159 # if SIZEOF_LONG >= 4
160 # define INT32 long
161 # else /* SIZEOF_LONG */
162 #error cannot find 32 bit type...
163 # endif /* SIZEOF_LONG */
164 #endif /* SIZEOF_INT */
165
166 /* end of common headers */
167
168 /* Stop gcc and lint from complaining about possibly uninitialized variables */
169 #if defined(__GNUC__) || defined(lint)
170 # define UNINITIALIZED(var) var = 0
171 #else
172 # define UNINITIALIZED(var) var
173 #endif /* GNUC || lint */
174
175 /* some useful #defines */
176 #ifdef EXTERN
177 # define I__(i) = i
178 #else
179 # define I__(i)
180 # define EXTERN extern
181 # define EXTERN_DEFINED
182 #endif
183
184 #ifndef EXECSHELL
185 /* shell to exec scripts (see also $SHELL initialization in main.c) */
186 # define EXECSHELL "/bin/sh"
187 # define EXECSHELL_STR "EXECSHELL"
188 #endif
189
190 /* ISABSPATH() means path is fully and completely specified,
191 * ISROOTEDPATH() means a .. as the first component is a no-op,
192 * ISRELPATH() means $PWD can be tacked on to get an absolute path.
193 *
194 * OS Path ISABSPATH ISROOTEDPATH ISRELPATH
195 * unix /foo yes yes no
196 * unix foo no no yes
197 * unix ../foo no no yes
198 */
199 # define PATHSEP ':'
200 # define DIRSEP '/'
201 # define DIRSEPSTR "/"
202 # define ISDIRSEP(c) ((c) == '/')
203 # define ISABSPATH(s) ISDIRSEP((s)[0])
204 # define ISRELPATH(s) (!ISABSPATH(s))
205 # define ISROOTEDPATH(s) ISABSPATH(s)
206 # define FILECHCONV(c) c
207 # define FILECMP(s1, s2) strcmp(s1, s2)
208 # define FILENCMP(s1, s2, n) strncmp(s1, s2, n)
209 # define ksh_strchr_dirsep(p) strchr(p, DIRSEP)
210 # define ksh_strrchr_dirsep(p) strrchr(p, DIRSEP)
211
212 typedef int bool_t;
213 #define FALSE 0
214 #define TRUE 1
215
216 #define NELEM(a) (sizeof(a) / sizeof((a)[0]))
217 #define sizeofN(type, n) (sizeof(type) * (n))
218 #define BIT(i) (1<<(i)) /* define bit in flag */
219
220 /* Table flag type - needs > 16 and < 32 bits */
221 typedef INT32 Tflag;
222
223 #define NUFILE 32 /* Number of user-accessible files */
224 #define FDBASE 10 /* First file usable by Shell */
225
226 /* you're not going to run setuid shell scripts, are you? */
227 #define eaccess(path, mode) access(path, mode)
228
229 /* Make MAGIC a char that might be printed to make bugs more obvious, but
230 * not a char that is used often. Also, can't use the high bit as it causes
231 * portability problems (calling strchr(x, 0x80|'x') is error prone).
232 */
233 #define MAGIC (7) /* prefix for *?[!{,} during expand */
234 #define ISMAGIC(c) ((unsigned char)(c) == MAGIC)
235 #define NOT '!' /* might use ^ (ie, [!...] vs [^..]) */
236
237 #define LINE 1024 /* input line size */
238 #define PATH 1024 /* pathname size (todo: PATH_MAX/pathconf()) */
239 #define ARRAYMAX 1023 /* max array index */
240
241 EXTERN const char *kshname; /* $0 */
242 EXTERN pid_t kshpid; /* $$, shell pid */
243 EXTERN pid_t procpid; /* pid of executing process */
244 EXTERN uid_t ksheuid; /* effective uid of shell */
245 EXTERN int exstat; /* exit status */
246 EXTERN int subst_exstat; /* exit status of last $(..)/`..` */
247 EXTERN const char *safe_prompt; /* safe prompt if PS1 substitution fails */
248
249 /*
250 * Area-based allocation built on malloc/free
251 */
252 typedef struct Area {
253 struct link *freelist; /* free list */
254 } Area;
255
256 EXTERN Area aperm; /* permanent object space */
257 #define APERM &aperm
258 #define ATEMP &e->area
259
260 #ifdef MEM_DEBUG
261 # include "chmem.h" /* a debugging front end for malloc et. al. */
262 #endif /* MEM_DEBUG */
263
264 #ifdef KSH_DEBUG
265 # define kshdebug_init() kshdebug_init_()
266 # define kshdebug_printf(a) kshdebug_printf_ a
267 # define kshdebug_dump(a) kshdebug_dump_ a
268 #else /* KSH_DEBUG */
269 # define kshdebug_init()
270 # define kshdebug_printf(a)
271 # define kshdebug_dump(a)
272 #endif /* KSH_DEBUG */
273
274 /*
275 * parsing & execution environment
276 */
277 EXTERN struct env {
278 short type; /* environment type - see below */
279 short flags; /* EF_* */
280 Area area; /* temporary allocation area */
281 struct block *loc; /* local variables and functions */
282 short *savefd; /* original redirected fd's */
283 struct env *oenv; /* link to previous environment */
284 ksh_jmp_buf jbuf; /* long jump back to env creator */
285 struct temp *temps; /* temp files */
286 } *e;
287
288 /* struct env.type values */
289 #define E_NONE 0 /* dummy environment */
290 #define E_PARSE 1 /* parsing command # */
291 #define E_FUNC 2 /* executing function # */
292 #define E_INCL 3 /* including a file via . # */
293 #define E_EXEC 4 /* executing command tree */
294 #define E_LOOP 5 /* executing for/while # */
295 #define E_ERRH 6 /* general error handler # */
296 /* # indicates env has valid jbuf (see unwind()) */
297
298 /* struct env.flag values */
299 #define EF_FUNC_PARSE BIT(0) /* function being parsed */
300 #define EF_BRKCONT_PASS BIT(1) /* set if E_LOOP must pass break/continue on */
301 #define EF_FAKE_SIGDIE BIT(2) /* hack to get info from unwind to quitenv */
302
303 /* Do breaks/continues stop at env type e? */
304 #define STOP_BRKCONT(t) ((t) == E_NONE || (t) == E_PARSE \
305 || (t) == E_FUNC || (t) == E_INCL)
306 /* Do returns stop at env type e? */
307 #define STOP_RETURN(t) ((t) == E_FUNC || (t) == E_INCL)
308
309 /* values for ksh_siglongjmp(e->jbuf, 0) */
310 #define LRETURN 1 /* return statement */
311 #define LEXIT 2 /* exit statement */
312 #define LERROR 3 /* errorf() called */
313 #define LLEAVE 4 /* untrappable exit/error */
314 #define LINTR 5 /* ^C noticed */
315 #define LBREAK 6 /* break statement */
316 #define LCONTIN 7 /* continue statement */
317 #define LSHELL 8 /* return to interactive shell() */
318 #define LAEXPR 9 /* error in arithmetic expression */
319
320 /* option processing */
321 #define OF_CMDLINE 0x01 /* command line */
322 #define OF_SET 0x02 /* set builtin */
323 #define OF_SPECIAL 0x04 /* a special variable changing */
324 #define OF_INTERNAL 0x08 /* set internally by shell */
325 #define OF_ANY (OF_CMDLINE | OF_SET | OF_SPECIAL | OF_INTERNAL)
326
327 struct option {
328 const char *name; /* long name of option */
329 char c; /* character flag (if any) */
330 short flags; /* OF_* */
331 };
332 extern const struct option goptions[];
333
334 /*
335 * flags (the order of these enums MUST match the order in misc.c(options[]))
336 */
337 enum sh_flag {
338 FEXPORT = 0, /* -a: export all */
339 #ifdef BRACE_EXPAND
340 FBRACEEXPAND, /* enable {} globbing */
341 #endif
342 FBGNICE, /* bgnice */
343 FCOMMAND, /* -c: (invocation) execute specified command */
344 #ifdef EMACS
345 FEMACS, /* emacs command editing */
346 FEMACSUSEMETA, /* use 8th bit as meta */
347 #endif
348 FERREXIT, /* -e: quit on error */
349 #ifdef EMACS
350 FGMACS, /* gmacs command editing */
351 #endif
352 FIGNOREEOF, /* eof does not exit */
353 FTALKING, /* -i: interactive */
354 FKEYWORD, /* -k: name=value anywhere */
355 FLOGIN, /* -l: a login shell */
356 FMARKDIRS, /* mark dirs with / in file name completion */
357 FMONITOR, /* -m: job control monitoring */
358 FNOCLOBBER, /* -C: don't overwrite existing files */
359 FNOEXEC, /* -n: don't execute any commands */
360 FNOGLOB, /* -f: don't do file globbing */
361 FNOHUP, /* -H: don't kill running jobs when login shell exits */
362 FNOLOG, /* don't save functions in history (ignored) */
363 #ifdef JOBS
364 FNOTIFY, /* -b: asynchronous job completion notification */
365 #endif
366 FNOUNSET, /* -u: using an unset var is an error */
367 FPHYSICAL, /* -o physical: don't do logical cd's/pwd's */
368 FPOSIX, /* -o posix: be posixly correct */
369 FPRIVILEGED, /* -p: use suid_profile */
370 FRESTRICTED, /* -r: restricted shell */
371 FSTDIN, /* -s: (invocation) parse stdin */
372 FTRACKALL, /* -h: create tracked aliases for all commands */
373 FVERBOSE, /* -v: echo input */
374 #ifdef VI
375 FVI, /* vi command editing */
376 FVIRAW, /* always read in raw mode (ignored) */
377 FVISHOW8, /* display chars with 8th bit set as is (versus M-) */
378 FVITABCOMPLETE, /* enable tab as file name completion char */
379 FVIESCCOMPLETE, /* enable ESC as file name completion in command mode */
380 #endif
381 FXTRACE, /* -x: execution trace */
382 FTALKING_I, /* (internal): initial shell was interactive */
383 FNFLAGS /* (place holder: how many flags are there) */
384 };
385
386 #define Flag(f) (shell_flags[(int) (f)])
387
388 EXTERN char shell_flags [FNFLAGS];
389
390 EXTERN char null [] I__(""); /* null value for variable */
391 EXTERN char space [] I__(" ");
392 EXTERN char newline [] I__("\n");
393 EXTERN char slash [] I__("/");
394
395 enum temp_type {
396 TT_HEREDOC_EXP, /* expanded heredoc */
397 TT_HIST_EDIT /* temp file used for history editing (fc -e) */
398 };
399 typedef enum temp_type Temp_type;
400 /* temp/heredoc files. The file is removed when the struct is freed. */
401 struct temp {
402 struct temp *next;
403 struct shf *shf;
404 int pid; /* pid of process parsed here-doc */
405 Temp_type type;
406 char *name;
407 };
408
409 /*
410 * stdio and our IO routines
411 */
412
413 #define shl_spare (&shf_iob[0]) /* for c_read()/c_print() */
414 #define shl_stdout (&shf_iob[1])
415 #define shl_out (&shf_iob[2])
416 EXTERN int shl_stdout_ok;
417
418 /*
419 * trap handlers
420 */
421 typedef struct trap {
422 int signal; /* signal number */
423 const char *name; /* short name */
424 const char *mess; /* descriptive name */
425 char *trap; /* trap command */
426 int volatile set; /* trap pending */
427 int flags; /* TF_* */
428 handler_t cursig; /* current handler (valid if TF_ORIG_* set) */
429 handler_t shtrap; /* shell signal handler */
430 } Trap;
431
432 /* values for Trap.flags */
433 #define TF_SHELL_USES BIT(0) /* shell uses signal, user can't change */
434 #define TF_USER_SET BIT(1) /* user has (tried to) set trap */
435 #define TF_ORIG_IGN BIT(2) /* original action was SIG_IGN */
436 #define TF_ORIG_DFL BIT(3) /* original action was SIG_DFL */
437 #define TF_EXEC_IGN BIT(4) /* restore SIG_IGN just before exec */
438 #define TF_EXEC_DFL BIT(5) /* restore SIG_DFL just before exec */
439 #define TF_DFL_INTR BIT(6) /* when received, default action is LINTR */
440 #define TF_TTY_INTR BIT(7) /* tty generated signal (see j_waitj) */
441 #define TF_CHANGED BIT(8) /* used by runtrap() to detect trap changes */
442 #define TF_FATAL BIT(9) /* causes termination if not trapped */
443
444 /* values for setsig()/setexecsig() flags argument */
445 #define SS_RESTORE_MASK 0x3 /* how to restore a signal before an exec() */
446 #define SS_RESTORE_CURR 0 /* leave current handler in place */
447 #define SS_RESTORE_ORIG 1 /* restore original handler */
448 #define SS_RESTORE_DFL 2 /* restore to SIG_DFL */
449 #define SS_RESTORE_IGN 3 /* restore to SIG_IGN */
450 #define SS_FORCE BIT(3) /* set signal even if original signal ignored */
451 #define SS_USER BIT(4) /* user is doing the set (ie, trap command) */
452 #define SS_SHTRAP BIT(5) /* trap for internal use (CHLD,ALRM,WINCH) */
453
454 #define SIGEXIT_ 0 /* for trap EXIT */
455 #define SIGERR_ SIGNALS /* for trap ERR */
456
457 EXTERN int volatile trap; /* traps pending? */
458 EXTERN int volatile intrsig; /* pending trap interrupts executing command */
459 EXTERN int volatile fatal_trap;/* received a fatal signal */
460 extern Trap sigtraps[SIGNALS+1];
461
462 #ifdef KSH
463 /*
464 * TMOUT support
465 */
466 /* values for ksh_tmout_state */
467 enum tmout_enum {
468 TMOUT_EXECUTING = 0, /* executing commands */
469 TMOUT_READING, /* waiting for input */
470 TMOUT_LEAVING /* have timed out */
471 };
472 EXTERN unsigned int ksh_tmout;
473 EXTERN enum tmout_enum ksh_tmout_state I__(TMOUT_EXECUTING);
474 #endif /* KSH */
475
476 /* For "You have stopped jobs" message */
477 EXTERN int really_exit;
478
479 /*
480 * fast character classes
481 */
482 #define C_ALPHA BIT(0) /* a-z_A-Z */
483 #define C_DIGIT BIT(1) /* 0-9 */
484 #define C_LEX1 BIT(2) /* \0 \t\n|&;<>() */
485 #define C_VAR1 BIT(3) /* *@#!$-? */
486 #define C_IFSWS BIT(4) /* \t \n (IFS white space) */
487 #define C_SUBOP1 BIT(5) /* "=-+?" */
488 #define C_SUBOP2 BIT(6) /* "#%" */
489 #define C_IFS BIT(7) /* $IFS */
490 #define C_QUOTE BIT(8) /* \n\t"#$&'()*;<>?[\`| (needing quoting) */
491
492 extern short ctypes [];
493
494 #define ctype(c, t) !!(ctypes[(unsigned char)(c)]&(t))
495 #define letter(c) ctype(c, C_ALPHA)
496 #define digit(c) ctype(c, C_DIGIT)
497 #define letnum(c) ctype(c, C_ALPHA|C_DIGIT)
498
499 EXTERN int ifs0 I__(' '); /* for "$*" */
500
501 /* Argument parsing for built-in commands and getopts command */
502
503 /* Values for Getopt.flags */
504 #define GF_ERROR BIT(0) /* call errorf() if there is an error */
505 #define GF_PLUSOPT BIT(1) /* allow +c as an option */
506 #define GF_NONAME BIT(2) /* don't print argv[0] in errors */
507
508 /* Values for Getopt.info */
509 #define GI_MINUS BIT(0) /* an option started with -... */
510 #define GI_PLUS BIT(1) /* an option started with +... */
511 #define GI_MINUSMINUS BIT(2) /* arguments were ended with -- */
512
513 typedef struct {
514 int optind;
515 int uoptind;/* what user sees in $OPTIND */
516 char *optarg;
517 int flags; /* see GF_* */
518 int info; /* see GI_* */
519 unsigned int p; /* 0 or index into argv[optind - 1] */
520 char buf[2]; /* for bad option OPTARG value */
521 } Getopt;
522
523 EXTERN Getopt builtin_opt; /* for shell builtin commands */
524 EXTERN Getopt user_opt; /* parsing state for getopts builtin command */
525
526 #ifdef KSH
527 /* This for co-processes */
528
529 typedef INT32 Coproc_id; /* something that won't (realisticly) wrap */
530 struct coproc {
531 int read; /* pipe from co-process's stdout */
532 int readw; /* other side of read (saved temporarily) */
533 int write; /* pipe to co-process's stdin */
534 Coproc_id id; /* id of current output pipe */
535 int njobs; /* number of live jobs using output pipe */
536 void *job; /* 0 or job of co-process using input pipe */
537 };
538 EXTERN struct coproc coproc;
539 #endif /* KSH */
540
541 /* Used in jobs.c and by coprocess stuff in exec.c */
542 #ifdef JOB_SIGS
543 EXTERN sigset_t sm_default, sm_sigchld;
544 #endif /* JOB_SIGS */
545
546 extern char ksh_version[];
547
548 /* name of called builtin function (used by error functions) */
549 EXTERN char *builtin_argv0;
550 EXTERN Tflag builtin_flag; /* flags of called builtin (SPEC_BI, etc.) */
551
552 /* current working directory, and size of memory allocated for same */
553 EXTERN char *current_wd;
554 EXTERN int current_wd_size;
555
556 #ifdef EDIT
557 /* Minimum required space to work with on a line - if the prompt leaves less
558 * space than this on a line, the prompt is truncated.
559 */
560 # define MIN_EDIT_SPACE 7
561 /* Minimum allowed value for x_cols: 2 for prompt, 3 for " < " at end of line
562 */
563 # define MIN_COLS (2 + MIN_EDIT_SPACE + 3)
564 EXTERN int x_cols I__(80); /* tty columns */
565 #else
566 # define x_cols 80 /* for pr_menu(exec.c) */
567 #endif
568
569 /* These to avoid bracket matching problems */
570 #define OPAREN '('
571 #define CPAREN ')'
572 #define OBRACK '['
573 #define CBRACK ']'
574 #define OBRACE '{'
575 #define CBRACE '}'
576
577 /* Determine the location of the system (common) profile */
578 #ifndef KSH_SYSTEM_PROFILE
579 # ifdef __NeXT
580 # define KSH_SYSTEM_PROFILE "/etc/profile.std"
581 # else /* __NeXT */
582 # define KSH_SYSTEM_PROFILE "/etc/profile"
583 # endif /* __NeXT */
584 #endif /* KSH_SYSTEM_PROFILE */
585
586 /* Used by v_evaluate() and setstr() to control action when error occurs */
587 #define KSH_UNWIND_ERROR 0 /* unwind the stack (longjmp) */
588 #define KSH_RETURN_ERROR 1 /* return 1/0 for success/failure */
589
590 #include "shf.h"
591 #include "table.h"
592 #include "tree.h"
593 #include "expand.h"
594 #include "lex.h"
595 #include "proto.h"
596
597 /* be sure not to interfere with anyone else's idea about EXTERN */
598 #ifdef EXTERN_DEFINED
599 # undef EXTERN_DEFINED
600 # undef EXTERN
601 #endif
602 #undef I__
603