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