Research V7 development
authorKen Thompson <ken@research.uucp>
Sat, 5 May 1979 05:50:12 +0000 (00:50 -0500)
committerKen Thompson <ken@research.uucp>
Sat, 5 May 1979 05:50:12 +0000 (00:50 -0500)
Work on file usr/include/stdio.h

Co-Authored-By: Dennis Ritchie <dmr@research.uucp>
Synthesized-from: v7

usr/include/stdio.h [new file with mode: 0644]

diff --git a/usr/include/stdio.h b/usr/include/stdio.h
new file mode 100644 (file)
index 0000000..1764add
--- /dev/null
@@ -0,0 +1,41 @@
+#define        BUFSIZ  512
+#define        _NFILE  20
+# ifndef FILE
+extern struct  _iobuf {
+       char    *_ptr;
+       int     _cnt;
+       char    *_base;
+       char    _flag;
+       char    _file;
+} _iob[_NFILE];
+# endif
+
+#define        _IOREAD 01
+#define        _IOWRT  02
+#define        _IONBF  04
+#define        _IOMYBUF        010
+#define        _IOEOF  020
+#define        _IOERR  040
+#define        _IOSTRG 0100
+#define        _IORW   0200
+
+#define        NULL    0
+#define        FILE    struct _iobuf
+#define        EOF     (-1)
+
+#define        stdin   (&_iob[0])
+#define        stdout  (&_iob[1])
+#define        stderr  (&_iob[2])
+#define        getc(p)         (--(p)->_cnt>=0? *(p)->_ptr++&0377:_filbuf(p))
+#define        getchar()       getc(stdin)
+#define putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p))
+#define        putchar(x)      putc(x,stdout)
+#define        feof(p)         (((p)->_flag&_IOEOF)!=0)
+#define        ferror(p)       (((p)->_flag&_IOERR)!=0)
+#define        fileno(p)       p->_file
+
+FILE   *fopen();
+FILE   *freopen();
+FILE   *fdopen();
+long   ftell();
+char   *fgets();