ANSIfication; bug report 4.3BSD/bin/223
[unix-history] / usr / src / include / stdio.h
index 8d8f0f6..3a9117a 100644 (file)
@@ -1,16 +1,21 @@
-/*     stdio.h 1.11    85/01/08        */
-#define        BUFSIZ  1024
-#define        _NFILE  48
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)stdio.h     5.4 (Berkeley) %G%
+ */
+
 # ifndef FILE
 # ifndef FILE
+#define        BUFSIZ  1024
 extern struct  _iobuf {
        int     _cnt;
 extern struct  _iobuf {
        int     _cnt;
-       char    *_ptr;
-       char    *_base;
+       char    *_ptr;          /* should be unsigned char */
+       char    *_base;         /* ditto */
        int     _bufsiz;
        short   _flag;
        int     _bufsiz;
        short   _flag;
-       char    _file;
-} _iob[_NFILE];
-# endif
+       char    _file;          /* should be short */
+} _iob[];
 
 #define        _IOREAD 01
 #define        _IOWRT  02
 
 #define        _IOREAD 01
 #define        _IOWRT  02
@@ -28,8 +33,11 @@ extern       struct  _iobuf {
 #define        stdin   (&_iob[0])
 #define        stdout  (&_iob[1])
 #define        stderr  (&_iob[2])
 #define        stdin   (&_iob[0])
 #define        stdout  (&_iob[1])
 #define        stderr  (&_iob[2])
+#ifndef lint
 #define        getc(p)         (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p))
 #define        getc(p)         (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p))
+#endif not lint
 #define        getchar()       getc(stdin)
 #define        getchar()       getc(stdin)
+#ifndef lint
 #define putc(x, p)     (--(p)->_cnt >= 0 ?\
        (int)(*(unsigned char *)(p)->_ptr++ = (x)) :\
        (((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
 #define putc(x, p)     (--(p)->_cnt >= 0 ?\
        (int)(*(unsigned char *)(p)->_ptr++ = (x)) :\
        (((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
@@ -37,17 +45,19 @@ extern      struct  _iobuf {
                        (int)(*(unsigned char *)(p)->_ptr++) :\
                        _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
                _flsbuf((unsigned char)(x), p)))
                        (int)(*(unsigned char *)(p)->_ptr++) :\
                        _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
                _flsbuf((unsigned char)(x), p)))
+#endif not lint
 #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)
 #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)
+#define        clearerr(p)     ((p)->_flag &= ~(_IOERR|_IOEOF))
 
 FILE   *fopen();
 FILE   *fdopen();
 FILE   *freopen();
 
 FILE   *fopen();
 FILE   *fdopen();
 FILE   *freopen();
+FILE   *popen();
 long   ftell();
 char   *fgets();
 char   *gets();
 long   ftell();
 char   *fgets();
 char   *gets();
-#ifdef vax
-char   *sprintf();             /* too painful to do right */
-#endif
+int    sprintf();      /* here until everyone does it right */
+# endif