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