1: /* mode.h 4.1 82/05/07 */
2:
3: #
4: /*
5: * UNIX shell
6: */
7:
8:
9: #define BYTESPERWORD (sizeof(char *))
10:
11: TYPE char CHAR;
12: TYPE char BOOL;
13: TYPE int UFD;
14: TYPE int INT;
15: TYPE float REAL;
16: TYPE char *ADDRESS;
17: TYPE long int L_INT;
18: TYPE int VOID;
19: TYPE unsigned POS;
20: TYPE char *STRING;
21: TYPE char MSG[];
22: TYPE int PIPE[];
23: TYPE char *STKPTR;
24: TYPE char *BYTPTR;
25:
26: STRUCT stat STATBUF; /* defined in /usr/sys/stat.h */
27: STRUCT blk *BLKPTR;
28: STRUCT fileblk FILEBLK;
29: STRUCT filehdr FILEHDR;
30: STRUCT fileblk *FILE;
31: STRUCT trenod *TREPTR;
32: STRUCT forknod *FORKPTR;
33: STRUCT comnod *COMPTR;
34: STRUCT swnod *SWPTR;
35: STRUCT regnod *REGPTR;
36: STRUCT parnod *PARPTR;
37: STRUCT ifnod *IFPTR;
38: STRUCT whnod *WHPTR;
39: STRUCT fornod *FORPTR;
40: STRUCT lstnod *LSTPTR;
41: STRUCT argnod *ARGPTR;
42: STRUCT dolnod *DOLPTR;
43: STRUCT ionod *IOPTR;
44: STRUCT namnod NAMNOD;
45: STRUCT namnod *NAMPTR;
46: STRUCT sysnod SYSNOD;
47: STRUCT sysnod *SYSPTR;
48: STRUCT sysnod SYSTAB[];
49: #define NIL ((char*)0)
50:
51:
52: /* the following nonsense is required
53: * because casts turn an Lvalue
54: * into an Rvalue so two cheats
55: * are necessary, one for each context.
56: */
57: union { int _cheat;};
58: #define Lcheat(a) ((a)._cheat)
59: #define Rcheat(a) ((int)(a))
60:
61:
62: /* address puns for storage allocation */
63: UNION {
64: FORKPTR _forkptr;
65: COMPTR _comptr;
66: PARPTR _parptr;
67: IFPTR _ifptr;
68: WHPTR _whptr;
69: FORPTR _forptr;
70: LSTPTR _lstptr;
71: BLKPTR _blkptr;
72: NAMPTR _namptr;
73: BYTPTR _bytptr;
74: } address;
75:
76:
77: /* for functions that do not return values */
78: /*
79: struct void {INT vvvvvvvv;};
80: */
81:
82:
83: /* heap storage */
84: struct blk {
85: BLKPTR word;
86: };
87:
88: #define BUFSIZ 64
89: struct fileblk {
90: UFD fdes;
91: POS flin;
92: BOOL feof;
93: CHAR fsiz;
94: STRING fnxt;
95: STRING fend;
96: STRING *feval;
97: FILE fstak;
98: CHAR fbuf[BUFSIZ];
99: };
100:
101: /* for files not used with file descriptors */
102: struct filehdr {
103: UFD fdes;
104: POS flin;
105: BOOL feof;
106: CHAR fsiz;
107: STRING fnxt;
108: STRING fend;
109: STRING *feval;
110: FILE fstak;
111: CHAR _fbuf[1];
112: };
113:
114: struct sysnod {
115: STRING sysnam;
116: INT sysval;
117: };
118:
119: /* this node is a proforma for those that follow */
120: struct trenod {
121: INT tretyp;
122: IOPTR treio;
123: };
124:
125: /* dummy for access only */
126: struct argnod {
127: ARGPTR argnxt;
128: CHAR argval[1];
129: };
130:
131: struct dolnod {
132: DOLPTR dolnxt;
133: INT doluse;
134: CHAR dolarg[1];
135: };
136:
137: struct forknod {
138: INT forktyp;
139: IOPTR forkio;
140: TREPTR forktre;
141: };
142:
143: struct comnod {
144: INT comtyp;
145: IOPTR comio;
146: ARGPTR comarg;
147: ARGPTR comset;
148: };
149:
150: struct ifnod {
151: INT iftyp;
152: TREPTR iftre;
153: TREPTR thtre;
154: TREPTR eltre;
155: };
156:
157: struct whnod {
158: INT whtyp;
159: TREPTR whtre;
160: TREPTR dotre;
161: };
162:
163: struct fornod {
164: INT fortyp;
165: TREPTR fortre;
166: STRING fornam;
167: COMPTR forlst;
168: };
169:
170: struct swnod {
171: INT swtyp;
172: STRING swarg;
173: REGPTR swlst;
174: };
175:
176: struct regnod {
177: ARGPTR regptr;
178: TREPTR regcom;
179: REGPTR regnxt;
180: };
181:
182: struct parnod {
183: INT partyp;
184: TREPTR partre;
185: };
186:
187: struct lstnod {
188: INT lsttyp;
189: TREPTR lstlef;
190: TREPTR lstrit;
191: };
192:
193: struct ionod {
194: INT iofile;
195: STRING ioname;
196: IOPTR ionxt;
197: IOPTR iolst;
198: };
199:
200: #define FORKTYPE (sizeof(struct forknod))
201: #define COMTYPE (sizeof(struct comnod))
202: #define IFTYPE (sizeof(struct ifnod))
203: #define WHTYPE (sizeof(struct whnod))
204: #define FORTYPE (sizeof(struct fornod))
205: #define SWTYPE (sizeof(struct swnod))
206: #define REGTYPE (sizeof(struct regnod))
207: #define PARTYPE (sizeof(struct parnod))
208: #define LSTTYPE (sizeof(struct lstnod))
209: #define IOTYPE (sizeof(struct ionod))
Defined variables
BOOL
defined in line
12; used 22 times
CHAR
defined in line
11; used 44 times
- in line 93-98(2),
106-111(2),
128,
134
- in /usr/src/bin/sh/args.c line
19-21(2)
- in /usr/src/bin/sh/cmd.c line
323
- in /usr/src/bin/sh/defs.h line
193,
252
- in /usr/src/bin/sh/expand.c line
110,
122
- in /usr/src/bin/sh/io.c line
114-115(2)
- in /usr/src/bin/sh/macro.c line
17-25(4),
34-37(2),
54-56(2),
70,
159,
176,
216
- in /usr/src/bin/sh/main.c line
24
- in /usr/src/bin/sh/name.c line
36,
134,
220
- in /usr/src/bin/sh/print.c line
16,
47,
90-92(2)
- in /usr/src/bin/sh/service.c line
293-294(2)
- in /usr/src/bin/sh/string.c line
28-31(2)
- in /usr/src/bin/sh/word.c line
23-24(2),
82-84(2),
98
INT
defined in line
14; used 124 times
- in line 116-121(2),
133-138(2),
144,
151,
158,
164,
171,
183-188(2),
194
- in /usr/src/bin/sh/args.c line
24,
31-33(2),
77
- in /usr/src/bin/sh/blok.c line
36,
95-98(2)
- in /usr/src/bin/sh/cmd.c line
36,
47,
70-71(2),
123,
155,
219,
283,
321,
371
- in /usr/src/bin/sh/defs.h line
121-126(2),
153-156(3),
195-200(2),
220,
257-260(3)
- in /usr/src/bin/sh/error.c line
52
- in /usr/src/bin/sh/expand.c line
33-36(2),
121,
132,
167
- in /usr/src/bin/sh/fault.c line
25-27(2),
58,
68,
77,
92,
104,
112
- in /usr/src/bin/sh/io.c line
63,
73,
82,
94,
116
- in /usr/src/bin/sh/macro.c line
64-67(2),
190,
214-218(2)
- in /usr/src/bin/sh/main.c line
37-40(2),
104,
184
- in /usr/src/bin/sh/msg.c line
128
- in /usr/src/bin/sh/name.c line
54,
69,
129,
135,
171,
194,
308
- in /usr/src/bin/sh/print.c line
57,
70,
77,
91
- in /usr/src/bin/sh/service.c line
21-23(2),
40,
88,
201-206(3),
214-216(2),
229-242(8),
312,
337-338(2),
360-364(2),
377-382(3)
- in /usr/src/bin/sh/stak.c line
23-26(2)
- in /usr/src/bin/sh/string.c line
27,
41,
52
- in /usr/src/bin/sh/word.c line
25,
99,
130
- in /usr/src/bin/sh/xec.c line
17,
28,
37-38(2),
49,
74,
113,
126,
177,
311,
365
L_INT
defined in line
17; used 3 times
MSG
defined in line
21; used 97 times
PIPE
defined in line
22;
never used
POS
defined in line
19; used 9 times
REAL
defined in line
15; used 1 times
STKPTR
defined in line
23; used 16 times
STRING
defined in line
20; used 141 times
- in line 94-96(3),
107-109(3),
115,
166,
172,
195
- in /usr/src/bin/sh/args.c line
16,
32-38(5),
73-76(2),
90,
105-110(6)
- in /usr/src/bin/sh/defs.h line
85-86(2),
94-104(8),
110,
127,
175-179(5),
194,
201,
246-251(2)
- in /usr/src/bin/sh/error.c line
36,
46,
71
- in /usr/src/bin/sh/expand.c line
34-40(3),
79,
119,
164-166(2),
189
- in /usr/src/bin/sh/fault.c line
17,
78,
105
- in /usr/src/bin/sh/io.c line
30,
71,
92
- in /usr/src/bin/sh/macro.c line
22,
69-71(2),
152-153(2),
184
- in /usr/src/bin/sh/main.c line
38
- in /usr/src/bin/sh/msg.c line
93
- in /usr/src/bin/sh/name.c line
33-37(2),
57,
68-71(2),
104-105(2),
112,
121,
130,
170,
176-179(3),
190,
218,
254,
264-267(2),
302,
316,
326-328(2)
- in /usr/src/bin/sh/print.c line
37-39(2),
88
- in /usr/src/bin/sh/service.c line
22,
39,
73-76(3),
89,
98-103(4),
114-121(5),
132-136(4),
290-292(2),
303-315(5),
335,
348-351(2),
378-380(2)
- in /usr/src/bin/sh/stak.c line
54
- in /usr/src/bin/sh/string.c line
20-21(2),
29,
42,
53-55(2)
- in /usr/src/bin/sh/xec.c line
39,
48,
339,
386-391(2),
413
UFD
defined in line
13; used 7 times
VOID
defined in line
18; used 47 times
- in /usr/src/bin/sh/args.c line
72
- in /usr/src/bin/sh/blok.c line
56,
81
- in /usr/src/bin/sh/cmd.c line
18-19(2),
25-27(3),
312,
362,
369,
377,
395
- in /usr/src/bin/sh/defs.h line
84,
90-91(2),
100-109(8),
244
- in /usr/src/bin/sh/expand.c line
30,
163
- in /usr/src/bin/sh/fault.c line
24
- in /usr/src/bin/sh/main.c line
31,
100
- in /usr/src/bin/sh/name.c line
67,
241,
251,
275,
286,
300,
310,
318
- in /usr/src/bin/sh/print.c line
36,
46
- in /usr/src/bin/sh/service.c line
17,
36,
117,
213,
228,
334
- in /usr/src/bin/sh/stak.c line
62
Defined struct's
blk
defined in line
84;
never used
Defined macros
NIL
defined in line
49; used 11 times
Rcheat
defined in line
59; used 11 times
Usage of this include