tc.decls.h revision 100616
1185573Srwatson/* $Header: /src/pub/tcsh/tc.decls.h,v 3.50 2002/03/08 17:36:47 christos Exp $ */
2189279Srwatson/*
3155131Srwatson * tc.decls.h: Function declarations from all the tcsh modules
4155131Srwatson */
5155131Srwatson/*-
6155131Srwatson * Copyright (c) 1980, 1991 The Regents of the University of California.
7155131Srwatson * All rights reserved.
8155131Srwatson *
9155131Srwatson * Redistribution and use in source and binary forms, with or without
10155131Srwatson * modification, are permitted provided that the following conditions
11155131Srwatson * are met:
12155131Srwatson * 1. Redistributions of source code must retain the above copyright
13155131Srwatson *    notice, this list of conditions and the following disclaimer.
14185573Srwatson * 2. Redistributions in binary form must reproduce the above copyright
15155131Srwatson *    notice, this list of conditions and the following disclaimer in the
16155131Srwatson *    documentation and/or other materials provided with the distribution.
17155131Srwatson * 3. Neither the name of the University nor the names of its contributors
18155131Srwatson *    may be used to endorse or promote products derived from this software
19155131Srwatson *    without specific prior written permission.
20155131Srwatson *
21155131Srwatson * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22155131Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23155131Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24155131Srwatson * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25155131Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26155131Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27155131Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28155131Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29189279Srwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30155131Srwatson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31155131Srwatson * SUCH DAMAGE.
32155131Srwatson */
33156283Srwatson#ifndef _h_tc_decls
34156283Srwatson#define _h_tc_decls
35156283Srwatson
36155131Srwatson/*
37155131Srwatson * tc.alloc.c
38155131Srwatson */
39155131Srwatson#ifndef SYSMALLOC
40155131Srwatson#ifndef WINNT_NATIVE
41155131Srwatsonextern	void		  free		__P((ptr_t));
42155131Srwatsonextern	memalign_t	  malloc	__P((size_t));
43155131Srwatsonextern	memalign_t	  realloc	__P((ptr_t, size_t));
44155131Srwatsonextern	memalign_t	  calloc	__P((size_t, size_t));
45155131Srwatson#endif /* !WINNT_NATIVE */
46155131Srwatson#else /* SYSMALLOC */
47155131Srwatsonextern	void		  sfree		__P((ptr_t));
48155131Srwatsonextern	memalign_t	  smalloc	__P((size_t));
49155131Srwatsonextern	memalign_t	  srealloc	__P((ptr_t, size_t));
50155131Srwatsonextern	memalign_t	  scalloc	__P((size_t, size_t));
51155131Srwatson#endif /* SYSMALLOC */
52155131Srwatsonextern	void		  showall	__P((Char **, struct command *));
53155131Srwatson
54155131Srwatson/*
55155131Srwatson * tc.bind.c
56155131Srwatson */
57155131Srwatsonextern	void		  dobindkey	__P((Char **, struct command *));
58155131Srwatson#ifdef OBSOLETE
59155131Srwatsonextern	void		  dobind	__P((Char **, struct command *));
60155131Srwatson#endif /* OBSOLETE */
61155131Srwatson
62155131Srwatson/*
63155131Srwatson * tc.defs.c:
64155131Srwatson */
65155131Srwatsonextern	void		  getmachine	__P((void));
66155131Srwatson
67155131Srwatson
68155131Srwatson/*
69155131Srwatson * tc.disc.c
70155131Srwatson */
71155131Srwatsonextern	int		  setdisc	__P((int));
72155131Srwatsonextern	int		  resetdisc	__P((int));
73155131Srwatson
74186647Srwatson/*
75155131Srwatson * tc.func.c
76155131Srwatson */
77186647Srwatsonextern	Char		 *expand_lex	__P((Char *, size_t, struct wordent *,
78155131Srwatson					     int, int));
79186647Srwatsonextern	Char		 *sprlex	__P((Char *, size_t, struct wordent *));
80155131Srwatsonextern	Char		 *Itoa		__P((int, Char *, int, int));
81155131Srwatsonextern	void		  dolist	__P((Char **, struct command *));
82186647Srwatsonextern	void		  dotelltc	__P((Char **, struct command *));
83155131Srwatsonextern	void		  doechotc	__P((Char **, struct command *));
84155131Srwatsonextern	void		  dosettc	__P((Char **, struct command *));
85155131Srwatsonextern	int		  cmd_expand	__P((Char *, Char *));
86155131Srwatsonextern	void		  dowhich	__P((Char **, struct command *));
87155131Srwatsonextern	struct process	 *find_stop_ed	__P((void));
88155131Srwatsonextern	void		  fg_proc_entry	__P((struct process *));
89155131Srwatsonextern	sigret_t	  alrmcatch	__P((int));
90155131Srwatsonextern	void		  precmd	__P((void));
91155131Srwatsonextern	void		  postcmd	__P((void));
92155131Srwatsonextern	void		  cwd_cmd	__P((void));
93155131Srwatsonextern	void		  beep_cmd	__P((void));
94155131Srwatsonextern	void		  period_cmd	__P((void));
95155131Srwatsonextern	void		  job_cmd	__P((Char *));
96155131Srwatsonextern	void		  aliasrun	__P((int, Char *, Char *));
97155131Srwatsonextern	void		  setalarm	__P((int));
98155131Srwatsonextern	void		  rmstar	__P((struct wordent *));
99155131Srwatsonextern	void		  continue_jobs	__P((struct wordent *));
100155131Srwatsonextern	Char		 *gettilde	__P((Char *));
101155131Srwatsonextern	Char		 *getusername	__P((Char **));
102155131Srwatson#ifdef OBSOLETE
103155131Srwatsonextern	void		  doaliases	__P((Char **, struct command *));
104155131Srwatson#endif /* OBSOLETE */
105155131Srwatsonextern	void		  shlvl		__P((int));
106155131Srwatsonextern	int		  fixio		__P((int, int));
107155131Srwatsonextern	int		  collate	__P((const Char *, const Char *));
108155131Srwatson#ifdef HASHBANG
109155131Srwatsonextern	int		  hashbang	__P((int, Char ***));
110155131Srwatson#endif /* HASHBANG */
111155131Srwatson#ifdef REMOTEHOST
112155131Srwatsonextern	void		  remotehost	__P((void));
113155131Srwatson#endif /* REMOTEHOST */
114155131Srwatson
115155131Srwatson
116155131Srwatson/*
117155131Srwatson * tc.os.c
118155131Srwatson */
119162621Srwatson#ifdef MACH
120162621Srwatsonextern	void		  dosetpath	__P((Char **, struct command *));
121162621Srwatson#endif /* MACH */
122162621Srwatson
123162621Srwatson#ifdef TCF
124162621Srwatsonextern	void		  dogetxvers	__P((Char **, struct command *));
125162621Srwatsonextern	void		  dosetxvers	__P((Char **, struct command *));
126162621Srwatsonextern	void		  dogetspath	__P((Char **, struct command *));
127162621Srwatsonextern	void		  dosetspath	__P((Char **, struct command *));
128162621Srwatsonextern	char		 *sitename	__P((pid_t));
129162621Srwatsonextern	void		  domigrate	__P((Char **, struct command *));
130162621Srwatson#endif /* TCF */
131162621Srwatson
132162621Srwatson#ifdef WARP
133162621Srwatsonextern	void 		  dowarp	__P((Char **, struct command *));
134155131Srwatson#endif /* WARP */
135155131Srwatson
136155131Srwatson#if defined(_CRAY) && !defined(_CRAYMPP)
137155131Srwatsonextern	void 		  dodmmode	__P((Char **, struct command *));
138155131Srwatson#endif /* _CRAY && !_CRAYMPP */
139155131Srwatson
140155131Srwatson#if defined(masscomp) || defined(hcx)
141155131Srwatsonextern	void		  douniverse	__P((Char **, struct command *));
142155131Srwatson#endif /* masscomp */
143155131Srwatson
144155131Srwatson#if defined(hcx)
145155131Srwatsonextern	void		  doatt		__P((Char **, struct command *));
146155131Srwatsonextern	void		  doucb		__P((Char **, struct command *));
147155131Srwatson#endif /* hcx */
148155131Srwatson
149155131Srwatson#ifdef _SEQUENT_
150155131Srwatsonextern	void	 	  pr_stat_sub	__P((struct process_stats *,
151155131Srwatson					     struct process_stats *,
152155131Srwatson					     struct process_stats *));
153155131Srwatson#endif /* _SEQUENT_ */
154155131Srwatson
155155131Srwatson#ifdef NEEDtcgetpgrp
156155131Srwatsonextern	int	 	  xtcgetpgrp	__P((int));
157155131Srwatsonextern	int		  xtcsetpgrp	__P((int, int));
158155131Srwatson# undef tcgetpgrp
159155131Srwatson# define tcgetpgrp(a) 	  xtcgetpgrp(a)
160155131Srwatson# undef tcsetpgrp
161155131Srwatson# define tcsetpgrp(a, b)  xtcsetpgrp((a), (b))
162155131Srwatson#endif /* NEEDtcgetpgrp */
163155131Srwatson
164155131Srwatson#ifdef YPBUGS
165155131Srwatsonextern	void	 	  fix_yp_bugs	__P((void));
166155131Srwatson#endif /* YPBUGS */
167155131Srwatson#ifdef STRCOLLBUG
168155131Srwatsonextern	void	 	  fix_strcoll_bug	__P((void));
169155131Srwatson#endif /* STRCOLLBUG */
170155131Srwatson
171155131Srwatsonextern	void	 	  osinit	__P((void));
172155131Srwatson
173155131Srwatson#ifdef NEEDmemmove
174155131Srwatsonextern ptr_t 		 xmemmove	__P((ptr_t, const ptr_t, size_t));
175155131Srwatson# define memmove(a, b, c) xmemmove((a), (b), (c))
176155131Srwatson#endif /* NEEDmemmove */
177155131Srwatson
178155131Srwatson#ifdef NEEDmemset
179155131Srwatsonextern ptr_t 		 xmemset	__P((ptr_t, int, size_t));
180155131Srwatson# define memset(a, b, c) xmemset((a), (b), (c))
181155131Srwatson#endif /* NEEDmemset */
182155131Srwatson
183155131Srwatson
184155131Srwatson#ifdef NEEDgetcwd
185155131Srwatsonextern	char		 *xgetcwd	__P((char *, size_t));
186155131Srwatson# undef getcwd
187155131Srwatson# define getcwd(a, b) xgetcwd((a), (b))
188155131Srwatson#endif /* NEEDgetcwd */
189155131Srwatson
190155131Srwatson#ifdef NEEDgethostname
191155131Srwatsonextern	int	 	  xgethostname	__P((char *, int));
192155131Srwatson# undef gethostname
193155131Srwatson# define gethostname(a, b) xgethostname((a), (b))
194155131Srwatson#endif /* NEEDgethostname */
195155131Srwatson
196155131Srwatson#ifdef NEEDnice
197155131Srwatsonextern	int	 	  xnice	__P((int));
198155131Srwatson# undef nice
199155131Srwatson# define nice(a)	  xnice(a)
200155131Srwatson#endif /* NEEDnice */
201155131Srwatson
202155131Srwatson#ifdef NEEDstrerror
203155131Srwatsonextern	char	 	 *xstrerror	__P((int));
204155131Srwatson# undef strerror
205155131Srwatson# define strerror(a) 	  xstrerror(a)
206155131Srwatson#endif /* NEEDstrerror */
207155131Srwatson
208155131Srwatson#ifdef apollo
209155131Srwatsonextern	void		  doinlib	__P((Char **, struct command *));
210155131Srwatsonextern	void		  dover		__P((Char **, struct command *));
211155131Srwatsonextern	void		  dorootnode	__P((Char **, struct command *));
212155131Srwatsonextern	int		  getv		__P((Char *));
213155131Srwatson#endif /* apollo */
214155131Srwatson
215155131Srwatson
216155131Srwatson/*
217155131Srwatson * tc.printf.h
218155131Srwatson */
219155131Srwatsonextern	pret_t		  xprintf	__P((const char *, ...));
220155131Srwatsonextern	pret_t		  xsnprintf	__P((char *, size_t, const char *, ...));
221155131Srwatsonextern	pret_t		  xvprintf	__P((const char *, va_list));
222155131Srwatsonextern	pret_t		  xvsnprintf	__P((char *, size_t, const char *,
223155131Srwatson					     va_list));
224155131Srwatson
225155131Srwatson/*
226155131Srwatson * tc.prompt.c
227155131Srwatson */
228155131Srwatsonextern	void		  dateinit	__P((void));
229155131Srwatsonextern	void		  printprompt	__P((int, char *));
230155131Srwatsonextern  Char 		 *expdollar	__P((Char **, const Char **, size_t *,
231155131Srwatson					     int));
232155131Srwatsonextern	void		  tprintf	__P((int, Char *, const Char *, size_t,
233155131Srwatson					     char *, time_t, ptr_t));
234155131Srwatson
235155131Srwatson/*
236155131Srwatson * tc.sched.c
237155131Srwatson */
238155131Srwatsonextern	time_t		  sched_next	__P((void));
239189279Srwatsonextern	void		  dosched	__P((Char **, struct command *));
240189279Srwatsonextern	void		  sched_run	__P((int));
241189279Srwatson
242189279Srwatson/*
243189279Srwatson * tc.sig.c
244189279Srwatson */
245189279Srwatson#ifndef BSDSIGS
246189279Srwatson# ifdef UNRELSIGS
247189279Srwatson#  ifdef COHERENT
248189279Srwatsonextern	sigret_t	(*xsignal	__P((int, sigret_t (*)(int)))) ();
249189279Srwatson#   define signal(x,y)	  xsignal(x,y)
250189279Srwatson#  endif /* COHERENT */
251189279Srwatsonextern	sigret_t	(*xsigset	__P((int, sigret_t (*)(int)))) ();
252189279Srwatson#  define sigset(x,y)	  xsigset(x,y)
253189279Srwatsonextern	void		  xsigrelse	__P((int));
254#  define sigrelse(x)	  xsigrelse(x)
255extern	void		  xsighold	__P((int));
256#  define sighold(x)	  xsighold(x)
257extern	void		  xsigignore	__P((int));
258#  define sigignore(x)	  xsigignore(x)
259extern	void 		  xsigpause	__P((int));
260#  define sigpause(x)	  xsigpause(x)
261extern	pid_t 		  ourwait	__P((int *));
262# endif /* UNRELSIGS */
263# ifdef SXA
264extern	void 		  sigpause	__P((int));
265# endif /* SXA */
266#endif /* !BSDSIGS */
267
268#ifdef NEEDsignal
269extern	sigret_t	(*xsignal	__P((int, sigret_t (*)(int)))) ();
270# define signal(a, b)	  xsignal(a, b)
271#endif /* NEEDsignal */
272#if defined(_SEQUENT_) || ((SYSVREL > 3 || defined(_DGUX_SOURCE)) && defined(POSIXSIGS)) || ((defined(_AIX) || defined(__CYGWIN__)) && defined(POSIXSIGS)) || defined(WINNT_NATIVE)
273extern	sigmask_t	  sigsetmask	__P((sigmask_t));
274# if !defined(DGUX) || (defined(DGUX) && defined(__ix86))
275extern	sigmask_t	  sigblock	__P((sigmask_t));
276# endif /* !DGUX */
277extern	void		  bsd_sigpause	__P((sigmask_t));
278extern  sigret_t        (*bsd_signal    __P((int, sigret_t (*)(int)))) __P((int));
279#endif /* _SEQUENT_ */
280#ifdef SIGSYNCH
281extern	sigret_t	  synch_handler	__P((int));
282#endif /* SIGSYNCH */
283
284
285/*
286 * tc.str.c:
287 */
288#ifdef SHORT_STRINGS
289extern	Char		 *s_strchr	__P((const Char *, int));
290extern	Char		 *s_strrchr	__P((const Char *, int));
291extern	Char		 *s_strcat	__P((Char *, const Char *));
292# ifdef NOTUSED
293extern	Char		 *s_strncat	__P((Char *, const Char *, size_t));
294# endif /* NOTUSED */
295extern	Char		 *s_strcpy	__P((Char *, const Char *));
296extern	Char		 *s_strncpy	__P((Char *, const Char *, size_t));
297extern	Char		 *s_strspl	__P((const Char *, const Char *));
298extern	size_t		  s_strlen	__P((const Char *));
299extern	int		  s_strcmp	__P((const Char *, const Char *));
300extern	int		  s_strncmp	__P((const Char *, const Char *,
301					     size_t));
302extern	Char		 *s_strsave	__P((const Char *));
303extern	Char		 *s_strend	__P((const Char *));
304extern	Char		 *s_strstr	__P((const Char *, const Char *));
305extern	Char		 *str2short	__P((const char *));
306extern	Char		**blk2short	__P((char **));
307extern	char		 *short2str	__P((const Char *));
308extern	char		**short2blk	__P((Char **));
309#endif /* SHORT_STRINGS */
310extern	char		 *short2qstr	__P((const Char *));
311
312
313/*
314 * tc.vers.c:
315 */
316extern	void		  fix_version	__P((void));
317
318/*
319 * tc.who.c
320 */
321#ifndef HAVENOUTMP
322extern	void		  initwatch	__P((void));
323extern	void		  resetwatch	__P((void));
324extern	void		  watch_login	__P((int));
325extern	const char 	 *who_info	__P((ptr_t, int, char *, size_t));
326extern	void		  dolog		__P((Char **, struct command *));
327# ifdef UTHOST
328extern	char		 *utmphost	__P((void));
329extern	size_t		  utmphostsize	__P((void));
330# endif /* UTHOST */
331#endif /* HAVENOUTMP */
332
333#endif /* _h_tc_decls */
334