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