xref: /original-bsd/bin/csh/extern.h (revision 138cce1a)
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.4 (Berkeley) 06/08/91
8  */
9 
10 #include <sys/cdefs.h>
11 
12 /*
13  * csh.c
14  */
15 int	gethdir __P((Char *));
16 void	dosource __P((Char **));
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 **));
39 Char	*dcanon __P((Char *, Char *));
40 void	 dtildepr __P((Char *, Char *));
41 void	 dtilde __P((void));
42 void	 dochngd __P((Char **));
43 Char	*dnormalize __P((Char *));
44 void	 dopushd __P((Char **));
45 void	 dopopd __P((Char **));
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((struct command *));
66 void	dohash __P((void));
67 void	dounhash __P((void));
68 void	execash __P((char **, struct command *));
69 void	hashstat __P((void));
70 void	xechoit __P((Char **));
71 
72 /*
73  * exp.c
74  */
75 int	exp __P((Char ***));
76 int	exp0 __P((Char ***, bool));
77 
78 /*
79  * file.c
80  */
81 #ifdef FILEC
82 int	tenex __P((Char *, int));
83 #endif
84 
85 /*
86  * func.c
87  */
88 void	Setenv __P((Char *, Char *));
89 void	doalias __P((Char **));
90 void	dobreak __P((void));
91 void	docontin __P((void));
92 void	doecho __P((Char **));
93 void	doelse __P((void));
94 void	doend __P((void));
95 void	doeval __P((Char **));
96 void	doexit __P((Char **));
97 void	doforeach __P((Char **));
98 void	doglob __P((Char **));
99 void	dogoto __P((Char **));
100 void	doif __P((Char **, struct command *));
101 void	dolimit __P((Char **));
102 void	dologin __P((Char **));
103 void	dologout __P((void));
104 void	donohup __P((void));
105 void	doonintr __P((Char **));
106 void	dorepeat __P((Char **, struct command *));
107 void	dosetenv __P((Char **));
108 void	dosuspend __P((void));
109 void	doswbrk __P((void));
110 void	doswitch __P((Char **));
111 void	doumask __P((Char **));
112 void	dounlimit __P((Char **));
113 void	dounsetenv __P((Char **));
114 void	dowhile __P((Char **));
115 void	dozip __P((void));
116 void	func __P((struct command *, struct biltins *));
117 struct	biltins *
118 	isbfunc __P((struct command *));
119 void	prvars __P((void));
120 void	search __P((int, int, Char *));
121 int	srchx __P((Char *));
122 void	unalias __P((Char **));
123 void	wfree __P((void));
124 
125 /*
126  * glob.c
127  */
128 Char	**dobackp __P((Char *, bool));
129 void	  Gcat __P((Char *, Char *));
130 Char	 *globone __P((Char *, int));
131 int	  Gmatch __P((Char *, Char *));
132 void	  ginit __P((void));
133 Char	**globall __P((Char **));
134 void	  rscan __P((Char **, void (*)()));
135 void	  tglob __P((Char **));
136 void	  trim __P((Char **));
137 #ifdef FILEC
138 int	  sortscmp __P((Char **, Char **));
139 #endif /* FILEC */
140 
141 /*
142  * hist.c
143  */
144 void	dohist __P((Char **));
145 struct Hist *
146 	enthist __P((int, struct wordent *, bool));
147 void	savehist __P((struct wordent *));
148 
149 /*
150  * lex.c
151  */
152 void	 addla __P((Char *));
153 void	 bseek __P((off_t));
154 void	 btoeof __P((void));
155 void	 copylex __P((struct wordent *, struct wordent *));
156 Char	*domod __P((Char *, int));
157 void	 freelex __P((struct wordent *));
158 int	 lex __P((struct wordent *));
159 void	 prlex __P((struct wordent *));
160 int	 readc __P((bool));
161 void	 settell __P((void));
162 void	 unreadc __P((int));
163 
164 /*
165  * misc.c
166  */
167 int	  any __P((char *, int));
168 Char	**blkcat __P((Char **, Char **));
169 Char	**blkcpy __P((Char **, Char **));
170 Char	**blkend __P((Char **));
171 void	  blkfree __P((Char **));
172 int	  blklen __P((Char **));
173 void	  blkpr __P((Char **));
174 Char	**blkspl __P((Char **, Char **));
175 void	  closem __P((void));
176 Char	**copyblk __P((Char **));
177 int	  dcopy __P((int, int));
178 int	  dmove __P((int, int));
179 void	  donefds __P((void));
180 Char	  lastchr __P((Char *));
181 void	  lshift __P((Char **, int));
182 int	  number __P((Char *));
183 int	  prefix __P((Char *, Char *));
184 Char	**saveblk __P((Char **));
185 void	  setzero __P((char *, int));
186 Char	 *strip __P((Char *));
187 char	 *strsave __P((char *));
188 char	 *strspl __P((char *, char *));
189 void	  udvar __P((Char *));
190 
191 #ifndef	NOTUSED
192 char	 *strstr __P((const char *, const char *));
193 #endif
194 #ifndef	SHORT_STRINGS
195 char	 *strend __P((char *));
196 #endif
197 
198 /*
199  * parse.c
200  */
201 void	alias __P((struct wordent *));
202 void	freesyn __P((struct command *));
203 struct command *
204 	syntax __P((struct wordent *, struct wordent *, int));
205 
206 /*
207  * print.c
208  */
209 void	draino __P((void));
210 void	flush __P((void));
211 void	pcsecs __P((long));
212 void	psecs __P((long));
213 int	putpure __P((int));
214 int	putraw __P((int));
215 void	xputchar __P((int));
216 
217 /*
218  * proc.c
219  */
220 void	dobg __P((Char **));
221 void	dobg1 __P((Char **));
222 void	dofg __P((Char **));
223 void	dofg1 __P((Char **));
224 void	dojobs __P((Char **));
225 void	dokill __P((Char **));
226 void	donotify __P((Char **));
227 void	dostop __P((Char **));
228 void	dowait __P((void));
229 void	palloc __P((int, struct command *));
230 void	panystop __P((bool));
231 void	pchild __P((int));
232 void	pendjob __P((void));
233 struct process *
234 	pfind __P((Char *));
235 int	pfork __P((struct command *, int));
236 void	pgetty __P((int, int));
237 void	pjwait __P((struct process *));
238 void	pnote __P((void));
239 void	prestjob __P((void));
240 void	psavejob __P((void));
241 void	pstart __P((struct process *, int));
242 void	pwait __P((void));
243 
244 /*
245  * sem.c
246  */
247 void	execute __P((struct command *, int, int *, int *));
248 void	mypipe __P((int *));
249 
250 /*
251  * set.c
252  */
253 struct	varent
254 	*adrof1 __P((Char *, struct varent *));
255 void	 doset __P((Char **));
256 void	 dolet __P((Char **));
257 Char	*putn __P((int));
258 int	 getn __P((Char *));
259 Char	*value1 __P((Char *, struct varent *));
260 void	 set __P((Char *, Char *));
261 void	 set1 __P((Char *, Char **, struct varent *));
262 void	 setq __P((Char *, Char **, struct varent *));
263 void	 unset __P((Char *[]));
264 void	 unset1 __P((Char *[], struct varent *));
265 void	 unsetv __P((Char *));
266 void	 setNS __P((Char *));
267 void	 shift __P((Char **));
268 void	 plist __P((struct varent *));
269 
270 /*
271  * time.c
272  */
273 void	donice __P((Char **));
274 void	dotime __P((void));
275 void	prusage __P((struct rusage *, struct rusage *,
276 	    struct timeval *, struct timeval *));
277 void	ruadd __P((struct rusage *, struct rusage *));
278 void	settimes __P((void));
279 void	tvadd __P((struct timeval *, struct timeval *));
280 void	tvsub __P((struct timeval *, struct timeval *, struct timeval *));
281 
282 /*
283  * alloc.c
284  */
285 #ifndef SYSMALLOC
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 #else
291 void	Free __P((ptr_t));
292 ptr_t	Malloc __P((size_t));
293 ptr_t	Realloc __P((ptr_t, size_t));
294 ptr_t	Calloc __P((size_t, size_t));
295 #endif				/* SYSMALLOC */
296 void	showall __P((void));
297 
298 /*
299  * printf.h
300  */
301 void	xprintf __P((char *, ...));
302 void	xsprintf __P((char *, char *, ...));
303 void	xvprintf __P((char *, va_list));
304 void	xvsprintf __P((char *, char *, va_list));
305 
306 /*
307  * str.c:
308  */
309 #ifdef SHORT_STRINGS
310 Char	 *s_strchr __P((Char *, int));
311 Char	 *s_strrchr __P((Char *, int));
312 Char	 *s_strcat __P((Char *, Char *));
313 #ifdef NOTUSED
314 Char	 *s_strncat __P((Char *, Char *, size_t));
315 #endif
316 Char	 *s_strcpy __P((Char *, Char *));
317 Char	 *s_strncpy __P((Char *, Char *, size_t));
318 Char	 *s_strspl __P((Char *, Char *));
319 size_t	  s_strlen __P((Char *));
320 int	  s_strcmp __P((Char *, Char *));
321 int	  s_strncmp __P((Char *, Char *, size_t));
322 Char	 *s_strsave __P((Char *));
323 Char	 *s_strend __P((Char *));
324 #ifdef NOTUSED
325 Char	 *s_strstr __P((Char *, Char *));
326 #endif
327 Char	 *str2short __P((char *));
328 Char	**blk2short __P((char **));
329 char	 *short2str __P((Char *));
330 char	 *short2qstr __P((Char *));
331 char	**short2blk __P((Char **));
332 #endif
333