tc.decls.h revision 145479
1145479Smp/* $Header: /src/pub/tcsh/tc.decls.h,v 3.57 2005/01/18 20:24:51 christos Exp $ */ 259243Sobrien/* 359243Sobrien * tc.decls.h: Function declarations from all the tcsh modules 459243Sobrien */ 559243Sobrien/*- 659243Sobrien * Copyright (c) 1980, 1991 The Regents of the University of California. 759243Sobrien * All rights reserved. 859243Sobrien * 959243Sobrien * Redistribution and use in source and binary forms, with or without 1059243Sobrien * modification, are permitted provided that the following conditions 1159243Sobrien * are met: 1259243Sobrien * 1. Redistributions of source code must retain the above copyright 1359243Sobrien * notice, this list of conditions and the following disclaimer. 1459243Sobrien * 2. Redistributions in binary form must reproduce the above copyright 1559243Sobrien * notice, this list of conditions and the following disclaimer in the 1659243Sobrien * documentation and/or other materials provided with the distribution. 17100616Smp * 3. Neither the name of the University nor the names of its contributors 1859243Sobrien * may be used to endorse or promote products derived from this software 1959243Sobrien * without specific prior written permission. 2059243Sobrien * 2159243Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2259243Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2359243Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2459243Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2559243Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2659243Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2759243Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2859243Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2959243Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3059243Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3159243Sobrien * SUCH DAMAGE. 3259243Sobrien */ 3359243Sobrien#ifndef _h_tc_decls 3459243Sobrien#define _h_tc_decls 35145479Smp 3659243Sobrien/* 3759243Sobrien * tc.alloc.c 38145479Smp */ 39145479Smp#ifndef SYSMALLOC 4059243Sobrien#ifndef WINNT_NATIVE 4159243Sobrienextern void free __P((ptr_t)); 4259243Sobrienextern memalign_t malloc __P((size_t)); 4359243Sobrienextern memalign_t realloc __P((ptr_t, size_t)); 4459243Sobrienextern memalign_t calloc __P((size_t, size_t)); 4559243Sobrien#endif /* !WINNT_NATIVE */ 4659243Sobrien#else /* SYSMALLOC */ 4759243Sobrienextern void sfree __P((ptr_t)); 4859243Sobrienextern memalign_t smalloc __P((size_t)); 4959243Sobrienextern memalign_t srealloc __P((ptr_t, size_t)); 5059243Sobrienextern memalign_t scalloc __P((size_t, size_t)); 5159243Sobrien#endif /* SYSMALLOC */ 52145479Smpextern void showall __P((Char **, struct command *)); 53145479Smp 5459243Sobrien/* 55145479Smp * tc.bind.c 56145479Smp */ 5759243Sobrienextern void dobindkey __P((Char **, struct command *)); 58145479Smp#ifdef OBSOLETE 5959243Sobrienextern void dobind __P((Char **, struct command *)); 6059243Sobrien#endif /* OBSOLETE */ 61145479Smp 6259243Sobrien/* 6359243Sobrien * tc.defs.c: 6459243Sobrien */ 65145479Smpextern void getmachine __P((void)); 66145479Smp 67145479Smp 6859243Sobrien/* 6959243Sobrien * tc.disc.c 7059243Sobrien */ 7159243Sobrienextern int setdisc __P((int)); 7259243Sobrienextern int resetdisc __P((int)); 7359243Sobrien 7459243Sobrien/* 7559243Sobrien * tc.func.c 7659243Sobrien */ 7759243Sobrienextern Char *expand_lex __P((Char *, size_t, struct wordent *, 7859243Sobrien int, int)); 7959243Sobrienextern Char *sprlex __P((Char *, size_t, struct wordent *)); 8059243Sobrienextern Char *Itoa __P((int, Char *, int, int)); 8159243Sobrienextern void dolist __P((Char **, struct command *)); 8259243Sobrienextern void dotermname __P((Char **, struct command *)); 8359243Sobrienextern void dotelltc __P((Char **, struct command *)); 8459243Sobrienextern void doechotc __P((Char **, struct command *)); 8559243Sobrienextern void dosettc __P((Char **, struct command *)); 8659243Sobrienextern int cmd_expand __P((Char *, Char *)); 8759243Sobrienextern void dowhich __P((Char **, struct command *)); 8859243Sobrienextern struct process *find_stop_ed __P((void)); 8959243Sobrienextern void fg_proc_entry __P((struct process *)); 9059243Sobrienextern RETSIGTYPE alrmcatch __P((int)); 9159243Sobrienextern void precmd __P((void)); 9259243Sobrienextern void postcmd __P((void)); 9359243Sobrienextern void cwd_cmd __P((void)); 9459243Sobrienextern void beep_cmd __P((void)); 9559243Sobrienextern void period_cmd __P((void)); 9659243Sobrienextern void job_cmd __P((Char *)); 9759243Sobrienextern void aliasrun __P((int, Char *, Char *)); 9859243Sobrienextern void setalarm __P((int)); 9969408Sacheextern void rmstar __P((struct wordent *)); 10059243Sobrienextern void continue_jobs __P((struct wordent *)); 10159243Sobrienextern Char *gettilde __P((Char *)); 10259243Sobrienextern Char *getusername __P((Char **)); 10359243Sobrien#ifdef OBSOLETE 10459243Sobrienextern void doaliases __P((Char **, struct command *)); 10559243Sobrien#endif /* OBSOLETE */ 10659243Sobrienextern void shlvl __P((int)); 10759243Sobrienextern int fixio __P((int, int)); 10859243Sobrienextern int collate __P((const Char *, const Char *)); 10959243Sobrien#ifdef HASHBANG 11059243Sobrienextern int hashbang __P((int, Char ***)); 11159243Sobrien#endif /* HASHBANG */ 11259243Sobrien#ifdef REMOTEHOST 11359243Sobrienextern void remotehost __P((void)); 11459243Sobrien#endif /* REMOTEHOST */ 11559243Sobrien 11659243Sobrien 117145479Smp/* 11859243Sobrien * tc.os.c 11959243Sobrien */ 12059243Sobrien#ifdef MACH 12159243Sobrienextern void dosetpath __P((Char **, struct command *)); 12259243Sobrien#endif /* MACH */ 12359243Sobrien 12459243Sobrien#ifdef TCF 12559243Sobrienextern void dogetxvers __P((Char **, struct command *)); 12659243Sobrienextern void dosetxvers __P((Char **, struct command *)); 127145479Smpextern void dogetspath __P((Char **, struct command *)); 12859243Sobrienextern void dosetspath __P((Char **, struct command *)); 12959243Sobrienextern char *sitename __P((pid_t)); 13059243Sobrienextern void domigrate __P((Char **, struct command *)); 13159243Sobrien#endif /* TCF */ 132145479Smp 13359243Sobrien#ifdef WARP 13459243Sobrienextern void dowarp __P((Char **, struct command *)); 13559243Sobrien#endif /* WARP */ 13659243Sobrien 13759243Sobrien#if defined(_CRAY) && !defined(_CRAYMPP) 13859243Sobrienextern void dodmmode __P((Char **, struct command *)); 13959243Sobrien#endif /* _CRAY && !_CRAYMPP */ 14059243Sobrien 14159243Sobrien#if defined(masscomp) || defined(hcx) 14259243Sobrienextern void douniverse __P((Char **, struct command *)); 143145479Smp#endif /* masscomp */ 144145479Smp 145145479Smp#if defined(_OSD_POSIX) /* BS2000 */ 146145479Smpextern void dobs2cmd __P((Char **, struct command *)); 147145479Smp#endif /* _OSD_POSIX */ 14859243Sobrien 14959243Sobrien#if defined(hcx) 15059243Sobrienextern void doatt __P((Char **, struct command *)); 15159243Sobrienextern void doucb __P((Char **, struct command *)); 15259243Sobrien#endif /* hcx */ 15359243Sobrien 15459243Sobrien#ifdef _SEQUENT_ 15559243Sobrienextern void pr_stat_sub __P((struct process_stats *, 15659243Sobrien struct process_stats *, 15759243Sobrien struct process_stats *)); 15859243Sobrien#endif /* _SEQUENT_ */ 159145479Smp 160145479Smp#ifdef NEEDtcgetpgrp 16159243Sobrienextern int xtcgetpgrp __P((int)); 16259243Sobrienextern int xtcsetpgrp __P((int, int)); 16359243Sobrien# undef tcgetpgrp 16459243Sobrien# define tcgetpgrp(a) xtcgetpgrp(a) 16559243Sobrien# undef tcsetpgrp 16659243Sobrien# define tcsetpgrp(a, b) xtcsetpgrp((a), (b)) 16759243Sobrien#endif /* NEEDtcgetpgrp */ 16859243Sobrien 16959243Sobrien#ifdef YPBUGS 17059243Sobrienextern void fix_yp_bugs __P((void)); 17159243Sobrien#endif /* YPBUGS */ 17259243Sobrien#ifdef STRCOLLBUG 17359243Sobrienextern void fix_strcoll_bug __P((void)); 17459243Sobrien#endif /* STRCOLLBUG */ 175145479Smp 17659243Sobrienextern void osinit __P((void)); 17759243Sobrien 17859243Sobrien#ifndef HAVE_MEMMOVE 17959243Sobrienextern ptr_t xmemmove __P((ptr_t, const ptr_t, size_t)); 18059243Sobrien# define memmove(a, b, c) xmemmove(a, b, c) 18159243Sobrien#endif /* !HAVE_MEMMOVE */ 18259243Sobrien 18359243Sobrien#ifndef HAVE_MEMSET 18459243Sobrienextern ptr_t xmemset __P((ptr_t, int, size_t)); 18559243Sobrien# define memset(a, b, c) xmemset(a, b, c) 18659243Sobrien#endif /* !HAVE_MEMSET */ 18759243Sobrien 18859243Sobrien 18959243Sobrien#ifndef HAVE_GETCWD 19059243Sobrienextern char *xgetcwd __P((char *, size_t)); 19159243Sobrien# undef getcwd 19259243Sobrien# define getcwd(a, b) xgetcwd(a, b) 19359243Sobrien#endif /* !HAVE_GETCWD */ 19459243Sobrien 195145479Smp#ifndef HAVE_GETHOSTNAME 196145479Smpextern int xgethostname __P((char *, int)); 19759243Sobrien# undef gethostname 19859243Sobrien# define gethostname(a, b) xgethostname(a, b) 19959243Sobrien#endif /* !HAVE_GETHOSTNAME */ 20059243Sobrien 20159243Sobrien#ifndef HAVE_NICE 20259243Sobrienextern int xnice __P((int)); 20359243Sobrien# undef nice 20459243Sobrien# define nice(a) xnice(a) 20559243Sobrien#endif /* !HAVE_NICE */ 20659243Sobrien 20759243Sobrien#ifndef HAVE_STRERROR 20859243Sobrienextern char *xstrerror __P((int)); 20959243Sobrien# undef strerror 21059243Sobrien# define strerror(a) xstrerror(a) 21159243Sobrien#endif /* !HAVE_STRERROR */ 212145479Smp 213145479Smp#ifdef apollo 21459243Sobrienextern void doinlib __P((Char **, struct command *)); 21559243Sobrienextern void dover __P((Char **, struct command *)); 21659243Sobrienextern void dorootnode __P((Char **, struct command *)); 21759243Sobrienextern int getv __P((Char *)); 21859243Sobrien#endif /* apollo */ 21959243Sobrien 22059243Sobrien 22159243Sobrien/* 222145479Smp * tc.printf.h 22359243Sobrien */ 22459243Sobrienextern pret_t xprintf __P((const char *, ...)); 22559243Sobrienextern pret_t xsnprintf __P((char *, size_t, const char *, ...)); 22659243Sobrienextern pret_t xvprintf __P((const char *, va_list)); 22759243Sobrienextern pret_t xvsnprintf __P((char *, size_t, const char *, 22859243Sobrien va_list)); 22959243Sobrien 23059243Sobrien/* 23159243Sobrien * tc.prompt.c 23259243Sobrien */ 23359243Sobrienextern void dateinit __P((void)); 23459243Sobrienextern void printprompt __P((int, const char *)); 23559243Sobrienextern Char *expdollar __P((Char **, const Char **, size_t *, 23659243Sobrien int)); 23759243Sobrienextern void tprintf __P((int, Char *, const Char *, size_t, 23859243Sobrien const char *, time_t, ptr_t)); 23959243Sobrien 24059243Sobrien/* 24159243Sobrien * tc.sched.c 24259243Sobrien */ 24359243Sobrienextern time_t sched_next __P((void)); 24459243Sobrienextern void dosched __P((Char **, struct command *)); 24559243Sobrienextern void sched_run __P((int)); 24659243Sobrien 24759243Sobrien/* 24859243Sobrien * tc.sig.c 24959243Sobrien */ 25059243Sobrien#ifndef BSDSIGS 25159243Sobrien# ifdef UNRELSIGS 25259243Sobrien# ifdef COHERENT 25359243Sobrienextern RETSIGTYPE (*xsignal __P((int, RETSIGTYPE (*)(int)))) (); 25459243Sobrien# define signal(x,y) xsignal(x,y) 25559243Sobrien# endif /* COHERENT */ 25659243Sobrienextern RETSIGTYPE (*xsigset __P((int, RETSIGTYPE (*)(int)))) (); 25759243Sobrien# define sigset(x,y) xsigset(x,y) 25859243Sobrienextern void xsigrelse __P((int)); 25959243Sobrien# define sigrelse(x) xsigrelse(x) 26059243Sobrienextern void xsighold __P((int)); 26159243Sobrien# define sighold(x) xsighold(x) 26259243Sobrienextern void xsigignore __P((int)); 26359243Sobrien# define sigignore(x) xsigignore(x) 26459243Sobrienextern void xsigpause __P((int)); 26559243Sobrien# define sigpause(x) xsigpause(x) 26659243Sobrienextern pid_t ourwait __P((int *)); 26759243Sobrien# endif /* UNRELSIGS */ 26859243Sobrien# ifdef SXA 26959243Sobrienextern void sigpause __P((int)); 27059243Sobrien# endif /* SXA */ 27159243Sobrien#endif /* !BSDSIGS */ 27259243Sobrien 27359243Sobrien#ifdef NEEDsignal 27459243Sobrienextern RETSIGTYPE (*xsignal __P((int, RETSIGTYPE (*)(int)))) (); 27559243Sobrien# define signal(a, b) xsignal(a, b) 27659243Sobrien#endif /* NEEDsignal */ 27759243Sobrien#if defined(_SEQUENT_) || ((SYSVREL > 3 || defined(_DGUX_SOURCE)) && defined(POSIXSIGS)) || ((defined(_AIX) || defined(__CYGWIN__)) && defined(POSIXSIGS)) || defined(WINNT_NATIVE) 27859243Sobrienextern sigmask_t sigsetmask __P((sigmask_t)); 27959243Sobrien# if !defined(DGUX) || (defined(DGUX) && defined(__ix86)) 28059243Sobrienextern sigmask_t sigblock __P((sigmask_t)); 28159243Sobrien# endif /* !DGUX */ 28259243Sobrienextern void bsd_sigpause __P((sigmask_t)); 28359243Sobrienextern RETSIGTYPE (*bsd_signal __P((int, RETSIGTYPE (*)(int)))) __P((int)); 28459243Sobrien#endif /* _SEQUENT_ */ 28559243Sobrien#ifdef SIGSYNCH 28659243Sobrienextern RETSIGTYPE synch_handler __P((int)); 28759243Sobrien#endif /* SIGSYNCH */ 28859243Sobrien 28959243Sobrien 29059243Sobrien/* 29159243Sobrien * tc.str.c: 29259243Sobrien */ 29359243Sobrien#ifdef WIDE_STRINGS 29459243Sobrienextern size_t one_mbtowc __P((wchar_t *, const char *, size_t)); 295145479Smpextern size_t one_wctomb __P((char *, wchar_t)); 296145479Smp#else 29759243Sobrien#define one_mbtowc(PWC, S, N) \ 298145479Smp ((void)(N), *(PWC) = (unsigned char)*(S), (size_t)1) 299145479Smp#define one_wctomb(S, WCHAR) (*(S) = (WCHAR), (size_t)1) 30059243Sobrien#endif 30159243Sobrien#ifdef SHORT_STRINGS 30259243Sobrienextern int rt_mbtowc __P((wchar_t *, const char *, size_t)); 303145479Smpextern Char *s_strchr __P((const Char *, int)); 30459243Sobrienextern Char *s_strrchr __P((const Char *, int)); 30559243Sobrienextern Char *s_strcat __P((Char *, const Char *)); 30659243Sobrien# ifdef NOTUSED 30759243Sobrienextern Char *s_strncat __P((Char *, const Char *, size_t)); 30859243Sobrien# endif /* NOTUSED */ 30959243Sobrienextern Char *s_strcpy __P((Char *, const Char *)); 31059243Sobrienextern Char *s_strncpy __P((Char *, const Char *, size_t)); 31159243Sobrienextern Char *s_strspl __P((const Char *, const Char *)); 31259243Sobrienextern size_t s_strlen __P((const Char *)); 31359243Sobrienextern int s_strcmp __P((const Char *, const Char *)); 31459243Sobrienextern int s_strncmp __P((const Char *, const Char *, 31559243Sobrien size_t)); 31659243Sobrienextern int s_strcasecmp __P((const Char *, const Char *)); 31759243Sobrienextern Char *s_strsave __P((const Char *)); 31859243Sobrienextern Char *s_strend __P((const Char *)); 31959243Sobrienextern Char *s_strstr __P((const Char *, const Char *)); 32059243Sobrienextern Char *str2short __P((const char *)); 32159243Sobrienextern Char **blk2short __P((char **)); 32259243Sobrienextern char *short2str __P((const Char *)); 32359243Sobrienextern char **short2blk __P((Char **)); 32459243Sobrien#endif /* SHORT_STRINGS */ 32559243Sobrienextern char *short2qstr __P((const Char *)); 326145479Smp 32759243Sobrien 32859243Sobrien/* 32959243Sobrien * tc.vers.c: 33059243Sobrien */ 33159243Sobrienextern void fix_version __P((void)); 33259243Sobrien 333145479Smp/* 33459243Sobrien * tc.who.c 33559243Sobrien */ 336145479Smp#if defined (HAVE_UTMP_H) || defined (HAVE_UTMPX_H) || defined (WINNT_NATIVE) 337145479Smpextern void initwatch __P((void)); 338145479Smpextern void resetwatch __P((void)); 339145479Smpextern void watch_login __P((int)); 34059243Sobrienextern const char *who_info __P((ptr_t, int, char *, size_t)); 34159243Sobrienextern void dolog __P((Char **, struct command *)); 34259243Sobrien# ifdef HAVE_STRUCT_UTMP_UT_HOST 34359243Sobrienextern char *utmphost __P((void)); 34459243Sobrienextern size_t utmphostsize __P((void)); 34559243Sobrien# endif /* HAVE_STRUCT_UTMP_UT_HOST */ 34659243Sobrien#else 34759243Sobrien# define HAVENOUTMP 34859243Sobrien#endif 34959243Sobrien 35059243Sobrien#endif /* _h_tc_decls */ 35159243Sobrien