summaryrefslogtreecommitdiff
path: root/libio/bits
diff options
context:
space:
mode:
Diffstat (limited to 'libio/bits')
-rw-r--r--libio/bits/libio-ldbl.h24
-rw-r--r--libio/bits/stdio-ldbl.h8
-rw-r--r--libio/bits/stdio.h35
-rw-r--r--libio/bits/stdio2.h40
-rw-r--r--libio/bits/types/FILE.h9
-rw-r--r--libio/bits/types/__FILE.h7
-rw-r--r--libio/bits/types/__fpos64_t.h16
-rw-r--r--libio/bits/types/__fpos_t.h16
-rw-r--r--libio/bits/types/cookie_io_functions_t.h63
-rw-r--r--libio/bits/types/struct_FILE.h120
10 files changed, 274 insertions, 64 deletions
diff --git a/libio/bits/libio-ldbl.h b/libio/bits/libio-ldbl.h
deleted file mode 100644
index 15c5af9b78..0000000000
--- a/libio/bits/libio-ldbl.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -mlong-double-64 compatibility mode for libio functions.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _IO_STDIO_H
-# error "Never include <bits/libio-ldbl.h> directly; use <libio.h> instead."
-#endif
-
-__LDBL_REDIR_DECL (_IO_vfscanf)
-__LDBL_REDIR_DECL (_IO_vfprintf)
diff --git a/libio/bits/stdio-ldbl.h b/libio/bits/stdio-ldbl.h
index d19415ffde..99d9bcc233 100644
--- a/libio/bits/stdio-ldbl.h
+++ b/libio/bits/stdio-ldbl.h
@@ -1,5 +1,5 @@
/* -mlong-double-64 compatibility mode for stdio functions.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,6 @@
# error "Never include <bits/stdio-ldbl.h> directly; use <stdio.h> instead."
#endif
-__BEGIN_NAMESPACE_STD
__LDBL_REDIR_DECL (fprintf)
__LDBL_REDIR_DECL (printf)
__LDBL_REDIR_DECL (sprintf)
@@ -38,17 +37,13 @@ __LDBL_REDIR_DECL (fscanf)
__LDBL_REDIR_DECL (scanf)
__LDBL_REDIR_DECL (sscanf)
#endif
-__END_NAMESPACE_STD
#if defined __USE_ISOC99 || defined __USE_UNIX98
-__BEGIN_NAMESPACE_C99
__LDBL_REDIR_DECL (snprintf)
__LDBL_REDIR_DECL (vsnprintf)
-__END_NAMESPACE_C99
#endif
#ifdef __USE_ISOC99
-__BEGIN_NAMESPACE_C99
# if !defined __USE_GNU && !defined __REDIRECT \
&& (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
__LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf)
@@ -59,7 +54,6 @@ __LDBL_REDIR_DECL (vfscanf)
__LDBL_REDIR_DECL (vsscanf)
__LDBL_REDIR_DECL (vscanf)
# endif
-__END_NAMESPACE_C99
#endif
#ifdef __USE_XOPEN2K8
diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h
index df57e7c69b..4ab919031f 100644
--- a/libio/bits/stdio.h
+++ b/libio/bits/stdio.h
@@ -1,5 +1,5 @@
/* Optimizing macros and inline functions for stdio functions.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_STDIO_H
+#define _BITS_STDIO_H 1
+
#ifndef _STDIO_H
# error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
#endif
@@ -33,7 +36,7 @@
# if !(__USE_FORTIFY_LEVEL > 0 && defined __fortify_function)
/* Write formatted output to stdout from argument list ARG. */
__STDIO_INLINE int
-vprintf (const char *__restrict __fmt, _G_va_list __arg)
+vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
@@ -43,7 +46,7 @@ vprintf (const char *__restrict __fmt, _G_va_list __arg)
__STDIO_INLINE int
getchar (void)
{
- return _IO_getc (stdin);
+ return getc (stdin);
}
@@ -52,7 +55,7 @@ getchar (void)
__STDIO_INLINE int
fgetc_unlocked (FILE *__fp)
{
- return _IO_getc_unlocked (__fp);
+ return __getc_unlocked_body (__fp);
}
# endif /* misc */
@@ -62,14 +65,14 @@ fgetc_unlocked (FILE *__fp)
__STDIO_INLINE int
getc_unlocked (FILE *__fp)
{
- return _IO_getc_unlocked (__fp);
+ return __getc_unlocked_body (__fp);
}
/* This is defined in POSIX.1:1996. */
__STDIO_INLINE int
getchar_unlocked (void)
{
- return _IO_getc_unlocked (stdin);
+ return __getc_unlocked_body (stdin);
}
# endif /* POSIX */
@@ -78,7 +81,7 @@ getchar_unlocked (void)
__STDIO_INLINE int
putchar (int __c)
{
- return _IO_putc (__c, stdout);
+ return putc (__c, stdout);
}
@@ -87,7 +90,7 @@ putchar (int __c)
__STDIO_INLINE int
fputc_unlocked (int __c, FILE *__stream)
{
- return _IO_putc_unlocked (__c, __stream);
+ return __putc_unlocked_body (__c, __stream);
}
# endif /* misc */
@@ -97,21 +100,21 @@ fputc_unlocked (int __c, FILE *__stream)
__STDIO_INLINE int
putc_unlocked (int __c, FILE *__stream)
{
- return _IO_putc_unlocked (__c, __stream);
+ return __putc_unlocked_body (__c, __stream);
}
/* This is defined in POSIX.1:1996. */
__STDIO_INLINE int
putchar_unlocked (int __c)
{
- return _IO_putc_unlocked (__c, stdout);
+ return __putc_unlocked_body (__c, stdout);
}
# endif /* POSIX */
# ifdef __USE_GNU
/* Like `getdelim', but reads up to a newline. */
-__STDIO_INLINE _IO_ssize_t
+__STDIO_INLINE __ssize_t
getline (char **__lineptr, size_t *__n, FILE *__stream)
{
return __getdelim (__lineptr, __n, '\n', __stream);
@@ -124,14 +127,14 @@ getline (char **__lineptr, size_t *__n, FILE *__stream)
__STDIO_INLINE int
__NTH (feof_unlocked (FILE *__stream))
{
- return _IO_feof_unlocked (__stream);
+ return __feof_unlocked_body (__stream);
}
/* Faster versions when locking is not required. */
__STDIO_INLINE int
__NTH (ferror_unlocked (FILE *__stream))
{
- return _IO_ferror_unlocked (__stream);
+ return __ferror_unlocked_body (__stream);
}
# endif /* misc */
@@ -151,7 +154,7 @@ __NTH (ferror_unlocked (FILE *__stream))
for (__cnt = (size_t) (size) * (size_t) (n); \
__cnt > 0; --__cnt) \
{ \
- int __c = _IO_getc_unlocked (__stream); \
+ int __c = getc_unlocked (__stream); \
if (__c == EOF) \
break; \
*__ptr++ = __c; \
@@ -174,7 +177,7 @@ __NTH (ferror_unlocked (FILE *__stream))
size_t __cnt; \
for (__cnt = (size_t) (size) * (size_t) (n); \
__cnt > 0; --__cnt) \
- if (_IO_putc_unlocked (*__ptr++, __stream) == EOF) \
+ if (putc_unlocked (*__ptr++, __stream) == EOF) \
break; \
((size_t) (size) * (size_t) (n) - __cnt) \
/ (size_t) (size); }) \
@@ -188,3 +191,5 @@ __NTH (ferror_unlocked (FILE *__stream))
/* Define helper macro. */
#undef __STDIO_INLINE
+
+#endif /* bits/stdio.h. */
diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h
index fa3be79a66..11651506a6 100644
--- a/libio/bits/stdio2.h
+++ b/libio/bits/stdio2.h
@@ -1,5 +1,5 @@
/* Checking macros for stdio functions.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _BITS_STDIO2_H
+#define _BITS_STDIO2_H 1
+
#ifndef _STDIO_H
# error "Never include <bits/stdio2.h> directly; use <stdio.h> instead."
#endif
@@ -24,7 +27,7 @@ extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
const char *__restrict __format, ...) __THROW;
extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
const char *__restrict __format,
- _G_va_list __ap) __THROW;
+ __gnuc_va_list __ap) __THROW;
#ifdef __va_arg_pack
__fortify_function int
@@ -41,7 +44,7 @@ __NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...))
__fortify_function int
__NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt,
- _G_va_list __ap))
+ __gnuc_va_list __ap))
{
return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
__bos (__s), __fmt, __ap);
@@ -54,7 +57,7 @@ extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
...) __THROW;
extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
size_t __slen, const char *__restrict __format,
- _G_va_list __ap) __THROW;
+ __gnuc_va_list __ap) __THROW;
# ifdef __va_arg_pack
__fortify_function int
@@ -72,7 +75,7 @@ __NTH (snprintf (char *__restrict __s, size_t __n,
__fortify_function int
__NTH (vsnprintf (char *__restrict __s, size_t __n,
- const char *__restrict __fmt, _G_va_list __ap))
+ const char *__restrict __fmt, __gnuc_va_list __ap))
{
return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
__bos (__s), __fmt, __ap);
@@ -86,9 +89,9 @@ extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
const char *__restrict __format, ...);
extern int __printf_chk (int __flag, const char *__restrict __format, ...);
extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
- const char *__restrict __format, _G_va_list __ap);
+ const char *__restrict __format, __gnuc_va_list __ap);
extern int __vprintf_chk (int __flag, const char *__restrict __format,
- _G_va_list __ap);
+ __gnuc_va_list __ap);
# ifdef __va_arg_pack
__fortify_function int
@@ -111,7 +114,7 @@ printf (const char *__restrict __fmt, ...)
# endif
__fortify_function int
-vprintf (const char *__restrict __fmt, _G_va_list __ap)
+vprintf (const char *__restrict __fmt, __gnuc_va_list __ap)
{
#ifdef __USE_EXTERN_INLINES
return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
@@ -122,7 +125,7 @@ vprintf (const char *__restrict __fmt, _G_va_list __ap)
__fortify_function int
vfprintf (FILE *__restrict __stream,
- const char *__restrict __fmt, _G_va_list __ap)
+ const char *__restrict __fmt, __gnuc_va_list __ap)
{
return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
}
@@ -131,7 +134,7 @@ vfprintf (FILE *__restrict __stream,
extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
...) __attribute__ ((__format__ (__printf__, 3, 4)));
extern int __vdprintf_chk (int __fd, int __flag,
- const char *__restrict __fmt, _G_va_list __arg)
+ const char *__restrict __fmt, __gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 3, 0)));
# ifdef __va_arg_pack
@@ -147,7 +150,7 @@ dprintf (int __fd, const char *__restrict __fmt, ...)
# endif
__fortify_function int
-vdprintf (int __fd, const char *__restrict __fmt, _G_va_list __ap)
+vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap)
{
return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
}
@@ -159,7 +162,7 @@ extern int __asprintf_chk (char **__restrict __ptr, int __flag,
const char *__restrict __fmt, ...)
__THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur;
extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
- const char *__restrict __fmt, _G_va_list __arg)
+ const char *__restrict __fmt, __gnuc_va_list __arg)
__THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur;
extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
int __flag, const char *__restrict __format,
@@ -168,7 +171,7 @@ extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
int __flag,
const char *__restrict __format,
- _G_va_list __args)
+ __gnuc_va_list __args)
__THROW __attribute__ ((__format__ (__printf__, 3, 0)));
# ifdef __va_arg_pack
@@ -205,14 +208,14 @@ __NTH (obstack_printf (struct obstack *__restrict __obstack,
__fortify_function int
__NTH (vasprintf (char **__restrict __ptr, const char *__restrict __fmt,
- _G_va_list __ap))
+ __gnuc_va_list __ap))
{
return __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
}
__fortify_function int
__NTH (obstack_vprintf (struct obstack *__restrict __obstack,
- const char *__restrict __fmt, _G_va_list __ap))
+ const char *__restrict __fmt, __gnuc_va_list __ap))
{
return __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
__ap);
@@ -222,8 +225,7 @@ __NTH (obstack_vprintf (struct obstack *__restrict __obstack,
#endif
-#if !defined __USE_ISOC11 \
- || (defined __cplusplus && __cplusplus <= 201103L && !defined __USE_GNU)
+#if __GLIBC_USE (DEPRECATED_GETS)
extern char *__gets_chk (char *__str, size_t) __wur;
extern char *__REDIRECT (__gets_warn, (char *__str), gets)
__wur __warnattr ("please use fgets or getline instead, gets can't "
@@ -369,7 +371,7 @@ fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
for (; __cnt > 0; --__cnt)
{
- int __c = _IO_getc_unlocked (__stream);
+ int __c = getc_unlocked (__stream);
if (__c == EOF)
break;
*__cptr++ = __c;
@@ -380,3 +382,5 @@ fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
return __fread_unlocked_alias (__ptr, __size, __n, __stream);
}
#endif
+
+#endif /* bits/stdio2.h. */
diff --git a/libio/bits/types/FILE.h b/libio/bits/types/FILE.h
new file mode 100644
index 0000000000..f268263209
--- /dev/null
+++ b/libio/bits/types/FILE.h
@@ -0,0 +1,9 @@
+#ifndef __FILE_defined
+#define __FILE_defined 1
+
+struct _IO_FILE;
+
+/* The opaque type of streams. This is the definition used elsewhere. */
+typedef struct _IO_FILE FILE;
+
+#endif
diff --git a/libio/bits/types/__FILE.h b/libio/bits/types/__FILE.h
new file mode 100644
index 0000000000..06dd79bc83
--- /dev/null
+++ b/libio/bits/types/__FILE.h
@@ -0,0 +1,7 @@
+#ifndef ____FILE_defined
+#define ____FILE_defined 1
+
+struct _IO_FILE;
+typedef struct _IO_FILE __FILE;
+
+#endif
diff --git a/libio/bits/types/__fpos64_t.h b/libio/bits/types/__fpos64_t.h
new file mode 100644
index 0000000000..06a6891154
--- /dev/null
+++ b/libio/bits/types/__fpos64_t.h
@@ -0,0 +1,16 @@
+#ifndef _____fpos64_t_defined
+#define _____fpos64_t_defined 1
+
+#include <bits/types.h>
+#include <bits/types/__mbstate_t.h>
+
+/* The tag name of this struct is _G_fpos64_t to preserve historic
+ C++ mangled names for functions taking fpos_t and/or fpos64_t
+ arguments. That name should not be used in new code. */
+typedef struct _G_fpos64_t
+{
+ __off64_t __pos;
+ __mbstate_t __state;
+} __fpos64_t;
+
+#endif
diff --git a/libio/bits/types/__fpos_t.h b/libio/bits/types/__fpos_t.h
new file mode 100644
index 0000000000..bb04576651
--- /dev/null
+++ b/libio/bits/types/__fpos_t.h
@@ -0,0 +1,16 @@
+#ifndef _____fpos_t_defined
+#define _____fpos_t_defined 1
+
+#include <bits/types.h>
+#include <bits/types/__mbstate_t.h>
+
+/* The tag name of this struct is _G_fpos_t to preserve historic
+ C++ mangled names for functions taking fpos_t arguments.
+ That name should not be used in new code. */
+typedef struct _G_fpos_t
+{
+ __off_t __pos;
+ __mbstate_t __state;
+} __fpos_t;
+
+#endif
diff --git a/libio/bits/types/cookie_io_functions_t.h b/libio/bits/types/cookie_io_functions_t.h
new file mode 100644
index 0000000000..a6d9d39a47
--- /dev/null
+++ b/libio/bits/types/cookie_io_functions_t.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef __cookie_io_functions_t_defined
+#define __cookie_io_functions_t_defined 1
+
+#include <bits/types.h>
+
+/* Functions to do I/O and file management for a stream. */
+
+/* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF.
+ Return number of bytes read. */
+typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,
+ size_t __nbytes);
+
+/* Write NBYTES bytes pointed to by BUF to COOKIE. Write all NBYTES bytes
+ unless there is an error. Return number of bytes written. If
+ there is an error, return 0 and do not write anything. If the file
+ has been opened for append (__mode.__append set), then set the file
+ pointer to the end of the file and then do the write; if not, just
+ write at the current file pointer. */
+typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,
+ size_t __nbytes);
+
+/* Move COOKIE's file position to *POS bytes from the
+ beginning of the file (if W is SEEK_SET),
+ the current position (if W is SEEK_CUR),
+ or the end of the file (if W is SEEK_END).
+ Set *POS to the new file position.
+ Returns zero if successful, nonzero if not. */
+typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);
+
+/* Close COOKIE. */
+typedef int cookie_close_function_t (void *__cookie);
+
+/* The structure with the cookie function pointers.
+ The tag name of this struct is _IO_cookie_io_functions_t to
+ preserve historic C++ mangled names for functions taking
+ cookie_io_functions_t arguments. That name should not be used in
+ new code. */
+typedef struct _IO_cookie_io_functions_t
+{
+ cookie_read_function_t *read; /* Read bytes. */
+ cookie_write_function_t *write; /* Write bytes. */
+ cookie_seek_function_t *seek; /* Seek/tell file position. */
+ cookie_close_function_t *close; /* Close file. */
+} cookie_io_functions_t;
+
+#endif
diff --git a/libio/bits/types/struct_FILE.h b/libio/bits/types/struct_FILE.h
new file mode 100644
index 0000000000..359f949453
--- /dev/null
+++ b/libio/bits/types/struct_FILE.h
@@ -0,0 +1,120 @@
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef __struct_FILE_defined
+#define __struct_FILE_defined 1
+
+/* Caution: The contents of this file are not part of the official
+ stdio.h API. However, much of it is part of the official *binary*
+ interface, and therefore cannot be changed. */
+
+#if defined _IO_USE_OLD_IO_FILE && !defined _LIBC
+# error "_IO_USE_OLD_IO_FILE should only be defined when building libc itself"
+#endif
+
+#if defined _IO_lock_t_defined && !defined _LIBC
+# error "_IO_lock_t_defined should only be defined when building libc itself"
+#endif
+
+#include <bits/types.h>
+
+struct _IO_FILE;
+struct _IO_marker;
+struct _IO_codecvt;
+struct _IO_wide_data;
+
+/* During the build of glibc itself, _IO_lock_t will already have been
+ defined by internal headers. */
+#ifndef _IO_lock_t_defined
+typedef void _IO_lock_t;
+#endif
+
+/* The tag name of this struct is _IO_FILE to preserve historic
+ C++ mangled names for functions taking FILE* arguments.
+ That name should not be used in new code. */
+struct _IO_FILE
+{
+ int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
+
+ /* The following pointers correspond to the C++ streambuf protocol. */
+ char *_IO_read_ptr; /* Current read pointer */
+ char *_IO_read_end; /* End of get area. */
+ char *_IO_read_base; /* Start of putback+get area. */
+ char *_IO_write_base; /* Start of put area. */
+ char *_IO_write_ptr; /* Current put pointer. */
+ char *_IO_write_end; /* End of put area. */
+ char *_IO_buf_base; /* Start of reserve area. */
+ char *_IO_buf_end; /* End of reserve area. */
+
+ /* The following fields are used to support backing up and undo. */
+ char *_IO_save_base; /* Pointer to start of non-current get area. */
+ char *_IO_backup_base; /* Pointer to first valid character of backup area */
+ char *_IO_save_end; /* Pointer to end of non-current get area. */
+
+ struct _IO_marker *_markers;
+
+ struct _IO_FILE *_chain;
+
+ int _fileno;
+ int _flags2;
+ __off_t _old_offset; /* This used to be _offset but it's too small. */
+
+ /* 1+column number of pbase(); 0 is unknown. */
+ unsigned short _cur_column;
+ signed char _vtable_offset;
+ char _shortbuf[1];
+
+ _IO_lock_t *_lock;
+#ifdef _IO_USE_OLD_IO_FILE
+};
+
+struct _IO_FILE_complete
+{
+ struct _IO_FILE _file;
+#endif
+ __off64_t _offset;
+ /* Wide character stream stuff. */
+ struct _IO_codecvt *_codecvt;
+ struct _IO_wide_data *_wide_data;
+ struct _IO_FILE *_freeres_list;
+ void *_freeres_buf;
+ size_t __pad5;
+ int _mode;
+ /* Make sure we don't get into trouble again. */
+ char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
+};
+
+/* These macros are used by bits/stdio.h and internal headers. */
+#define __getc_unlocked_body(_fp) \
+ (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end) \
+ ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++)
+
+#define __putc_unlocked_body(_ch, _fp) \
+ (__glibc_unlikely ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \
+ ? __overflow (_fp, (unsigned char) (_ch)) \
+ : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))
+
+#define _IO_EOF_SEEN 0x0010
+#define __feof_unlocked_body(_fp) (((_fp)->_flags & _IO_EOF_SEEN) != 0)
+
+#define _IO_ERR_SEEN 0x0020
+#define __ferror_unlocked_body(_fp) (((_fp)->_flags & _IO_ERR_SEEN) != 0)
+
+#define _IO_USER_LOCK 0x8000
+/* Many more flag bits are defined internally. */
+
+#endif