tc.decls.h revision 69408
1/* $Header: /src/pub/tcsh/tc.decls.h,v 3.47 2000/11/12 02:18:06 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. All advertising materials mentioning features or use of this software 18 * must display the following acknowledgement: 19 * This product includes software developed by the University of 20 * California, Berkeley and its contributors. 21 * 4. Neither the name of the University nor the names of its contributors 22 * may be used to endorse or promote products derived from this software 23 * without specific prior written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37#ifndef _h_tc_decls 38#define _h_tc_decls 39 40/* 41 * tc.alloc.c 42 */ 43#ifndef SYSMALLOC 44#ifndef WINNT_NATIVE 45extern void free __P((ptr_t)); 46extern memalign_t malloc __P((size_t)); 47extern memalign_t realloc __P((ptr_t, size_t)); 48extern memalign_t calloc __P((size_t, size_t)); 49#endif /* !WINNT_NATIVE */ 50#else /* SYSMALLOC */ 51extern void sfree __P((ptr_t)); 52extern memalign_t smalloc __P((size_t)); 53extern memalign_t srealloc __P((ptr_t, size_t)); 54extern memalign_t scalloc __P((size_t, size_t)); 55#endif /* SYSMALLOC */ 56extern void showall __P((Char **, struct command *)); 57 58/* 59 * tc.bind.c 60 */ 61extern void dobindkey __P((Char **, struct command *)); 62#ifdef OBSOLETE 63extern void dobind __P((Char **, struct command *)); 64#endif /* OBSOLETE */ 65 66/* 67 * tc.defs.c: 68 */ 69extern void getmachine __P((void)); 70 71 72/* 73 * tc.disc.c 74 */ 75extern int setdisc __P((int)); 76extern int resetdisc __P((int)); 77 78/* 79 * tc.func.c 80 */ 81extern Char *expand_lex __P((Char *, size_t, struct wordent *, 82 int, int)); 83extern Char *sprlex __P((Char *, size_t, struct wordent *)); 84extern Char *Itoa __P((int, Char *, int, int)); 85extern void dolist __P((Char **, struct command *)); 86extern void dotelltc __P((Char **, struct command *)); 87extern void doechotc __P((Char **, struct command *)); 88extern void dosettc __P((Char **, struct command *)); 89extern int cmd_expand __P((Char *, Char *)); 90extern void dowhich __P((Char **, struct command *)); 91extern struct process *find_stop_ed __P((void)); 92extern void fg_proc_entry __P((struct process *)); 93extern sigret_t alrmcatch __P((int)); 94extern void precmd __P((void)); 95extern void postcmd __P((void)); 96extern void cwd_cmd __P((void)); 97extern void beep_cmd __P((void)); 98extern void period_cmd __P((void)); 99extern void aliasrun __P((int, Char *, Char *)); 100extern void setalarm __P((int)); 101extern void rmstar __P((struct wordent *)); 102extern void continue_jobs __P((struct wordent *)); 103extern Char *gettilde __P((Char *)); 104extern Char *getusername __P((Char **)); 105#ifdef OBSOLETE 106extern void doaliases __P((Char **, struct command *)); 107#endif /* OBSOLETE */ 108extern void shlvl __P((int)); 109extern int fixio __P((int, int)); 110extern int collate __P((const Char *, const Char *)); 111#ifdef HASHBANG 112extern int hashbang __P((int, Char ***)); 113#endif /* HASHBANG */ 114#ifdef REMOTEHOST 115extern void remotehost __P((void)); 116#endif /* REMOTEHOST */ 117 118 119/* 120 * tc.os.c 121 */ 122#ifdef MACH 123extern void dosetpath __P((Char **, struct command *)); 124#endif /* MACH */ 125 126#ifdef TCF 127extern void dogetxvers __P((Char **, struct command *)); 128extern void dosetxvers __P((Char **, struct command *)); 129extern void dogetspath __P((Char **, struct command *)); 130extern void dosetspath __P((Char **, struct command *)); 131extern char *sitename __P((pid_t)); 132extern void domigrate __P((Char **, struct command *)); 133#endif /* TCF */ 134 135#ifdef WARP 136extern void dowarp __P((Char **, struct command *)); 137#endif /* WARP */ 138 139#if defined(_CRAY) && !defined(_CRAYMPP) 140extern void dodmmode __P((Char **, struct command *)); 141#endif /* _CRAY && !_CRAYMPP */ 142 143#if defined(masscomp) || defined(hcx) 144extern void douniverse __P((Char **, struct command *)); 145#endif /* masscomp */ 146 147#if defined(hcx) 148extern void doatt __P((Char **, struct command *)); 149extern void doucb __P((Char **, struct command *)); 150#endif /* hcx */ 151 152#ifdef _SEQUENT_ 153extern void pr_stat_sub __P((struct process_stats *, 154 struct process_stats *, 155 struct process_stats *)); 156#endif /* _SEQUENT_ */ 157 158#ifdef NEEDtcgetpgrp 159extern int xtcgetpgrp __P((int)); 160extern int xtcsetpgrp __P((int, int)); 161# undef tcgetpgrp 162# define tcgetpgrp(a) xtcgetpgrp(a) 163# undef tcsetpgrp 164# define tcsetpgrp(a, b) xtcsetpgrp((a), (b)) 165#endif /* NEEDtcgetpgrp */ 166 167#ifdef YPBUGS 168extern void fix_yp_bugs __P((void)); 169#endif /* YPBUGS */ 170#ifdef STRCOLLBUG 171extern void fix_strcoll_bug __P((void)); 172#endif /* STRCOLLBUG */ 173 174extern void osinit __P((void)); 175 176#ifdef NEEDmemmove 177extern ptr_t xmemmove __P((ptr_t, const ptr_t, size_t)); 178# define memmove(a, b, c) xmemmove((a), (b), (c)) 179#endif /* NEEDmemmove */ 180 181#ifdef NEEDmemset 182extern ptr_t xmemset __P((ptr_t, int, size_t)); 183# define memset(a, b, c) xmemset((a), (b), (c)) 184#endif /* NEEDmemset */ 185 186 187#ifdef NEEDgetcwd 188extern char *xgetcwd __P((char *, size_t)); 189# undef getcwd 190# define getcwd(a, b) xgetcwd((a), (b)) 191#endif /* NEEDgetcwd */ 192 193#ifdef NEEDgethostname 194extern int xgethostname __P((char *, int)); 195# undef gethostname 196# define gethostname(a, b) xgethostname((a), (b)) 197#endif /* NEEDgethostname */ 198 199#ifdef NEEDnice 200extern int xnice __P((int)); 201# undef nice 202# define nice(a) xnice(a) 203#endif /* NEEDnice */ 204 205#ifdef NEEDstrerror 206extern char *xstrerror __P((int)); 207# undef strerror 208# define strerror(a) xstrerror(a) 209#endif /* NEEDstrerror */ 210 211#ifdef apollo 212extern void doinlib __P((Char **, struct command *)); 213extern void dover __P((Char **, struct command *)); 214extern void dorootnode __P((Char **, struct command *)); 215extern int getv __P((Char *)); 216#endif /* apollo */ 217 218 219/* 220 * tc.printf.h 221 */ 222extern pret_t xprintf __P((const char *, ...)); 223extern pret_t xsnprintf __P((char *, size_t, const char *, ...)); 224extern pret_t xvprintf __P((const char *, va_list)); 225extern pret_t xvsnprintf __P((char *, size_t, const char *, 226 va_list)); 227 228/* 229 * tc.prompt.c 230 */ 231extern void dateinit __P((void)); 232extern void printprompt __P((int, char *)); 233extern Char *expdollar __P((Char **, const Char **, size_t *, 234 int)); 235extern void tprintf __P((int, Char *, const Char *, size_t, 236 char *, time_t, ptr_t)); 237 238/* 239 * tc.sched.c 240 */ 241extern time_t sched_next __P((void)); 242extern void dosched __P((Char **, struct command *)); 243extern void sched_run __P((int)); 244 245/* 246 * tc.sig.c 247 */ 248#ifndef BSDSIGS 249# ifdef UNRELSIGS 250# ifdef COHERENT 251extern sigret_t (*xsignal __P((int, sigret_t (*)(int)))) (); 252# define signal(x,y) xsignal(x,y) 253# endif /* COHERENT */ 254extern sigret_t (*xsigset __P((int, sigret_t (*)(int)))) (); 255# define sigset(x,y) xsigset(x,y) 256extern void xsigrelse __P((int)); 257# define sigrelse(x) xsigrelse(x) 258extern void xsighold __P((int)); 259# define sighold(x) xsighold(x) 260extern void xsigignore __P((int)); 261# define sigignore(x) xsigignore(x) 262extern void xsigpause __P((int)); 263# define sigpause(x) xsigpause(x) 264extern pid_t ourwait __P((int *)); 265# endif /* UNRELSIGS */ 266# ifdef SXA 267extern void sigpause __P((int)); 268# endif /* SXA */ 269#endif /* !BSDSIGS */ 270 271#ifdef NEEDsignal 272extern sigret_t (*xsignal __P((int, sigret_t (*)(int)))) (); 273# define signal(a, b) xsignal(a, b) 274#endif /* NEEDsignal */ 275#if defined(_SEQUENT_) || ((SYSVREL > 3 || defined(_DGUX_SOURCE)) && defined(POSIXSIGS)) || ((defined(_AIX) || defined(__CYGWIN__)) && defined(POSIXSIGS)) || defined(WINNT_NATIVE) 276extern sigmask_t sigsetmask __P((sigmask_t)); 277# if !defined(DGUX) || (defined(DGUX) && defined(__ix86)) 278extern sigmask_t sigblock __P((sigmask_t)); 279# endif /* !DGUX */ 280extern void bsd_sigpause __P((sigmask_t)); 281extern sigret_t (*bsd_signal __P((int, sigret_t (*)(int)))) __P((int)); 282#endif /* _SEQUENT_ */ 283#ifdef SIGSYNCH 284extern sigret_t synch_handler __P((int)); 285#endif /* SIGSYNCH */ 286 287 288/* 289 * tc.str.c: 290 */ 291#ifdef SHORT_STRINGS 292extern Char *s_strchr __P((const Char *, int)); 293extern Char *s_strrchr __P((const Char *, int)); 294extern Char *s_strcat __P((Char *, const Char *)); 295# ifdef NOTUSED 296extern Char *s_strncat __P((Char *, const Char *, size_t)); 297# endif /* NOTUSED */ 298extern Char *s_strcpy __P((Char *, const Char *)); 299extern Char *s_strncpy __P((Char *, const Char *, size_t)); 300extern Char *s_strspl __P((const Char *, const Char *)); 301extern size_t s_strlen __P((const Char *)); 302extern int s_strcmp __P((const Char *, const Char *)); 303extern int s_strncmp __P((const Char *, const Char *, 304 size_t)); 305extern Char *s_strsave __P((const Char *)); 306extern Char *s_strend __P((const Char *)); 307extern Char *s_strstr __P((const Char *, const Char *)); 308extern Char *str2short __P((const char *)); 309extern Char **blk2short __P((char **)); 310extern char *short2str __P((const Char *)); 311extern char **short2blk __P((Char **)); 312#endif /* SHORT_STRINGS */ 313extern char *short2qstr __P((const Char *)); 314 315 316/* 317 * tc.vers.c: 318 */ 319extern void fix_version __P((void)); 320 321/* 322 * tc.who.c 323 */ 324#ifndef HAVENOUTMP 325extern void initwatch __P((void)); 326extern void resetwatch __P((void)); 327extern void watch_login __P((int)); 328extern const char *who_info __P((ptr_t, int, char *, size_t)); 329extern void dolog __P((Char **, struct command *)); 330# ifdef UTHOST 331extern char *utmphost __P((void)); 332extern size_t utmphostsize __P((void)); 333# endif /* UTHOST */ 334#endif /* HAVENOUTMP */ 335 336#endif /* _h_tc_decls */ 337