xref: /original-bsd/bin/csh/extern.h (revision 67e03b52)
1 /*-
2  * Copyright (c) 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)extern.h	5.6 (Berkeley) 07/28/91
8  */
9 
10 #include <sys/cdefs.h>
11 
12 /*
13  * csh.c
14  */
15 int	gethdir __P((Char *));
16 void	dosource __P((Char **, struct command *));
17 void	exitstat __P((void));
18 void	goodbye __P((void));
19 void	importpath __P((Char *));
20 void	initdesc __P((void));
21 void	pintr __P((int));
22 void	pintr1 __P((bool));
23 void	printprompt __P((void));
24 void	process __P((bool));
25 void	rechist __P((void));
26 void	untty __P((void));
27 
28 #ifdef PROF
29 void done __P((int));
30 #else
31 void xexit __P((int));
32 #endif
33 
34 /*
35  * dir.c
36  */
37 void	 dinit __P((Char *));
38 void	 dodirs __P((Char **, struct command *));
39 Char	*dcanon __P((Char *, Char *));
40 void	 dtildepr __P((Char *, Char *));
41 void	 dtilde __P((void));
42 void	 dochngd __P((Char **, struct command *));
43 Char	*dnormalize __P((Char *));
44 void	 dopushd __P((Char **, struct command *));
45 void	 dopopd __P((Char **, struct command *));
46 struct directory;
47 void	 dfree __P((struct directory *));
48 
49 /*
50  * dol.c
51  */
52 void	 Dfix __P((struct command *));
53 Char	*Dfix1 __P((Char *));
54 void	 heredoc __P((Char *));
55 
56 /*
57  * err.c
58  */
59 void	seterror __P((int, ...));
60 void	stderror __P((int, ...));
61 
62 /*
63  * exec.c
64  */
65 void	doexec __P((Char **, struct command *));
66 void	dohash __P((Char **, struct command *));
67 void	dounhash __P((Char **, struct command *));
68 void	dowhich __P((Char **, struct command *));
69 void	execash __P((Char **, struct command *));
70 void	hashstat __P((Char **, struct command *));
71 void	xechoit __P((Char **));
72 
73 /*
74  * exp.c
75  */
76 int	exp __P((Char ***));
77 int	exp0 __P((Char ***, bool));
78 
79 /*
80  * file.c
81  */
82 #ifdef FILEC
83 int	tenex __P((Char *, int));
84 #endif
85 
86 /*
87  * func.c
88  */
89 void	Setenv __P((Char *, Char *));
90 void	doalias __P((Char **, struct command *));
91 void	dobreak __P((Char **, struct command *));
92 void	docontin __P((Char **, struct command *));
93 void	doecho __P((Char **, struct command *));
94 void	doelse __P((Char **, struct command *));
95 void	doend __P((Char **, struct command *));
96 void	doeval __P((Char **, struct command *));
97 void	doexit __P((Char **, struct command *));
98 void	doforeach __P((Char **, struct command *));
99 void	doglob __P((Char **, struct command *));
100 void	dogoto __P((Char **, struct command *));
101 void	doif __P((Char **, struct command *));
102 void	dolimit __P((Char **, struct command *));
103 void	dologin __P((Char **, struct command *));
104 void	dologout __P((Char **, struct command *));
105 void	donohup __P((Char **, struct command *));
106 void	doonintr __P((Char **, struct command *));
107 void	doprintf __P((Char **, struct command *));
108 void	dorepeat __P((Char **, struct command *));
109 void	dosetenv __P((Char **, struct command *));
110 void	dosuspend __P((Char **, struct command *));
111 void	doswbrk __P((Char **, struct command *));
112 void	doswitch __P((Char **, struct command *));
113 void	doumask __P((Char **, struct command *));
114 void	dounlimit __P((Char **, struct command *));
115 void	dounsetenv __P((Char **, struct command *));
116 void	dowhile __P((Char **, struct command *));
117 void	dozip __P((Char **, struct command *));
118 void	func __P((struct command *, struct biltins *));
119 struct	biltins *
120 	isbfunc __P((struct command *));
121 void	prvars __P((void));
122 void	search __P((int, int, Char *));
123 int	srchx __P((Char *));
124 void	unalias __P((Char **, struct command *));
125 void	wfree __P((void));
126 
127 /*
128  * glob.c
129  */
130 Char	**dobackp __P((Char *, bool));
131 void	  Gcat __P((Char *, Char *));
132 Char	 *globone __P((Char *, int));
133 int	  Gmatch __P((Char *, Char *));
134 void	  ginit __P((void));
135 Char	**globall __P((Char **));
136 void	  rscan __P((Char **, void (*)()));
137 void	  tglob __P((Char **));
138 void	  trim __P((Char **));
139 #ifdef FILEC
140 int	  sortscmp __P((Char **, Char **));
141 #endif /* FILEC */
142 
143 /*
144  * hist.c
145  */
146 void	dohist __P((Char **, struct command *));
147 struct Hist *
148 	enthist __P((int, struct wordent *, bool));
149 void	savehist __P((struct wordent *));
150 
151 /*
152  * lex.c
153  */
154 void	 addla __P((Char *));
155 void	 bseek __P((off_t));
156 void	 btoeof __P((void));
157 void	 copylex __P((struct wordent *, struct wordent *));
158 Char	*domod __P((Char *, int));
159 void	 freelex __P((struct wordent *));
160 int	 lex __P((struct wordent *));
161 void	 prlex __P((FILE *, struct wordent *));
162 int	 readc __P((bool));
163 void	 settell __P((void));
164 void	 unreadc __P((int));
165 
166 /*
167  * misc.c
168  */
169 int	  any __P((char *, int));
170 Char	**blkcat __P((Char **, Char **));
171 Char	**blkcpy __P((Char **, Char **));
172 Char	**blkend __P((Char **));
173 void	  blkfree __P((Char **));
174 int	  blklen __P((Char **));
175 void	  blkpr __P((FILE *, Char **));
176 Char	**blkspl __P((Char **, Char **));
177 void	  closem __P((void));
178 Char	**copyblk __P((Char **));
179 int	  dcopy __P((int, int));
180 int	  dmove __P((int, int));
181 void	  donefds __P((void));
182 Char	  lastchr __P((Char *));
183 void	  lshift __P((Char **, int));
184 int	  number __P((Char *));
185 int	  prefix __P((Char *, Char *));
186 Char	**saveblk __P((Char **));
187 void	  setzero __P((char *, int));
188 Char	 *strip __P((Char *));
189 char	 *strsave __P((char *));
190 char	 *strspl __P((char *, char *));
191 void	  udvar __P((Char *));
192 
193 #ifndef	NOTUSED
194 char	 *strstr __P((const char *, const char *));
195 #endif
196 #ifndef	SHORT_STRINGS
197 char	 *strend __P((char *));
198 #endif
199 
200 /*
201  * parse.c
202  */
203 void	alias __P((struct wordent *));
204 void	freesyn __P((struct command *));
205 struct command *
206 	syntax __P((struct wordent *, struct wordent *, int));
207 
208 
209 /*
210  * proc.c
211  */
212 void	dobg __P((Char **, struct command *));
213 void	dobg1 __P((Char **, struct command *));
214 void	dofg __P((Char **, struct command *));
215 void	dofg1 __P((Char **, struct command *));
216 void	dojobs __P((Char **, struct command *));
217 void	dokill __P((Char **, struct command *));
218 void	donotify __P((Char **, struct command *));
219 void	dostop __P((Char **, struct command *));
220 void	dowait __P((Char **, struct command *));
221 void	palloc __P((int, struct command *));
222 void	panystop __P((bool));
223 void	pchild __P((int));
224 void	pendjob __P((void));
225 struct process *
226 	pfind __P((Char *));
227 int	pfork __P((struct command *, int));
228 void	pgetty __P((int, int));
229 void	pjwait __P((struct process *));
230 void	pnote __P((void));
231 void	prestjob __P((void));
232 void	psavejob __P((void));
233 void	pstart __P((struct process *, int));
234 void	pwait __P((void));
235 
236 /*
237  * sem.c
238  */
239 void	execute __P((struct command *, int, int *, int *));
240 void	mypipe __P((int *));
241 
242 /*
243  * set.c
244  */
245 struct	varent
246 	*adrof1 __P((Char *, struct varent *));
247 void	 doset __P((Char **, struct command *));
248 void	 dolet __P((Char **, struct command *));
249 Char	*putn __P((int));
250 int	 getn __P((Char *));
251 Char	*value1 __P((Char *, struct varent *));
252 void	 set __P((Char *, Char *));
253 void	 set1 __P((Char *, Char **, struct varent *));
254 void	 setq __P((Char *, Char **, struct varent *));
255 void	 unset __P((Char **, struct command *));
256 void	 unset1 __P((Char *[], struct varent *));
257 void	 unsetv __P((Char *));
258 void	 setNS __P((Char *));
259 void	 shift __P((Char **, struct command *));
260 void	 plist __P((struct varent *));
261 
262 /*
263  * time.c
264  */
265 void	donice __P((Char **, struct command *));
266 void	dotime __P((Char **, struct command *));
267 void	prusage __P((struct rusage *, struct rusage *,
268 	    struct timeval *, struct timeval *));
269 void	ruadd __P((struct rusage *, struct rusage *));
270 void	settimes __P((void));
271 void	tvadd __P((struct timeval *, struct timeval *));
272 void	tvsub __P((struct timeval *, struct timeval *, struct timeval *));
273 void	pcsecs __P((long));
274 void	psecs __P((long));
275 
276 /*
277  * alloc.c
278  */
279 #ifndef SYSMALLOC
280 void	free __P((ptr_t));
281 ptr_t	malloc __P((size_t));
282 ptr_t	realloc __P((ptr_t, size_t));
283 ptr_t	calloc __P((size_t, size_t));
284 #else
285 void	Free __P((ptr_t));
286 ptr_t	Malloc __P((size_t));
287 ptr_t	Realloc __P((ptr_t, size_t));
288 ptr_t	Calloc __P((size_t, size_t));
289 #endif				/* SYSMALLOC */
290 void	showall __P((Char **, struct command *));
291 
292 /*
293  * str.c:
294  */
295 #ifdef SHORT_STRINGS
296 Char	 *s_strchr __P((Char *, int));
297 Char	 *s_strrchr __P((Char *, int));
298 Char	 *s_strcat __P((Char *, Char *));
299 #ifdef NOTUSED
300 Char	 *s_strncat __P((Char *, Char *, size_t));
301 #endif
302 Char	 *s_strcpy __P((Char *, Char *));
303 Char	 *s_strncpy __P((Char *, Char *, size_t));
304 Char	 *s_strspl __P((Char *, Char *));
305 size_t	  s_strlen __P((Char *));
306 int	  s_strcmp __P((Char *, Char *));
307 int	  s_strncmp __P((Char *, Char *, size_t));
308 Char	 *s_strsave __P((Char *));
309 Char	 *s_strend __P((Char *));
310 #ifdef NOTUSED
311 Char	 *s_strstr __P((Char *, Char *));
312 #endif
313 Char	 *str2short __P((char *));
314 Char	**blk2short __P((char **));
315 char	 *short2str __P((Char *));
316 char	**short2blk __P((Char **));
317 #endif
318 char	 *short2qstr __P((Char *));
319