sh.decls.h revision 83098
1226458Sdas/* $Header: /src/pub/tcsh/sh.decls.h,v 3.35 2001/08/06 23:52:03 christos Exp $ */
2226458Sdas/*
3226458Sdas * sh.decls.h	 External declarations from sh*.c
4226458Sdas */
5226458Sdas/*-
6226458Sdas * Copyright (c) 1980, 1991 The Regents of the University of California.
7226458Sdas * All rights reserved.
8226458Sdas *
9226458Sdas * Redistribution and use in source and binary forms, with or without
10226458Sdas * modification, are permitted provided that the following conditions
11226458Sdas * are met:
12226458Sdas * 1. Redistributions of source code must retain the above copyright
13226458Sdas *    notice, this list of conditions and the following disclaimer.
14226458Sdas * 2. Redistributions in binary form must reproduce the above copyright
15226458Sdas *    notice, this list of conditions and the following disclaimer in the
16226458Sdas *    documentation and/or other materials provided with the distribution.
17226458Sdas * 3. All advertising materials mentioning features or use of this software
18226458Sdas *    must display the following acknowledgement:
19226458Sdas *	This product includes software developed by the University of
20226458Sdas *	California, Berkeley and its contributors.
21226458Sdas * 4. Neither the name of the University nor the names of its contributors
22226458Sdas *    may be used to endorse or promote products derived from this software
23226458Sdas *    without specific prior written permission.
24226458Sdas *
25226458Sdas * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26226458Sdas * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27226458Sdas * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28284810Stijl * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29226458Sdas * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30226458Sdas * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31226458Sdas * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32226458Sdas * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33226458Sdas * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34226458Sdas * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35226458Sdas * SUCH DAMAGE.
36226458Sdas */
37226458Sdas#ifndef _h_sh_decls
38226458Sdas#define _h_sh_decls
39226599Sdas
40226599Sdas/*
41226458Sdas * sh.c
42226458Sdas */
43226458Sdasextern	int	 	  gethdir	__P((Char *));
44226599Sdasextern	void		  dosource	__P((Char **, struct command *));
45226458Sdasextern	void		  exitstat	__P((void));
46226458Sdasextern	void		  goodbye	__P((Char **, struct command *));
47226458Sdasextern	void		  importpath	__P((Char *));
48226458Sdasextern	void		  initdesc	__P((void));
49226458Sdasextern	sigret_t	  pintr		__P((int));
50226458Sdasextern	void		  pintr1	__P((bool));
51226458Sdasextern	void		  process	__P((bool));
52226458Sdasextern	void		  untty		__P((void));
53226458Sdas#ifdef PROF
54226458Sdasextern	void		  done		__P((int));
55226458Sdas#else
56226458Sdasextern	void		  xexit		__P((int));
57226458Sdas#endif
58284810Stijl
59284810Stijl/*
60284810Stijl * sh.dir.c
61226599Sdas */
62226599Sdasextern	void		  dinit		__P((Char *));
63226599Sdasextern	void		  dodirs	__P((Char **, struct command *));
64226599Sdasextern	Char		 *dcanon	__P((Char *, Char *));
65284810Stijlextern	void		  dtildepr	__P((Char *));
66284810Stijlextern	void		  dtilde	__P((void));
67226599Sdasextern	void		  dochngd	__P((Char **, struct command *));
68226599Sdasextern	Char		 *dnormalize	__P((Char *, int));
69284810Stijlextern	void		  dopushd	__P((Char **, struct command *));
70284810Stijlextern	void		  dopopd	__P((Char **, struct command *));
71226599Sdasextern	void		  dfree		__P((struct directory *));
72226599Sdasextern	void		  dsetstack	__P((void));
73226599Sdasextern	int		  getstakd	__P((Char *, int));
74284810Stijlextern	void		  recdirs	__P((Char *, int));
75226599Sdasextern	void		  loaddirs	__P((Char *));
76226458Sdas
77226458Sdas/*
78284810Stijl * sh.dol.c
79284810Stijl */
80226458Sdasextern	void		  Dfix		__P((struct command *));
81284810Stijlextern	Char		 *Dfix1		__P((Char *));
82284810Stijlextern	void		  heredoc	__P((Char *));
83226458Sdas
84284810Stijl/*
85284810Stijl * sh.err.c
86226458Sdas */
87284810Stijlextern	void		  errinit	__P((void));
88226458Sdasextern	void		  seterror	__P((unsigned int, ...));
89284810Stijlextern	void		  stderror	__P((unsigned int, ...));
90284810Stijl
91226458Sdas/*
92226458Sdas * sh.exec.c
93284810Stijl */
94226458Sdasextern	void		  doexec	__P((struct command *));
95226458Sdasextern	void		  dohash	__P((Char **, struct command *));
96226458Sdasextern	void		  dounhash	__P((Char **, struct command *));
97226458Sdasextern	void		  execash	__P((Char **, struct command *));
98226458Sdasextern	void		  hashstat	__P((Char **, struct command *));
99226458Sdasextern	void		  xechoit	__P((Char **));
100284810Stijlextern	int		  executable	__P((Char *, Char *, bool));
101284810Stijlextern	int		  tellmewhat	__P((struct wordent *, Char *));
102226458Sdasextern	void		  dowhere	__P((Char **, struct command *));
103extern	int		  find_cmd	__P((Char *, int));
104
105/*
106 * sh.exp.c
107 */
108extern  Char     *filetest       __P((Char *, Char ***, bool));
109extern	int	 	  expr		__P((Char ***));
110extern	int		  exp0		__P((Char ***, bool));
111
112/*
113 * sh.file.c
114 */
115#ifdef FILEC
116extern	int		  tenex		__P((Char *, int));
117#endif
118
119/*
120 * sh.func.c
121 */
122extern	void		  tsetenv	__P((Char *, Char *));
123extern	void		  Unsetenv	__P((Char *));
124extern	void		  doalias	__P((Char **, struct command *));
125extern	void		  dobreak	__P((Char **, struct command *));
126extern	void		  docontin	__P((Char **, struct command *));
127extern	void		  doecho	__P((Char **, struct command *));
128extern	void		  doelse	__P((Char **, struct command *));
129extern	void		  doend		__P((Char **, struct command *));
130extern	void		  doeval	__P((Char **, struct command *));
131extern	void		  doexit	__P((Char **, struct command *));
132extern	void		  doforeach	__P((Char **, struct command *));
133extern	void		  doglob	__P((Char **, struct command *));
134extern	void		  dogoto	__P((Char **, struct command *));
135extern	void		  doif		__P((Char **, struct command *));
136extern	void		  dolimit	__P((Char **, struct command *));
137extern	void		  dologin	__P((Char **, struct command *));
138extern	void		  dologout	__P((Char **, struct command *));
139#ifdef NEWGRP
140extern	void		  donewgrp	__P((Char **, struct command *));
141#endif
142extern	void		  donohup	__P((Char **, struct command *));
143extern	void		  dohup		__P((Char **, struct command *));
144extern	void		  doonintr	__P((Char **, struct command *));
145extern	void		  doprintenv	__P((Char **, struct command *));
146extern	void		  dorepeat	__P((Char **, struct command *));
147extern	void		  dofiletest	__P((Char **, struct command *));
148extern	void		  dosetenv	__P((Char **, struct command *));
149extern	void		  dosuspend	__P((Char **, struct command *));
150extern	void		  doswbrk	__P((Char **, struct command *));
151extern	void		  doswitch	__P((Char **, struct command *));
152extern	void		  doumask	__P((Char **, struct command *));
153extern	void		  dounlimit	__P((Char **, struct command *));
154extern	void		  dounsetenv	__P((Char **, struct command *));
155extern	void		  dowhile	__P((Char **, struct command *));
156extern	void		  dozip		__P((Char **, struct command *));
157extern	void		  func		__P((struct command *,
158					     struct biltins *));
159extern	void		  gotolab	__P((Char *));
160extern struct biltins 	 *isbfunc	__P((struct command *));
161extern	void		  prvars	__P((void));
162extern	int		  srchx		__P((Char *));
163extern	void		  unalias	__P((Char **, struct command *));
164extern	void		  wfree		__P((void));
165extern	void		  dobuiltins	__P((Char **, struct command *));
166extern	void		  reexecute	__P((struct command *));
167
168/*
169 * sh.glob.c
170 */
171extern	Char	 	 *globequal	__P((Char *, Char *));
172extern	Char		**dobackp	__P((Char *, bool));
173extern	void		  Gcat		__P((Char *, Char *));
174extern	Char		 *globone	__P((Char *, int));
175extern	int		  Gmatch	__P((Char *, Char *));
176extern	int		  Gnmatch	__P((Char *, Char *, Char **));
177extern	void		  ginit		__P((void));
178extern	Char		**globall	__P((Char **));
179extern	void		  rscan		__P((Char **, void (*)(int)));
180extern	void		  tglob		__P((Char **));
181extern	void		  trim		__P((Char **));
182#ifdef FILEC
183extern	int		  sortscmp	__P((Char **, Char **));
184#endif
185extern	void		  nlsinit	__P((void));
186
187/*
188 * sh.hist.c
189 */
190extern	void	 	  dohist	__P((Char **, struct command *));
191extern  struct Hist 	 *enthist	__P((int, struct wordent *, bool, bool));
192extern	void	 	  savehist	__P((struct wordent *, bool));
193extern	void		  fmthist	__P((int, ptr_t, char *, size_t));
194extern	void		  rechist	__P((Char *, int));
195extern	void		  loadhist	__P((Char *, bool));
196
197/*
198 * sh.init.c
199 */
200extern	void		  mesginit	__P((void));
201
202/*
203 * sh.lex.c
204 */
205extern	void		  addla		__P((Char *));
206extern	void		  bseek		__P((struct Ain *));
207extern	void		  btell		__P((struct Ain *));
208extern	void		  btoeof	__P((void));
209extern	void		  copylex	__P((struct wordent *,
210					     struct wordent *));
211extern	Char		 *domod		__P((Char *, int));
212extern	void		  freelex	__P((struct wordent *));
213extern	int		  lex		__P((struct wordent *));
214extern	void		  prlex		__P((struct wordent *));
215extern	int		  readc		__P((bool));
216extern	void		  settell	__P((void));
217extern	void		  unreadc	__P((int));
218
219
220/*
221 * sh.misc.c
222 */
223extern	int		  any		__P((char *, int));
224extern	Char		**blkcpy	__P((Char **, Char **));
225extern	void		  blkfree	__P((Char **));
226extern	int		  blklen	__P((Char **));
227extern	void		  blkpr		__P((Char **));
228extern	void		  blkexpand	__P((Char **, Char *));
229extern	Char		**blkspl	__P((Char **, Char **));
230extern	void		  closem	__P((void));
231#ifndef CLOSE_ON_EXEC
232extern  void 		  closech	__P((void));
233#endif /* !CLOSE_ON_EXEC */
234extern	Char		**copyblk	__P((Char **));
235extern	int		  dcopy		__P((int, int));
236extern	int		  dmove		__P((int, int));
237extern	void		  donefds	__P((void));
238extern	Char		  lastchr	__P((Char *));
239extern	void		  lshift	__P((Char **, int));
240extern	int		  number	__P((Char *));
241extern	int		  prefix	__P((Char *, Char *));
242extern	Char		**saveblk	__P((Char **));
243extern	void		  setzero	__P((char *, int));
244extern	Char		 *strip		__P((Char *));
245extern	Char		 *quote		__P((Char *));
246extern	Char		 *quote_meta	__P((Char *, const Char *));
247extern	char		 *strsave	__P((const char *));
248extern	void		  udvar		__P((Char *));
249#ifndef POSIX
250extern  char   	  	 *strstr	__P((const char *, const char *));
251#endif /* !POSIX */
252#ifndef SHORT_STRINGS
253extern	char		 *strspl	__P((char *, char *));
254extern	char		 *strend	__P((char *));
255#endif /* SHORT_STRINGS */
256
257/*
258 * sh.parse.c
259 */
260extern	void		  alias		__P((struct wordent *));
261extern	void		  freesyn	__P((struct command *));
262extern struct command 	 *syntax	__P((struct wordent *,
263					     struct wordent *, int));
264
265/*
266 * sh.print.c
267 */
268extern	void		  drainoline	__P((void));
269extern	void		  flush		__P((void));
270#ifdef BSDTIMES
271extern	void		  pcsecs	__P((long));
272#else /* !BSDTIMES */
273# ifdef POSIX
274extern	void		  pcsecs	__P((clock_t));
275# else /* !POSIX */
276extern	void		  pcsecs	__P((time_t));
277# endif /* !POSIX */
278#endif /* BSDTIMES */
279#ifdef BSDLIMIT
280extern	void		  psecs		__P((long));
281#endif /* BSDLIMIT */
282extern	int		  putpure	__P((int));
283extern	int		  putraw	__P((int));
284extern	void		  xputchar	__P((int));
285
286
287/*
288 * sh.proc.c
289 */
290extern	void		  dobg		__P((Char **, struct command *));
291extern	void		  dobg1		__P((Char **, struct command *));
292extern	void		  dofg		__P((Char **, struct command *));
293extern	void		  dofg1		__P((Char **, struct command *));
294extern	void		  dojobs	__P((Char **, struct command *));
295extern	void		  dokill	__P((Char **, struct command *));
296extern	void		  donotify	__P((Char **, struct command *));
297extern	void		  dostop	__P((Char **, struct command *));
298extern	void		  dowait	__P((Char **, struct command *));
299extern	void		  palloc	__P((int, struct command *));
300extern	void		  panystop	__P((bool));
301extern	sigret_t	  pchild	__P((int));
302extern	void		  pendjob	__P((void));
303extern	int		  pfork		__P((struct command *, int));
304extern	void		  pgetty	__P((int, int));
305extern	void		  pjwait	__P((struct process *));
306extern	void		  pnote		__P((void));
307extern	void		  prestjob	__P((void));
308extern	void		  psavejob	__P((void));
309extern	int		  pstart	__P((struct process *, int));
310extern	void		  pwait		__P((void));
311extern  struct process   *pfind		__P((Char *));
312
313/*
314 * sh.sem.c
315 */
316extern	void		  execute	__P((struct command *, int, int *,
317					     int *));
318extern	void		  mypipe	__P((int *));
319
320/*
321 * sh.set.c
322 */
323extern	struct varent 	 *adrof1	__P((Char *, struct varent *));
324extern	void		  doset		__P((Char **, struct command *));
325extern	void		  dolet		__P((Char **, struct command *));
326extern	Char		 *putn		__P((int));
327extern	int		  getn		__P((Char *));
328extern	Char		 *value1	__P((Char *, struct varent *));
329extern	void		  set		__P((Char *, Char *, int));
330extern	void		  set1		__P((Char *, Char **, struct varent *,
331					     int));
332extern	void		  setq		__P((Char *, Char **, struct varent *,
333					     int));
334extern	void		  unset		__P((Char **, struct command *));
335extern	void		  unset1	__P((Char *[], struct varent *));
336extern	void		  unsetv	__P((Char *));
337extern	void		  setNS		__P((Char *));
338extern	void		  shift		__P((Char **, struct command *));
339extern	void		  plist		__P((struct varent *, int));
340extern	Char		 *unparse	__P((struct command *));
341#if defined(DSPMBYTE)
342extern	void 		  update_dspmbyte_vars	__P((void));
343extern	void		  autoset_dspmbyte	__P((Char *));
344#endif
345
346/*
347 * sh.time.c
348 */
349extern	void		  donice	__P((Char **, struct command *));
350extern	void		  dotime	__P((Char **, struct command *));
351#ifdef BSDTIMES
352extern	void		  prusage	__P((struct sysrusage *,
353					     struct sysrusage *,
354					     timeval_t *, timeval_t *));
355extern	void		  ruadd		__P((struct sysrusage *,
356					     struct sysrusage *));
357#else /* BSDTIMES */
358# ifdef _SEQUENT_
359extern	void		  prusage	__P((struct process_stats *,
360					     struct process_stats *,
361					     timeval_t *, timeval_t *));
362extern	void		  ruadd		__P((struct process_stats *,
363					     struct process_stats *));
364# else /* !_SEQUENT_ */
365#  ifdef POSIX
366extern	void		  prusage	__P((struct tms *, struct tms *,
367					     clock_t, clock_t));
368#  else	/* !POSIX */
369extern	void		  prusage	__P((struct tms *, struct tms *,
370					     time_t, time_t));
371#  endif /* !POSIX */
372# endif	/* !_SEQUENT_ */
373#endif /* BSDTIMES */
374extern	void		  settimes	__P((void));
375#if defined(BSDTIMES) || defined(_SEQUENT_)
376extern	void		  tvsub		__P((struct timeval *,
377					     struct timeval *,
378					     struct timeval *));
379#endif /* BSDTIMES || _SEQUENT_ */
380
381#endif /* _h_sh_decls */
382