extern.h revision 1.16 1 1.16 xtraeme /* $NetBSD: extern.h,v 1.16 2005/02/17 16:07:53 xtraeme Exp $ */
2 1.6 cgd
3 1.1 cgd /*-
4 1.5 mycroft * Copyright (c) 1991, 1993
5 1.5 mycroft * The Regents of the University of California. All rights reserved.
6 1.1 cgd *
7 1.1 cgd * Redistribution and use in source and binary forms, with or without
8 1.1 cgd * modification, are permitted provided that the following conditions
9 1.1 cgd * are met:
10 1.1 cgd * 1. Redistributions of source code must retain the above copyright
11 1.1 cgd * notice, this list of conditions and the following disclaimer.
12 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 cgd * notice, this list of conditions and the following disclaimer in the
14 1.1 cgd * documentation and/or other materials provided with the distribution.
15 1.15 agc * 3. Neither the name of the University nor the names of its contributors
16 1.1 cgd * may be used to endorse or promote products derived from this software
17 1.1 cgd * without specific prior written permission.
18 1.1 cgd *
19 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1 cgd * SUCH DAMAGE.
30 1.1 cgd *
31 1.6 cgd * @(#)extern.h 8.1 (Berkeley) 5/31/93
32 1.1 cgd */
33 1.1 cgd
34 1.14 wiz #ifndef _EXTERN_H_
35 1.14 wiz #define _EXTERN_H_
36 1.14 wiz
37 1.1 cgd #include <sys/cdefs.h>
38 1.1 cgd
39 1.1 cgd /*
40 1.1 cgd * csh.c
41 1.1 cgd */
42 1.14 wiz int gethdir(Char *);
43 1.14 wiz void dosource(Char **, struct command *);
44 1.16 xtraeme __dead void exitstat(void) __attribute__((noreturn));
45 1.14 wiz void goodbye(void);
46 1.14 wiz void importpath(Char *);
47 1.14 wiz void initdesc(void);
48 1.14 wiz void pintr(int);
49 1.16 xtraeme void pintr1(bool) __attribute__((noreturn));
50 1.14 wiz void printprompt(void);
51 1.14 wiz void process(bool);
52 1.14 wiz void rechist(void);
53 1.14 wiz void untty(void);
54 1.14 wiz int vis_fputc(int, FILE *);
55 1.1 cgd
56 1.1 cgd #ifdef PROF
57 1.16 xtraeme __dead void done(int) __attribute__((noreturn));
58 1.1 cgd #else
59 1.16 xtraeme __dead void xexit(int) __attribute__((noreturn));
60 1.1 cgd #endif
61 1.1 cgd
62 1.1 cgd /*
63 1.1 cgd * dir.c
64 1.1 cgd */
65 1.14 wiz void dinit(Char *);
66 1.14 wiz void dodirs(Char **, struct command *);
67 1.14 wiz Char *dcanon(Char *, Char *);
68 1.14 wiz void dtildepr(Char *, Char *);
69 1.14 wiz void dtilde(void);
70 1.14 wiz void dochngd(Char **, struct command *);
71 1.14 wiz Char *dnormalize(Char *);
72 1.14 wiz void dopushd(Char **, struct command *);
73 1.14 wiz void dopopd(Char **, struct command *);
74 1.1 cgd struct directory;
75 1.14 wiz void dfree(struct directory *);
76 1.1 cgd
77 1.1 cgd /*
78 1.1 cgd * dol.c
79 1.1 cgd */
80 1.14 wiz void Dfix(struct command *);
81 1.14 wiz Char *Dfix1(Char *);
82 1.14 wiz void heredoc(Char *);
83 1.1 cgd
84 1.1 cgd /*
85 1.1 cgd * err.c
86 1.1 cgd */
87 1.14 wiz void seterror(int, ...);
88 1.16 xtraeme __dead void stderror(int, ...) __attribute__((noreturn));
89 1.1 cgd
90 1.1 cgd /*
91 1.1 cgd * exec.c
92 1.1 cgd */
93 1.16 xtraeme void doexec(Char **, struct command *) __attribute__((noreturn));
94 1.14 wiz void dohash(Char **, struct command *);
95 1.14 wiz void dounhash(Char **, struct command *);
96 1.14 wiz void dowhich(Char **, struct command *);
97 1.14 wiz void execash(Char **, struct command *);
98 1.14 wiz void hashstat(Char **, struct command *);
99 1.14 wiz void xechoit(Char **);
100 1.1 cgd
101 1.1 cgd /*
102 1.1 cgd * exp.c
103 1.1 cgd */
104 1.14 wiz int expr(Char ***);
105 1.14 wiz int exp0(Char ***, bool);
106 1.1 cgd
107 1.1 cgd /*
108 1.1 cgd * file.c
109 1.1 cgd */
110 1.1 cgd #ifdef FILEC
111 1.14 wiz int tenex(Char *, int);
112 1.1 cgd #endif
113 1.1 cgd
114 1.1 cgd /*
115 1.1 cgd * func.c
116 1.1 cgd */
117 1.14 wiz void Setenv(Char *, Char *);
118 1.14 wiz void doalias(Char **, struct command *);
119 1.14 wiz void dobreak(Char **, struct command *);
120 1.14 wiz void docontin(Char **, struct command *);
121 1.14 wiz void doecho(Char **, struct command *);
122 1.14 wiz void doelse(Char **, struct command *);
123 1.14 wiz void doend(Char **, struct command *);
124 1.14 wiz void doeval(Char **, struct command *);
125 1.14 wiz void doexit(Char **, struct command *);
126 1.14 wiz void doforeach(Char **, struct command *);
127 1.14 wiz void doglob(Char **, struct command *);
128 1.14 wiz void dogoto(Char **, struct command *);
129 1.14 wiz void doif(Char **, struct command *);
130 1.14 wiz void dolimit(Char **, struct command *);
131 1.14 wiz void dologin(Char **, struct command *);
132 1.14 wiz void dologout(Char **, struct command *);
133 1.14 wiz void donohup(Char **, struct command *);
134 1.14 wiz void doonintr(Char **, struct command *);
135 1.14 wiz void doprintf(Char **, struct command *);
136 1.14 wiz void dorepeat(Char **, struct command *);
137 1.14 wiz void dosetenv(Char **, struct command *);
138 1.14 wiz void dosuspend(Char **, struct command *);
139 1.14 wiz void doswbrk(Char **, struct command *);
140 1.14 wiz void doswitch(Char **, struct command *);
141 1.14 wiz void doumask(Char **, struct command *);
142 1.14 wiz void dounlimit(Char **, struct command *);
143 1.14 wiz void dounsetenv(Char **, struct command *);
144 1.14 wiz void dowhile(Char **, struct command *);
145 1.14 wiz void dozip(Char **, struct command *);
146 1.14 wiz void func(struct command *, struct biltins *);
147 1.14 wiz struct biltins *isbfunc(struct command *);
148 1.14 wiz void prvars(void);
149 1.14 wiz void gotolab(Char *);
150 1.14 wiz int srchx(Char *);
151 1.14 wiz void unalias(Char **, struct command *);
152 1.14 wiz void wfree(void);
153 1.1 cgd
154 1.1 cgd /*
155 1.1 cgd * glob.c
156 1.1 cgd */
157 1.14 wiz Char **dobackp(Char *, bool);
158 1.14 wiz void Gcat(Char *, Char *);
159 1.14 wiz Char *globone(Char *, int);
160 1.14 wiz int Gmatch(Char *, Char *);
161 1.14 wiz void ginit(void);
162 1.14 wiz Char **globall(Char **);
163 1.14 wiz void rscan(Char **, void (*)(int));
164 1.14 wiz void tglob(Char **);
165 1.14 wiz void trim(Char **);
166 1.1 cgd #ifdef FILEC
167 1.14 wiz int sortscmp(const ptr_t, const ptr_t);
168 1.1 cgd #endif /* FILEC */
169 1.1 cgd
170 1.1 cgd /*
171 1.1 cgd * hist.c
172 1.1 cgd */
173 1.14 wiz void dohist(Char **, struct command *);
174 1.14 wiz struct Hist *enthist(int, struct wordent *, bool);
175 1.14 wiz void savehist(struct wordent *);
176 1.1 cgd
177 1.1 cgd /*
178 1.1 cgd * lex.c
179 1.1 cgd */
180 1.14 wiz void addla(Char *);
181 1.14 wiz void bseek(struct Ain *);
182 1.14 wiz void btell(struct Ain *);
183 1.14 wiz void btoeof(void);
184 1.14 wiz void copylex(struct wordent *, struct wordent *);
185 1.14 wiz Char *domod(Char *, int);
186 1.14 wiz void freelex(struct wordent *);
187 1.14 wiz int lex(struct wordent *);
188 1.14 wiz void prlex(FILE *, struct wordent *);
189 1.14 wiz int readc(bool);
190 1.14 wiz void settell(void);
191 1.14 wiz void unreadc(int);
192 1.1 cgd
193 1.1 cgd /*
194 1.1 cgd * misc.c
195 1.1 cgd */
196 1.14 wiz int any(char *, int);
197 1.14 wiz Char **blkcat(Char **, Char **);
198 1.14 wiz Char **blkcpy(Char **, Char **);
199 1.14 wiz Char **blkend(Char **);
200 1.14 wiz void blkfree(Char **);
201 1.14 wiz int blklen(Char **);
202 1.14 wiz void blkpr(FILE *, Char **);
203 1.14 wiz Char **blkspl(Char **, Char **);
204 1.14 wiz void closem(void);
205 1.14 wiz Char **copyblk(Char **);
206 1.14 wiz int dcopy(int, int);
207 1.14 wiz int dmove(int, int);
208 1.14 wiz void donefds(void);
209 1.14 wiz Char lastchr(Char *);
210 1.14 wiz void lshift(Char **, int);
211 1.14 wiz int number(Char *);
212 1.14 wiz int prefix(Char *, Char *);
213 1.14 wiz Char **saveblk(Char **);
214 1.14 wiz Char *strip(Char *);
215 1.14 wiz Char *quote(Char *);
216 1.14 wiz char *strsave(char *);
217 1.14 wiz char *strspl(char *, char *);
218 1.16 xtraeme void udvar(Char *) __attribute__((noreturn));
219 1.1 cgd
220 1.5 mycroft #ifndef SHORT_STRINGS
221 1.5 mycroft # ifdef NOTUSED
222 1.14 wiz char *strstr(const char *, const char *);
223 1.5 mycroft # endif /* NOTUSED */
224 1.14 wiz char *strend(char *);
225 1.1 cgd #endif
226 1.1 cgd
227 1.1 cgd /*
228 1.1 cgd * parse.c
229 1.1 cgd */
230 1.14 wiz void alias(struct wordent *);
231 1.14 wiz void freesyn(struct command *);
232 1.14 wiz struct command *syntax(struct wordent *, struct wordent *, int);
233 1.1 cgd
234 1.1 cgd
235 1.1 cgd /*
236 1.1 cgd * proc.c
237 1.1 cgd */
238 1.14 wiz void dobg(Char **, struct command *);
239 1.14 wiz void dobg1(Char **, struct command *);
240 1.14 wiz void dofg(Char **, struct command *);
241 1.14 wiz void dofg1(Char **, struct command *);
242 1.14 wiz void dojobs(Char **, struct command *);
243 1.14 wiz void dokill(Char **, struct command *);
244 1.14 wiz void donotify(Char **, struct command *);
245 1.14 wiz void dostop(Char **, struct command *);
246 1.14 wiz void dowait(Char **, struct command *);
247 1.14 wiz void palloc(int, struct command *);
248 1.14 wiz void panystop(bool);
249 1.14 wiz void pchild(int);
250 1.14 wiz void pendjob(void);
251 1.14 wiz struct process *pfind(Char *);
252 1.14 wiz int pfork(struct command *, int);
253 1.14 wiz void pgetty(int, int);
254 1.14 wiz void pjwait(struct process *);
255 1.14 wiz void pnote(void);
256 1.14 wiz void prestjob(void);
257 1.14 wiz void psavejob(void);
258 1.14 wiz void pstart(struct process *, int);
259 1.14 wiz void pwait(void);
260 1.1 cgd
261 1.1 cgd /*
262 1.1 cgd * sem.c
263 1.1 cgd */
264 1.14 wiz void execute(struct command *, int, int *, int *);
265 1.14 wiz void mypipe(int *);
266 1.1 cgd
267 1.1 cgd /*
268 1.1 cgd * set.c
269 1.1 cgd */
270 1.14 wiz struct varent*adrof1(Char *, struct varent *);
271 1.14 wiz void doset(Char **, struct command *);
272 1.14 wiz void dolet(Char **, struct command *);
273 1.14 wiz Char *putn(int);
274 1.14 wiz int getn(Char *);
275 1.14 wiz Char *value1(Char *, struct varent *);
276 1.14 wiz void set(Char *, Char *);
277 1.14 wiz void set1(Char *, Char **, struct varent *);
278 1.14 wiz void setq(Char *, Char **, struct varent *);
279 1.14 wiz void unset(Char **, struct command *);
280 1.14 wiz void unset1(Char *[], struct varent *);
281 1.14 wiz void unsetv(Char *);
282 1.14 wiz void setNS(Char *);
283 1.14 wiz void shift(Char **, struct command *);
284 1.14 wiz void plist(struct varent *);
285 1.1 cgd
286 1.1 cgd /*
287 1.1 cgd * time.c
288 1.1 cgd */
289 1.14 wiz void donice(Char **, struct command *);
290 1.14 wiz void dotime(Char **, struct command *);
291 1.14 wiz void prusage(struct rusage *, struct rusage *, struct timeval *,
292 1.14 wiz struct timeval *);
293 1.14 wiz void ruadd(struct rusage *, struct rusage *);
294 1.14 wiz void settimes(void);
295 1.14 wiz void pcsecs(long);
296 1.14 wiz void psecs(long);
297 1.1 cgd
298 1.1 cgd /*
299 1.1 cgd * alloc.c
300 1.1 cgd */
301 1.14 wiz void Free(ptr_t);
302 1.14 wiz ptr_t Malloc(size_t);
303 1.14 wiz ptr_t Realloc(ptr_t, size_t);
304 1.14 wiz ptr_t Calloc(size_t, size_t);
305 1.14 wiz void showall(Char **, struct command *);
306 1.1 cgd
307 1.1 cgd /*
308 1.1 cgd * str.c:
309 1.1 cgd */
310 1.1 cgd #ifdef SHORT_STRINGS
311 1.14 wiz Char *s_strchr(Char *, int);
312 1.14 wiz Char *s_strrchr(Char *, int);
313 1.14 wiz Char *s_strcat(Char *, Char *);
314 1.1 cgd #ifdef NOTUSED
315 1.14 wiz Char *s_strncat(Char *, Char *, size_t);
316 1.1 cgd #endif
317 1.14 wiz Char *s_strcpy(Char *, Char *);
318 1.14 wiz Char *s_strncpy(Char *, Char *, size_t);
319 1.14 wiz Char *s_strspl(Char *, Char *);
320 1.14 wiz size_t s_strlen(Char *);
321 1.14 wiz int s_strcmp(Char *, Char *);
322 1.14 wiz int s_strncmp(Char *, Char *, size_t);
323 1.14 wiz Char *s_strsave(Char *);
324 1.14 wiz Char *s_strend(Char *);
325 1.14 wiz Char *s_strstr(Char *, Char *);
326 1.14 wiz Char *str2short(const char *);
327 1.14 wiz Char **blk2short(char **);
328 1.14 wiz char *short2str(Char *);
329 1.14 wiz char **short2blk(Char **);
330 1.1 cgd #endif
331 1.14 wiz char *short2qstr(Char *);
332 1.14 wiz char *vis_str(Char *);
333 1.14 wiz
334 1.14 wiz #endif /* !_EXTERN_H_ */
335