/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */ /* All Rights Reserved */ /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */ /* UNIX System Laboratories, Inc. */ /* The copyright notice above does not evidence any */ /* actual or intended publication of such source code. */ #ident "@(#)ksh:include/shnodes.h 1.2.4.2" #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 0200000 /* 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 */ #ifdef sgi /* types of ionodes */ #define IOUFD 0x3fffff /* mask back to index in file descriptor */ /* #if IOUFD < (nfile-1) * this is a failure * #endif */ #define IOPUT 0x400000 #define IOAPP 0x800000 #define IOMOV 0x1000000 #define IODOC 0x2000000 #define IOSTRIP 0x4000000 #define IOCLOB 0x8000000 #define IORDW 0x10000000 #define IORAW 0x20000000 #define IOSTRG 0x40000000 #else /* types of ionodes */ #define IOUFD 0x7f /* mask back to index in file descriptor */ #if IOUFD != (NFILE-1) this is a failure; abort here #endif #define IOPUT 0x80 #define IOAPP 0x100 #define IOMOV 0x200 #define IODOC 0x400 #define IOSTRIP 0x800 #define IOCLOB 0x1000 #define IORDW 0x2000 #define IORAW 0x4000 #define IOSTRG 0x8000 #endif /* sgi */ 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 */