tc.decls.h revision 145479
1/* $Header: /src/pub/tcsh/tc.decls.h,v 3.57 2005/01/18 20:24:51 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 dotermname __P((Char **, struct command *)); 83extern void dotelltc __P((Char **, struct command *)); 84extern void doechotc __P((Char **, struct command *)); 85extern void dosettc __P((Char **, struct command *)); 86extern int cmd_expand __P((Char *, Char *)); 87extern void dowhich __P((Char **, struct command *)); 88extern struct process *find_stop_ed __P((void)); 89extern void fg_proc_entry __P((struct process *)); 90extern RETSIGTYPE alrmcatch __P((int)); 91extern void precmd __P((void)); 92extern void postcmd __P((void)); 93extern void cwd_cmd __P((void)); 94extern void beep_cmd __P((void)); 95extern void period_cmd __P((void)); 96extern void job_cmd __P((Char *)); 97extern void aliasrun __P((int, Char *, Char *)); 98extern void setalarm __P((int)); 99extern void rmstar __P((struct wordent *)); 100extern void continue_jobs __P((struct wordent *)); 101extern Char *gettilde __P((Char *)); 102extern Char *getusername __P((Char **)); 103#ifdef OBSOLETE 104extern void doaliases __P((Char **, struct command *)); 105#endif /* OBSOLETE */ 106extern void shlvl __P((int)); 107extern int fixio __P((int, int)); 108extern int collate __P((const Char *, const Char *)); 109#ifdef HASHBANG 110extern int hashbang __P((int, Char ***)); 111#endif /* HASHBANG */ 112#ifdef REMOTEHOST 113extern void remotehost __P((void)); 114#endif /* REMOTEHOST */ 115 116 117/* 118 * tc.os.c 119 */ 120#ifdef MACH 121extern void dosetpath __P((Char **, struct command *)); 122#endif /* MACH */ 123 124#ifdef TCF 125extern void dogetxvers __P((Char **, struct command *)); 126extern void dosetxvers __P((Char **, struct command *)); 127extern void dogetspath __P((Char **, struct command *)); 128extern void dosetspath __P((Char **, struct command *)); 129extern char *sitename __P((pid_t)); 130extern void domigrate __P((Char **, struct command *)); 131#endif /* TCF */ 132 133#ifdef WARP 134extern void dowarp __P((Char **, struct command *)); 135#endif /* WARP */ 136 137#if defined(_CRAY) && !defined(_CRAYMPP) 138extern void dodmmode __P((Char **, struct command *)); 139#endif /* _CRAY && !_CRAYMPP */ 140 141#if defined(masscomp) || defined(hcx) 142extern void douniverse __P((Char **, struct command *)); 143#endif /* masscomp */ 144 145#if defined(_OSD_POSIX) /* BS2000 */ 146extern void dobs2cmd __P((Char **, struct command *)); 147#endif /* _OSD_POSIX */ 148 149#if defined(hcx) 150extern void doatt __P((Char **, struct command *)); 151extern void doucb __P((Char **, struct command *)); 152#endif /* hcx */ 153 154#ifdef _SEQUENT_ 155extern void pr_stat_sub __P((struct process_stats *, 156 struct process_stats *, 157 struct process_stats *)); 158#endif /* _SEQUENT_ */ 159 160#ifdef NEEDtcgetpgrp 161extern int xtcgetpgrp __P((int)); 162extern int xtcsetpgrp __P((int, int)); 163# undef tcgetpgrp 164# define tcgetpgrp(a) xtcgetpgrp(a) 165# undef tcsetpgrp 166# define tcsetpgrp(a, b) xtcsetpgrp((a), (b)) 167#endif /* NEEDtcgetpgrp */ 168 169#ifdef YPBUGS 170extern void fix_yp_bugs __P((void)); 171#endif /* YPBUGS */ 172#ifdef STRCOLLBUG 173extern void fix_strcoll_bug __P((void)); 174#endif /* STRCOLLBUG */ 175 176extern void osinit __P((void)); 177 178#ifndef HAVE_MEMMOVE 179extern ptr_t xmemmove __P((ptr_t, const ptr_t, size_t)); 180# define memmove(a, b, c) xmemmove(a, b, c) 181#endif /* !HAVE_MEMMOVE */ 182 183#ifndef HAVE_MEMSET 184extern ptr_t xmemset __P((ptr_t, int, size_t)); 185# define memset(a, b, c) xmemset(a, b, c) 186#endif /* !HAVE_MEMSET */ 187 188 189#ifndef HAVE_GETCWD 190extern char *xgetcwd __P((char *, size_t)); 191# undef getcwd 192# define getcwd(a, b) xgetcwd(a, b) 193#endif /* !HAVE_GETCWD */ 194 195#ifndef HAVE_GETHOSTNAME 196extern int xgethostname __P((char *, int)); 197# undef gethostname 198# define gethostname(a, b) xgethostname(a, b) 199#endif /* !HAVE_GETHOSTNAME */ 200 201#ifndef HAVE_NICE 202extern int xnice __P((int)); 203# undef nice 204# define nice(a) xnice(a) 205#endif /* !HAVE_NICE */ 206 207#ifndef HAVE_STRERROR 208extern char *xstrerror __P((int)); 209# undef strerror 210# define strerror(a) xstrerror(a) 211#endif /* !HAVE_STRERROR */ 212 213#ifdef apollo 214extern void doinlib __P((Char **, struct command *)); 215extern void dover __P((Char **, struct command *)); 216extern void dorootnode __P((Char **, struct command *)); 217extern int getv __P((Char *)); 218#endif /* apollo */ 219 220 221/* 222 * tc.printf.h 223 */ 224extern pret_t xprintf __P((const char *, ...)); 225extern pret_t xsnprintf __P((char *, size_t, const char *, ...)); 226extern pret_t xvprintf __P((const char *, va_list)); 227extern pret_t xvsnprintf __P((char *, size_t, const char *, 228 va_list)); 229 230/* 231 * tc.prompt.c 232 */ 233extern void dateinit __P((void)); 234extern void printprompt __P((int, const char *)); 235extern Char *expdollar __P((Char **, const Char **, size_t *, 236 int)); 237extern void tprintf __P((int, Char *, const Char *, size_t, 238 const char *, time_t, ptr_t)); 239 240/* 241 * tc.sched.c 242 */ 243extern time_t sched_next __P((void)); 244extern void dosched __P((Char **, struct command *)); 245extern void sched_run __P((int)); 246 247/* 248 * tc.sig.c 249 */ 250#ifndef BSDSIGS 251# ifdef UNRELSIGS 252# ifdef COHERENT 253extern RETSIGTYPE (*xsignal __P((int, RETSIGTYPE (*)(int)))) (); 254# define signal(x,y) xsignal(x,y) 255# endif /* COHERENT */ 256extern RETSIGTYPE (*xsigset __P((int, RETSIGTYPE (*)(int)))) (); 257# define sigset(x,y) xsigset(x,y) 258extern void xsigrelse __P((int)); 259# define sigrelse(x) xsigrelse(x) 260extern void xsighold __P((int)); 261# define sighold(x) xsighold(x) 262extern void xsigignore __P((int)); 263# define sigignore(x) xsigignore(x) 264extern void xsigpause __P((int)); 265# define sigpause(x) xsigpause(x) 266extern pid_t ourwait __P((int *)); 267# endif /* UNRELSIGS */ 268# ifdef SXA 269extern void sigpause __P((int)); 270# endif /* SXA */ 271#endif /* !BSDSIGS */ 272 273#ifdef NEEDsignal 274extern RETSIGTYPE (*xsignal __P((int, RETSIGTYPE (*)(int)))) (); 275# define signal(a, b) xsignal(a, b) 276#endif /* NEEDsignal */ 277#if defined(_SEQUENT_) || ((SYSVREL > 3 || defined(_DGUX_SOURCE)) && defined(POSIXSIGS)) || ((defined(_AIX) || defined(__CYGWIN__)) && defined(POSIXSIGS)) || defined(WINNT_NATIVE) 278extern sigmask_t sigsetmask __P((sigmask_t)); 279# if !defined(DGUX) || (defined(DGUX) && defined(__ix86)) 280extern sigmask_t sigblock __P((sigmask_t)); 281# endif /* !DGUX */ 282extern void bsd_sigpause __P((sigmask_t)); 283extern RETSIGTYPE (*bsd_signal __P((int, RETSIGTYPE (*)(int)))) __P((int)); 284#endif /* _SEQUENT_ */ 285#ifdef SIGSYNCH 286extern RETSIGTYPE synch_handler __P((int)); 287#endif /* SIGSYNCH */ 288 289 290/* 291 * tc.str.c: 292 */ 293#ifdef WIDE_STRINGS 294extern size_t one_mbtowc __P((wchar_t *, const char *, size_t)); 295extern size_t one_wctomb __P((char *, wchar_t)); 296#else 297#define one_mbtowc(PWC, S, N) \ 298 ((void)(N), *(PWC) = (unsigned char)*(S), (size_t)1) 299#define one_wctomb(S, WCHAR) (*(S) = (WCHAR), (size_t)1) 300#endif 301#ifdef SHORT_STRINGS 302extern int rt_mbtowc __P((wchar_t *, const char *, size_t)); 303extern Char *s_strchr __P((const Char *, int)); 304extern Char *s_strrchr __P((const Char *, int)); 305extern Char *s_strcat __P((Char *, const Char *)); 306# ifdef NOTUSED 307extern Char *s_strncat __P((Char *, const Char *, size_t)); 308# endif /* NOTUSED */ 309extern Char *s_strcpy __P((Char *, const Char *)); 310extern Char *s_strncpy __P((Char *, const Char *, size_t)); 311extern Char *s_strspl __P((const Char *, const Char *)); 312extern size_t s_strlen __P((const Char *)); 313extern int s_strcmp __P((const Char *, const Char *)); 314extern int s_strncmp __P((const Char *, const Char *, 315 size_t)); 316extern int s_strcasecmp __P((const Char *, const Char *)); 317extern Char *s_strsave __P((const Char *)); 318extern Char *s_strend __P((const Char *)); 319extern Char *s_strstr __P((const Char *, const Char *)); 320extern Char *str2short __P((const char *)); 321extern Char **blk2short __P((char **)); 322extern char *short2str __P((const Char *)); 323extern char **short2blk __P((Char **)); 324#endif /* SHORT_STRINGS */ 325extern char *short2qstr __P((const Char *)); 326 327 328/* 329 * tc.vers.c: 330 */ 331extern void fix_version __P((void)); 332 333/* 334 * tc.who.c 335 */ 336#if defined (HAVE_UTMP_H) || defined (HAVE_UTMPX_H) || defined (WINNT_NATIVE) 337extern void initwatch __P((void)); 338extern void resetwatch __P((void)); 339extern void watch_login __P((int)); 340extern const char *who_info __P((ptr_t, int, char *, size_t)); 341extern void dolog __P((Char **, struct command *)); 342# ifdef HAVE_STRUCT_UTMP_UT_HOST 343extern char *utmphost __P((void)); 344extern size_t utmphostsize __P((void)); 345# endif /* HAVE_STRUCT_UTMP_UT_HOST */ 346#else 347# define HAVENOUTMP 348#endif 349 350#endif /* _h_tc_decls */ 351