xref: /original-bsd/bin/csh/extern.h (revision 0f558095)
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.8 (Berkeley) 09/06/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	expr __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((struct Ain *));
156 void	 btell __P((struct Ain *));
157 void	 btoeof __P((void));
158 void	 copylex __P((struct wordent *, struct wordent *));
159 Char	*domod __P((Char *, int));
160 void	 freelex __P((struct wordent *));
161 int	 lex __P((struct wordent *));
162 void	 prlex __P((FILE *, struct wordent *));
163 int	 readc __P((bool));
164 void	 settell __P((void));
165 void	 unreadc __P((int));
166 
167 /*
168  * misc.c
169  */
170 int	  any __P((char *, int));
171 Char	**blkcat __P((Char **, Char **));
172 Char	**blkcpy __P((Char **, Char **));
173 Char	**blkend __P((Char **));
174 void	  blkfree __P((Char **));
175 int	  blklen __P((Char **));
176 void	  blkpr __P((FILE *, Char **));
177 Char	**blkspl __P((Char **, Char **));
178 void	  closem __P((void));
179 Char	**copyblk __P((Char **));
180 int	  dcopy __P((int, int));
181 int	  dmove __P((int, int));
182 void	  donefds __P((void));
183 Char	  lastchr __P((Char *));
184 void	  lshift __P((Char **, int));
185 int	  number __P((Char *));
186 int	  prefix __P((Char *, Char *));
187 Char	**saveblk __P((Char **));
188 void	  setzero __P((char *, int));
189 Char	 *strip __P((Char *));
190 char	 *strsave __P((char *));
191 char	 *strspl __P((char *, char *));
192 void	  udvar __P((Char *));
193 
194 #ifndef	NOTUSED
195 char	 *strstr __P((const char *, const char *));
196 #endif
197 #ifndef	SHORT_STRINGS
198 char	 *strend __P((char *));
199 #endif
200 
201 /*
202  * parse.c
203  */
204 void	alias __P((struct wordent *));
205 void	freesyn __P((struct command *));
206 struct command *
207 	syntax __P((struct wordent *, struct wordent *, int));
208 
209 
210 /*
211  * proc.c
212  */
213 void	dobg __P((Char **, struct command *));
214 void	dobg1 __P((Char **, struct command *));
215 void	dofg __P((Char **, struct command *));
216 void	dofg1 __P((Char **, struct command *));
217 void	dojobs __P((Char **, struct command *));
218 void	dokill __P((Char **, struct command *));
219 void	donotify __P((Char **, struct command *));
220 void	dostop __P((Char **, struct command *));
221 void	dowait __P((Char **, struct command *));
222 void	palloc __P((int, struct command *));
223 void	panystop __P((bool));
224 void	pchild __P((int));
225 void	pendjob __P((void));
226 struct process *
227 	pfind __P((Char *));
228 int	pfork __P((struct command *, int));
229 void	pgetty __P((int, int));
230 void	pjwait __P((struct process *));
231 void	pnote __P((void));
232 void	prestjob __P((void));
233 void	psavejob __P((void));
234 void	pstart __P((struct process *, int));
235 void	pwait __P((void));
236 
237 /*
238  * sem.c
239  */
240 void	execute __P((struct command *, int, int *, int *));
241 void	mypipe __P((int *));
242 
243 /*
244  * set.c
245  */
246 struct	varent
247 	*adrof1 __P((Char *, struct varent *));
248 void	 doset __P((Char **, struct command *));
249 void	 dolet __P((Char **, struct command *));
250 Char	*putn __P((int));
251 int	 getn __P((Char *));
252 Char	*value1 __P((Char *, struct varent *));
253 void	 set __P((Char *, Char *));
254 void	 set1 __P((Char *, Char **, struct varent *));
255 void	 setq __P((Char *, Char **, struct varent *));
256 void	 unset __P((Char **, struct command *));
257 void	 unset1 __P((Char *[], struct varent *));
258 void	 unsetv __P((Char *));
259 void	 setNS __P((Char *));
260 void	 shift __P((Char **, struct command *));
261 void	 plist __P((struct varent *));
262 
263 /*
264  * time.c
265  */
266 void	donice __P((Char **, struct command *));
267 void	dotime __P((Char **, struct command *));
268 void	prusage __P((struct rusage *, struct rusage *,
269 	    struct timeval *, struct timeval *));
270 void	ruadd __P((struct rusage *, struct rusage *));
271 void	settimes __P((void));
272 void	tvadd __P((struct timeval *, struct timeval *));
273 void	tvsub __P((struct timeval *, struct timeval *, struct timeval *));
274 void	pcsecs __P((long));
275 void	psecs __P((long));
276 
277 /*
278  * alloc.c
279  */
280 #ifndef SYSMALLOC
281 void	free __P((ptr_t));
282 ptr_t	malloc __P((size_t));
283 ptr_t	realloc __P((ptr_t, size_t));
284 ptr_t	calloc __P((size_t, size_t));
285 #else
286 void	Free __P((ptr_t));
287 ptr_t	Malloc __P((size_t));
288 ptr_t	Realloc __P((ptr_t, size_t));
289 ptr_t	Calloc __P((size_t, size_t));
290 #endif				/* SYSMALLOC */
291 void	showall __P((Char **, struct command *));
292 
293 /*
294  * str.c:
295  */
296 #ifdef SHORT_STRINGS
297 Char	 *s_strchr __P((Char *, int));
298 Char	 *s_strrchr __P((Char *, int));
299 Char	 *s_strcat __P((Char *, Char *));
300 #ifdef NOTUSED
301 Char	 *s_strncat __P((Char *, Char *, size_t));
302 #endif
303 Char	 *s_strcpy __P((Char *, Char *));
304 Char	 *s_strncpy __P((Char *, Char *, size_t));
305 Char	 *s_strspl __P((Char *, Char *));
306 size_t	  s_strlen __P((Char *));
307 int	  s_strcmp __P((Char *, Char *));
308 int	  s_strncmp __P((Char *, Char *, size_t));
309 Char	 *s_strsave __P((Char *));
310 Char	 *s_strend __P((Char *));
311 #ifdef NOTUSED
312 Char	 *s_strstr __P((Char *, Char *));
313 #endif
314 Char	 *str2short __P((char *));
315 Char	**blk2short __P((char **));
316 char	 *short2str __P((Char *));
317 char	**short2blk __P((Char **));
318 #endif
319 char	 *short2qstr __P((Char *));
320