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