xref: /csrg-svn/bin/csh/extern.h (revision 60765)
150001Schristos /*-
2*60765Sbostic  * Copyright (c) 1991, 1993
3*60765Sbostic  *	The Regents of the University of California.  All rights reserved.
450001Schristos  *
550001Schristos  * %sccs.include.redist.c%
650001Schristos  *
7*60765Sbostic  *	@(#)extern.h	8.1 (Berkeley) 05/31/93
850001Schristos  */
950001Schristos 
1050023Sbostic #include <sys/cdefs.h>
1150023Sbostic 
1250001Schristos /*
1350023Sbostic  * csh.c
1450001Schristos  */
1550023Sbostic int	gethdir __P((Char *));
1650439Schristos void	dosource __P((Char **, struct command *));
1750023Sbostic void	exitstat __P((void));
1850023Sbostic void	goodbye __P((void));
1950023Sbostic void	importpath __P((Char *));
2050023Sbostic void	initdesc __P((void));
2150023Sbostic void	pintr __P((int));
2250023Sbostic void	pintr1 __P((bool));
2350023Sbostic void	printprompt __P((void));
2450023Sbostic void	process __P((bool));
2550023Sbostic void	rechist __P((void));
2650023Sbostic void	untty __P((void));
2751589Schristos int	vis_fputc __P((int, FILE *));
2850023Sbostic 
2950023Sbostic #ifdef PROF
3050023Sbostic void done __P((int));
3150001Schristos #else
3250023Sbostic void xexit __P((int));
3350001Schristos #endif
3450001Schristos 
3550001Schristos /*
3650023Sbostic  * dir.c
3750001Schristos  */
3850023Sbostic void	 dinit __P((Char *));
3950439Schristos void	 dodirs __P((Char **, struct command *));
4050023Sbostic Char	*dcanon __P((Char *, Char *));
4150023Sbostic void	 dtildepr __P((Char *, Char *));
4250023Sbostic void	 dtilde __P((void));
4350439Schristos void	 dochngd __P((Char **, struct command *));
4450023Sbostic Char	*dnormalize __P((Char *));
4550439Schristos void	 dopushd __P((Char **, struct command *));
4650439Schristos void	 dopopd __P((Char **, struct command *));
4750023Sbostic struct directory;
4850023Sbostic void	 dfree __P((struct directory *));
4950001Schristos 
5050001Schristos /*
5150023Sbostic  * dol.c
5250001Schristos  */
5350023Sbostic void	 Dfix __P((struct command *));
5450023Sbostic Char	*Dfix1 __P((Char *));
5550023Sbostic void	 heredoc __P((Char *));
5650001Schristos 
5750001Schristos /*
5850023Sbostic  * err.c
5950001Schristos  */
6050023Sbostic void	seterror __P((int, ...));
6150023Sbostic void	stderror __P((int, ...));
6250001Schristos 
6350001Schristos /*
6450023Sbostic  * exec.c
6550001Schristos  */
6650439Schristos void	doexec __P((Char **, struct command *));
6750439Schristos void	dohash __P((Char **, struct command *));
6850439Schristos void	dounhash __P((Char **, struct command *));
6950639Schristos void	dowhich __P((Char **, struct command *));
7050439Schristos void	execash __P((Char **, struct command *));
7150439Schristos void	hashstat __P((Char **, struct command *));
7250023Sbostic void	xechoit __P((Char **));
7350001Schristos 
7450001Schristos /*
7550023Sbostic  * exp.c
7650001Schristos  */
7751009Schristos int	expr __P((Char ***));
7850023Sbostic int	exp0 __P((Char ***, bool));
7950001Schristos 
8050001Schristos /*
8150023Sbostic  * file.c
8250001Schristos  */
8350001Schristos #ifdef FILEC
8450023Sbostic int	tenex __P((Char *, int));
8550001Schristos #endif
8650001Schristos 
8750001Schristos /*
8850023Sbostic  * func.c
8950001Schristos  */
9050023Sbostic void	Setenv __P((Char *, Char *));
9150439Schristos void	doalias __P((Char **, struct command *));
9250439Schristos void	dobreak __P((Char **, struct command *));
9350439Schristos void	docontin __P((Char **, struct command *));
9450439Schristos void	doecho __P((Char **, struct command *));
9550439Schristos void	doelse __P((Char **, struct command *));
9650439Schristos void	doend __P((Char **, struct command *));
9750439Schristos void	doeval __P((Char **, struct command *));
9850439Schristos void	doexit __P((Char **, struct command *));
9950439Schristos void	doforeach __P((Char **, struct command *));
10050439Schristos void	doglob __P((Char **, struct command *));
10150439Schristos void	dogoto __P((Char **, struct command *));
10250023Sbostic void	doif __P((Char **, struct command *));
10350439Schristos void	dolimit __P((Char **, struct command *));
10450439Schristos void	dologin __P((Char **, struct command *));
10550439Schristos void	dologout __P((Char **, struct command *));
10650439Schristos void	donohup __P((Char **, struct command *));
10750439Schristos void	doonintr __P((Char **, struct command *));
10850639Schristos void	doprintf __P((Char **, struct command *));
10950023Sbostic void	dorepeat __P((Char **, struct command *));
11050439Schristos void	dosetenv __P((Char **, struct command *));
11150439Schristos void	dosuspend __P((Char **, struct command *));
11250439Schristos void	doswbrk __P((Char **, struct command *));
11350439Schristos void	doswitch __P((Char **, struct command *));
11450439Schristos void	doumask __P((Char **, struct command *));
11550439Schristos void	dounlimit __P((Char **, struct command *));
11650439Schristos void	dounsetenv __P((Char **, struct command *));
11750439Schristos void	dowhile __P((Char **, struct command *));
11850439Schristos void	dozip __P((Char **, struct command *));
11950023Sbostic void	func __P((struct command *, struct biltins *));
12050023Sbostic struct	biltins *
12150023Sbostic 	isbfunc __P((struct command *));
12250023Sbostic void	prvars __P((void));
12351420Schristos void	gotolab __P((Char *));
12450023Sbostic int	srchx __P((Char *));
12550439Schristos void	unalias __P((Char **, struct command *));
12650023Sbostic void	wfree __P((void));
12750001Schristos 
12850001Schristos /*
12950023Sbostic  * glob.c
13050001Schristos  */
13150023Sbostic Char	**dobackp __P((Char *, bool));
13250023Sbostic void	  Gcat __P((Char *, Char *));
13350023Sbostic Char	 *globone __P((Char *, int));
13450023Sbostic int	  Gmatch __P((Char *, Char *));
13550023Sbostic void	  ginit __P((void));
13650023Sbostic Char	**globall __P((Char **));
13750023Sbostic void	  rscan __P((Char **, void (*)()));
13850023Sbostic void	  tglob __P((Char **));
13950023Sbostic void	  trim __P((Char **));
14050025Schristos #ifdef FILEC
14152369Schristos int	  sortscmp __P((const ptr_t, const ptr_t));
14250025Schristos #endif /* FILEC */
14350001Schristos 
14450001Schristos /*
14550023Sbostic  * hist.c
14650001Schristos  */
14750439Schristos void	dohist __P((Char **, struct command *));
14850023Sbostic struct Hist *
14950023Sbostic 	enthist __P((int, struct wordent *, bool));
15050023Sbostic void	savehist __P((struct wordent *));
15150001Schristos 
15250001Schristos /*
15350023Sbostic  * lex.c
15450001Schristos  */
15550023Sbostic void	 addla __P((Char *));
15650944Schristos void	 bseek __P((struct Ain *));
15750944Schristos void	 btell __P((struct Ain *));
15850023Sbostic void	 btoeof __P((void));
15950023Sbostic void	 copylex __P((struct wordent *, struct wordent *));
16050023Sbostic Char	*domod __P((Char *, int));
16150023Sbostic void	 freelex __P((struct wordent *));
16250023Sbostic int	 lex __P((struct wordent *));
16350439Schristos void	 prlex __P((FILE *, struct wordent *));
16450023Sbostic int	 readc __P((bool));
16550023Sbostic void	 settell __P((void));
16650023Sbostic void	 unreadc __P((int));
16750001Schristos 
16850001Schristos /*
16950023Sbostic  * misc.c
17050001Schristos  */
17150023Sbostic int	  any __P((char *, int));
17250023Sbostic Char	**blkcat __P((Char **, Char **));
17350023Sbostic Char	**blkcpy __P((Char **, Char **));
17450023Sbostic Char	**blkend __P((Char **));
17550023Sbostic void	  blkfree __P((Char **));
17650023Sbostic int	  blklen __P((Char **));
17750439Schristos void	  blkpr __P((FILE *, Char **));
17850023Sbostic Char	**blkspl __P((Char **, Char **));
17950023Sbostic void	  closem __P((void));
18050023Sbostic Char	**copyblk __P((Char **));
18150023Sbostic int	  dcopy __P((int, int));
18250023Sbostic int	  dmove __P((int, int));
18350023Sbostic void	  donefds __P((void));
18450023Sbostic Char	  lastchr __P((Char *));
18550023Sbostic void	  lshift __P((Char **, int));
18650023Sbostic int	  number __P((Char *));
18750023Sbostic int	  prefix __P((Char *, Char *));
18850023Sbostic Char	**saveblk __P((Char **));
18950023Sbostic void	  setzero __P((char *, int));
19050023Sbostic Char	 *strip __P((Char *));
19150023Sbostic char	 *strsave __P((char *));
19250023Sbostic char	 *strspl __P((char *, char *));
19350023Sbostic void	  udvar __P((Char *));
19450023Sbostic 
19551524Schristos #ifndef	SHORT_STRINGS
19651524Schristos # ifdef NOTUSED
19750023Sbostic char	 *strstr __P((const char *, const char *));
19851524Schristos # endif /* NOTUSED */
19950023Sbostic char	 *strend __P((char *));
20050001Schristos #endif
20150001Schristos 
20250001Schristos /*
20350023Sbostic  * parse.c
20450001Schristos  */
20550023Sbostic void	alias __P((struct wordent *));
20650023Sbostic void	freesyn __P((struct command *));
20750023Sbostic struct command *
20850023Sbostic 	syntax __P((struct wordent *, struct wordent *, int));
20950001Schristos 
21050001Schristos 
21150001Schristos /*
21250023Sbostic  * proc.c
21350001Schristos  */
21450439Schristos void	dobg __P((Char **, struct command *));
21550439Schristos void	dobg1 __P((Char **, struct command *));
21650439Schristos void	dofg __P((Char **, struct command *));
21750439Schristos void	dofg1 __P((Char **, struct command *));
21850439Schristos void	dojobs __P((Char **, struct command *));
21950439Schristos void	dokill __P((Char **, struct command *));
22050439Schristos void	donotify __P((Char **, struct command *));
22150439Schristos void	dostop __P((Char **, struct command *));
22250439Schristos void	dowait __P((Char **, struct command *));
22350023Sbostic void	palloc __P((int, struct command *));
22450023Sbostic void	panystop __P((bool));
22550023Sbostic void	pchild __P((int));
22650023Sbostic void	pendjob __P((void));
22750023Sbostic struct process *
22850023Sbostic 	pfind __P((Char *));
22950023Sbostic int	pfork __P((struct command *, int));
23050023Sbostic void	pgetty __P((int, int));
23150023Sbostic void	pjwait __P((struct process *));
23250023Sbostic void	pnote __P((void));
23350023Sbostic void	prestjob __P((void));
23450023Sbostic void	psavejob __P((void));
23550023Sbostic void	pstart __P((struct process *, int));
23650023Sbostic void	pwait __P((void));
23750001Schristos 
23850001Schristos /*
23950023Sbostic  * sem.c
24050001Schristos  */
24150023Sbostic void	execute __P((struct command *, int, int *, int *));
24250023Sbostic void	mypipe __P((int *));
24350001Schristos 
24450001Schristos /*
24550023Sbostic  * set.c
24650001Schristos  */
24750023Sbostic struct	varent
24850023Sbostic 	*adrof1 __P((Char *, struct varent *));
24950439Schristos void	 doset __P((Char **, struct command *));
25050439Schristos void	 dolet __P((Char **, struct command *));
25150023Sbostic Char	*putn __P((int));
25250023Sbostic int	 getn __P((Char *));
25350023Sbostic Char	*value1 __P((Char *, struct varent *));
25450023Sbostic void	 set __P((Char *, Char *));
25550023Sbostic void	 set1 __P((Char *, Char **, struct varent *));
25650023Sbostic void	 setq __P((Char *, Char **, struct varent *));
25750439Schristos void	 unset __P((Char **, struct command *));
25850023Sbostic void	 unset1 __P((Char *[], struct varent *));
25950023Sbostic void	 unsetv __P((Char *));
26050023Sbostic void	 setNS __P((Char *));
26150439Schristos void	 shift __P((Char **, struct command *));
26250023Sbostic void	 plist __P((struct varent *));
26350001Schristos 
26450001Schristos /*
26550023Sbostic  * time.c
26650001Schristos  */
26750439Schristos void	donice __P((Char **, struct command *));
26850439Schristos void	dotime __P((Char **, struct command *));
26950023Sbostic void	prusage __P((struct rusage *, struct rusage *,
27050023Sbostic 	    struct timeval *, struct timeval *));
27150023Sbostic void	ruadd __P((struct rusage *, struct rusage *));
27250023Sbostic void	settimes __P((void));
27350023Sbostic void	tvadd __P((struct timeval *, struct timeval *));
27450023Sbostic void	tvsub __P((struct timeval *, struct timeval *, struct timeval *));
27550439Schristos void	pcsecs __P((long));
27650439Schristos void	psecs __P((long));
27750001Schristos 
27850001Schristos /*
27950033Schristos  * alloc.c
28050001Schristos  */
28150033Schristos void	Free __P((ptr_t));
28250033Schristos ptr_t	Malloc __P((size_t));
28350033Schristos ptr_t	Realloc __P((ptr_t, size_t));
28450033Schristos ptr_t	Calloc __P((size_t, size_t));
28550439Schristos void	showall __P((Char **, struct command *));
28650001Schristos 
28750001Schristos /*
28850033Schristos  * str.c:
28950001Schristos  */
29050001Schristos #ifdef SHORT_STRINGS
29150033Schristos Char	 *s_strchr __P((Char *, int));
29250033Schristos Char	 *s_strrchr __P((Char *, int));
29350033Schristos Char	 *s_strcat __P((Char *, Char *));
29450001Schristos #ifdef NOTUSED
29550033Schristos Char	 *s_strncat __P((Char *, Char *, size_t));
29650001Schristos #endif
29750033Schristos Char	 *s_strcpy __P((Char *, Char *));
29850033Schristos Char	 *s_strncpy __P((Char *, Char *, size_t));
29950033Schristos Char	 *s_strspl __P((Char *, Char *));
30050033Schristos size_t	  s_strlen __P((Char *));
30150033Schristos int	  s_strcmp __P((Char *, Char *));
30250033Schristos int	  s_strncmp __P((Char *, Char *, size_t));
30350033Schristos Char	 *s_strsave __P((Char *));
30450033Schristos Char	 *s_strend __P((Char *));
30550033Schristos Char	 *s_strstr __P((Char *, Char *));
30650033Schristos Char	 *str2short __P((char *));
30750033Schristos Char	**blk2short __P((char **));
30850033Schristos char	 *short2str __P((Char *));
30950033Schristos char	**short2blk __P((Char **));
31050001Schristos #endif
31150439Schristos char	 *short2qstr __P((Char *));
31251589Schristos char	 *vis_str    __P((Char *));
313