Home | History | Annotate | Line # | Download | only in csh
extern.h revision 1.1.1.2
      1 /*-
      2  * Copyright (c) 1991, 1993
      3  *	The Regents of the University of California.  All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  * 1. Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  * 2. Redistributions in binary form must reproduce the above copyright
     11  *    notice, this list of conditions and the following disclaimer in the
     12  *    documentation and/or other materials provided with the distribution.
     13  * 3. All advertising materials mentioning features or use of this software
     14  *    must display the following acknowledgement:
     15  *	This product includes software developed by the University of
     16  *	California, Berkeley and its contributors.
     17  * 4. 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  *	@(#)extern.h	8.1 (Berkeley) 5/31/93
     34  */
     35 
     36 #include <sys/cdefs.h>
     37 
     38 /*
     39  * csh.c
     40  */
     41 int	gethdir __P((Char *));
     42 void	dosource __P((Char **, struct command *));
     43 void	exitstat __P((void));
     44 void	goodbye __P((void));
     45 void	importpath __P((Char *));
     46 void	initdesc __P((void));
     47 void	pintr __P((int));
     48 void	pintr1 __P((bool));
     49 void	printprompt __P((void));
     50 void	process __P((bool));
     51 void	rechist __P((void));
     52 void	untty __P((void));
     53 int	vis_fputc __P((int, FILE *));
     54 
     55 #ifdef PROF
     56 void done __P((int));
     57 #else
     58 void xexit __P((int));
     59 #endif
     60 
     61 /*
     62  * dir.c
     63  */
     64 void	 dinit __P((Char *));
     65 void	 dodirs __P((Char **, struct command *));
     66 Char	*dcanon __P((Char *, Char *));
     67 void	 dtildepr __P((Char *, Char *));
     68 void	 dtilde __P((void));
     69 void	 dochngd __P((Char **, struct command *));
     70 Char	*dnormalize __P((Char *));
     71 void	 dopushd __P((Char **, struct command *));
     72 void	 dopopd __P((Char **, struct command *));
     73 struct directory;
     74 void	 dfree __P((struct directory *));
     75 
     76 /*
     77  * dol.c
     78  */
     79 void	 Dfix __P((struct command *));
     80 Char	*Dfix1 __P((Char *));
     81 void	 heredoc __P((Char *));
     82 
     83 /*
     84  * err.c
     85  */
     86 void	seterror __P((int, ...));
     87 void	stderror __P((int, ...));
     88 
     89 /*
     90  * exec.c
     91  */
     92 void	doexec __P((Char **, struct command *));
     93 void	dohash __P((Char **, struct command *));
     94 void	dounhash __P((Char **, struct command *));
     95 void	dowhich __P((Char **, struct command *));
     96 void	execash __P((Char **, struct command *));
     97 void	hashstat __P((Char **, struct command *));
     98 void	xechoit __P((Char **));
     99 
    100 /*
    101  * exp.c
    102  */
    103 int	expr __P((Char ***));
    104 int	exp0 __P((Char ***, bool));
    105 
    106 /*
    107  * file.c
    108  */
    109 #ifdef FILEC
    110 int	tenex __P((Char *, int));
    111 #endif
    112 
    113 /*
    114  * func.c
    115  */
    116 void	Setenv __P((Char *, Char *));
    117 void	doalias __P((Char **, struct command *));
    118 void	dobreak __P((Char **, struct command *));
    119 void	docontin __P((Char **, struct command *));
    120 void	doecho __P((Char **, struct command *));
    121 void	doelse __P((Char **, struct command *));
    122 void	doend __P((Char **, struct command *));
    123 void	doeval __P((Char **, struct command *));
    124 void	doexit __P((Char **, struct command *));
    125 void	doforeach __P((Char **, struct command *));
    126 void	doglob __P((Char **, struct command *));
    127 void	dogoto __P((Char **, struct command *));
    128 void	doif __P((Char **, struct command *));
    129 void	dolimit __P((Char **, struct command *));
    130 void	dologin __P((Char **, struct command *));
    131 void	dologout __P((Char **, struct command *));
    132 void	donohup __P((Char **, struct command *));
    133 void	doonintr __P((Char **, struct command *));
    134 void	doprintf __P((Char **, struct command *));
    135 void	dorepeat __P((Char **, struct command *));
    136 void	dosetenv __P((Char **, struct command *));
    137 void	dosuspend __P((Char **, struct command *));
    138 void	doswbrk __P((Char **, struct command *));
    139 void	doswitch __P((Char **, struct command *));
    140 void	doumask __P((Char **, struct command *));
    141 void	dounlimit __P((Char **, struct command *));
    142 void	dounsetenv __P((Char **, struct command *));
    143 void	dowhile __P((Char **, struct command *));
    144 void	dozip __P((Char **, struct command *));
    145 void	func __P((struct command *, struct biltins *));
    146 struct	biltins *
    147 	isbfunc __P((struct command *));
    148 void	prvars __P((void));
    149 void	gotolab __P((Char *));
    150 int	srchx __P((Char *));
    151 void	unalias __P((Char **, struct command *));
    152 void	wfree __P((void));
    153 
    154 /*
    155  * glob.c
    156  */
    157 Char	**dobackp __P((Char *, bool));
    158 void	  Gcat __P((Char *, Char *));
    159 Char	 *globone __P((Char *, int));
    160 int	  Gmatch __P((Char *, Char *));
    161 void	  ginit __P((void));
    162 Char	**globall __P((Char **));
    163 void	  rscan __P((Char **, void (*)()));
    164 void	  tglob __P((Char **));
    165 void	  trim __P((Char **));
    166 #ifdef FILEC
    167 int	  sortscmp __P((const ptr_t, const ptr_t));
    168 #endif /* FILEC */
    169 
    170 /*
    171  * hist.c
    172  */
    173 void	dohist __P((Char **, struct command *));
    174 struct Hist *
    175 	enthist __P((int, struct wordent *, bool));
    176 void	savehist __P((struct wordent *));
    177 
    178 /*
    179  * lex.c
    180  */
    181 void	 addla __P((Char *));
    182 void	 bseek __P((struct Ain *));
    183 void	 btell __P((struct Ain *));
    184 void	 btoeof __P((void));
    185 void	 copylex __P((struct wordent *, struct wordent *));
    186 Char	*domod __P((Char *, int));
    187 void	 freelex __P((struct wordent *));
    188 int	 lex __P((struct wordent *));
    189 void	 prlex __P((FILE *, struct wordent *));
    190 int	 readc __P((bool));
    191 void	 settell __P((void));
    192 void	 unreadc __P((int));
    193 
    194 /*
    195  * misc.c
    196  */
    197 int	  any __P((char *, int));
    198 Char	**blkcat __P((Char **, Char **));
    199 Char	**blkcpy __P((Char **, Char **));
    200 Char	**blkend __P((Char **));
    201 void	  blkfree __P((Char **));
    202 int	  blklen __P((Char **));
    203 void	  blkpr __P((FILE *, Char **));
    204 Char	**blkspl __P((Char **, Char **));
    205 void	  closem __P((void));
    206 Char	**copyblk __P((Char **));
    207 int	  dcopy __P((int, int));
    208 int	  dmove __P((int, int));
    209 void	  donefds __P((void));
    210 Char	  lastchr __P((Char *));
    211 void	  lshift __P((Char **, int));
    212 int	  number __P((Char *));
    213 int	  prefix __P((Char *, Char *));
    214 Char	**saveblk __P((Char **));
    215 void	  setzero __P((char *, int));
    216 Char	 *strip __P((Char *));
    217 char	 *strsave __P((char *));
    218 char	 *strspl __P((char *, char *));
    219 void	  udvar __P((Char *));
    220 
    221 #ifndef	SHORT_STRINGS
    222 # ifdef NOTUSED
    223 char	 *strstr __P((const char *, const char *));
    224 # endif /* NOTUSED */
    225 char	 *strend __P((char *));
    226 #endif
    227 
    228 /*
    229  * parse.c
    230  */
    231 void	alias __P((struct wordent *));
    232 void	freesyn __P((struct command *));
    233 struct command *
    234 	syntax __P((struct wordent *, struct wordent *, int));
    235 
    236 
    237 /*
    238  * proc.c
    239  */
    240 void	dobg __P((Char **, struct command *));
    241 void	dobg1 __P((Char **, struct command *));
    242 void	dofg __P((Char **, struct command *));
    243 void	dofg1 __P((Char **, struct command *));
    244 void	dojobs __P((Char **, struct command *));
    245 void	dokill __P((Char **, struct command *));
    246 void	donotify __P((Char **, struct command *));
    247 void	dostop __P((Char **, struct command *));
    248 void	dowait __P((Char **, struct command *));
    249 void	palloc __P((int, struct command *));
    250 void	panystop __P((bool));
    251 void	pchild __P((int));
    252 void	pendjob __P((void));
    253 struct process *
    254 	pfind __P((Char *));
    255 int	pfork __P((struct command *, int));
    256 void	pgetty __P((int, int));
    257 void	pjwait __P((struct process *));
    258 void	pnote __P((void));
    259 void	prestjob __P((void));
    260 void	psavejob __P((void));
    261 void	pstart __P((struct process *, int));
    262 void	pwait __P((void));
    263 
    264 /*
    265  * sem.c
    266  */
    267 void	execute __P((struct command *, int, int *, int *));
    268 void	mypipe __P((int *));
    269 
    270 /*
    271  * set.c
    272  */
    273 struct	varent
    274 	*adrof1 __P((Char *, struct varent *));
    275 void	 doset __P((Char **, struct command *));
    276 void	 dolet __P((Char **, struct command *));
    277 Char	*putn __P((int));
    278 int	 getn __P((Char *));
    279 Char	*value1 __P((Char *, struct varent *));
    280 void	 set __P((Char *, Char *));
    281 void	 set1 __P((Char *, Char **, struct varent *));
    282 void	 setq __P((Char *, Char **, struct varent *));
    283 void	 unset __P((Char **, struct command *));
    284 void	 unset1 __P((Char *[], struct varent *));
    285 void	 unsetv __P((Char *));
    286 void	 setNS __P((Char *));
    287 void	 shift __P((Char **, struct command *));
    288 void	 plist __P((struct varent *));
    289 
    290 /*
    291  * time.c
    292  */
    293 void	donice __P((Char **, struct command *));
    294 void	dotime __P((Char **, struct command *));
    295 void	prusage __P((struct rusage *, struct rusage *,
    296 	    struct timeval *, struct timeval *));
    297 void	ruadd __P((struct rusage *, struct rusage *));
    298 void	settimes __P((void));
    299 void	tvadd __P((struct timeval *, struct timeval *));
    300 void	tvsub __P((struct timeval *, struct timeval *, struct timeval *));
    301 void	pcsecs __P((long));
    302 void	psecs __P((long));
    303 
    304 /*
    305  * alloc.c
    306  */
    307 void	Free __P((ptr_t));
    308 ptr_t	Malloc __P((size_t));
    309 ptr_t	Realloc __P((ptr_t, size_t));
    310 ptr_t	Calloc __P((size_t, size_t));
    311 void	showall __P((Char **, struct command *));
    312 
    313 /*
    314  * str.c:
    315  */
    316 #ifdef SHORT_STRINGS
    317 Char	 *s_strchr __P((Char *, int));
    318 Char	 *s_strrchr __P((Char *, int));
    319 Char	 *s_strcat __P((Char *, Char *));
    320 #ifdef NOTUSED
    321 Char	 *s_strncat __P((Char *, Char *, size_t));
    322 #endif
    323 Char	 *s_strcpy __P((Char *, Char *));
    324 Char	 *s_strncpy __P((Char *, Char *, size_t));
    325 Char	 *s_strspl __P((Char *, Char *));
    326 size_t	  s_strlen __P((Char *));
    327 int	  s_strcmp __P((Char *, Char *));
    328 int	  s_strncmp __P((Char *, Char *, size_t));
    329 Char	 *s_strsave __P((Char *));
    330 Char	 *s_strend __P((Char *));
    331 Char	 *s_strstr __P((Char *, Char *));
    332 Char	 *str2short __P((char *));
    333 Char	**blk2short __P((char **));
    334 char	 *short2str __P((Char *));
    335 char	**short2blk __P((Char **));
    336 #endif
    337 char	 *short2qstr __P((Char *));
    338 char	 *vis_str    __P((Char *));
    339