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