| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * This file is included by programs which are optionally built into the
|
|---|
| 3 | * shell. If SHELL is defined, we try to map the standard UNIX library
|
|---|
| 4 | * routines to ash routines using defines.
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright (C) 1989 by Kenneth Almquist. All rights reserved.
|
|---|
| 7 | * This file is part of ash, which is distributed under the terms specified
|
|---|
| 8 | * by the Ash General Public License. See the file named LICENSE.
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | #include "../shell.h"
|
|---|
| 12 | #include "../mystring.h"
|
|---|
| 13 | #ifdef SHELL
|
|---|
| 14 | #include "../output.h"
|
|---|
| 15 | #define stdout out1
|
|---|
| 16 | #define stderr out2
|
|---|
| 17 | #define printf out1fmt
|
|---|
| 18 | #define putc(c, file) outc(c, file)
|
|---|
| 19 | #define putchar(c) out1c(c)
|
|---|
| 20 | #define fprintf outfmt
|
|---|
| 21 | #define fputs outstr
|
|---|
| 22 | #define fflush flushout
|
|---|
| 23 | #define INITARGS(argv)
|
|---|
| 24 | #else
|
|---|
| 25 | #undef NULL
|
|---|
| 26 | #include <stdio.h>
|
|---|
| 27 | #undef main
|
|---|
| 28 | #define INITARGS(argv) if ((commandname = argv[0]) == NULL) {fputs("Argc is zero\n", stderr); exit(2);} else
|
|---|
| 29 | #endif
|
|---|
| 30 |
|
|---|
| 31 | #ifdef __STDC__
|
|---|
| 32 | pointer stalloc(int);
|
|---|
| 33 | void error(char *, ...);
|
|---|
| 34 | #else
|
|---|
| 35 | pointer stalloc();
|
|---|
| 36 | void error();
|
|---|
| 37 | #endif
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 | extern char *commandname;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.