tc.decls.h revision 100616
1/* $Header: /src/pub/tcsh/tc.decls.h,v 3.50 2002/03/08 17:36:47 christos Exp $ */
2/*
3 * tc.decls.h: Function declarations from all the tcsh modules
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_tc_decls
34#define _h_tc_decls
35
36/*
37 * tc.alloc.c
38 */
39#ifndef SYSMALLOC
40#ifndef WINNT_NATIVE
41extern	void		  free		__P((ptr_t));
42extern	memalign_t	  malloc	__P((size_t));
43extern	memalign_t	  realloc	__P((ptr_t, size_t));
44extern	memalign_t	  calloc	__P((size_t, size_t));
45#endif /* !WINNT_NATIVE */
46#else /* SYSMALLOC */
47extern	void		  sfree		__P((ptr_t));
48extern	memalign_t	  smalloc	__P((size_t));
49extern	memalign_t	  srealloc	__P((ptr_t, size_t));
50extern	memalign_t	  scalloc	__P((size_t, size_t));
51#endif /* SYSMALLOC */
52extern	void		  showall	__P((Char **, struct command *));
53
54/*
55 * tc.bind.c
56 */
57extern	void		  dobindkey	__P((Char **, struct command *));
58#ifdef OBSOLETE
59extern	void		  dobind	__P((Char **, struct command *));
60#endif /* OBSOLETE */
61
62/*
63 * tc.defs.c:
64 */
65extern	void		  getmachine	__P((void));
66
67
68/*
69 * tc.disc.c
70 */
71extern	int		  setdisc	__P((int));
72extern	int		  resetdisc	__P((int));
73
74/*
75 * tc.func.c
76 */
77extern	Char		 *expand_lex	__P((Char *, size_t, struct wordent *,
78					     int, int));
79extern	Char		 *sprlex	__P((Char *, size_t, struct wordent *));
80extern	Char		 *Itoa		__P((int, Char *, int, int));
81extern	void		  dolist	__P((Char **, struct command *));
82extern	void		  dotelltc	__P((Char **, struct command *));
83extern	void		  doechotc	__P((Char **, struct command *));
84extern	void		  dosettc	__P((Char **, struct command *));
85extern	int		  cmd_expand	__P((Char *, Char *));
86extern	void		  dowhich	__P((Char **, struct command *));
87extern	struct process	 *find_stop_ed	__P((void));
88extern	void		  fg_proc_entry	__P((struct process *));
89extern	sigret_t	  alrmcatch	__P((int));
90extern	void		  precmd	__P((void));
91extern	void		  postcmd	__P((void));
92extern	void		  cwd_cmd	__P((void));
93extern	void		  beep_cmd	__P((void));
94extern	void		  period_cmd	__P((void));
95extern	void		  job_cmd	__P((Char *));
96extern	void		  aliasrun	__P((int, Char *, Char *));
97extern	void		  setalarm	__P((int));
98extern	void		  rmstar	__P((struct wordent *));
99extern	void		  continue_jobs	__P((struct wordent *));
100extern	Char		 *gettilde	__P((Char *));
101extern	Char		 *getusername	__P((Char **));
102#ifdef OBSOLETE
103extern	void		  doaliases	__P((Char **, struct command *));
104#endif /* OBSOLETE */
105extern	void		  shlvl		__P((int));
106extern	int		  fixio		__P((int, int));
107extern	int		  collate	__P((const Char *, const Char *));
108#ifdef HASHBANG
109extern	int		  hashbang	__P((int, Char ***));
110#endif /* HASHBANG */
111#ifdef REMOTEHOST
112extern	void		  remotehost	__P((void));
113#endif /* REMOTEHOST */
114
115
116/*
117 * tc.os.c
118 */
119#ifdef MACH
120extern	void		  dosetpath	__P((Char **, struct command *));
121#endif /* MACH */
122
123#ifdef TCF
124extern	void		  dogetxvers	__P((Char **, struct command *));
125extern	void		  dosetxvers	__P((Char **, struct command *));
126extern	void		  dogetspath	__P((Char **, struct command *));
127extern	void		  dosetspath	__P((Char **, struct command *));
128extern	char		 *sitename	__P((pid_t));
129extern	void		  domigrate	__P((Char **, struct command *));
130#endif /* TCF */
131
132#ifdef WARP
133extern	void 		  dowarp	__P((Char **, struct command *));
134#endif /* WARP */
135
136#if defined(_CRAY) && !defined(_CRAYMPP)
137extern	void 		  dodmmode	__P((Char **, struct command *));
138#endif /* _CRAY && !_CRAYMPP */
139
140#if defined(masscomp) || defined(hcx)
141extern	void		  douniverse	__P((Char **, struct command *));
142#endif /* masscomp */
143
144#if defined(hcx)
145extern	void		  doatt		__P((Char **, struct command *));
146extern	void		  doucb		__P((Char **, struct command *));
147#endif /* hcx */
148
149#ifdef _SEQUENT_
150extern	void	 	  pr_stat_sub	__P((struct process_stats *,
151					     struct process_stats *,
152					     struct process_stats *));
153#endif /* _SEQUENT_ */
154
155#ifdef NEEDtcgetpgrp
156extern	int	 	  xtcgetpgrp	__P((int));
157extern	int		  xtcsetpgrp	__P((int, int));
158# undef tcgetpgrp
159# define tcgetpgrp(a) 	  xtcgetpgrp(a)
160# undef tcsetpgrp
161# define tcsetpgrp(a, b)  xtcsetpgrp((a), (b))
162#endif /* NEEDtcgetpgrp */
163
164#ifdef YPBUGS
165extern	void	 	  fix_yp_bugs	__P((void));
166#endif /* YPBUGS */
167#ifdef STRCOLLBUG
168extern	void	 	  fix_strcoll_bug	__P((void));
169#endif /* STRCOLLBUG */
170
171extern	void	 	  osinit	__P((void));
172
173#ifdef NEEDmemmove
174extern ptr_t 		 xmemmove	__P((ptr_t, const ptr_t, size_t));
175# define memmove(a, b, c) xmemmove((a), (b), (c))
176#endif /* NEEDmemmove */
177
178#ifdef NEEDmemset
179extern ptr_t 		 xmemset	__P((ptr_t, int, size_t));
180# define memset(a, b, c) xmemset((a), (b), (c))
181#endif /* NEEDmemset */
182
183
184#ifdef NEEDgetcwd
185extern	char		 *xgetcwd	__P((char *, size_t));
186# undef getcwd
187# define getcwd(a, b) xgetcwd((a), (b))
188#endif /* NEEDgetcwd */
189
190#ifdef NEEDgethostname
191extern	int	 	  xgethostname	__P((char *, int));
192# undef gethostname
193# define gethostname(a, b) xgethostname((a), (b))
194#endif /* NEEDgethostname */
195
196#ifdef NEEDnice
197extern	int	 	  xnice	__P((int));
198# undef nice
199# define nice(a)	  xnice(a)
200#endif /* NEEDnice */
201
202#ifdef NEEDstrerror
203extern	char	 	 *xstrerror	__P((int));
204# undef strerror
205# define strerror(a) 	  xstrerror(a)
206#endif /* NEEDstrerror */
207
208#ifdef apollo
209extern	void		  doinlib	__P((Char **, struct command *));
210extern	void		  dover		__P((Char **, struct command *));
211extern	void		  dorootnode	__P((Char **, struct command *));
212extern	int		  getv		__P((Char *));
213#endif /* apollo */
214
215
216/*
217 * tc.printf.h
218 */
219extern	pret_t		  xprintf	__P((const char *, ...));
220extern	pret_t		  xsnprintf	__P((char *, size_t, const char *, ...));
221extern	pret_t		  xvprintf	__P((const char *, va_list));
222extern	pret_t		  xvsnprintf	__P((char *, size_t, const char *,
223					     va_list));
224
225/*
226 * tc.prompt.c
227 */
228extern	void		  dateinit	__P((void));
229extern	void		  printprompt	__P((int, char *));
230extern  Char 		 *expdollar	__P((Char **, const Char **, size_t *,
231					     int));
232extern	void		  tprintf	__P((int, Char *, const Char *, size_t,
233					     char *, time_t, ptr_t));
234
235/*
236 * tc.sched.c
237 */
238extern	time_t		  sched_next	__P((void));
239extern	void		  dosched	__P((Char **, struct command *));
240extern	void		  sched_run	__P((int));
241
242/*
243 * tc.sig.c
244 */
245#ifndef BSDSIGS
246# ifdef UNRELSIGS
247#  ifdef COHERENT
248extern	sigret_t	(*xsignal	__P((int, sigret_t (*)(int)))) ();
249#   define signal(x,y)	  xsignal(x,y)
250#  endif /* COHERENT */
251extern	sigret_t	(*xsigset	__P((int, sigret_t (*)(int)))) ();
252#  define sigset(x,y)	  xsigset(x,y)
253extern	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