1 /* $Id: stdio.h,v 1.10 1994/06/24 11:05:38 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
20 #define _BUFSIZ (_NBF * BUFSIZ)
26 #define IO_WRITEMODE 2
31 #define IO_PERPRINTF 64
35 extern struct _io_buf {
42 } *_io_table[_NFILES], _stdin, _stdout, _stderr;
47 #define FILE struct _io_buf
50 #define stdin (&_stdin)
51 #define stdout (&_stdout)
52 #define stderr (&_stderr)
54 #define getchar() getc(stdin)
55 #define putchar(c) putc(c,stdout)
56 #define getc(p) (--(p)->_count >= 0 ? (int) (*(p)->_ptr++) : \
58 #define putc(c, p) (--(p)->_count >= 0 ? \
59 (int) (*(p)->_ptr++ = (c)) : \
61 #define feof(p) (((p)->_flags & IO_EOF) != 0)
62 #define ferror(p) (((p)->_flags & IO_ERR) != 0)
63 #define fileno(p) ((p)->_fd)
64 #define io_testflag(p,x) ((p)->_flags & (x))
66 /* If you want a stream to be flushed after each printf use:
68 * io_perprintf(stream);
70 * If you want to stop with this kind of buffering use:
72 * io_noperprintf(stream);
75 #define io_noperprintf(p) ((p)->_flags &= ~IO_PERPRINTF)
76 #define io_perprintf(p) ((p)->_flags |= IO_PERPRINTF)
78 extern FILE *fopen(), *fdopen(), *freopen(), *popen();
80 extern setbuf(), rewind();
81 extern char *fgets(), *gets();