1 /* $NetBSD: extern.h,v 1.21 2007/07/16 18:26:10 christos Exp $ */
4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * @(#)extern.h 8.1 (Berkeley) 5/31/93
37 #include <sys/cdefs.h>
43 void dosource(Char
**, struct command
*);
44 __dead
void exitstat(void);
46 void importpath(Char
*);
49 __dead
void pintr1(int);
50 void printprompt(void);
54 int vis_fputc(int, FILE *);
57 __dead
void done(int);
59 __dead
void xexit(int);
66 void dodirs(Char
**, struct command
*);
67 Char
*dcanon(Char
*, Char
*);
68 void dtildepr(Char
*, Char
*);
70 void dochngd(Char
**, struct command
*);
71 Char
*dnormalize(Char
*);
72 void dopushd(Char
**, struct command
*);
73 void dopopd(Char
**, struct command
*);
75 void dfree(struct directory
*);
80 void Dfix(struct command
*);
87 void seterror(int, ...);
88 __dead
void stderror(int, ...);
93 __dead
void doexec(Char
**, struct command
*);
94 void dohash(Char
**, struct command
*);
95 void dounhash(Char
**, struct command
*);
96 void dowhich(Char
**, struct command
*);
97 void execash(Char
**, struct command
*);
98 void hashstat(Char
**, struct command
*);
99 void xechoit(Char
**);
105 int exp0(Char
***, int);
111 int tenex(Char
*, int);
117 void Setenv(Char
*, Char
*);
118 void doalias(Char
**, struct command
*);
119 void dobreak(Char
**, struct command
*);
120 void docontin(Char
**, struct command
*);
121 void doecho(Char
**, struct command
*);
122 void doelse(Char
**, struct command
*);
123 void doend(Char
**, struct command
*);
124 void doeval(Char
**, struct command
*);
125 void doexit(Char
**, struct command
*);
126 void doforeach(Char
**, struct command
*);
127 void doglob(Char
**, struct command
*);
128 void dogoto(Char
**, struct command
*);
129 void doif(Char
**, struct command
*);
130 void dolimit(Char
**, struct command
*);
131 void dologin(Char
**, struct command
*);
132 void dologout(Char
**, struct command
*);
133 void donohup(Char
**, struct command
*);
134 void doonintr(Char
**, struct command
*);
135 void doprintf(Char
**, struct command
*);
136 void dorepeat(Char
**, struct command
*);
137 void dosetenv(Char
**, struct command
*);
138 void dosuspend(Char
**, struct command
*);
139 void doswbrk(Char
**, struct command
*);
140 void doswitch(Char
**, struct command
*);
141 void doumask(Char
**, struct command
*);
142 void dounlimit(Char
**, struct command
*);
143 void dounsetenv(Char
**, struct command
*);
144 void dowhile(Char
**, struct command
*);
145 void dozip(Char
**, struct command
*);
146 void func(struct command
*, struct biltins
*);
147 struct biltins
*isbfunc(struct command
*);
149 void gotolab(Char
*);
151 void unalias(Char
**, struct command
*);
157 Char
**dobackp(Char
*, int);
158 void Gcat(Char
*, Char
*);
159 Char
*globone(Char
*, int);
160 int Gmatch(Char
*, Char
*);
162 Char
**globall(Char
**);
163 void rscan(Char
**, void (*)(int));
167 int sortscmp(const ptr_t
, const ptr_t
);
173 void dohist(Char
**, struct command
*);
174 struct Hist
*enthist(int, struct wordent
*, int);
175 void savehist(struct wordent
*);
181 void bseek(struct Ain
*);
182 void btell(struct Ain
*);
184 void copylex(struct wordent
*, struct wordent
*);
185 Char
*domod(Char
*, int);
186 void freelex(struct wordent
*);
187 int lex(struct wordent
*);
188 void prlex(FILE *, struct wordent
*);
196 int any(const char *, int);
197 Char
**blkcat(Char
**, Char
**);
198 Char
**blkcpy(Char
**, Char
**);
199 Char
**blkend(Char
**);
200 void blkfree(Char
**);
202 void blkpr(FILE *, Char
**);
203 Char
**blkspl(Char
**, Char
**);
205 Char
**copyblk(Char
**);
209 Char
lastchr(Char
*);
210 void lshift(Char
**, int);
212 int prefix(Char
*, Char
*);
213 Char
**saveblk(Char
**);
216 char *strsave(const char *);
217 char *strspl(char *, char *);
218 __dead
void udvar(Char
*);
220 #ifndef SHORT_STRINGS
222 char *strstr(const char *, const char *);
223 # endif /* NOTUSED */
224 char *strend(char *);
230 void alias(struct wordent
*);
231 void freesyn(struct command
*);
232 struct command
*syntax(struct wordent
*, struct wordent
*, int);
238 void dobg(Char
**, struct command
*);
239 void dobg1(Char
**, struct command
*);
240 void dofg(Char
**, struct command
*);
241 void dofg1(Char
**, struct command
*);
242 void dojobs(Char
**, struct command
*);
243 void dokill(Char
**, struct command
*);
244 void donotify(Char
**, struct command
*);
245 void dostop(Char
**, struct command
*);
246 void dowait(Char
**, struct command
*);
247 void palloc(int, struct command
*);
251 struct process
*pfind(Char
*);
252 int pfork(struct command
*, int);
253 void pgetty(int, int);
254 void pjwait(struct process
*);
258 void pstart(struct process
*, int);
264 void execute(struct command
*, int, int *, int *);
270 struct varent
*adrof1(Char
*, struct varent
*);
271 void doset(Char
**, struct command
*);
272 void dolet(Char
**, struct command
*);
275 Char
*value1(Char
*, struct varent
*);
276 void set(Char
*, Char
*);
277 void set1(Char
*, Char
**, struct varent
*);
278 void setq(Char
*, Char
**, struct varent
*);
279 void unset(Char
**, struct command
*);
280 void unset1(Char
*[], struct varent
*);
283 void shift(Char
**, struct command
*);
284 void plist(struct varent
*);
289 void donice(Char
**, struct command
*);
290 void dotime(Char
**, struct command
*);
291 void prusage(FILE *, struct rusage
*, struct rusage
*, struct timeval
*,
293 void ruadd(struct rusage
*, struct rusage
*);
301 ptr_t
Malloc(size_t);
302 ptr_t
Realloc(ptr_t
, size_t);
303 ptr_t
Calloc(size_t, size_t);
304 void showall(Char
**, struct command
*);
310 Char
*s_strchr(Char
*, int);
311 Char
*s_strrchr(Char
*, int);
312 Char
*s_strcat(Char
*, Char
*);
314 Char
*s_strncat(Char
*, Char
*, size_t);
316 Char
*s_strcpy(Char
*, Char
*);
317 Char
*s_strncpy(Char
*, Char
*, size_t);
318 Char
*s_strspl(Char
*, Char
*);
319 size_t s_strlen(Char
*);
320 int s_strcmp(Char
*, Char
*);
321 int s_strncmp(Char
*, Char
*, size_t);
322 Char
*s_strsave(Char
*);
323 Char
*s_strend(Char
*);
324 Char
*s_strstr(Char
*, Char
*);
325 Char
*str2short(const char *);
326 Char
**blk2short(char **);
327 char *short2str(Char
*);
328 char **short2blk(Char
**);
330 char *short2qstr(Char
*);
331 char *vis_str(Char
*);
333 #endif /* !_EXTERN_H_ */