1 /* $NetBSD: extern.h,v 1.29 2013/07/16 17:47:43 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);
45 __dead
void goodbye(void);
46 void importpath(Char
*);
48 __dead
void pintr(int);
49 __dead
void pintr1(int);
50 void printprompt(void);
52 char *printpromptstr(EditLine
*);
57 int vis_fputc(int, FILE *);
60 __dead
void done(int);
62 __dead
void xexit(int);
69 void dodirs(Char
**, struct command
*);
70 Char
*dcanon(Char
*, Char
*);
71 void dtildepr(Char
*, Char
*);
73 void dochngd(Char
**, struct command
*);
74 Char
*dnormalize(Char
*);
75 void dopushd(Char
**, struct command
*);
76 void dopopd(Char
**, struct command
*);
78 void dfree(struct directory
*);
83 void Dfix(struct command
*);
90 void seterror(int, ...);
91 __dead
void stderror(int, ...);
96 __dead
void doexec(Char
**, struct command
*);
97 void dohash(Char
**, struct command
*);
98 void dounhash(Char
**, struct command
*);
99 void dowhich(Char
**, struct command
*);
100 void execash(Char
**, struct command
*);
101 void hashstat(Char
**, struct command
*);
102 void xechoit(Char
**);
108 int exp0(Char
***, int);
114 ssize_t
tenex(Char
*, size_t);
120 void Setenv(Char
*, Char
*);
121 void doalias(Char
**, struct command
*);
122 void dobreak(Char
**, struct command
*);
123 void docontin(Char
**, struct command
*);
124 void doecho(Char
**, struct command
*);
125 void doelse(Char
**, struct command
*);
126 void doend(Char
**, struct command
*);
127 void doeval(Char
**, struct command
*);
128 void doexit(Char
**, struct command
*);
129 void doforeach(Char
**, struct command
*);
130 void doglob(Char
**, struct command
*);
131 void dogoto(Char
**, struct command
*);
132 void doif(Char
**, struct command
*);
133 void dolimit(Char
**, struct command
*);
134 __dead
void dologin(Char
**, struct command
*);
135 __dead
void dologout(Char
**, struct command
*);
136 void donohup(Char
**, struct command
*);
137 void doonintr(Char
**, struct command
*);
138 void doprintf(Char
**, struct command
*);
139 void dorepeat(Char
**, struct command
*);
140 void dosetenv(Char
**, struct command
*);
141 void dosuspend(Char
**, struct command
*);
142 void doswbrk(Char
**, struct command
*);
143 void doswitch(Char
**, struct command
*);
144 void doumask(Char
**, struct command
*);
145 void dounlimit(Char
**, struct command
*);
146 void dounsetenv(Char
**, struct command
*);
147 void dowhile(Char
**, struct command
*);
148 void dozip(Char
**, struct command
*);
149 void func(struct command
*, struct biltins
*);
150 struct biltins
*isbfunc(struct command
*);
152 void gotolab(Char
*);
154 void unalias(Char
**, struct command
*);
160 Char
**dobackp(Char
*, int);
161 void Gcat(Char
*, Char
*);
162 Char
*globone(Char
*, int);
163 int Gmatch(Char
*, Char
*);
165 Char
**globall(Char
**);
166 void rscan(Char
**, void (*)(int));
170 int sortscmp(const ptr_t
, const ptr_t
);
176 void dohist(Char
**, struct command
*);
177 struct Hist
*enthist(int, struct wordent
*, int);
179 void loadhist(struct Hist
*);
181 void savehist(struct wordent
*);
187 void bseek(struct Ain
*);
188 void btell(struct Ain
*);
190 void copylex(struct wordent
*, struct wordent
*);
191 Char
*domod(Char
*, int);
192 void freelex(struct wordent
*);
193 int lex(struct wordent
*);
194 void prlex(FILE *, struct wordent
*);
196 int sprlex(char **, struct wordent
*);
205 int any(const char *, int);
206 Char
**blkcat(Char
**, Char
**);
207 Char
**blkcpy(Char
**, Char
**);
208 Char
**blkend(Char
**);
209 void blkfree(Char
**);
211 void blkpr(FILE *, Char
**);
212 Char
**blkspl(Char
**, Char
**);
214 Char
**copyblk(Char
**);
218 Char
lastchr(Char
*);
219 void lshift(Char
**, size_t);
221 int prefix(Char
*, Char
*);
222 Char
**saveblk(Char
**);
225 char *strsave(const char *);
226 char *strspl(char *, char *);
227 __dead
void udvar(Char
*);
229 #ifndef SHORT_STRINGS
231 char *strstr(const char *, const char *);
232 # endif /* NOTUSED */
233 char *strend(char *);
239 void alias(struct wordent
*);
240 void freesyn(struct command
*);
241 struct command
*syntax(struct wordent
*, struct wordent
*, int);
247 void dobg(Char
**, struct command
*);
248 void dobg1(Char
**, struct command
*);
249 void dofg(Char
**, struct command
*);
250 void dofg1(Char
**, struct command
*);
251 void dojobs(Char
**, struct command
*);
252 void dokill(Char
**, struct command
*);
253 void donotify(Char
**, struct command
*);
254 void dostop(Char
**, struct command
*);
255 void dowait(Char
**, struct command
*);
256 void palloc(int, struct command
*);
260 struct process
*pfind(Char
*);
261 int pfork(struct command
*, int);
262 void pgetty(int, int);
263 void pjwait(struct process
*);
267 void pstart(struct process
*, int);
273 void execute(struct command
*, int, int *, int *);
279 struct varent
*adrof1(Char
*, struct varent
*);
280 void doset(Char
**, struct command
*);
281 void dolet(Char
**, struct command
*);
284 Char
*value1(Char
*, struct varent
*);
285 void set(Char
*, Char
*);
286 void set1(Char
*, Char
**, struct varent
*);
287 void setq(Char
*, Char
**, struct varent
*);
288 void unset(Char
**, struct command
*);
289 void unset1(Char
*[], struct varent
*);
292 void shift(Char
**, struct command
*);
293 void plist(struct varent
*);
298 void donice(Char
**, struct command
*);
299 void dotime(Char
**, struct command
*);
300 void prusage(FILE *, struct rusage
*, struct rusage
*, struct timespec
*,
302 void ruadd(struct rusage
*, struct rusage
*);
310 ptr_t
Malloc(size_t);
311 ptr_t
Realloc(ptr_t
, size_t);
312 ptr_t
Calloc(size_t, size_t);
318 Char
*s_strchr(const Char
*, int);
319 Char
*s_strrchr(const Char
*, int);
320 Char
*s_strcat(Char
*, const Char
*);
322 Char
*s_strncat(Char
*, const Char
*, size_t);
324 Char
*s_strcpy(Char
*, const Char
*);
325 Char
*s_strncpy(Char
*, const Char
*, size_t);
326 Char
*s_strspl(const Char
*, const Char
*);
327 size_t s_strlen(const Char
*);
328 int s_strcmp(const Char
*, const Char
*);
329 int s_strncmp(const Char
*, const Char
*, size_t);
330 Char
*s_strsave(const Char
*);
331 Char
*s_strend(const Char
*);
332 Char
*s_strstr(const Char
*, const Char
*);
333 Char
*str2short(const char *);
334 Char
**blk2short(char **);
335 char *short2str(const Char
*);
336 char **short2blk(Char
* const *);
338 char *short2qstr(const Char
*);
339 char *vis_str(const Char
*);
341 #endif /* !_EXTERN_H_ */