sh.decls.h revision 145479
1/* $Header: /src/pub/tcsh/sh.decls.h,v 3.46 2005/03/03 17:04:01 kim Exp $ */
2/*
3 * sh.decls.h	 External declarations from sh*.c
4 */
5/*-
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 *    notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 *    notice, this list of conditions and the following disclaimer in the
16 *    documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 *    may be used to endorse or promote products derived from this software
19 *    without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33#ifndef _h_sh_decls
34#define _h_sh_decls
35
36/*
37 * sh.c
38 */
39extern	int	 	  gethdir	__P((Char *));
40extern	void		  dosource	__P((Char **, struct command *));
41extern	void		  exitstat	__P((void));
42extern	void		  goodbye	__P((Char **, struct command *));
43extern	void		  importpath	__P((Char *));
44extern	void		  initdesc	__P((void));
45extern	RETSIGTYPE	  pintr		__P((int));
46extern	void		  pintr1	__P((int));
47extern	void		  process	__P((int));
48extern	void		  untty		__P((void));
49#ifdef PROF
50extern	void		  done		__P((int));
51#else
52extern	void		  xexit		__P((int));
53#endif
54
55/*
56 * sh.dir.c
57 */
58extern	void		  dinit		__P((Char *));
59extern	void		  dodirs	__P((Char **, struct command *));
60extern	Char		 *dcanon	__P((Char *, Char *));
61extern	void		  dtildepr	__P((Char *));
62extern	void		  dtilde	__P((void));
63extern	void		  dochngd	__P((Char **, struct command *));
64extern	Char		 *dnormalize	__P((Char *, int));
65extern	void		  dopushd	__P((Char **, struct command *));
66extern	void		  dopopd	__P((Char **, struct command *));
67extern	void		  dfree		__P((struct directory *));
68extern	void		  dsetstack	__P((void));
69extern	int		  getstakd	__P((Char *, int));
70extern	void		  recdirs	__P((Char *, int));
71extern	void		  loaddirs	__P((Char *));
72
73/*
74 * sh.dol.c
75 */
76extern	void		  Dfix		__P((struct command *));
77extern	Char		 *Dfix1		__P((Char *));
78extern	void		  heredoc	__P((Char *));
79
80/*
81 * sh.err.c
82 */
83extern	void		  errinit	__P((void));
84extern	void		  seterror	__P((unsigned int, ...));
85extern	void		  stderror	__P((unsigned int, ...));
86
87/*
88 * sh.exec.c
89 */
90extern	void		  doexec	__P((struct command *, int));
91extern	void		  dohash	__P((Char **, struct command *));
92extern	void		  dounhash	__P((Char **, struct command *));
93extern	void		  execash	__P((Char **, struct command *));
94extern	void		  hashstat	__P((Char **, struct command *));
95extern	void		  xechoit	__P((Char **));
96extern	int		  executable	__P((Char *, Char *, int));
97extern	int		  tellmewhat	__P((struct wordent *, Char *));
98extern	void		  dowhere	__P((Char **, struct command *));
99extern	int		  find_cmd	__P((Char *, int));
100
101/*
102 * sh.exp.c
103 */
104extern  Char     *filetest       __P((Char *, Char ***, int));
105extern	int	 	  expr		__P((Char ***));
106extern	int		  exp0		__P((Char ***, int));
107
108/*
109 * sh.file.c
110 */
111#if defined(FILEC) && defined(TIOCSTI)
112extern	int		  tenex		__P((Char *, int));
113#endif
114
115/*
116 * sh.func.c
117 */
118extern	void		  tsetenv	__P((const Char *, const Char *));
119extern	void		  Unsetenv	__P((Char *));
120extern	void		  doalias	__P((Char **, struct command *));
121extern	void		  dobreak	__P((Char **, struct command *));
122extern	void		  docontin	__P((Char **, struct command *));
123extern	void		  doecho	__P((Char **, struct command *));
124extern	void		  doelse	__P((Char **, struct command *));
125extern	void		  doend		__P((Char **, struct command *));
126extern	void		  doeval	__P((Char **, struct command *));
127extern	void		  doexit	__P((Char **, struct command *));
128extern	void		  doforeach	__P((Char **, struct command *));
129extern	void		  doglob	__P((Char **, struct command *));
130extern	void		  dogoto	__P((Char **, struct command *));
131extern	void		  doif		__P((Char **, struct command *));
132extern	void		  dolimit	__P((Char **, struct command *));
133extern	void		  dologin	__P((Char **, struct command *));
134extern	void		  dologout	__P((Char **, struct command *));
135#ifdef NEWGRP
136extern	void		  donewgrp	__P((Char **, struct command *));
137#endif
138extern	void		  donohup	__P((Char **, struct command *));
139extern	void		  dohup		__P((Char **, struct command *));
140extern	void		  doonintr	__P((Char **, struct command *));
141extern	void		  doprintenv	__P((Char **, struct command *));
142extern	void		  dorepeat	__P((Char **, struct command *));
143extern	void		  dofiletest	__P((Char **, struct command *));
144extern	void		  dosetenv	__P((Char **, struct command *));
145extern	void		  dosuspend	__P((Char **, struct command *));
146extern	void		  doswbrk	__P((Char **, struct command *));
147extern	void		  doswitch	__P((Char **, struct command *));
148extern	void		  doumask	__P((Char **, struct command *));
149extern	void		  dounlimit	__P((Char **, struct command *));
150extern	void		  dounsetenv	__P((Char **, struct command *));
151extern	void		  dowhile	__P((Char **, struct command *));
152extern	void		  dozip		__P((Char **, struct command *));
153extern	void		  func		__P((struct command *,
154					     struct biltins *));
155extern	void		  gotolab	__P((Char *));
156extern struct biltins 	 *isbfunc	__P((struct command *));
157extern	void		  prvars	__P((void));
158extern	int		  srchx		__P((Char *));
159extern	void		  unalias	__P((Char **, struct command *));
160extern	void		  wfree		__P((void));
161extern	void		  dobuiltins	__P((Char **, struct command *));
162extern	void		  reexecute	__P((struct command *));
163
164/*
165 * sh.glob.c
166 */
167extern	Char	 	 *globequal	__P((Char *, Char *));
168extern	Char		**dobackp	__P((Char *, int));
169extern	void		  Gcat		__P((Char *, Char *));
170extern	Char		 *globone	__P((Char *, int));
171extern	int		  Gmatch	__P((Char *, Char *));
172extern	int		  Gnmatch	__P((Char *, Char *, Char **));
173extern	void		  ginit		__P((void));
174extern	Char		**globall	__P((Char **));
175extern	void		  rscan		__P((Char **, void (*)(Char)));
176extern	void		  tglob		__P((Char **));
177extern	void		  trim		__P((Char **));
178#if defined(FILEC) && defined(TIOCSTI)
179extern	int		  sortscmp	__P((Char **, Char **));
180#endif
181
182#ifndef WINNT_NATIVE
183#ifdef NLS_CATALOGS
184#ifdef HAVE_ICONV
185extern	char		 *iconv_catgets	__P((nl_catd, int, int, const char *));
186#endif
187#endif
188#endif
189extern	void		  nlsinit	__P((void));
190extern	void	          nlsclose	__P((void));
191extern  int	  	  t_pmatch	__P((Char *, Char *, Char **, int));
192
193/*
194 * sh.hist.c
195 */
196extern	void	 	  dohist	__P((Char **, struct command *));
197extern  struct Hist 	 *enthist	__P((int, struct wordent *, int, int));
198extern	void	 	  savehist	__P((struct wordent *, int));
199extern	void		  fmthist	__P((int, ptr_t, char *, size_t));
200extern	void		  rechist	__P((Char *, int));
201extern	void		  loadhist	__P((Char *, int));
202
203/*
204 * sh.init.c
205 */
206extern	void		  mesginit	__P((void));
207
208/*
209 * sh.lex.c
210 */
211extern	void		  addla		__P((Char *));
212extern	void		  bseek		__P((struct Ain *));
213extern	void		  btell		__P((struct Ain *));
214extern	void		  btoeof	__P((void));
215extern	void		  copylex	__P((struct wordent *,
216					     struct wordent *));
217extern	Char		 *domod		__P((Char *, Char));
218extern	void		  freelex	__P((struct wordent *));
219extern	int		  lex		__P((struct wordent *));
220extern	void		  prlex		__P((struct wordent *));
221extern	eChar		  readc		__P((int));
222extern	void		  settell	__P((void));
223extern	void		  unreadc	__P((Char));
224
225
226/*
227 * sh.misc.c
228 */
229extern	int		  any		__P((const char *, Char));
230extern	Char		**blkcpy	__P((Char **, Char **));
231extern	void		  blkfree	__P((Char **));
232extern	int		  blklen	__P((Char **));
233extern	void		  blkpr		__P((Char **));
234extern	void		  blkexpand	__P((Char **, Char *));
235extern	Char		**blkspl	__P((Char **, Char **));
236extern	void		  closem	__P((void));
237#ifndef CLOSE_ON_EXEC
238extern  void 		  closech	__P((void));
239#endif /* !CLOSE_ON_EXEC */
240extern	Char		**copyblk	__P((Char **));
241extern	int		  dcopy		__P((int, int));
242extern	int		  dmove		__P((int, int));
243extern	void		  donefds	__P((void));
244extern	Char		  lastchr	__P((Char *));
245extern	void		  lshift	__P((Char **, int));
246extern	int		  number	__P((Char *));
247extern	int		  prefix	__P((const Char *, const Char *));
248extern	Char		**saveblk	__P((Char **));
249extern	void		  setzero	__P((char *, int));
250extern	Char		 *strip		__P((Char *));
251extern	Char		 *quote		__P((Char *));
252extern	Char		 *quote_meta	__P((Char *, const Char *));
253extern	char		 *strsave	__P((const char *));
254extern	void		  udvar		__P((Char *));
255#ifndef POSIX
256extern  char   	  	 *strstr	__P((const char *, const char *));
257#endif /* !POSIX */
258#ifndef SHORT_STRINGS
259extern	char		 *strspl	__P((const char *, const char *));
260extern	char		 *strend	__P((char *));
261#endif /* SHORT_STRINGS */
262
263/*
264 * sh.parse.c
265 */
266extern	void		  alias		__P((struct wordent *));
267extern	void		  freesyn	__P((struct command *));
268extern struct command 	 *syntax	__P((struct wordent *,
269					     struct wordent *, int));
270
271/*
272 * sh.print.c
273 */
274extern	void		  drainoline	__P((void));
275extern	void		  flush		__P((void));
276#ifdef BSDTIMES
277extern	void		  pcsecs	__P((unsigned long));
278#else /* !BSDTIMES */
279# ifdef POSIX
280extern	void		  pcsecs	__P((clock_t));
281# else /* !POSIX */
282extern	void		  pcsecs	__P((time_t));
283# endif /* !POSIX */
284#endif /* BSDTIMES */
285#ifdef BSDLIMIT
286extern	void		  psecs		__P((unsigned long));
287#endif /* BSDLIMIT */
288extern	int		  putpure	__P((int));
289extern	int		  putraw	__P((int));
290extern	void		  xputchar	__P((int));
291#ifdef WIDE_STRINGS
292extern	void		  putwraw	__P((Char));
293extern	void		  xputwchar	__P((Char));
294#else
295# define putwraw(C) putraw(C)
296# define xputwchar(C) xputchar(C)
297#endif
298
299
300/*
301 * sh.proc.c
302 */
303extern	void		  dobg		__P((Char **, struct command *));
304extern	void		  dobg1		__P((Char **, struct command *));
305extern	void		  dofg		__P((Char **, struct command *));
306extern	void		  dofg1		__P((Char **, struct command *));
307extern	void		  dojobs	__P((Char **, struct command *));
308extern	void		  dokill	__P((Char **, struct command *));
309extern	void		  donotify	__P((Char **, struct command *));
310extern	void		  dostop	__P((Char **, struct command *));
311extern	void		  dowait	__P((Char **, struct command *));
312extern	void		  palloc	__P((int, struct command *));
313extern	void		  panystop	__P((int));
314extern	RETSIGTYPE	  pchild	__P((int));
315extern	void		  pendjob	__P((void));
316extern	int		  pfork		__P((struct command *, int));
317extern	void		  pgetty	__P((int, int));
318extern	void		  pjwait	__P((struct process *));
319extern	void		  pnote		__P((void));
320extern	void		  prestjob	__P((void));
321extern	void		  psavejob	__P((void));
322extern	int		  pstart	__P((struct process *, int));
323extern	void		  pwait		__P((void));
324extern  struct process   *pfind		__P((Char *));
325
326/*
327 * sh.sem.c
328 */
329extern	void		  execute	__P((struct command *, int, int *,
330					     int *, int));
331extern	void		  mypipe	__P((int *));
332
333/*
334 * sh.set.c
335 */
336extern	struct varent 	 *adrof1	__P((Char *, struct varent *));
337extern	void		  doset		__P((Char **, struct command *));
338extern	void		  dolet		__P((Char **, struct command *));
339extern	Char		 *putn		__P((int));
340extern	int		  getn		__P((Char *));
341extern	Char		 *value1	__P((Char *, struct varent *));
342extern	void		  set		__P((Char *, Char *, int));
343extern	void		  set1		__P((Char *, Char **, struct varent *,
344					     int));
345extern	void		  setq		__P((Char *, Char **, struct varent *,
346					     int));
347extern	void		  unset		__P((Char **, struct command *));
348extern	void		  unset1	__P((Char *[], struct varent *));
349extern	void		  unsetv	__P((Char *));
350extern	void		  setNS		__P((Char *));
351extern	void		  shift		__P((Char **, struct command *));
352extern	void		  plist		__P((struct varent *, int));
353extern	Char		 *unparse	__P((struct command *));
354#if defined(DSPMBYTE)
355extern	void 		  update_dspmbyte_vars	__P((void));
356extern	void		  autoset_dspmbyte	__P((Char *));
357#endif
358
359/*
360 * sh.time.c
361 */
362extern	void		  donice	__P((Char **, struct command *));
363extern	void		  dotime	__P((Char **, struct command *));
364#ifdef BSDTIMES
365extern	void		  prusage	__P((struct sysrusage *,
366					     struct sysrusage *,
367					     timeval_t *, timeval_t *));
368extern	void		  ruadd		__P((struct sysrusage *,
369					     struct sysrusage *));
370#else /* BSDTIMES */
371# ifdef _SEQUENT_
372extern	void		  prusage	__P((struct process_stats *,
373					     struct process_stats *,
374					     timeval_t *, timeval_t *));
375extern	void		  ruadd		__P((struct process_stats *,
376					     struct process_stats *));
377# else /* !_SEQUENT_ */
378#  ifdef POSIX
379extern	void		  prusage	__P((struct tms *, struct tms *,
380					     clock_t, clock_t));
381#  else	/* !POSIX */
382extern	void		  prusage	__P((struct tms *, struct tms *,
383					     time_t, time_t));
384#  endif /* !POSIX */
385# endif	/* !_SEQUENT_ */
386#endif /* BSDTIMES */
387extern	void		  settimes	__P((void));
388#if defined(BSDTIMES) || defined(_SEQUENT_)
389extern	void		  tvsub		__P((struct timeval *,
390					     struct timeval *,
391					     struct timeval *));
392#endif /* BSDTIMES || _SEQUENT_ */
393
394#endif /* _h_sh_decls */
395