147099Sbostic /*- 260695Sbostic * Copyright (c) 1991, 1993 360695Sbostic * The Regents of the University of California. All rights reserved. 447099Sbostic * 547099Sbostic * This code is derived from software contributed to Berkeley by 647099Sbostic * Kenneth Almquist. 747099Sbostic * 847099Sbostic * %sccs.include.redist.c% 947099Sbostic * 10*69276Schristos * @(#)bltin.h 8.2 (Berkeley) 05/04/95 1147099Sbostic */ 1247099Sbostic 1347099Sbostic /* 1447099Sbostic * This file is included by programs which are optionally built into the 1547099Sbostic * shell. If SHELL is defined, we try to map the standard UNIX library 1647099Sbostic * routines to ash routines using defines. 1747099Sbostic */ 1847099Sbostic 1947099Sbostic #include "../shell.h" 2047099Sbostic #include "../mystring.h" 2147099Sbostic #ifdef SHELL 2247099Sbostic #include "../output.h" 2347099Sbostic #define stdout out1 2447099Sbostic #define stderr out2 2547099Sbostic #define printf out1fmt 2647099Sbostic #define putc(c, file) outc(c, file) 2747099Sbostic #define putchar(c) out1c(c) 2847099Sbostic #define fprintf outfmt 2947099Sbostic #define fputs outstr 3047099Sbostic #define fflush flushout 3147099Sbostic #define INITARGS(argv) 3247099Sbostic #else 3347099Sbostic #undef NULL 3447099Sbostic #include <stdio.h> 3547099Sbostic #undef main 3647099Sbostic #define INITARGS(argv) if ((commandname = argv[0]) == NULL) {fputs("Argc is zero\n", stderr); exit(2);} else 3747099Sbostic #endif 3847099Sbostic 3947099Sbostic #ifdef __STDC__ 4047099Sbostic pointer stalloc(int); 4147099Sbostic void error(char *, ...); 4247099Sbostic #else 4347099Sbostic pointer stalloc(); 4447099Sbostic void error(); 4547099Sbostic #endif 4647099Sbostic 4747099Sbostic 4847099Sbostic extern char *commandname; 49