xref: /netbsd-src/bin/csh/extern.h (revision fdecd6a253f999ae92b139670d9e15cc9df4497c)
1 /*	$NetBSD: extern.h,v 1.9 1997/07/04 21:24:00 christos Exp $	*/
2 
3 /*-
4  * Copyright (c) 1991, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *	This product includes software developed by the University of
18  *	California, Berkeley and its contributors.
19  * 4. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  *	@(#)extern.h	8.1 (Berkeley) 5/31/93
36  */
37 
38 #include <sys/cdefs.h>
39 
40 /*
41  * csh.c
42  */
43 int	gethdir __P((Char *));
44 void	dosource __P((Char **, struct command *));
45 void	exitstat __P((void));
46 void	goodbye __P((void));
47 void	importpath __P((Char *));
48 void	initdesc __P((void));
49 void	pintr __P((int));
50 void	pintr1 __P((bool));
51 void	printprompt __P((void));
52 void	process __P((bool));
53 void	rechist __P((void));
54 void	untty __P((void));
55 int	vis_fputc __P((int, FILE *));
56 
57 #ifdef PROF
58 void done __P((int));
59 #else
60 void xexit __P((int));
61 #endif
62 
63 /*
64  * dir.c
65  */
66 void	 dinit __P((Char *));
67 void	 dodirs __P((Char **, struct command *));
68 Char	*dcanon __P((Char *, Char *));
69 void	 dtildepr __P((Char *, Char *));
70 void	 dtilde __P((void));
71 void	 dochngd __P((Char **, struct command *));
72 Char	*dnormalize __P((Char *));
73 void	 dopushd __P((Char **, struct command *));
74 void	 dopopd __P((Char **, struct command *));
75 struct directory;
76 void	 dfree __P((struct directory *));
77 
78 /*
79  * dol.c
80  */
81 void	 Dfix __P((struct command *));
82 Char	*Dfix1 __P((Char *));
83 void	 heredoc __P((Char *));
84 
85 /*
86  * err.c
87  */
88 void	seterror __P((int, ...));
89 void	stderror __P((int, ...));
90 
91 /*
92  * exec.c
93  */
94 void	doexec __P((Char **, struct command *));
95 void	dohash __P((Char **, struct command *));
96 void	dounhash __P((Char **, struct command *));
97 void	dowhich __P((Char **, struct command *));
98 void	execash __P((Char **, struct command *));
99 void	hashstat __P((Char **, struct command *));
100 void	xechoit __P((Char **));
101 
102 /*
103  * exp.c
104  */
105 int	expr __P((Char ***));
106 int	exp0 __P((Char ***, bool));
107 
108 /*
109  * file.c
110  */
111 #ifdef FILEC
112 int	tenex __P((Char *, int));
113 #endif
114 
115 /*
116  * func.c
117  */
118 void	Setenv __P((Char *, Char *));
119 void	doalias __P((Char **, struct command *));
120 void	dobreak __P((Char **, struct command *));
121 void	docontin __P((Char **, struct command *));
122 void	doecho __P((Char **, struct command *));
123 void	doelse __P((Char **, struct command *));
124 void	doend __P((Char **, struct command *));
125 void	doeval __P((Char **, struct command *));
126 void	doexit __P((Char **, struct command *));
127 void	doforeach __P((Char **, struct command *));
128 void	doglob __P((Char **, struct command *));
129 void	dogoto __P((Char **, struct command *));
130 void	doif __P((Char **, struct command *));
131 void	dolimit __P((Char **, struct command *));
132 void	dologin __P((Char **, struct command *));
133 void	dologout __P((Char **, struct command *));
134 void	donohup __P((Char **, struct command *));
135 void	doonintr __P((Char **, struct command *));
136 void	doprintf __P((Char **, struct command *));
137 void	dorepeat __P((Char **, struct command *));
138 void	dosetenv __P((Char **, struct command *));
139 void	dosuspend __P((Char **, struct command *));
140 void	doswbrk __P((Char **, struct command *));
141 void	doswitch __P((Char **, struct command *));
142 void	doumask __P((Char **, struct command *));
143 void	dounlimit __P((Char **, struct command *));
144 void	dounsetenv __P((Char **, struct command *));
145 void	dowhile __P((Char **, struct command *));
146 void	dozip __P((Char **, struct command *));
147 void	func __P((struct command *, struct biltins *));
148 struct	biltins *
149 	isbfunc __P((struct command *));
150 void	prvars __P((void));
151 void	gotolab __P((Char *));
152 int	srchx __P((Char *));
153 void	unalias __P((Char **, struct command *));
154 void	wfree __P((void));
155 
156 /*
157  * glob.c
158  */
159 Char	**dobackp __P((Char *, bool));
160 void	  Gcat __P((Char *, Char *));
161 Char	 *globone __P((Char *, int));
162 int	  Gmatch __P((Char *, Char *));
163 void	  ginit __P((void));
164 Char	**globall __P((Char **));
165 void	  rscan __P((Char **, void (*)(int)));
166 void	  tglob __P((Char **));
167 void	  trim __P((Char **));
168 #ifdef FILEC
169 int	  sortscmp __P((const ptr_t, const ptr_t));
170 #endif /* FILEC */
171 
172 /*
173  * hist.c
174  */
175 void	dohist __P((Char **, struct command *));
176 struct Hist *
177 	enthist __P((int, struct wordent *, bool));
178 void	savehist __P((struct wordent *));
179 
180 /*
181  * lex.c
182  */
183 void	 addla __P((Char *));
184 void	 bseek __P((struct Ain *));
185 void	 btell __P((struct Ain *));
186 void	 btoeof __P((void));
187 void	 copylex __P((struct wordent *, struct wordent *));
188 Char	*domod __P((Char *, int));
189 void	 freelex __P((struct wordent *));
190 int	 lex __P((struct wordent *));
191 void	 prlex __P((FILE *, struct wordent *));
192 int	 readc __P((bool));
193 void	 settell __P((void));
194 void	 unreadc __P((int));
195 
196 /*
197  * misc.c
198  */
199 int	  any __P((char *, int));
200 Char	**blkcat __P((Char **, Char **));
201 Char	**blkcpy __P((Char **, Char **));
202 Char	**blkend __P((Char **));
203 void	  blkfree __P((Char **));
204 int	  blklen __P((Char **));
205 void	  blkpr __P((FILE *, Char **));
206 Char	**blkspl __P((Char **, Char **));
207 void	  closem __P((void));
208 Char	**copyblk __P((Char **));
209 int	  dcopy __P((int, int));
210 int	  dmove __P((int, int));
211 void	  donefds __P((void));
212 Char	  lastchr __P((Char *));
213 void	  lshift __P((Char **, int));
214 int	  number __P((Char *));
215 int	  prefix __P((Char *, Char *));
216 Char	**saveblk __P((Char **));
217 void	  setzero __P((char *, int));
218 Char	 *strip __P((Char *));
219 Char	 *quote __P((Char *));
220 char	 *strsave __P((char *));
221 char	 *strspl __P((char *, char *));
222 void	  udvar __P((Char *));
223 
224 #ifndef	SHORT_STRINGS
225 # ifdef NOTUSED
226 char	 *strstr __P((const char *, const char *));
227 # endif /* NOTUSED */
228 char	 *strend __P((char *));
229 #endif
230 
231 /*
232  * parse.c
233  */
234 void	alias __P((struct wordent *));
235 void	freesyn __P((struct command *));
236 struct command *
237 	syntax __P((struct wordent *, struct wordent *, int));
238 
239 
240 /*
241  * proc.c
242  */
243 void	dobg __P((Char **, struct command *));
244 void	dobg1 __P((Char **, struct command *));
245 void	dofg __P((Char **, struct command *));
246 void	dofg1 __P((Char **, struct command *));
247 void	dojobs __P((Char **, struct command *));
248 void	dokill __P((Char **, struct command *));
249 void	donotify __P((Char **, struct command *));
250 void	dostop __P((Char **, struct command *));
251 void	dowait __P((Char **, struct command *));
252 void	palloc __P((int, struct command *));
253 void	panystop __P((bool));
254 void	pchild __P((int));
255 void	pendjob __P((void));
256 struct process *
257 	pfind __P((Char *));
258 int	pfork __P((struct command *, int));
259 void	pgetty __P((int, int));
260 void	pjwait __P((struct process *));
261 void	pnote __P((void));
262 void	prestjob __P((void));
263 void	psavejob __P((void));
264 void	pstart __P((struct process *, int));
265 void	pwait __P((void));
266 
267 /*
268  * sem.c
269  */
270 void	execute __P((struct command *, int, int *, int *));
271 void	mypipe __P((int *));
272 
273 /*
274  * set.c
275  */
276 struct	varent
277 	*adrof1 __P((Char *, struct varent *));
278 void	 doset __P((Char **, struct command *));
279 void	 dolet __P((Char **, struct command *));
280 Char	*putn __P((int));
281 int	 getn __P((Char *));
282 Char	*value1 __P((Char *, struct varent *));
283 void	 set __P((Char *, Char *));
284 void	 set1 __P((Char *, Char **, struct varent *));
285 void	 setq __P((Char *, Char **, struct varent *));
286 void	 unset __P((Char **, struct command *));
287 void	 unset1 __P((Char *[], struct varent *));
288 void	 unsetv __P((Char *));
289 void	 setNS __P((Char *));
290 void	 shift __P((Char **, struct command *));
291 void	 plist __P((struct varent *));
292 
293 /*
294  * time.c
295  */
296 void	donice __P((Char **, struct command *));
297 void	dotime __P((Char **, struct command *));
298 void	prusage __P((struct rusage *, struct rusage *,
299 	    struct timeval *, struct timeval *));
300 void	ruadd __P((struct rusage *, struct rusage *));
301 void	settimes __P((void));
302 void	pcsecs __P((long));
303 void	psecs __P((long));
304 
305 /*
306  * alloc.c
307  */
308 void	Free __P((ptr_t));
309 ptr_t	Malloc __P((size_t));
310 ptr_t	Realloc __P((ptr_t, size_t));
311 ptr_t	Calloc __P((size_t, size_t));
312 void	showall __P((Char **, struct command *));
313 
314 /*
315  * str.c:
316  */
317 #ifdef SHORT_STRINGS
318 Char	 *s_strchr __P((Char *, int));
319 Char	 *s_strrchr __P((Char *, int));
320 Char	 *s_strcat __P((Char *, Char *));
321 #ifdef NOTUSED
322 Char	 *s_strncat __P((Char *, Char *, size_t));
323 #endif
324 Char	 *s_strcpy __P((Char *, Char *));
325 Char	 *s_strncpy __P((Char *, Char *, size_t));
326 Char	 *s_strspl __P((Char *, Char *));
327 size_t	  s_strlen __P((Char *));
328 int	  s_strcmp __P((Char *, Char *));
329 int	  s_strncmp __P((Char *, Char *, size_t));
330 Char	 *s_strsave __P((Char *));
331 Char	 *s_strend __P((Char *));
332 Char	 *s_strstr __P((Char *, Char *));
333 Char	 *str2short __P((char *));
334 Char	**blk2short __P((char **));
335 char	 *short2str __P((Char *));
336 char	**short2blk __P((Char **));
337 #endif
338 char	 *short2qstr __P((Char *));
339 char	 *vis_str    __P((Char *));
340