4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
25 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
26 /* All Rights Reserved */
43 #define BYTESPERWORD (sizeof (char *))
44 #define ALIGNSIZ (sizeof (double))
45 #define NIL ((char *)0)
49 * the following nonsense is required
50 * because casts turn an Lvalue
51 * into an Rvalue so two cheats
52 * are necessary, one for each context.
54 #define Rcheat(a) ((int)(a))
57 /* address puns for storage allocation */
60 struct forknod
*_forkptr
;
61 struct comnod
*_comptr
;
62 struct fndnod
*_fndptr
;
63 struct parnod
*_parptr
;
66 struct fornod
*_forptr
;
67 struct lstnod
*_lstptr
;
69 struct namnod
*_namptr
;
78 char pad
[ALIGNSIZ
- sizeof (struct blk
*)];
82 * largefile converson hack note.
83 * the shell uses the *fnxt and *fend pointers when
84 * parsing a script. However, it was also using the
85 * difference between them when doing lseeks. Because
86 * that doesn't work in the largefile world, I have
87 * added a parallel set of offset counters that need to
88 * be updated whenever the "buffer" offsets the shell
89 * uses get changed. Most of this code is in word.c.
90 * If you change it, have fun...
93 #define BUFFERSIZE 128
102 off_t nxtoff
; /* file offset */
103 off_t endoff
; /* file offset */
104 unsigned char **feval
;
105 struct fileblk
*fstak
;
106 unsigned char fbuf
[BUFFERSIZE
];
112 struct tempblk
*fstak
;
116 /* for files not used with file descriptors */
125 off_t nxtoff
; /* file offset */
126 off_t endoff
; /* file offset */
127 unsigned char **feval
;
128 struct fileblk
*fstak
;
129 unsigned char _fbuf
[1];
138 /* this node is a proforma for those that follow */
145 /* dummy for access only */
148 struct argnod
*argnxt
;
149 unsigned char argval
[1];
154 struct dolnod
*dolnxt
;
156 unsigned char **dolarg
;
162 struct ionod
*forkio
;
163 struct trenod
*forktre
;
170 struct argnod
*comarg
;
171 struct argnod
*comset
;
177 unsigned char *fndnam
;
178 struct trenod
*fndval
;
185 struct trenod
*iftre
;
186 struct trenod
*thtre
;
187 struct trenod
*eltre
;
193 struct trenod
*whtre
;
194 struct trenod
*dotre
;
200 struct trenod
*fortre
;
201 unsigned char *fornam
;
202 struct comnod
*forlst
;
208 unsigned char *swarg
;
209 struct regnod
*swlst
;
214 struct argnod
*regptr
;
215 struct trenod
*regcom
;
216 struct regnod
*regnxt
;
222 struct trenod
*partre
;
228 struct trenod
*lstlef
;
229 struct trenod
*lstrit
;
248 #define fndptr(x) ((struct fndnod *)x)
249 #define comptr(x) ((struct comnod *)x)
250 #define forkptr(x) ((struct forknod *)x)
251 #define parptr(x) ((struct parnod *)x)
252 #define lstptr(x) ((struct lstnod *)x)
253 #define forptr(x) ((struct fornod *)x)
254 #define whptr(x) ((struct whnod *)x)
255 #define ifptr(x) ((struct ifnod *)x)
256 #define swptr(x) ((struct swnod *)x)