1 /* $Header: /p/tcsh/cvsroot/tcsh/tc.decls.h,v 3.63 2006/02/14 14:07:36 christos Exp $ */
3 * tc.decls.h: Function declarations from all the tcsh modules
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
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.
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
46 extern void free (ptr_t
);
47 extern memalign_t
malloc (size_t);
48 extern memalign_t
realloc (ptr_t
, size_t);
49 extern memalign_t
calloc (size_t, size_t);
51 #endif /* !WINNT_NATIVE */
53 extern void sfree (ptr_t
);
54 extern memalign_t
smalloc (size_t);
55 extern memalign_t
srealloc (ptr_t
, size_t);
56 extern memalign_t
scalloc (size_t, size_t);
57 #endif /* SYSMALLOC */
58 extern void showall (Char
**, struct command
*);
63 extern void dobindkey (Char
**, struct command
*);
68 extern void getmachine (void);
74 extern int setdisc (int);
75 extern int resetdisc (int);
80 extern Char
*expand_lex (const struct wordent
*, int, int);
81 extern Char
*sprlex (const struct wordent
*);
82 extern Char
*Itoa (int, size_t, Char
);
83 extern void dolist (Char
**, struct command
*);
84 extern void dotermname (Char
**, struct command
*);
85 extern void dotelltc (Char
**, struct command
*);
86 extern void doechotc (Char
**, struct command
*);
87 extern void dosettc (Char
**, struct command
*);
88 extern int cmd_expand (Char
*, Char
**);
89 extern void dowhich (Char
**, struct command
*);
90 extern struct process
*find_stop_ed (void);
91 extern void fg_proc_entry (struct process
*);
92 extern void alrmcatch (void);
93 extern void precmd (void);
94 extern void postcmd (void);
95 extern void cwd_cmd (void);
96 extern void beep_cmd (void);
97 extern void period_cmd (void);
98 extern void job_cmd (Char
*);
99 extern void aliasrun (int, Char
*, Char
*);
100 extern void setalarm (int);
101 extern void rmstar (struct wordent
*);
102 extern void continue_jobs (struct wordent
*);
103 extern Char
*gettilde (const Char
*);
104 extern Char
*getusername (Char
**);
106 extern void doaliases (Char
**, struct command
*);
107 #endif /* OBSOLETE */
108 extern void shlvl (int);
109 extern int fixio (int, int);
110 extern int collate (const Char
*, const Char
*);
112 extern int hashbang (int, Char
***);
113 #endif /* HASHBANG */
115 extern void remotehost (void);
116 #endif /* REMOTEHOST */
123 extern void dosetpath (Char
**, struct command
*);
127 extern void dogetxvers (Char
**, struct command
*);
128 extern void dosetxvers (Char
**, struct command
*);
129 extern void dogetspath (Char
**, struct command
*);
130 extern void dosetspath (Char
**, struct command
*);
131 extern char *sitename (pid_t
);
132 extern void domigrate (Char
**, struct command
*);
136 extern void dowarp (Char
**, struct command
*);
139 #if defined(_CRAY) && !defined(_CRAYMPP)
140 extern void dodmmode (Char
**, struct command
*);
141 #endif /* _CRAY && !_CRAYMPP */
143 #if defined(masscomp) || defined(hcx)
144 extern void douniverse (Char
**, struct command
*);
145 #endif /* masscomp */
147 #if defined(_OSD_POSIX) /* BS2000 */
148 extern void dobs2cmd (Char
**, struct command
*);
149 #endif /* _OSD_POSIX */
152 extern void doatt (Char
**, struct command
*);
153 extern void doucb (Char
**, struct command
*);
157 extern void pr_stat_sub (struct process_stats
*,
158 struct process_stats
*,
159 struct process_stats
*);
160 #endif /* _SEQUENT_ */
163 extern pid_t
xtcgetpgrp (int);
164 extern int xtcsetpgrp (int, int);
166 # define tcgetpgrp(a) xtcgetpgrp(a)
168 # define tcsetpgrp(a, b) xtcsetpgrp((a), (b))
169 #endif /* NEEDtcgetpgrp */
172 extern void fix_yp_bugs (void);
175 extern void fix_strcoll_bug (void);
176 #endif /* STRCOLLBUG */
178 extern void osinit (void);
181 extern void *xmemmove (void *, const void *, size_t);
182 # define memmove(a, b, c) xmemmove(a, b, c)
183 #endif /* !HAVE_MEMMOVE */
186 extern void *xmemset (void *, int, size_t);
187 # define memset(a, b, c) xmemset(a, b, c)
188 #endif /* !HAVE_MEMSET */
192 extern char *xgetcwd (char *, size_t);
194 # define getcwd(a, b) xgetcwd(a, b)
195 #endif /* !HAVE_GETCWD */
197 #ifndef HAVE_GETHOSTNAME
198 extern int xgethostname (char *, int);
200 # define gethostname(a, b) xgethostname(a, b)
201 #endif /* !HAVE_GETHOSTNAME */
204 extern int xnice (int);
206 # define nice(a) xnice(a)
207 #endif /* !HAVE_NICE */
209 #ifndef HAVE_STRERROR
210 extern char *xstrerror (int);
212 # define strerror(a) xstrerror(a)
213 #endif /* !HAVE_STRERROR */
216 extern void doinlib (Char
**, struct command
*);
217 extern void dover (Char
**, struct command
*);
218 extern void dorootnode (Char
**, struct command
*);
219 extern int getv (Char
*);
227 #define __attribute__(a)
229 extern pret_t
xprintf (const char *, ...)
230 __attribute__((__format__(__printf__
, 1, 2)));
231 extern pret_t
xsnprintf (char *, size_t, const char *, ...)
232 __attribute__((__format__(__printf__
, 3, 4)));
233 extern char *xasprintf (const char *, ...)
234 __attribute__((__format__(__printf__
, 1, 2)));
235 extern pret_t
xvprintf (const char *, va_list)
236 __attribute__((__format__(__printf__
, 1, 0)));
237 extern pret_t
xvsnprintf (char *, size_t, const char *, va_list)
238 __attribute__((__format__(__printf__
, 3, 0)));
239 extern char *xvasprintf (const char *, va_list)
240 __attribute__((__format__(__printf__
, 1, 0)));
245 extern void dateinit (void);
246 extern void printprompt (int, const char *);
247 extern int expdollar (struct Strbuf
*, const Char
**, Char
);
248 extern Char
*tprintf (int, const Char
*, const char *,
254 extern time_t sched_next (void);
255 extern void dosched (Char
**, struct command
*);
256 extern void sched_run (void);
262 extern size_t one_mbtowc (wchar_t *, const char *, size_t);
263 extern size_t one_wctomb (char *, wchar_t);
264 extern int rt_mbtowc (wchar_t *, const char *, size_t);
266 #define one_mbtowc(PWC, S, N) \
267 ((void)(N), *(PWC) = (unsigned char)*(S), (size_t)1)
268 #define one_wctomb(S, WCHAR) (*(S) = (WCHAR), (size_t)1)
271 extern Char
*s_strchr (const Char
*, int);
272 extern Char
*s_strrchr (const Char
*, int);
273 extern Char
*s_strcat (Char
*, const Char
*);
275 extern Char
*s_strncat (Char
*, const Char
*, size_t);
276 # endif /* NOTUSED */
277 extern Char
*s_strcpy (Char
*, const Char
*);
278 extern Char
*s_strncpy (Char
*, const Char
*, size_t);
279 extern Char
*s_strspl (const Char
*, const Char
*);
280 extern size_t s_strlen (const Char
*);
281 extern int s_strcmp (const Char
*, const Char
*);
282 extern int s_strncmp (const Char
*, const Char
*, size_t);
283 extern int s_strcasecmp (const Char
*, const Char
*);
284 extern Char
*s_strnsave (const Char
*, size_t);
285 extern Char
*s_strsave (const Char
*);
286 extern Char
*s_strend (const Char
*);
287 extern Char
*s_strstr (const Char
*, const Char
*);
288 extern Char
*str2short (const char *);
289 extern Char
**blk2short (char **);
290 extern char *short2str (const Char
*);
291 extern char **short2blk (Char
**);
292 #else /* !SHORT_STRINGS */
293 extern char *caching_strip (const char *);
295 extern char *short2qstr (const Char
*);
297 extern void bb_append (struct blk_buf
*, Char
*);
298 extern void bb_cleanup (void *);
299 extern Char
**bb_finish (struct blk_buf
*);
301 extern void strbuf_terminate(struct strbuf
*);
302 extern void strbuf_append1(struct strbuf
*, char);
303 extern void strbuf_appendn(struct strbuf
*, const char *,
305 extern void strbuf_append (struct strbuf
*, const char *);
306 extern char *strbuf_finish (struct strbuf
*);
307 extern void strbuf_cleanup(void *);
308 extern void Strbuf_terminate(struct Strbuf
*);
309 extern void Strbuf_append1(struct Strbuf
*, Char
);
310 extern void Strbuf_appendn(struct Strbuf
*, const Char
*,
312 extern void Strbuf_append (struct Strbuf
*, const Char
*);
313 extern Char
*Strbuf_finish (struct Strbuf
*);
314 extern void Strbuf_cleanup(void *);
320 extern void fix_version (void);
325 #if defined (HAVE_UTMP_H) || defined (HAVE_UTMPX_H) || defined (WINNT_NATIVE)
326 extern void initwatch (void);
327 extern void resetwatch (void);
328 extern void watch_login (int);
329 extern char *who_info (ptr_t
, int);
330 extern void dolog (Char
**, struct command
*);
331 # ifdef HAVE_STRUCT_UTMP_UT_HOST
332 extern char *utmphost (void);
333 extern size_t utmphostsize (void);
334 # endif /* HAVE_STRUCT_UTMP_UT_HOST */
339 #endif /* _h_tc_decls */