Aztec C source - stdio.h
dcn at ihuxl.UUCP
dcn at ihuxl.UUCP
Sat Nov 12 08:26:20 AEST 1983
/* This version of stdio.h has extra defines at the end for my tools.
* I realize this is probably bad programming practice, but at least
* all the tools will share the same constants.
*/
/* Copyright (c) 1982 by Manx Software Systems */
/* Copyright (c) 1982 by Jim Goodnow II */
#define _NOBUFS 8
#define _IOREAD 0x1
#define _IOWRITE 0x2
#define _IODTY 0x4
#define _IOINUSE 0x8
#define _IOBUFFED 0x10
#define _IOERROR 0x20
#define _IOEOF 0x40
int errno;
struct _iobuff {
char *cp;
char *end;
char *base;
int fd;
int mode;
int bufsiz;
long pos;
};
#define FILE struct _iobuff
extern struct _iobuff _iob[];
#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])
#define _BUFSIZE 256
#define putchar(c) aputc(c, stdout)
#define getchar() agetc(stdin)
#define fileno(b) (b->fd)
#define fflush(b) (_flsh(-1, (b)))
#define ferror(b) (((b)->mode & _IOERROR) != 0)
#define feof(b) ((b)->mode & _IOEOF)
#define EOF (-1)
#define NULL (0)
long ftell();
#define E_NOBUFS -50 /* no stdio buffers available */
#define E_BADMODE -51 /* attempted to read/write with bad fopen mode*/
#define E_SKMODE -52 /* invalid seek mode */
#define E_BADSK -53 /* seeked off the beg of file */
/* extra defines for tools */
#define TRUE 1
#define FALSE 0
#define MAXLINE 256
#define BLANK ' '
#define TAB '\t'
#define NL '\n'
#define EOS '\0'
More information about the Comp.sources.unix
mailing list