sh.decls.h revision 59243
159243Sobrien/* $Header: /src/pub/tcsh/sh.decls.h,v 3.34 1999/02/06 15:01:21 christos Exp $ */ 259243Sobrien/* 359243Sobrien * sh.decls.h External declarations from sh*.c 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. 1759243Sobrien * 3. All advertising materials mentioning features or use of this software 1859243Sobrien * must display the following acknowledgement: 1959243Sobrien * This product includes software developed by the University of 2059243Sobrien * California, Berkeley and its contributors. 2159243Sobrien * 4. Neither the name of the University nor the names of its contributors 2259243Sobrien * may be used to endorse or promote products derived from this software 2359243Sobrien * without specific prior written permission. 2459243Sobrien * 2559243Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2659243Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2759243Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2859243Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2959243Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3059243Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3159243Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3259243Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3359243Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3459243Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3559243Sobrien * SUCH DAMAGE. 3659243Sobrien */ 3759243Sobrien#ifndef _h_sh_decls 3859243Sobrien#define _h_sh_decls 3959243Sobrien 4059243Sobrien/* 4159243Sobrien * sh.c 4259243Sobrien */ 4359243Sobrienextern int gethdir __P((Char *)); 4459243Sobrienextern void dosource __P((Char **, struct command *)); 4559243Sobrienextern void exitstat __P((void)); 4659243Sobrienextern void goodbye __P((Char **, struct command *)); 4759243Sobrienextern void importpath __P((Char *)); 4859243Sobrienextern void initdesc __P((void)); 4959243Sobrienextern sigret_t pintr __P((int)); 5059243Sobrienextern void pintr1 __P((bool)); 5159243Sobrienextern void process __P((bool)); 5259243Sobrienextern void untty __P((void)); 5359243Sobrien#ifdef PROF 5459243Sobrienextern void done __P((int)); 5559243Sobrien#else 5659243Sobrienextern void xexit __P((int)); 5759243Sobrien#endif 5859243Sobrien 5959243Sobrien/* 6059243Sobrien * sh.dir.c 6159243Sobrien */ 6259243Sobrienextern void dinit __P((Char *)); 6359243Sobrienextern void dodirs __P((Char **, struct command *)); 6459243Sobrienextern Char *dcanon __P((Char *, Char *)); 6559243Sobrienextern void dtildepr __P((Char *)); 6659243Sobrienextern void dtilde __P((void)); 6759243Sobrienextern void dochngd __P((Char **, struct command *)); 6859243Sobrienextern Char *dnormalize __P((Char *, int)); 6959243Sobrienextern void dopushd __P((Char **, struct command *)); 7059243Sobrienextern void dopopd __P((Char **, struct command *)); 7159243Sobrienextern void dfree __P((struct directory *)); 7259243Sobrienextern void dsetstack __P((void)); 7359243Sobrienextern int getstakd __P((Char *, int)); 7459243Sobrienextern void recdirs __P((Char *, int)); 7559243Sobrienextern void loaddirs __P((Char *)); 7659243Sobrien 7759243Sobrien/* 7859243Sobrien * sh.dol.c 7959243Sobrien */ 8059243Sobrienextern void Dfix __P((struct command *)); 8159243Sobrienextern Char *Dfix1 __P((Char *)); 8259243Sobrienextern void heredoc __P((Char *)); 8359243Sobrien 8459243Sobrien/* 8559243Sobrien * sh.err.c 8659243Sobrien */ 8759243Sobrienextern void errinit __P((void)); 8859243Sobrienextern void seterror __P((unsigned int, ...)); 8959243Sobrienextern void stderror __P((unsigned int, ...)); 9059243Sobrien 9159243Sobrien/* 9259243Sobrien * sh.exec.c 9359243Sobrien */ 9459243Sobrienextern void doexec __P((struct command *)); 9559243Sobrienextern void dohash __P((Char **, struct command *)); 9659243Sobrienextern void dounhash __P((Char **, struct command *)); 9759243Sobrienextern void execash __P((Char **, struct command *)); 9859243Sobrienextern void hashstat __P((Char **, struct command *)); 9959243Sobrienextern void xechoit __P((Char **)); 10059243Sobrienextern int executable __P((Char *, Char *, bool)); 10159243Sobrienextern int tellmewhat __P((struct wordent *, Char *)); 10259243Sobrienextern void dowhere __P((Char **, struct command *)); 10359243Sobrienextern int find_cmd __P((Char *, int)); 10459243Sobrien 10559243Sobrien/* 10659243Sobrien * sh.exp.c 10759243Sobrien */ 10859243Sobrienextern Char *filetest __P((Char *, Char ***, bool)); 10959243Sobrienextern int expr __P((Char ***)); 11059243Sobrienextern int exp0 __P((Char ***, bool)); 11159243Sobrien 11259243Sobrien/* 11359243Sobrien * sh.file.c 11459243Sobrien */ 11559243Sobrien#ifdef FILEC 11659243Sobrienextern int tenex __P((Char *, int)); 11759243Sobrien#endif 11859243Sobrien 11959243Sobrien/* 12059243Sobrien * sh.func.c 12159243Sobrien */ 12259243Sobrienextern void tsetenv __P((Char *, Char *)); 12359243Sobrienextern void Unsetenv __P((Char *)); 12459243Sobrienextern void doalias __P((Char **, struct command *)); 12559243Sobrienextern void dobreak __P((Char **, struct command *)); 12659243Sobrienextern void docontin __P((Char **, struct command *)); 12759243Sobrienextern void doecho __P((Char **, struct command *)); 12859243Sobrienextern void doelse __P((Char **, struct command *)); 12959243Sobrienextern void doend __P((Char **, struct command *)); 13059243Sobrienextern void doeval __P((Char **, struct command *)); 13159243Sobrienextern void doexit __P((Char **, struct command *)); 13259243Sobrienextern void doforeach __P((Char **, struct command *)); 13359243Sobrienextern void doglob __P((Char **, struct command *)); 13459243Sobrienextern void dogoto __P((Char **, struct command *)); 13559243Sobrienextern void doif __P((Char **, struct command *)); 13659243Sobrienextern void dolimit __P((Char **, struct command *)); 13759243Sobrienextern void dologin __P((Char **, struct command *)); 13859243Sobrienextern void dologout __P((Char **, struct command *)); 13959243Sobrien#ifdef NEWGRP 14059243Sobrienextern void donewgrp __P((Char **, struct command *)); 14159243Sobrien#endif 14259243Sobrienextern void donohup __P((Char **, struct command *)); 14359243Sobrienextern void dohup __P((Char **, struct command *)); 14459243Sobrienextern void doonintr __P((Char **, struct command *)); 14559243Sobrienextern void doprintenv __P((Char **, struct command *)); 14659243Sobrienextern void dorepeat __P((Char **, struct command *)); 14759243Sobrienextern void dofiletest __P((Char **, struct command *)); 14859243Sobrienextern void dosetenv __P((Char **, struct command *)); 14959243Sobrienextern void dosuspend __P((Char **, struct command *)); 15059243Sobrienextern void doswbrk __P((Char **, struct command *)); 15159243Sobrienextern void doswitch __P((Char **, struct command *)); 15259243Sobrienextern void doumask __P((Char **, struct command *)); 15359243Sobrienextern void dounlimit __P((Char **, struct command *)); 15459243Sobrienextern void dounsetenv __P((Char **, struct command *)); 15559243Sobrienextern void dowhile __P((Char **, struct command *)); 15659243Sobrienextern void dozip __P((Char **, struct command *)); 15759243Sobrienextern void func __P((struct command *, 15859243Sobrien struct biltins *)); 15959243Sobrienextern void gotolab __P((Char *)); 16059243Sobrienextern struct biltins *isbfunc __P((struct command *)); 16159243Sobrienextern void prvars __P((void)); 16259243Sobrienextern int srchx __P((Char *)); 16359243Sobrienextern void unalias __P((Char **, struct command *)); 16459243Sobrienextern void wfree __P((void)); 16559243Sobrienextern void dobuiltins __P((Char **, struct command *)); 16659243Sobrienextern void reexecute __P((struct command *)); 16759243Sobrien 16859243Sobrien/* 16959243Sobrien * sh.glob.c 17059243Sobrien */ 17159243Sobrienextern Char *globequal __P((Char *, Char *)); 17259243Sobrienextern Char **dobackp __P((Char *, bool)); 17359243Sobrienextern void Gcat __P((Char *, Char *)); 17459243Sobrienextern Char *globone __P((Char *, int)); 17559243Sobrienextern int Gmatch __P((Char *, Char *)); 17659243Sobrienextern int Gnmatch __P((Char *, Char *, Char **)); 17759243Sobrienextern void ginit __P((void)); 17859243Sobrienextern Char **globall __P((Char **)); 17959243Sobrienextern void rscan __P((Char **, void (*)(int))); 18059243Sobrienextern void tglob __P((Char **)); 18159243Sobrienextern void trim __P((Char **)); 18259243Sobrien#ifdef FILEC 18359243Sobrienextern int sortscmp __P((Char **, Char **)); 18459243Sobrien#endif 18559243Sobrienextern void nlsinit __P((void)); 18659243Sobrien 18759243Sobrien/* 18859243Sobrien * sh.hist.c 18959243Sobrien */ 19059243Sobrienextern void dohist __P((Char **, struct command *)); 19159243Sobrienextern struct Hist *enthist __P((int, struct wordent *, bool, bool)); 19259243Sobrienextern void savehist __P((struct wordent *, bool)); 19359243Sobrienextern void fmthist __P((int, ptr_t, char *, size_t)); 19459243Sobrienextern void rechist __P((Char *, int)); 19559243Sobrienextern void loadhist __P((Char *, bool)); 19659243Sobrien 19759243Sobrien/* 19859243Sobrien * sh.init.c 19959243Sobrien */ 20059243Sobrienextern void mesginit __P((void)); 20159243Sobrien 20259243Sobrien/* 20359243Sobrien * sh.lex.c 20459243Sobrien */ 20559243Sobrienextern void addla __P((Char *)); 20659243Sobrienextern void bseek __P((struct Ain *)); 20759243Sobrienextern void btell __P((struct Ain *)); 20859243Sobrienextern void btoeof __P((void)); 20959243Sobrienextern void copylex __P((struct wordent *, 21059243Sobrien struct wordent *)); 21159243Sobrienextern Char *domod __P((Char *, int)); 21259243Sobrienextern void freelex __P((struct wordent *)); 21359243Sobrienextern int lex __P((struct wordent *)); 21459243Sobrienextern void prlex __P((struct wordent *)); 21559243Sobrienextern int readc __P((bool)); 21659243Sobrienextern void settell __P((void)); 21759243Sobrienextern void unreadc __P((int)); 21859243Sobrien 21959243Sobrien 22059243Sobrien/* 22159243Sobrien * sh.misc.c 22259243Sobrien */ 22359243Sobrienextern int any __P((char *, int)); 22459243Sobrienextern Char **blkcpy __P((Char **, Char **)); 22559243Sobrienextern void blkfree __P((Char **)); 22659243Sobrienextern int blklen __P((Char **)); 22759243Sobrienextern void blkpr __P((Char **)); 22859243Sobrienextern void blkexpand __P((Char **, Char *)); 22959243Sobrienextern Char **blkspl __P((Char **, Char **)); 23059243Sobrienextern void closem __P((void)); 23159243Sobrien#ifndef CLOSE_ON_EXEC 23259243Sobrienextern void closech __P((void)); 23359243Sobrien#endif /* !CLOSE_ON_EXEC */ 23459243Sobrienextern Char **copyblk __P((Char **)); 23559243Sobrienextern int dcopy __P((int, int)); 23659243Sobrienextern int dmove __P((int, int)); 23759243Sobrienextern void donefds __P((void)); 23859243Sobrienextern Char lastchr __P((Char *)); 23959243Sobrienextern void lshift __P((Char **, int)); 24059243Sobrienextern int number __P((Char *)); 24159243Sobrienextern int prefix __P((Char *, Char *)); 24259243Sobrienextern Char **saveblk __P((Char **)); 24359243Sobrienextern void setzero __P((char *, int)); 24459243Sobrienextern Char *strip __P((Char *)); 24559243Sobrienextern Char *quote __P((Char *)); 24659243Sobrienextern Char *quote_meta __P((Char *, const Char *)); 24759243Sobrienextern char *strsave __P((const char *)); 24859243Sobrienextern void udvar __P((Char *)); 24959243Sobrien#ifndef POSIX 25059243Sobrienextern char *strstr __P((const char *, const char *)); 25159243Sobrien#endif /* !POSIX */ 25259243Sobrien#ifndef SHORT_STRINGS 25359243Sobrienextern char *strspl __P((char *, char *)); 25459243Sobrienextern char *strend __P((char *)); 25559243Sobrien#endif /* SHORT_STRINGS */ 25659243Sobrien 25759243Sobrien/* 25859243Sobrien * sh.parse.c 25959243Sobrien */ 26059243Sobrienextern void alias __P((struct wordent *)); 26159243Sobrienextern void freesyn __P((struct command *)); 26259243Sobrienextern struct command *syntax __P((struct wordent *, 26359243Sobrien struct wordent *, int)); 26459243Sobrien 26559243Sobrien/* 26659243Sobrien * sh.print.c 26759243Sobrien */ 26859243Sobrienextern void drainoline __P((void)); 26959243Sobrienextern void flush __P((void)); 27059243Sobrien#ifdef BSDTIMES 27159243Sobrienextern void pcsecs __P((long)); 27259243Sobrien#else /* !BSDTIMES */ 27359243Sobrien# ifdef POSIX 27459243Sobrienextern void pcsecs __P((clock_t)); 27559243Sobrien# else /* !POSIX */ 27659243Sobrienextern void pcsecs __P((time_t)); 27759243Sobrien# endif /* !POSIX */ 27859243Sobrien#endif /* BSDTIMES */ 27959243Sobrien#ifdef BSDLIMIT 28059243Sobrienextern void psecs __P((long)); 28159243Sobrien#endif /* BSDLIMIT */ 28259243Sobrienextern int putpure __P((int)); 28359243Sobrienextern int putraw __P((int)); 28459243Sobrienextern void xputchar __P((int)); 28559243Sobrien 28659243Sobrien 28759243Sobrien/* 28859243Sobrien * sh.proc.c 28959243Sobrien */ 29059243Sobrienextern void dobg __P((Char **, struct command *)); 29159243Sobrienextern void dobg1 __P((Char **, struct command *)); 29259243Sobrienextern void dofg __P((Char **, struct command *)); 29359243Sobrienextern void dofg1 __P((Char **, struct command *)); 29459243Sobrienextern void dojobs __P((Char **, struct command *)); 29559243Sobrienextern void dokill __P((Char **, struct command *)); 29659243Sobrienextern void donotify __P((Char **, struct command *)); 29759243Sobrienextern void dostop __P((Char **, struct command *)); 29859243Sobrienextern void dowait __P((Char **, struct command *)); 29959243Sobrienextern void palloc __P((int, struct command *)); 30059243Sobrienextern void panystop __P((bool)); 30159243Sobrienextern sigret_t pchild __P((int)); 30259243Sobrienextern void pendjob __P((void)); 30359243Sobrienextern int pfork __P((struct command *, int)); 30459243Sobrienextern void pgetty __P((int, int)); 30559243Sobrienextern void pjwait __P((struct process *)); 30659243Sobrienextern void pnote __P((void)); 30759243Sobrienextern void prestjob __P((void)); 30859243Sobrienextern void psavejob __P((void)); 30959243Sobrienextern int pstart __P((struct process *, int)); 31059243Sobrienextern void pwait __P((void)); 31159243Sobrienextern struct process *pfind __P((Char *)); 31259243Sobrien 31359243Sobrien/* 31459243Sobrien * sh.sem.c 31559243Sobrien */ 31659243Sobrienextern void execute __P((struct command *, int, int *, 31759243Sobrien int *)); 31859243Sobrienextern void mypipe __P((int *)); 31959243Sobrien 32059243Sobrien/* 32159243Sobrien * sh.set.c 32259243Sobrien */ 32359243Sobrienextern struct varent *adrof1 __P((Char *, struct varent *)); 32459243Sobrienextern void doset __P((Char **, struct command *)); 32559243Sobrienextern void dolet __P((Char **, struct command *)); 32659243Sobrienextern Char *putn __P((int)); 32759243Sobrienextern int getn __P((Char *)); 32859243Sobrienextern Char *value1 __P((Char *, struct varent *)); 32959243Sobrienextern void set __P((Char *, Char *, int)); 33059243Sobrienextern void set1 __P((Char *, Char **, struct varent *, 33159243Sobrien int)); 33259243Sobrienextern void setq __P((Char *, Char **, struct varent *, 33359243Sobrien int)); 33459243Sobrienextern void unset __P((Char **, struct command *)); 33559243Sobrienextern void unset1 __P((Char *[], struct varent *)); 33659243Sobrienextern void unsetv __P((Char *)); 33759243Sobrienextern void setNS __P((Char *)); 33859243Sobrienextern void shift __P((Char **, struct command *)); 33959243Sobrienextern void plist __P((struct varent *, int)); 34059243Sobrien#if defined(DSPMBYTE) 34159243Sobrienextern void update_dspmbyte_vars __P((void)); 34259243Sobrienextern void autoset_dspmbyte __P((Char *)); 34359243Sobrien#endif 34459243Sobrien 34559243Sobrien/* 34659243Sobrien * sh.time.c 34759243Sobrien */ 34859243Sobrienextern void donice __P((Char **, struct command *)); 34959243Sobrienextern void dotime __P((Char **, struct command *)); 35059243Sobrien#ifdef BSDTIMES 35159243Sobrienextern void prusage __P((struct sysrusage *, 35259243Sobrien struct sysrusage *, 35359243Sobrien timeval_t *, timeval_t *)); 35459243Sobrienextern void ruadd __P((struct sysrusage *, 35559243Sobrien struct sysrusage *)); 35659243Sobrien#else /* BSDTIMES */ 35759243Sobrien# ifdef _SEQUENT_ 35859243Sobrienextern void prusage __P((struct process_stats *, 35959243Sobrien struct process_stats *, 36059243Sobrien timeval_t *, timeval_t *)); 36159243Sobrienextern void ruadd __P((struct process_stats *, 36259243Sobrien struct process_stats *)); 36359243Sobrien# else /* !_SEQUENT_ */ 36459243Sobrien# ifdef POSIX 36559243Sobrienextern void prusage __P((struct tms *, struct tms *, 36659243Sobrien clock_t, clock_t)); 36759243Sobrien# else /* !POSIX */ 36859243Sobrienextern void prusage __P((struct tms *, struct tms *, 36959243Sobrien time_t, time_t)); 37059243Sobrien# endif /* !POSIX */ 37159243Sobrien# endif /* !_SEQUENT_ */ 37259243Sobrien#endif /* BSDTIMES */ 37359243Sobrienextern void settimes __P((void)); 37459243Sobrien#if defined(BSDTIMES) || defined(_SEQUENT_) 37559243Sobrienextern void tvsub __P((struct timeval *, 37659243Sobrien struct timeval *, 37759243Sobrien struct timeval *)); 37859243Sobrien#endif /* BSDTIMES || _SEQUENT_ */ 37959243Sobrien 38059243Sobrien#endif /* _h_sh_decls */ 381