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