Add support for the new ENVIRON opton
[unix-history] / usr / src / include / stdio.h
index 3193500..6a5d182 100644 (file)
@@ -1,13 +1,13 @@
 /*-
 /*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * Chris Torek.
  *
  * %sccs.include.redist.c%
  *
  *
  * This code is derived from software contributed to Berkeley by
  * Chris Torek.
  *
  * %sccs.include.redist.c%
  *
- *     @(#)stdio.h     5.22 (Berkeley) %G%
+ *     @(#)stdio.h     8.1 (Berkeley) %G%
  */
 
 #ifndef        _STDIO_H_
  */
 
 #ifndef        _STDIO_H_
@@ -32,7 +32,13 @@ typedef      _BSD_SIZE_T_    size_t;
 /*
  * This is fairly grotesque, but pure ANSI code must not inspect the
  * innards of an fpos_t anyway.  The library internally uses off_t,
 /*
  * This is fairly grotesque, but pure ANSI code must not inspect the
  * innards of an fpos_t anyway.  The library internally uses off_t,
- * which we assume is exactly as big as eight chars.
+ * which we assume is exactly as big as eight chars.  (When we switch
+ * to gcc 2.4 we will use __attribute__ here.)
+ *
+ * WARNING: the alignment constraints on an off_t and the struct below
+ * differ on (e.g.) the SPARC.  Hence, the placement of an fpos_t object
+ * in a structure will change if fpos_t's are not aligned on 8-byte
+ * boundaries.  THIS IS A CROCK, but for now there is no way around it.
  */
 #if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)
 typedef off_t fpos_t;
  */
 #if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)
 typedef off_t fpos_t;
@@ -79,6 +85,8 @@ struct __sbuf {
  * that does not match the previous one in _bf.  When this happens,
  * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  * that does not match the previous one in _bf.  When this happens,
  * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
+ *
+ * NB: see WARNING above before changing the layout of this structure!
  */
 typedef        struct __sFILE {
        unsigned char *_p;      /* current position in (some) buffer */
  */
 typedef        struct __sFILE {
        unsigned char *_p;      /* current position in (some) buffer */
@@ -110,7 +118,7 @@ typedef     struct __sFILE {
 
        /* Unix stdio files get aligned to block boundaries on fseek() */
        int     _blksize;       /* stat.st_blksize (may be != _bf._size) */
 
        /* Unix stdio files get aligned to block boundaries on fseek() */
        int     _blksize;       /* stat.st_blksize (may be != _bf._size) */
-       int     _offset;        /* current lseek offset */
+       fpos_t  _offset;        /* current lseek offset (see WARNING) */
 } FILE;
 
 __BEGIN_DECLS
 } FILE;
 
 __BEGIN_DECLS
@@ -206,7 +214,7 @@ int  getchar __P((void));
 char   *gets __P((char *));
 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
 extern int sys_nerr;                   /* perror(3) external variables */
 char   *gets __P((char *));
 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
 extern int sys_nerr;                   /* perror(3) external variables */
-extern char *sys_errlist[];
+extern const char *const sys_errlist[];
 #endif
 void    perror __P((const char *));
 int     printf __P((const char *, ...));
 #endif
 void    perror __P((const char *));
 int     printf __P((const char *, ...));
@@ -220,7 +228,7 @@ int  scanf __P((const char *, ...));
 void    setbuf __P((FILE *, char *));
 int     setvbuf __P((FILE *, char *, int, size_t));
 int     sprintf __P((char *, const char *, ...));
 void    setbuf __P((FILE *, char *));
 int     setvbuf __P((FILE *, char *, int, size_t));
 int     sprintf __P((char *, const char *, ...));
-int     sscanf __P((char *, const char *, ...));
+int     sscanf __P((const char *, const char *, ...));
 FILE   *tmpfile __P((void));
 char   *tmpnam __P((char *));
 int     ungetc __P((int, FILE *));
 FILE   *tmpfile __P((void));
 char   *tmpnam __P((char *));
 int     ungetc __P((int, FILE *));
@@ -261,6 +269,7 @@ int  snprintf __P((char *, size_t, const char *, ...));
 int     vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_));
 int     vscanf __P((const char *, _BSD_VA_LIST_));
 int     vsscanf __P((const char *, const char *, _BSD_VA_LIST_));
 int     vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_));
 int     vscanf __P((const char *, _BSD_VA_LIST_));
 int     vsscanf __P((const char *, const char *, _BSD_VA_LIST_));
+FILE   *zopen __P((const char *, const char *, int));
 __END_DECLS
 
 /*
 __END_DECLS
 
 /*