sh.decls.h revision 145479
1145479Smp/* $Header: /src/pub/tcsh/sh.decls.h,v 3.46 2005/03/03 17:04:01 kim Exp $ */
259243Sobrien/*
359243Sobrien * sh.decls.h	 External declarations from sh*.c
459243Sobrien */
559243Sobrien/*-
659243Sobrien * Copyright (c) 1980, 1991 The Regents of the University of California.
759243Sobrien * All rights reserved.
859243Sobrien *
959243Sobrien * Redistribution and use in source and binary forms, with or without
1059243Sobrien * modification, are permitted provided that the following conditions
1159243Sobrien * are met:
1259243Sobrien * 1. Redistributions of source code must retain the above copyright
1359243Sobrien *    notice, this list of conditions and the following disclaimer.
1459243Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1559243Sobrien *    notice, this list of conditions and the following disclaimer in the
1659243Sobrien *    documentation and/or other materials provided with the distribution.
17100616Smp * 3. Neither the name of the University nor the names of its contributors
1859243Sobrien *    may be used to endorse or promote products derived from this software
1959243Sobrien *    without specific prior written permission.
2059243Sobrien *
2159243Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2259243Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2359243Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2459243Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2559243Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2659243Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2759243Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2859243Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2959243Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3059243Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3159243Sobrien * SUCH DAMAGE.
3259243Sobrien */
3359243Sobrien#ifndef _h_sh_decls
3459243Sobrien#define _h_sh_decls
3559243Sobrien
3659243Sobrien/*
3759243Sobrien * sh.c
3859243Sobrien */
3959243Sobrienextern	int	 	  gethdir	__P((Char *));
4059243Sobrienextern	void		  dosource	__P((Char **, struct command *));
4159243Sobrienextern	void		  exitstat	__P((void));
4259243Sobrienextern	void		  goodbye	__P((Char **, struct command *));
4359243Sobrienextern	void		  importpath	__P((Char *));
4459243Sobrienextern	void		  initdesc	__P((void));
45145479Smpextern	RETSIGTYPE	  pintr		__P((int));
46145479Smpextern	void		  pintr1	__P((int));
47145479Smpextern	void		  process	__P((int));
4859243Sobrienextern	void		  untty		__P((void));
4959243Sobrien#ifdef PROF
5059243Sobrienextern	void		  done		__P((int));
5159243Sobrien#else
5259243Sobrienextern	void		  xexit		__P((int));
5359243Sobrien#endif
5459243Sobrien
5559243Sobrien/*
5659243Sobrien * sh.dir.c
5759243Sobrien */
5859243Sobrienextern	void		  dinit		__P((Char *));
5959243Sobrienextern	void		  dodirs	__P((Char **, struct command *));
6059243Sobrienextern	Char		 *dcanon	__P((Char *, Char *));
6159243Sobrienextern	void		  dtildepr	__P((Char *));
6259243Sobrienextern	void		  dtilde	__P((void));
6359243Sobrienextern	void		  dochngd	__P((Char **, struct command *));
6459243Sobrienextern	Char		 *dnormalize	__P((Char *, int));
6559243Sobrienextern	void		  dopushd	__P((Char **, struct command *));
6659243Sobrienextern	void		  dopopd	__P((Char **, struct command *));
6759243Sobrienextern	void		  dfree		__P((struct directory *));
6859243Sobrienextern	void		  dsetstack	__P((void));
6959243Sobrienextern	int		  getstakd	__P((Char *, int));
7059243Sobrienextern	void		  recdirs	__P((Char *, int));
7159243Sobrienextern	void		  loaddirs	__P((Char *));
7259243Sobrien
7359243Sobrien/*
7459243Sobrien * sh.dol.c
7559243Sobrien */
7659243Sobrienextern	void		  Dfix		__P((struct command *));
7759243Sobrienextern	Char		 *Dfix1		__P((Char *));
7859243Sobrienextern	void		  heredoc	__P((Char *));
7959243Sobrien
8059243Sobrien/*
8159243Sobrien * sh.err.c
8259243Sobrien */
8359243Sobrienextern	void		  errinit	__P((void));
8459243Sobrienextern	void		  seterror	__P((unsigned int, ...));
8559243Sobrienextern	void		  stderror	__P((unsigned int, ...));
8659243Sobrien
8759243Sobrien/*
8859243Sobrien * sh.exec.c
8959243Sobrien */
90145479Smpextern	void		  doexec	__P((struct command *, int));
9159243Sobrienextern	void		  dohash	__P((Char **, struct command *));
9259243Sobrienextern	void		  dounhash	__P((Char **, struct command *));
9359243Sobrienextern	void		  execash	__P((Char **, struct command *));
9459243Sobrienextern	void		  hashstat	__P((Char **, struct command *));
9559243Sobrienextern	void		  xechoit	__P((Char **));
96145479Smpextern	int		  executable	__P((Char *, Char *, int));
9759243Sobrienextern	int		  tellmewhat	__P((struct wordent *, Char *));
9859243Sobrienextern	void		  dowhere	__P((Char **, struct command *));
9959243Sobrienextern	int		  find_cmd	__P((Char *, int));
10059243Sobrien
10159243Sobrien/*
10259243Sobrien * sh.exp.c
10359243Sobrien */
104145479Smpextern  Char     *filetest       __P((Char *, Char ***, int));
10559243Sobrienextern	int	 	  expr		__P((Char ***));
106145479Smpextern	int		  exp0		__P((Char ***, int));
10759243Sobrien
10859243Sobrien/*
10959243Sobrien * sh.file.c
11059243Sobrien */
111100616Smp#if defined(FILEC) && defined(TIOCSTI)
11259243Sobrienextern	int		  tenex		__P((Char *, int));
11359243Sobrien#endif
11459243Sobrien
11559243Sobrien/*
11659243Sobrien * sh.func.c
11759243Sobrien */
118145479Smpextern	void		  tsetenv	__P((const Char *, const Char *));
11959243Sobrienextern	void		  Unsetenv	__P((Char *));
12059243Sobrienextern	void		  doalias	__P((Char **, struct command *));
12159243Sobrienextern	void		  dobreak	__P((Char **, struct command *));
12259243Sobrienextern	void		  docontin	__P((Char **, struct command *));
12359243Sobrienextern	void		  doecho	__P((Char **, struct command *));
12459243Sobrienextern	void		  doelse	__P((Char **, struct command *));
12559243Sobrienextern	void		  doend		__P((Char **, struct command *));
12659243Sobrienextern	void		  doeval	__P((Char **, struct command *));
12759243Sobrienextern	void		  doexit	__P((Char **, struct command *));
12859243Sobrienextern	void		  doforeach	__P((Char **, struct command *));
12959243Sobrienextern	void		  doglob	__P((Char **, struct command *));
13059243Sobrienextern	void		  dogoto	__P((Char **, struct command *));
13159243Sobrienextern	void		  doif		__P((Char **, struct command *));
13259243Sobrienextern	void		  dolimit	__P((Char **, struct command *));
13359243Sobrienextern	void		  dologin	__P((Char **, struct command *));
13459243Sobrienextern	void		  dologout	__P((Char **, struct command *));
13559243Sobrien#ifdef NEWGRP
13659243Sobrienextern	void		  donewgrp	__P((Char **, struct command *));
13759243Sobrien#endif
13859243Sobrienextern	void		  donohup	__P((Char **, struct command *));
13959243Sobrienextern	void		  dohup		__P((Char **, struct command *));
14059243Sobrienextern	void		  doonintr	__P((Char **, struct command *));
14159243Sobrienextern	void		  doprintenv	__P((Char **, struct command *));
14259243Sobrienextern	void		  dorepeat	__P((Char **, struct command *));
14359243Sobrienextern	void		  dofiletest	__P((Char **, struct command *));
14459243Sobrienextern	void		  dosetenv	__P((Char **, struct command *));
14559243Sobrienextern	void		  dosuspend	__P((Char **, struct command *));
14659243Sobrienextern	void		  doswbrk	__P((Char **, struct command *));
14759243Sobrienextern	void		  doswitch	__P((Char **, struct command *));
14859243Sobrienextern	void		  doumask	__P((Char **, struct command *));
14959243Sobrienextern	void		  dounlimit	__P((Char **, struct command *));
15059243Sobrienextern	void		  dounsetenv	__P((Char **, struct command *));
15159243Sobrienextern	void		  dowhile	__P((Char **, struct command *));
15259243Sobrienextern	void		  dozip		__P((Char **, struct command *));
15359243Sobrienextern	void		  func		__P((struct command *,
15459243Sobrien					     struct biltins *));
15559243Sobrienextern	void		  gotolab	__P((Char *));
15659243Sobrienextern struct biltins 	 *isbfunc	__P((struct command *));
15759243Sobrienextern	void		  prvars	__P((void));
15859243Sobrienextern	int		  srchx		__P((Char *));
15959243Sobrienextern	void		  unalias	__P((Char **, struct command *));
16059243Sobrienextern	void		  wfree		__P((void));
16159243Sobrienextern	void		  dobuiltins	__P((Char **, struct command *));
16259243Sobrienextern	void		  reexecute	__P((struct command *));
16359243Sobrien
16459243Sobrien/*
16559243Sobrien * sh.glob.c
16659243Sobrien */
16759243Sobrienextern	Char	 	 *globequal	__P((Char *, Char *));
168145479Smpextern	Char		**dobackp	__P((Char *, int));
16959243Sobrienextern	void		  Gcat		__P((Char *, Char *));
17059243Sobrienextern	Char		 *globone	__P((Char *, int));
17159243Sobrienextern	int		  Gmatch	__P((Char *, Char *));
17259243Sobrienextern	int		  Gnmatch	__P((Char *, Char *, Char **));
17359243Sobrienextern	void		  ginit		__P((void));
17459243Sobrienextern	Char		**globall	__P((Char **));
175145479Smpextern	void		  rscan		__P((Char **, void (*)(Char)));
17659243Sobrienextern	void		  tglob		__P((Char **));
17759243Sobrienextern	void		  trim		__P((Char **));
178100616Smp#if defined(FILEC) && defined(TIOCSTI)
17959243Sobrienextern	int		  sortscmp	__P((Char **, Char **));
18059243Sobrien#endif
181145479Smp
182145479Smp#ifndef WINNT_NATIVE
183145479Smp#ifdef NLS_CATALOGS
184145479Smp#ifdef HAVE_ICONV
185145479Smpextern	char		 *iconv_catgets	__P((nl_catd, int, int, const char *));
186145479Smp#endif
187145479Smp#endif
188145479Smp#endif
18959243Sobrienextern	void		  nlsinit	__P((void));
190145479Smpextern	void	          nlsclose	__P((void));
191131962Smpextern  int	  	  t_pmatch	__P((Char *, Char *, Char **, int));
19259243Sobrien
19359243Sobrien/*
19459243Sobrien * sh.hist.c
19559243Sobrien */
19659243Sobrienextern	void	 	  dohist	__P((Char **, struct command *));
197145479Smpextern  struct Hist 	 *enthist	__P((int, struct wordent *, int, int));
198145479Smpextern	void	 	  savehist	__P((struct wordent *, int));
19959243Sobrienextern	void		  fmthist	__P((int, ptr_t, char *, size_t));
20059243Sobrienextern	void		  rechist	__P((Char *, int));
201145479Smpextern	void		  loadhist	__P((Char *, int));
20259243Sobrien
20359243Sobrien/*
20459243Sobrien * sh.init.c
20559243Sobrien */
20659243Sobrienextern	void		  mesginit	__P((void));
20759243Sobrien
20859243Sobrien/*
20959243Sobrien * sh.lex.c
21059243Sobrien */
21159243Sobrienextern	void		  addla		__P((Char *));
21259243Sobrienextern	void		  bseek		__P((struct Ain *));
21359243Sobrienextern	void		  btell		__P((struct Ain *));
21459243Sobrienextern	void		  btoeof	__P((void));
21559243Sobrienextern	void		  copylex	__P((struct wordent *,
21659243Sobrien					     struct wordent *));
217145479Smpextern	Char		 *domod		__P((Char *, Char));
21859243Sobrienextern	void		  freelex	__P((struct wordent *));
21959243Sobrienextern	int		  lex		__P((struct wordent *));
22059243Sobrienextern	void		  prlex		__P((struct wordent *));
221145479Smpextern	eChar		  readc		__P((int));
22259243Sobrienextern	void		  settell	__P((void));
223145479Smpextern	void		  unreadc	__P((Char));
22459243Sobrien
22559243Sobrien
22659243Sobrien/*
22759243Sobrien * sh.misc.c
22859243Sobrien */
229145479Smpextern	int		  any		__P((const char *, Char));
23059243Sobrienextern	Char		**blkcpy	__P((Char **, Char **));
23159243Sobrienextern	void		  blkfree	__P((Char **));
23259243Sobrienextern	int		  blklen	__P((Char **));
23359243Sobrienextern	void		  blkpr		__P((Char **));
23459243Sobrienextern	void		  blkexpand	__P((Char **, Char *));
23559243Sobrienextern	Char		**blkspl	__P((Char **, Char **));
23659243Sobrienextern	void		  closem	__P((void));
23759243Sobrien#ifndef CLOSE_ON_EXEC
23859243Sobrienextern  void 		  closech	__P((void));
23959243Sobrien#endif /* !CLOSE_ON_EXEC */
24059243Sobrienextern	Char		**copyblk	__P((Char **));
24159243Sobrienextern	int		  dcopy		__P((int, int));
24259243Sobrienextern	int		  dmove		__P((int, int));
24359243Sobrienextern	void		  donefds	__P((void));
24459243Sobrienextern	Char		  lastchr	__P((Char *));
24559243Sobrienextern	void		  lshift	__P((Char **, int));
24659243Sobrienextern	int		  number	__P((Char *));
247145479Smpextern	int		  prefix	__P((const Char *, const Char *));
24859243Sobrienextern	Char		**saveblk	__P((Char **));
24959243Sobrienextern	void		  setzero	__P((char *, int));
25059243Sobrienextern	Char		 *strip		__P((Char *));
25159243Sobrienextern	Char		 *quote		__P((Char *));
25259243Sobrienextern	Char		 *quote_meta	__P((Char *, const Char *));
25359243Sobrienextern	char		 *strsave	__P((const char *));
25459243Sobrienextern	void		  udvar		__P((Char *));
25559243Sobrien#ifndef POSIX
25659243Sobrienextern  char   	  	 *strstr	__P((const char *, const char *));
25759243Sobrien#endif /* !POSIX */
25859243Sobrien#ifndef SHORT_STRINGS
259145479Smpextern	char		 *strspl	__P((const char *, const char *));
26059243Sobrienextern	char		 *strend	__P((char *));
26159243Sobrien#endif /* SHORT_STRINGS */
26259243Sobrien
26359243Sobrien/*
26459243Sobrien * sh.parse.c
26559243Sobrien */
26659243Sobrienextern	void		  alias		__P((struct wordent *));
26759243Sobrienextern	void		  freesyn	__P((struct command *));
26859243Sobrienextern struct command 	 *syntax	__P((struct wordent *,
26959243Sobrien					     struct wordent *, int));
27059243Sobrien
27159243Sobrien/*
27259243Sobrien * sh.print.c
27359243Sobrien */
27459243Sobrienextern	void		  drainoline	__P((void));
27559243Sobrienextern	void		  flush		__P((void));
27659243Sobrien#ifdef BSDTIMES
277145479Smpextern	void		  pcsecs	__P((unsigned long));
27859243Sobrien#else /* !BSDTIMES */
27959243Sobrien# ifdef POSIX
28059243Sobrienextern	void		  pcsecs	__P((clock_t));
28159243Sobrien# else /* !POSIX */
28259243Sobrienextern	void		  pcsecs	__P((time_t));
28359243Sobrien# endif /* !POSIX */
28459243Sobrien#endif /* BSDTIMES */
28559243Sobrien#ifdef BSDLIMIT
286145479Smpextern	void		  psecs		__P((unsigned long));
28759243Sobrien#endif /* BSDLIMIT */
28859243Sobrienextern	int		  putpure	__P((int));
28959243Sobrienextern	int		  putraw	__P((int));
29059243Sobrienextern	void		  xputchar	__P((int));
291145479Smp#ifdef WIDE_STRINGS
292145479Smpextern	void		  putwraw	__P((Char));
293145479Smpextern	void		  xputwchar	__P((Char));
294145479Smp#else
295145479Smp# define putwraw(C) putraw(C)
296145479Smp# define xputwchar(C) xputchar(C)
297145479Smp#endif
29859243Sobrien
29959243Sobrien
30059243Sobrien/*
30159243Sobrien * sh.proc.c
30259243Sobrien */
30359243Sobrienextern	void		  dobg		__P((Char **, struct command *));
30459243Sobrienextern	void		  dobg1		__P((Char **, struct command *));
30559243Sobrienextern	void		  dofg		__P((Char **, struct command *));
30659243Sobrienextern	void		  dofg1		__P((Char **, struct command *));
30759243Sobrienextern	void		  dojobs	__P((Char **, struct command *));
30859243Sobrienextern	void		  dokill	__P((Char **, struct command *));
30959243Sobrienextern	void		  donotify	__P((Char **, struct command *));
31059243Sobrienextern	void		  dostop	__P((Char **, struct command *));
31159243Sobrienextern	void		  dowait	__P((Char **, struct command *));
31259243Sobrienextern	void		  palloc	__P((int, struct command *));
313145479Smpextern	void		  panystop	__P((int));
314145479Smpextern	RETSIGTYPE	  pchild	__P((int));
31559243Sobrienextern	void		  pendjob	__P((void));
31659243Sobrienextern	int		  pfork		__P((struct command *, int));
31759243Sobrienextern	void		  pgetty	__P((int, int));
31859243Sobrienextern	void		  pjwait	__P((struct process *));
31959243Sobrienextern	void		  pnote		__P((void));
32059243Sobrienextern	void		  prestjob	__P((void));
32159243Sobrienextern	void		  psavejob	__P((void));
32259243Sobrienextern	int		  pstart	__P((struct process *, int));
32359243Sobrienextern	void		  pwait		__P((void));
32459243Sobrienextern  struct process   *pfind		__P((Char *));
32559243Sobrien
32659243Sobrien/*
32759243Sobrien * sh.sem.c
32859243Sobrien */
32959243Sobrienextern	void		  execute	__P((struct command *, int, int *,
330145479Smp					     int *, int));
33159243Sobrienextern	void		  mypipe	__P((int *));
33259243Sobrien
33359243Sobrien/*
33459243Sobrien * sh.set.c
33559243Sobrien */
33659243Sobrienextern	struct varent 	 *adrof1	__P((Char *, struct varent *));
33759243Sobrienextern	void		  doset		__P((Char **, struct command *));
33859243Sobrienextern	void		  dolet		__P((Char **, struct command *));
33959243Sobrienextern	Char		 *putn		__P((int));
34059243Sobrienextern	int		  getn		__P((Char *));
34159243Sobrienextern	Char		 *value1	__P((Char *, struct varent *));
34259243Sobrienextern	void		  set		__P((Char *, Char *, int));
34359243Sobrienextern	void		  set1		__P((Char *, Char **, struct varent *,
34459243Sobrien					     int));
34559243Sobrienextern	void		  setq		__P((Char *, Char **, struct varent *,
34659243Sobrien					     int));
34759243Sobrienextern	void		  unset		__P((Char **, struct command *));
34859243Sobrienextern	void		  unset1	__P((Char *[], struct varent *));
34959243Sobrienextern	void		  unsetv	__P((Char *));
35059243Sobrienextern	void		  setNS		__P((Char *));
35159243Sobrienextern	void		  shift		__P((Char **, struct command *));
35259243Sobrienextern	void		  plist		__P((struct varent *, int));
35383098Smpextern	Char		 *unparse	__P((struct command *));
35459243Sobrien#if defined(DSPMBYTE)
35559243Sobrienextern	void 		  update_dspmbyte_vars	__P((void));
35659243Sobrienextern	void		  autoset_dspmbyte	__P((Char *));
35759243Sobrien#endif
35859243Sobrien
35959243Sobrien/*
36059243Sobrien * sh.time.c
36159243Sobrien */
36259243Sobrienextern	void		  donice	__P((Char **, struct command *));
36359243Sobrienextern	void		  dotime	__P((Char **, struct command *));
36459243Sobrien#ifdef BSDTIMES
36559243Sobrienextern	void		  prusage	__P((struct sysrusage *,
36659243Sobrien					     struct sysrusage *,
36759243Sobrien					     timeval_t *, timeval_t *));
36859243Sobrienextern	void		  ruadd		__P((struct sysrusage *,
36959243Sobrien					     struct sysrusage *));
37059243Sobrien#else /* BSDTIMES */
37159243Sobrien# ifdef _SEQUENT_
37259243Sobrienextern	void		  prusage	__P((struct process_stats *,
37359243Sobrien					     struct process_stats *,
37459243Sobrien					     timeval_t *, timeval_t *));
37559243Sobrienextern	void		  ruadd		__P((struct process_stats *,
37659243Sobrien					     struct process_stats *));
37759243Sobrien# else /* !_SEQUENT_ */
37859243Sobrien#  ifdef POSIX
37959243Sobrienextern	void		  prusage	__P((struct tms *, struct tms *,
38059243Sobrien					     clock_t, clock_t));
38159243Sobrien#  else	/* !POSIX */
38259243Sobrienextern	void		  prusage	__P((struct tms *, struct tms *,
38359243Sobrien					     time_t, time_t));
38459243Sobrien#  endif /* !POSIX */
38559243Sobrien# endif	/* !_SEQUENT_ */
38659243Sobrien#endif /* BSDTIMES */
38759243Sobrienextern	void		  settimes	__P((void));
38859243Sobrien#if defined(BSDTIMES) || defined(_SEQUENT_)
38959243Sobrienextern	void		  tvsub		__P((struct timeval *,
39059243Sobrien					     struct timeval *,
39159243Sobrien					     struct timeval *));
39259243Sobrien#endif /* BSDTIMES || _SEQUENT_ */
39359243Sobrien
39459243Sobrien#endif /* _h_sh_decls */
395