Move out some of the shell builtin bogosity from printf's source to
sh's builtin/bltin.h.
This commit is contained in:
parent
54e66fcad5
commit
d9f9371008
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)bltin.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id$
|
||||
* $Id: bltin.h,v 1.2 1994/09/24 02:58:26 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -47,15 +47,24 @@
|
||||
#include "../mystring.h"
|
||||
#ifdef SHELL
|
||||
#include "../output.h"
|
||||
#undef stdout
|
||||
#define stdout out1
|
||||
#undef stderr
|
||||
#define stderr out2
|
||||
#define printf out1fmt
|
||||
#undef putc
|
||||
#define putc(c, file) outc(c, file)
|
||||
#undef putchar
|
||||
#define putchar(c) out1c(c)
|
||||
#define fprintf outfmt
|
||||
#define fputs outstr
|
||||
#define fflush flushout
|
||||
#define INITARGS(argv)
|
||||
#define warnx(a, b, c) { \
|
||||
char buf[64]; \
|
||||
(void)snprintf(buf, sizeof(buf), a, b, c); \
|
||||
error(buf); \
|
||||
}
|
||||
#else
|
||||
#undef NULL
|
||||
#include <stdio.h>
|
||||
|
@ -48,26 +48,13 @@ static char sccsid[] = "@(#)printf.c 8.1 (Berkeley) 7/20/93";
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#ifdef SHELL
|
||||
#define EOF -1
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* This *has* to go away. TK.
|
||||
*/
|
||||
#ifdef SHELL
|
||||
#define main printfcmd
|
||||
#define warnx(a, b, c) { \
|
||||
char buf[64]; \
|
||||
(void)sprintf(buf, sizeof(buf), a, b, c); \
|
||||
error(buf); \
|
||||
}
|
||||
#include "../../bin/sh/bltin/bltin.h"
|
||||
#include "bltin/bltin.h"
|
||||
#endif
|
||||
|
||||
#define PF(f, func) { \
|
||||
|
Loading…
Reference in New Issue
Block a user