formatting
[unix-history] / usr / src / include / stdio.h
CommitLineData
acbe3138 1/* @(#)stdio.h 1.3 (Berkeley) %G% */
7002c7bd
MT
2#define BUFSIZ 1024
3#define _NFILE 20
4# ifndef FILE
5extern struct _iobuf {
6 int _cnt;
7 char *_ptr;
8 char *_base;
f4c06a32 9 int _bufsiz;
7002c7bd
MT
10 short _flag;
11 char _file;
12} _iob[_NFILE];
13# endif
14
15#define _IOREAD 01
16#define _IOWRT 02
17#define _IONBF 04
18#define _IOMYBUF 010
19#define _IOEOF 020
20#define _IOERR 040
21#define _IOSTRG 0100
22#define _IOLBF 0200
23#define _IORW 0400
24#define NULL 0
25#define FILE struct _iobuf
26#define EOF (-1)
27
28#define stdin (&_iob[0])
29#define stdout (&_iob[1])
30#define stderr (&_iob[2])
31#define getc(p) (--(p)->_cnt>=0? *(p)->_ptr++&0377:_filbuf(p))
32#define getchar() getc(stdin)
33#define putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p))
34#define putchar(x) putc(x,stdout)
35#define feof(p) (((p)->_flag&_IOEOF)!=0)
36#define ferror(p) (((p)->_flag&_IOERR)!=0)
37#define fileno(p) ((p)->_file)
38
39FILE *fopen();
40FILE *fdopen();
41FILE *freopen();
42long ftell();
43char *fgets();
acbe3138 44char *sprintf();