#ident "@(#)shnodes.h 1.6 93/06/08 SMI" /* From AT&T Toolchest */ #ifndef _SHNODES_H #define _SHNODES_H 1 /* * UNIX shell * Written by David Korn * */ #include "stak.h" #include "io.h" #include "brkincr.h" /* command tree for tretyp */ #define COMBITS 4 #define COMMSK ((1<argval-(char*)(&sh))) /* mark for peek-ahead characters */ #define MARK 0100000 /* legal argument flags */ #define A_RAW 0x1 /* string needs no processing */ #define A_MAKE 0x2 /* bit set during argument expansion */ #define A_MAC 0x4 /* string needs macro expansion */ #define A_EXP 0x8 /* string needs file expansion */ #define A_SPLIT 0x10 /* string needs word splitting */ #define A_ALIAS 0x20 /* formal alias argument */ #define A_JOIN 0x40 /* join with next argument */ /* types of ionodes */ #define IOUFD 0x1f #define IOPUT 0x20 #define IOAPP 0x40 #define IOMOV 0x80 #define IODOC 0x100 #define IOSTRIP 0x200 #define IOCLOB 0x400 #define IORDW 0x800 #define IORAW 0x1000 #define IOSTRG 0x2000 #define IODIGFD 0x4000 union anynode { struct argnod arg; struct ionod io; struct whnod wh; struct swnod sw; struct ifnod if_; struct dolnod dol; struct comnod com; struct trenod tre; struct forknod fork; struct fornod for_; struct regnod reg; struct parnod par; struct lstnod lst; struct procnod proc; struct arithnod ar; }; #ifdef PROTO extern union anynode *sh_mkfork(int,union anynode*); extern union anynode *sh_parse(int,int); extern int sh_lex(void); extern void sh_freeup(void); extern void sh_funstaks(struct slnod*,int); extern void sh_eval(char*); extern void sh_prompt(int); extern void sh_syntax(void); extern int sh_trace(char**,int); extern int sh_exec(union anynode*,int); #else extern union anynode *sh_mkfork(); extern union anynode *sh_parse(); extern int sh_lex(); extern void sh_freeup(); extern void sh_funstaks(); extern void sh_eval(); extern void sh_prompt(); extern void sh_syntax(); extern int sh_trace(); extern int sh_exec(); #endif /* PROTO */ #endif /* _SHNODES_H */