Commit | Line | Data |
---|---|---|
22f58170 KB |
1 | /*- |
2 | * Copyright (c) 1991 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * This code is derived from software contributed to Berkeley by | |
6 | * Kenneth Almquist. | |
7 | * | |
8 | * %sccs.include.redist.c% | |
9 | * | |
10 | * @(#)bltin.h 5.1 (Berkeley) %G% | |
11 | */ | |
12 | ||
13 | /* | |
14 | * This file is included by programs which are optionally built into the | |
15 | * shell. If SHELL is defined, we try to map the standard UNIX library | |
16 | * routines to ash routines using defines. | |
17 | */ | |
18 | ||
19 | #include "../shell.h" | |
20 | #include "../mystring.h" | |
21 | #ifdef SHELL | |
22 | #include "../output.h" | |
23 | #define stdout out1 | |
24 | #define stderr out2 | |
25 | #define printf out1fmt | |
26 | #define putc(c, file) outc(c, file) | |
27 | #define putchar(c) out1c(c) | |
28 | #define fprintf outfmt | |
29 | #define fputs outstr | |
30 | #define fflush flushout | |
31 | #define INITARGS(argv) | |
32 | #else | |
33 | #undef NULL | |
34 | #include <stdio.h> | |
35 | #undef main | |
36 | #define INITARGS(argv) if ((commandname = argv[0]) == NULL) {fputs("Argc is zero\n", stderr); exit(2);} else | |
37 | #endif | |
38 | ||
39 | #ifdef __STDC__ | |
40 | pointer stalloc(int); | |
41 | void error(char *, ...); | |
42 | #else | |
43 | pointer stalloc(); | |
44 | void error(); | |
45 | #endif | |
46 | ||
47 | ||
48 | extern char *commandname; |