]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove _IO_file_flags define.
authorZack Weinberg <zackw@panix.com>
Thu, 8 Feb 2018 00:41:01 +0000 (19:41 -0500)
committerZack Weinberg <zackw@panix.com>
Wed, 21 Feb 2018 19:22:50 +0000 (14:22 -0500)
This entirely mechanical (except for some indentation fixups) patch
replaces all uses of _IO_file_flags with _flags and removes the #define.

Installed stripped libraries and executables are unchanged by this patch.

* libio/libio.h (_IO_file_flags): Remove macro.
All uses changed to _flags.

22 files changed:
ChangeLog
debug/fgets_chk.c
debug/fgets_u_chk.c
debug/fgetws_chk.c
debug/fgetws_u_chk.c
debug/gets_chk.c
libio/bits/types/struct_FILE.h
libio/fileops.c
libio/iofclose.c
libio/iofgets.c
libio/iofgets_u.c
libio/iofgetws.c
libio/iofgetws_u.c
libio/iogets.c
libio/iosetvbuf.c
libio/libio.h
libio/libioP.h
libio/oldfileops.c
libio/oldiofclose.c
libio/strfile.h
libio/strops.c
stdio-common/vfprintf.c

index f35b6e4a3b69d7c8317fd65f69ce1ac7a978c539..26143536b13452c746778b46176fb89b2190b672 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2018-02-21  Zack Weinberg  <zackw@panix.com>
 
+       * libio/libio.h (_IOS_ATEND, _IOS_APPEND, _IOS_TRUNC)
+       (_IOS_NOCREATE, _IOS_NOREPLACE, _IOS_BIN, _OLD_STDIO_MAGIC)
+       (_IO_SKIPWS, _IO_LEFT, _IO_RIGHT, _IO_INTERNAL, _IO_DEC)
+       (_IO_OCT, _IO_HEX, _IO_SHOWBASE, _IO_SHOWPOINT, _IO_UPPERCASE)
+       (_IO_SHOWPOS, _IO_SCIENTIFIC, _IO_FIXED, _IO_UNITBUF, _IO_STDIO)
+       (_IO_DONT_CLOSE, _IO_BOOLALPHA, _IO_BAD_SEEN): Remove, unused.
+       Reformat bit flags for _flags field to make occupancy clearer.
+       Update commentary.
+       * libio/bits/types/struct_FILE.h (_IO_EOF_SEEN, _IO_ERR_SEEN):
+       Keep definitions consistent with those in libio/libio.h.
+
+       * libio/libio.h (_IO_file_flags): Remove macro.
+       All uses changed to _flags.
+
        * libio/libio.h (_IO_UNIFIED_JUMPTABLES, _STDIO_USES_IOSTREAM)
        (__HAVE_COLUMN, _IO_BE): Don't define.
        (_IO_peekc_unlocked, _IO_getwc_unlocked, _IO_putwc_unlocked)
index f2236533700c688a378e69ddc8fd4b892a593970..f3548c7d6109d08c509e87fa84312fdcce2dfafd 100644 (file)
@@ -40,13 +40,12 @@ __fgets_chk (char *buf, size_t size, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  int old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
-  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
-                    && errno != EAGAIN))
+  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
     result = NULL;
   else if (count >= size)
     __chk_fail ();
@@ -55,7 +54,7 @@ __fgets_chk (char *buf, size_t size, int n, FILE *fp)
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   _IO_release_lock (fp);
   return result;
 }
index 317ae5649df5a7f1be943ecdd4ddac069e71a8db..924634c17bca0013fc09b989a98defc862e5d952 100644 (file)
@@ -39,13 +39,12 @@ __fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  int old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
-  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
-                    && errno != EAGAIN))
+  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
     result = NULL;
   else if (count >= size)
     __chk_fail ();
@@ -54,6 +53,6 @@ __fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp)
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   return result;
 }
index 8ea6635b30ee1ff3416b8262c31119eb41d6515c..2380059f0f13e2da0cd62057eebc05bcf4cbe3fe 100644 (file)
@@ -32,8 +32,8 @@ __fgetws_chk (wchar_t *buf, size_t size, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
@@ -46,7 +46,7 @@ __fgetws_chk (wchar_t *buf, size_t size, int n, FILE *fp)
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   _IO_release_lock (fp);
   return result;
 }
index 42dad6bc8b5d1af0085c4cf3a8ef8ded4b4fed33..8147eb1e36c89a929bf6e4a01522b94f16c1181a 100644 (file)
@@ -40,13 +40,12 @@ __fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
-  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
-                    && errno != EAGAIN))
+  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
     result = NULL;
   else if (count >= size)
     __chk_fail ();
@@ -55,6 +54,6 @@ __fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, FILE *fp)
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   return result;
 }
index df3f947e7053a9241efc111e954bbfd643a5b62b..2b1416b295ee8f1d55d56f821519791095aecc8c 100644 (file)
@@ -51,17 +51,17 @@ __gets_chk (char *buf, size_t size)
       /* This is very tricky since a file descriptor may be in the
         non-blocking mode. The error flag doesn't mean much in this
         case. We return an error only when there is a new error. */
-      int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN;
-      _IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN;
+      int old_error = _IO_stdin->_flags & _IO_ERR_SEEN;
+      _IO_stdin->_flags &= ~_IO_ERR_SEEN;
       buf[0] = (char) ch;
       count = _IO_getline (_IO_stdin, buf + 1, size - 1, '\n', 0) + 1;
-      if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
+      if (_IO_stdin->_flags & _IO_ERR_SEEN)
        {
          retval = NULL;
          goto unlock_return;
        }
       else
-       _IO_stdin->_IO_file_flags |= old_error;
+       _IO_stdin->_flags |= old_error;
     }
   if (count >= size)
     __chk_fail ();
index a120c7626856e5886cd9e31844f87e0ebd4a7260..359f94945346c9eb4f92d1551e5e1a6d63a63dfb 100644 (file)
@@ -108,10 +108,10 @@ struct _IO_FILE_complete
    ? __overflow (_fp, (unsigned char) (_ch))                           \
    : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))
 
-#define _IO_EOF_SEEN 0x10
+#define _IO_EOF_SEEN 0x0010
 #define __feof_unlocked_body(_fp) (((_fp)->_flags & _IO_EOF_SEEN) != 0)
 
-#define _IO_ERR_SEEN 0x20
+#define _IO_ERR_SEEN 0x0020
 #define __ferror_unlocked_body(_fp) (((_fp)->_flags & _IO_ERR_SEEN) != 0)
 
 #define _IO_USER_LOCK 0x8000
index 4b8e443bc2f387e7fe65ae0275e5ea42d0daf08a..ec1e2b5904aaf4ba99c6ef22cc623678115aa82c 100644 (file)
@@ -109,7 +109,7 @@ _IO_new_file_init_internal (struct _IO_FILE_plus *fp)
      of our file descriptor.  Hence we actually don't know the actual
      position before we do the first fseek (and until a following fflush). */
   fp->file._offset = _IO_pos_BAD;
-  fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;
+  fp->file._flags |= CLOSED_FILEBUF_FLAGS;
 
   _IO_link_in (fp);
   fp->file._fileno = -1;
index c7c44ed9b47b845cfbf3ab8270605febb932845e..7a8b89f9f540e7621d42173d2200561123d07d98 100644 (file)
@@ -45,11 +45,11 @@ _IO_new_fclose (FILE *fp)
 #endif
 
   /* First unlink the stream.  */
-  if (fp->_IO_file_flags & _IO_IS_FILEBUF)
+  if (fp->_flags & _IO_IS_FILEBUF)
     _IO_un_link ((struct _IO_FILE_plus *) fp);
 
   _IO_acquire_lock (fp);
-  if (fp->_IO_file_flags & _IO_IS_FILEBUF)
+  if (fp->_flags & _IO_IS_FILEBUF)
     status = _IO_file_close_it (fp);
   else
     status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
@@ -73,7 +73,7 @@ _IO_new_fclose (FILE *fp)
     }
   if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
     {
-      fp->_IO_file_flags = 0;
+      fp->_flags = 0;
       free(fp);
     }
 
index b15b59d3bf6fd4a0d9f216cc23e6d7d502c57496..68177dbe22d3a3463291c3f25cf7188cc9ad4af1 100644 (file)
@@ -48,20 +48,19 @@ _IO_fgets (char *buf, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getline (fp, buf, n - 1, '\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
-  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
-                    && errno != EAGAIN))
+  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
     result = NULL;
   else
     {
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   _IO_release_lock (fp);
   return result;
 }
index 9091644685738fa7512223989f92b1bde70ace77..9d33a376219d20076b64a45e67e0f18dd9ff66db 100644 (file)
@@ -47,20 +47,19 @@ __fgets_unlocked (char *buf, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getline (fp, buf, n - 1, '\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
-  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
-                    && errno != EAGAIN))
+  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
     result = NULL;
   else
     {
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   return result;
 }
 libc_hidden_def (__fgets_unlocked)
index 0e2d515df5e0d640d9821af43ed0bf4ab87ba529..292a161757d082da810cc9472831566a418f73c6 100644 (file)
@@ -48,8 +48,8 @@ fgetws (wchar_t *buf, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getwline (fp, buf, n - 1, L'\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
@@ -60,7 +60,7 @@ fgetws (wchar_t *buf, int n, FILE *fp)
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   _IO_release_lock (fp);
   return result;
 }
index a930b47a6df9e5d5825efd6dd88f59ab526faf2a..46431a278b5b470e16ad1a01210050671cbc47d4 100644 (file)
@@ -47,19 +47,18 @@ fgetws_unlocked (wchar_t *buf, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getwline (fp, buf, n - 1, L'\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
-  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
-                    && errno != EAGAIN))
+  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
     result = NULL;
   else
     {
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   return result;
 }
index 19048f6d03d78ceffbc13f120516d0ab5bb18fee..c2223e6ecc0891428669aefaa2490796c9365922 100644 (file)
@@ -48,17 +48,17 @@ _IO_gets (char *buf)
       /* This is very tricky since a file descriptor may be in the
         non-blocking mode. The error flag doesn't mean much in this
         case. We return an error only when there is a new error. */
-      int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN;
-      _IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN;
+      int old_error = _IO_stdin->_flags & _IO_ERR_SEEN;
+      _IO_stdin->_flags &= ~_IO_ERR_SEEN;
       buf[0] = (char) ch;
       count = _IO_getline (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
-      if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
+      if (_IO_stdin->_flags & _IO_ERR_SEEN)
        {
          retval = NULL;
          goto unlock_return;
        }
       else
-       _IO_stdin->_IO_file_flags |= old_error;
+       _IO_stdin->_flags |= old_error;
     }
   buf[count] = 0;
   retval = buf;
index b29a93be548a69bd8ea57a379c92e0ef1ea205d6..a35d866d82778563b7b46f11d42dbc16e865bd83 100644 (file)
@@ -39,7 +39,7 @@ _IO_setvbuf (FILE *fp, char *buf, int mode, size_t size)
   switch (mode)
     {
     case _IOFBF:
-      fp->_IO_file_flags &= ~(_IO_LINE_BUF|_IO_UNBUFFERED);
+      fp->_flags &= ~(_IO_LINE_BUF|_IO_UNBUFFERED);
       if (buf == NULL)
        {
          if (fp->_IO_buf_base == NULL)
@@ -62,15 +62,15 @@ _IO_setvbuf (FILE *fp, char *buf, int mode, size_t size)
                  result = EOF;
                  goto unlock_return;
                }
-             fp->_IO_file_flags &= ~_IO_LINE_BUF;
+             fp->_flags &= ~_IO_LINE_BUF;
            }
          result = 0;
          goto unlock_return;
        }
       break;
     case _IOLBF:
-      fp->_IO_file_flags &= ~_IO_UNBUFFERED;
-      fp->_IO_file_flags |= _IO_LINE_BUF;
+      fp->_flags &= ~_IO_UNBUFFERED;
+      fp->_flags |= _IO_LINE_BUF;
       if (buf == NULL)
        {
          result = 0;
@@ -78,8 +78,8 @@ _IO_setvbuf (FILE *fp, char *buf, int mode, size_t size)
        }
       break;
     case _IONBF:
-      fp->_IO_file_flags &= ~_IO_LINE_BUF;
-      fp->_IO_file_flags |= _IO_UNBUFFERED;
+      fp->_flags &= ~_IO_LINE_BUF;
+      fp->_flags |= _IO_UNBUFFERED;
       buf = NULL;
       size = 0;
       break;
index a3c679ca666c5fb279ffd9ce5db99d051649c970..df40bfd5ba37f7c713c48841bfca3a37c68d3864 100644 (file)
@@ -60,45 +60,34 @@ typedef union
 
 #include <shlib-compat.h>
 
-/* compatibility defines */
-#define _IO_file_flags _flags
-
-/* open modes */
+/* _IO_seekoff modes */
 #define _IOS_INPUT     1
 #define _IOS_OUTPUT    2
-#define _IOS_ATEND     4
-#define _IOS_APPEND    8
-#define _IOS_TRUNC     16
-#define _IOS_NOCREATE  32
-#define _IOS_NOREPLACE 64
-#define _IOS_BIN       128
-
-/* Magic numbers and bits for the _flags field.
-   The magic numbers use the high-order bits of _flags;
-   the remaining bits are available for variable flags.
-   Note: The magic numbers must all be negative if stdio
-   emulation is desired. */
-
-#define _IO_MAGIC 0xFBAD0000 /* Magic number */
-#define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */
-#define _IO_MAGIC_MASK 0xFFFF0000
-#define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */
-#define _IO_UNBUFFERED 2
-#define _IO_NO_READS 4 /* Reading not allowed */
-#define _IO_NO_WRITES 8 /* Writing not allowd */
-#define _IO_EOF_SEEN 0x10
-#define _IO_ERR_SEEN 0x20
-#define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */
-#define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/
-#define _IO_IN_BACKUP 0x100
-#define _IO_LINE_BUF 0x200
-#define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */
-#define _IO_CURRENTLY_PUTTING 0x800
-#define _IO_IS_APPENDING 0x1000
-#define _IO_IS_FILEBUF 0x2000
-#define _IO_BAD_SEEN 0x4000
-#define _IO_USER_LOCK 0x8000
 
+/* Magic number and bits for the _flags field.  The magic number is
+   mostly vestigial, but preserved for compatibility.  It occupies the
+   high 16 bits of _flags; the low 16 bits are actual flag bits.  */
+
+#define _IO_MAGIC         0xFBAD0000 /* Magic number */
+#define _IO_MAGIC_MASK    0xFFFF0000
+#define _IO_USER_BUF          0x0001 /* Don't deallocate buffer on close. */
+#define _IO_UNBUFFERED        0x0002
+#define _IO_NO_READS          0x0004 /* Reading not allowed.  */
+#define _IO_NO_WRITES         0x0008 /* Writing not allowed.  */
+#define _IO_EOF_SEEN          0x0010
+#define _IO_ERR_SEEN          0x0020
+#define _IO_DELETE_DONT_CLOSE 0x0040 /* Don't call close(_fileno) on close.  */
+#define _IO_LINKED            0x0080 /* In the list of all open files.  */
+#define _IO_IN_BACKUP         0x0100
+#define _IO_LINE_BUF          0x0200
+#define _IO_TIED_PUT_GET      0x0400 /* Put and get pointer move in unison.  */
+#define _IO_CURRENTLY_PUTTING 0x0800
+#define _IO_IS_APPENDING      0x1000
+#define _IO_IS_FILEBUF        0x2000
+                           /* 0x4000  No longer used, reserved for compat.  */
+#define _IO_USER_LOCK         0x8000
+
+/* Bits for the _flags2 field.  */
 #define _IO_FLAGS2_MMAP 1
 #define _IO_FLAGS2_NOTCANCEL 2
 #define _IO_FLAGS2_FORTIFY 4
@@ -108,30 +97,10 @@ typedef union
 #define _IO_FLAGS2_CLOEXEC 64
 #define _IO_FLAGS2_NEED_LOCK 128
 
-/* These are "formatting flags" matching the iostream fmtflags enum values. */
-#define _IO_SKIPWS 01
-#define _IO_LEFT 02
-#define _IO_RIGHT 04
-#define _IO_INTERNAL 010
-#define _IO_DEC 020
-#define _IO_OCT 040
-#define _IO_HEX 0100
-#define _IO_SHOWBASE 0200
-#define _IO_SHOWPOINT 0400
-#define _IO_UPPERCASE 01000
-#define _IO_SHOWPOS 02000
-#define _IO_SCIENTIFIC 04000
-#define _IO_FIXED 010000
-#define _IO_UNITBUF 020000
-#define _IO_STDIO 040000
-#define _IO_DONT_CLOSE 0100000
-#define _IO_BOOLALPHA 0200000
-
 
 struct _IO_jump_t;
 
 /* A streammarker remembers a position in a buffer. */
-
 struct _IO_marker {
   struct _IO_marker *_next;
   FILE *_sbuf;
index 5064bdf69d41c0c977ee4d22cf558f4856cca351..ee23296ddba9ef20b370b2e0343fa9cab7400f36 100644 (file)
@@ -761,7 +761,7 @@ extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
 #else
 /* This is part of the kludge for binary compatibility with old stdio. */
 # define COERCE_FILE(FILE) \
-  (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) == _OLD_MAGIC_MASK \
+  (((FILE)->_flags & _IO_MAGIC_MASK) == _OLD_MAGIC_MASK \
     && (FILE) = *(FILE**)&((int*)fp)[1])
 #endif
 
@@ -775,7 +775,7 @@ extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
 # define CHECK_FILE(FILE, RET) \
        if ((FILE) == NULL) { MAYBE_SET_EINVAL; return RET; } \
        else { COERCE_FILE(FILE); \
-              if (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
+              if (((FILE)->_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
          { MAYBE_SET_EINVAL; return RET; }}
 #else
 # define CHECK_FILE(FILE, RET) COERCE_FILE (FILE)
index e824a64bbaef9af2848dcd44867f299eea5c95ac..7298bf5324934b114163c7720a90053d9a8f6a4a 100644 (file)
@@ -102,7 +102,7 @@ _IO_old_file_init_internal (struct _IO_FILE_plus *fp)
      of our file descriptor.  Hence we actually don't know the actual
      position before we do the first fseek (and until a following fflush). */
   fp->file._old_offset = _IO_pos_BAD;
-  fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;
+  fp->file._flags |= CLOSED_FILEBUF_FLAGS;
 
   _IO_link_in (fp);
   fp->file._vtable_offset = ((int) sizeof (struct _IO_FILE)
index 432a7dd89a4ac0a5926e10e4c10b64ed74a99c16..f414502fe010d2b3a28b9ca0b01c2d27c4eb20f7 100644 (file)
@@ -46,11 +46,11 @@ _IO_old_fclose (FILE *fp)
     return _IO_new_fclose (fp);
 
   /* First unlink the stream.  */
-  if (fp->_IO_file_flags & _IO_IS_FILEBUF)
+  if (fp->_flags & _IO_IS_FILEBUF)
     _IO_un_link ((struct _IO_FILE_plus *) fp);
 
   _IO_acquire_lock (fp);
-  if (fp->_IO_file_flags & _IO_IS_FILEBUF)
+  if (fp->_flags & _IO_IS_FILEBUF)
     status = _IO_old_file_close_it (fp);
   else
     status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
@@ -60,7 +60,7 @@ _IO_old_fclose (FILE *fp)
     _IO_free_backup_area (fp);
   if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
     {
-      fp->_IO_file_flags = 0;
+      fp->_flags = 0;
       free(fp);
     }
 
index b96fd0fb0aebc678887bf9cdb9912a6c46b49c4c..46ac81809a3ab0fe3e98677e4e10d09f08b2458a 100644 (file)
@@ -59,7 +59,7 @@ typedef struct _IO_strfile_
 
 /* frozen: set when the program has requested that the array object not
    be altered, reallocated, or freed. */
-#define _IO_STR_FROZEN(FP) ((FP)->_f._IO_file_flags & _IO_USER_BUF)
+#define _IO_STR_FROZEN(FP) ((FP)->_f._flags & _IO_USER_BUF)
 
 typedef struct
 {
index adfa80749c1d6f3d2bfecb051766939ba759a8ff..eddd722c093ee431ada44fa212475f0e9f6c63b7 100644 (file)
@@ -74,7 +74,7 @@ void
 _IO_str_init_readonly (_IO_strfile *sf, const char *ptr, int size)
 {
   _IO_str_init_static_internal (sf, (char *) ptr, size < 0 ? -1 : size, NULL);
-  sf->_sbf._f._IO_file_flags |= _IO_NO_WRITES;
+  sf->_sbf._f._flags |= _IO_NO_WRITES;
 }
 
 int
index 27d3a2c1bf74387cad83e2b051a51fcd395cc8a6..8f0a6f8cf28d97e57a086d8dee8d9eaae8e8f74e 100644 (file)
@@ -62,7 +62,7 @@
          return -1;                                                          \
        }                                                                     \
     } while (0)
-#define UNBUFFERED_P(S) ((S)->_IO_file_flags & _IO_UNBUFFERED)
+#define UNBUFFERED_P(S) ((S)->_flags & _IO_UNBUFFERED)
 
 #define done_add(val) \
   do {                                                                       \
@@ -2307,7 +2307,7 @@ buffered_vfprintf (FILE *s, const CHAR_T *format, va_list args)
   _IO_setp (hp, buf, buf + sizeof buf);
   hp->_mode = -1;
 #endif
-  hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS|_IO_USER_LOCK;
+  hp->_flags = _IO_MAGIC|_IO_NO_READS|_IO_USER_LOCK;
 #if _IO_JUMPS_OFFSET
   hp->_vtable_offset = 0;
 #endif