xref: /original-bsd/local/toolchest/ksh/sh/mode.h (revision 33b18212)
1 /*
2 
3  *      Copyright (c) 1984, 1985, 1986 AT&T
4  *      All Rights Reserved
5 
6  *      THIS IS UNPUBLISHED PROPRIETARY SOURCE
7  *      CODE OF AT&T.
8  *      The copyright notice above does not
9  *      evidence any actual or intended
10  *      publication of such source code.
11 
12  */
13 /* @(#)mode.h	1.1 */
14 /*
15  *	UNIX shell
16  *	S. R. Bourne
17  *	Rewritten by David Korn
18  *
19  */
20 
21 
22 
23 /* command tree for tretyp */
24 #define COMBITS	4
25 #define COMMSK	((1<<COMBITS)-1)
26 #define COMSCAN	(01<<COMBITS)
27 #define FPRS	(01<<COMBITS)
28 #define FINT	(02<<COMBITS)
29 #define FAMP	(04<<COMBITS)
30 #define FTMP	(010<<COMBITS)
31 #define FPIN	(020<<COMBITS)
32 #define FPOU	(040<<COMBITS)
33 #define FPCL	(0100<<COMBITS)
34 #define FCMD	(0200<<COMBITS)
35 #define	FCOMSUB	(0400<<COMBITS)
36 
37 #define TCOM	0
38 #define TPAR	1
39 #define TFIL	2
40 #define TLST	3
41 #define TIF	4
42 #define TWH	5
43 #define TUN	6
44 #define TSW	7
45 #define TAND	8
46 #define TORF	9
47 #define TFORK	10
48 #define TFOR	11
49 #define TSELECT	12
50 #define	TTIME	13
51 #define TSETIO	14
52 #define TPROC	15
53 
54 
55 /* heap storage */
56 /* this node is a proforma for those that follow */
57 struct trenod
58 {
59 	int	tretyp;
60 	IOPTR	treio;
61 };
62 
63 
64 struct dolnod
65 {
66 	DOLPTR	dolnxt;
67 	int	doluse;
68 	char	*dolarg[1];
69 };
70 
71 struct forknod
72 {
73 	int	forktyp;
74 	IOPTR	forkio;
75 	TREPTR	forktre;
76 };
77 
78 struct comnod
79 {
80 	int	comtyp;
81 	IOPTR	comio;
82 	ARGPTR	comarg;
83 	ARGPTR	comset;
84 	int	comline;
85 };
86 
87 struct ifnod
88 {
89 	int	iftyp;
90 	TREPTR	iftre;
91 	TREPTR	thtre;
92 	TREPTR	eltre;
93 };
94 
95 struct whnod
96 {
97 	int	whtyp;
98 	TREPTR	whtre;
99 	TREPTR	dotre;
100 };
101 
102 struct fornod
103 {
104 	int	fortyp;
105 	TREPTR	fortre;
106 	char *fornam;
107 	COMPTR	forlst;
108 };
109 
110 struct swnod
111 {
112 	int	swtyp;
113 	char *swarg;
114 	REGPTR	swlst;
115 };
116 
117 struct regnod
118 {
119 	ARGPTR	regptr;
120 	TREPTR	regcom;
121 	REGPTR	regnxt;
122 };
123 
124 struct parnod
125 {
126 	int	partyp;
127 	TREPTR	partre;
128 };
129 
130 struct lstnod
131 {
132 	int	lsttyp;
133 	TREPTR	lstlef;
134 	TREPTR	lstrit;
135 };
136 
137 
138 struct procnod
139 {
140 	int	proctyp;
141 	BLKPTR	proctre;
142 	char	*procnam;
143 	long	procloc;
144 };
145 
146 
147 #define	FORKTYPE	(sizeof(struct forknod))
148 #define	COMTYPE		(sizeof(struct comnod))
149 #define	IFTYPE		(sizeof(struct ifnod))
150 #define	WHTYPE		(sizeof(struct whnod))
151 #define	FORTYPE		(sizeof(struct fornod))
152 #define	SWTYPE		(sizeof(struct swnod))
153 #define	REGTYPE		(sizeof(struct regnod))
154 #define	PARTYPE		(sizeof(struct parnod))
155 #define	LSTTYPE		(sizeof(struct lstnod))
156 #define DOLTYPE		(sizeof(struct dolnod))
157 #define	PROCTYPE	(sizeof(struct procnod))
158