@@ -121,6 +121,9 @@ Deprecated and removed features, and other changes affecting compatibility:
any remaining external users. _G_config.h was never intended for public
use, but predates the bits convention.
+* The C++ name mangling for interfaces involving the types fpos_t and
+ fpos64_t has changed.
+
Changes to build and runtime requirements:
* bison version 2.7 or later is required to generate code in the 'intl'
@@ -19,20 +19,17 @@
#include <stddef.h>
#include <bits/types/__mbstate_t.h>
+#include <bits/types/__fpos_t.h>
+#include <bits/types/__fpos64_t.h>
+
+#define _G_fpos_t __fpos_t
+#define _G_fpos64_t __fpos64_t
+
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# include <bits/types/wint_t.h>
#endif
-typedef struct
-{
- __off_t __pos;
- __mbstate_t __state;
-} _G_fpos_t;
-typedef struct
-{
- __off64_t __pos;
- __mbstate_t __state;
-} _G_fpos64_t;
+
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# include <gconv.h>
typedef union
new file mode 100644
@@ -0,0 +1 @@
+#include <libio/bits/types/__fpos64_t.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <libio/bits/types/__fpos_t.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <libio/bits/types/cookie_io_functions_t.h>
@@ -25,7 +25,8 @@ include ../Makeconfig
headers := stdio.h libio.h _G_config.h \
bits/stdio.h bits/libio.h bits/_G_config.h \
bits/sys_errlist.h bits/stdio2.h bits/stdio-ldbl.h bits/libio-ldbl.h \
- bits/types/FILE.h bits/types/__FILE.h
+ bits/types/FILE.h bits/types/__FILE.h bits/types/__fpos_t.h \
+ bits/types/__fpos64_t.h bits/types/cookie_io_functions_t.h
routines := \
filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \
@@ -32,10 +32,12 @@
# error "Never include <bits/libio.h> directly; use <stdio.h> instead."
#endif
+#include <stdio.h>
+
#include <bits/_G_config.h>
/* ALL of these should be defined in _G_config.h */
-#define _IO_fpos_t _G_fpos_t
-#define _IO_fpos64_t _G_fpos64_t
+#define _IO_fpos_t __fpos_t
+#define _IO_fpos64_t __fpos64_t
#define _IO_size_t size_t
#define _IO_ssize_t __ssize_t
#define _IO_off_t __off_t
@@ -44,40 +46,13 @@
#define _IO_uid_t __uid_t
#define _IO_iconv_t _G_iconv_t
#define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE
-#define _IO_BUFSIZ _G_BUFSIZ
-#define _IO_va_list _G_va_list
+#define _IO_BUFSIZ BUFSIZ
#define _IO_wint_t wint_t
+#define _IO_va_list __gnuc_va_list
-/* This define avoids name pollution if we're using GNU stdarg.h */
-#define __need___va_list
-#include <stdarg.h>
-#ifdef __GNUC_VA_LIST
-# undef _IO_va_list
-# define _IO_va_list __gnuc_va_list
-#endif /* __GNUC_VA_LIST */
-
-#ifndef __P
-# include <sys/cdefs.h>
-#endif /*!__P*/
-
+#define _STDIO_USES_IOSTREAM
#define _IO_UNIFIED_JUMPTABLES 1
-#ifndef EOF
-# define EOF (-1)
-#endif
-#ifndef NULL
-# if defined __GNUG__ && \
- (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
-# define NULL (__null)
-# else
-# if !defined(__cplusplus)
-# define NULL ((void*)0)
-# else
-# define NULL (0)
-# endif
-# endif
-#endif
-
#define _IOS_INPUT 1
#define _IOS_OUTPUT 2
#define _IOS_ATEND 4
@@ -330,49 +305,13 @@ extern _IO_FILE *_IO_stderr attribute_hidden;
#endif
-/* 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 __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
-
-/* Write N bytes pointed to by BUF to COOKIE. Write all N 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 __io_write_fn (void *__cookie, const char *__buf,
- size_t __n);
-
-/* 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 __io_seek_fn (void *__cookie, _IO_off64_t *__pos, int __w);
-
-/* Close COOKIE. */
-typedef int __io_close_fn (void *__cookie);
-
-
+/* Compatibility names for cookie I/O functions. */
#ifdef __USE_GNU
-/* User-visible names for the above. */
-typedef __io_read_fn cookie_read_function_t;
-typedef __io_write_fn cookie_write_function_t;
-typedef __io_seek_fn cookie_seek_function_t;
-typedef __io_close_fn cookie_close_function_t;
-
-/* The structure with the cookie function pointers. */
-typedef struct
-{
- __io_read_fn *read; /* Read bytes. */
- __io_write_fn *write; /* Write bytes. */
- __io_seek_fn *seek; /* Seek/tell file position. */
- __io_close_fn *close; /* Close file. */
-} _IO_cookie_io_functions_t;
-typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+typedef cookie_read_function_t __io_read_fn;
+typedef cookie_write_function_t __io_write_fn;
+typedef cookie_seek_function_t __io_seek_fn;
+typedef cookie_close_function_t __io_close_fn;
+typedef cookie_io_functions_t _IO_cookie_io_functions_t;
struct _IO_cookie_file;
@@ -33,7 +33,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);
}
@@ -111,7 +111,7 @@ putchar_unlocked (int __c)
# 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);
@@ -24,7 +24,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 +41,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 +54,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 +72,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 +86,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 +111,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 +122,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 +131,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 +147,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 +159,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 +168,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 +205,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);
new file mode 100644
@@ -0,0 +1,13 @@
+#ifndef _____fpos64_t_defined
+#define _____fpos64_t_defined 1
+
+#include <bits/types.h>
+#include <bits/types/__mbstate_t.h>
+
+typedef struct
+{
+ __off64_t __pos;
+ __mbstate_t __state;
+} __fpos64_t;
+
+#endif
new file mode 100644
@@ -0,0 +1,13 @@
+#ifndef _____fpos_t_defined
+#define _____fpos_t_defined 1
+
+#include <bits/types.h>
+#include <bits/types/__mbstate_t.h>
+
+typedef struct
+{
+ __off_t __pos;
+ __mbstate_t __state;
+} __fpos_t;
+
+#endif
new file mode 100644
@@ -0,0 +1,41 @@
+#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. */
+typedef struct
+{
+ 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
@@ -32,18 +32,23 @@ __BEGIN_DECLS
#define __need_NULL
#include <stddef.h>
+#define __need___va_list
+#include <stdarg.h>
+
#include <bits/types.h>
+#include <bits/types/__fpos_t.h>
+#include <bits/types/__fpos64_t.h>
#include <bits/types/__FILE.h>
#include <bits/types/FILE.h>
-#define _STDIO_USES_IOSTREAM
-
-#include <bits/libio.h>
+#ifdef __USE_GNU
+# include <bits/types/cookie_io_functions_t.h>
+#endif
#if defined __USE_XOPEN || defined __USE_XOPEN2K8
# ifdef __GNUC__
# ifndef _VA_LIST_DEFINED
-typedef _G_va_list va_list;
+typedef __gnuc_va_list va_list;
# define _VA_LIST_DEFINED
# endif
# else
@@ -75,12 +80,12 @@ typedef __ssize_t ssize_t;
/* The type of the second argument to `fgetpos' and `fsetpos'. */
#ifndef __USE_FILE_OFFSET64
-typedef _G_fpos_t fpos_t;
+typedef __fpos_t fpos_t;
#else
-typedef _G_fpos64_t fpos_t;
+typedef __fpos64_t fpos_t;
#endif
#ifdef __USE_LARGEFILE64
-typedef _G_fpos64_t fpos64_t;
+typedef __fpos64_t fpos64_t;
#endif
/* The possibilities for the third argument to `setvbuf'. */
@@ -90,16 +95,11 @@ typedef _G_fpos64_t fpos64_t;
/* Default buffer size. */
-#ifndef BUFSIZ
-# define BUFSIZ _IO_BUFSIZ
-#endif
+#define BUFSIZ 8192
-/* End of file character.
- Some things throughout the library rely on this being -1. */
-#ifndef EOF
-# define EOF (-1)
-#endif
+/* End of file character. */
+#define EOF (-1)
/* The possibilities for the third argument to `fseek'.
@@ -132,9 +132,9 @@ typedef _G_fpos64_t fpos64_t;
/* Standard streams. */
-extern struct _IO_FILE *stdin; /* Standard input stream. */
-extern struct _IO_FILE *stdout; /* Standard output stream. */
-extern struct _IO_FILE *stderr; /* Standard error output stream. */
+extern FILE *stdin; /* Standard input stream. */
+extern FILE *stdout; /* Standard output stream. */
+extern FILE *stderr; /* Standard error output stream. */
/* C89/C99 say they're macros. Make them happy. */
#define stdin stdin
#define stdout stdout
@@ -270,7 +270,7 @@ extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur;
and uses the given functions for input and output. */
extern FILE *fopencookie (void *__restrict __magic_cookie,
const char *__restrict __modes,
- _IO_cookie_io_functions_t __io_funcs) __THROW __wur;
+ cookie_io_functions_t __io_funcs) __THROW __wur;
#endif
#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
@@ -325,15 +325,15 @@ extern int sprintf (char *__restrict __s,
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
- _G_va_list __arg);
+ __gnuc_va_list __arg);
/* Write formatted output to stdout from argument list ARG.
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern int vprintf (const char *__restrict __format, _G_va_list __arg);
+extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
/* Write formatted output to S from argument list ARG. */
extern int vsprintf (char *__restrict __s, const char *__restrict __format,
- _G_va_list __arg) __THROWNL;
+ __gnuc_va_list __arg) __THROWNL;
#if defined __USE_ISOC99 || defined __USE_UNIX98
/* Maximum chars of output to write in MAXLEN. */
@@ -342,7 +342,7 @@ extern int snprintf (char *__restrict __s, size_t __maxlen,
__THROWNL __attribute__ ((__format__ (__printf__, 3, 4)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
- const char *__restrict __format, _G_va_list __arg)
+ const char *__restrict __format, __gnuc_va_list __arg)
__THROWNL __attribute__ ((__format__ (__printf__, 3, 0)));
#endif
@@ -350,7 +350,7 @@ extern int vsnprintf (char *__restrict __s, size_t __maxlen,
/* Write formatted output to a string dynamically allocated with `malloc'.
Store the address of the string in *PTR. */
extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
- _G_va_list __arg)
+ __gnuc_va_list __arg)
__THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
extern int __asprintf (char **__restrict __ptr,
const char *__restrict __fmt, ...)
@@ -363,7 +363,7 @@ extern int asprintf (char **__restrict __ptr,
#ifdef __USE_XOPEN2K8
/* Write formatted output to a file descriptor. */
extern int vdprintf (int __fd, const char *__restrict __fmt,
- _G_va_list __arg)
+ __gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, const char *__restrict __fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
@@ -418,19 +418,19 @@ extern int __isoc99_sscanf (const char *__restrict __s,
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
- _G_va_list __arg)
+ __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
/* Read formatted input from stdin into argument list ARG.
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern int vscanf (const char *__restrict __format, _G_va_list __arg)
+extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
/* Read formatted input from S into argument list ARG. */
extern int vsscanf (const char *__restrict __s,
- const char *__restrict __format, _G_va_list __arg)
+ const char *__restrict __format, __gnuc_va_list __arg)
__THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
# if !defined __USE_GNU \
@@ -442,26 +442,26 @@ extern int vsscanf (const char *__restrict __s,
s, S or [. */
extern int __REDIRECT (vfscanf,
(FILE *__restrict __s,
- const char *__restrict __format, _G_va_list __arg),
+ const char *__restrict __format, __gnuc_va_list __arg),
__isoc99_vfscanf)
__attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
extern int __REDIRECT (vscanf, (const char *__restrict __format,
- _G_va_list __arg), __isoc99_vscanf)
+ __gnuc_va_list __arg), __isoc99_vscanf)
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
extern int __REDIRECT_NTH (vsscanf,
(const char *__restrict __s,
const char *__restrict __format,
- _G_va_list __arg), __isoc99_vsscanf)
+ __gnuc_va_list __arg), __isoc99_vsscanf)
__attribute__ ((__format__ (__scanf__, 2, 0)));
# else
extern int __isoc99_vfscanf (FILE *__restrict __s,
const char *__restrict __format,
- _G_va_list __arg) __wur;
+ __gnuc_va_list __arg) __wur;
extern int __isoc99_vscanf (const char *__restrict __format,
- _G_va_list __arg) __wur;
+ __gnuc_va_list __arg) __wur;
extern int __isoc99_vsscanf (const char *__restrict __s,
const char *__restrict __format,
- _G_va_list __arg) __THROW;
+ __gnuc_va_list __arg) __THROW;
# define vfscanf __isoc99_vfscanf
# define vscanf __isoc99_vscanf
# define vsscanf __isoc99_vsscanf
@@ -483,10 +483,6 @@ extern int getc (FILE *__stream);
marked with __THROW. */
extern int getchar (void);
-/* The C standard explicitly says this is a macro, so we always do the
- optimization for it. */
-#define getc(_fp) _IO_getc (_fp)
-
#ifdef __USE_POSIX199506
/* These are defined in POSIX.1:1996.
@@ -523,10 +519,6 @@ extern int putc (int __c, FILE *__stream);
marked with __THROW. */
extern int putchar (int __c);
-/* The C standard explicitly says this can be a macro,
- so we always do the optimization for it. */
-#define putc(_ch, _fp) _IO_putc (_ch, _fp)
-
#ifdef __USE_MISC
/* Faster version when locking is not necessary.
@@ -600,12 +592,12 @@ extern char *fgets_unlocked (char *__restrict __s, int __n,
cancellation point. But due to similarity with an POSIX interface
or due to the implementation they are cancellation points and
therefore not marked with __THROW. */
-extern _IO_ssize_t __getdelim (char **__restrict __lineptr,
- size_t *__restrict __n, int __delimiter,
- FILE *__restrict __stream) __wur;
-extern _IO_ssize_t getdelim (char **__restrict __lineptr,
- size_t *__restrict __n, int __delimiter,
- FILE *__restrict __stream) __wur;
+extern __ssize_t __getdelim (char **__restrict __lineptr,
+ size_t *__restrict __n, int __delimiter,
+ FILE *__restrict __stream) __wur;
+extern __ssize_t getdelim (char **__restrict __lineptr,
+ size_t *__restrict __n, int __delimiter,
+ FILE *__restrict __stream) __wur;
/* Like `getdelim', but reads up to a newline.
@@ -613,9 +605,9 @@ extern _IO_ssize_t getdelim (char **__restrict __lineptr,
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
-extern _IO_ssize_t getline (char **__restrict __lineptr,
- size_t *__restrict __n,
- FILE *__restrict __stream) __wur;
+extern __ssize_t getline (char **__restrict __lineptr,
+ size_t *__restrict __n,
+ FILE *__restrict __stream) __wur;
#endif
@@ -828,7 +820,7 @@ extern int obstack_printf (struct obstack *__restrict __obstack,
__THROWNL __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
const char *__restrict __format,
- _G_va_list __args)
+ __gnuc_va_list __args)
__THROWNL __attribute__ ((__format__ (__printf__, 2, 0)));
#endif /* Use GNU. */
@@ -853,6 +845,17 @@ extern void funlockfile (FILE *__stream) __THROW;
# include <bits/getopt_posix.h>
#endif
+/* Internal definitions used by optimizing inlines. */
+#include <bits/libio.h>
+
+/* The C standard explicitly says this can be a macro,
+ so we always do the optimization for it. */
+#define getc(_fp) _IO_getc (_fp)
+
+/* The C standard explicitly says this can be a macro,
+ so we always do the optimization for it. */
+#define putc(_ch, _fp) _IO_putc (_ch, _fp)
+
/* If we are compiling with optimizing read this file. It contains
several optimizing inline functions and macros. */
#ifdef __USE_EXTERN_INLINES
@@ -39,13 +39,8 @@
Beside this it is also shared between the normal and wide character
implementation as defined in ISO/IEC 9899:1990/Amendment 1:1995. */
-
#include <libioP.h>
-#define FILE _IO_FILE
-#undef va_list
-#define va_list _IO_va_list
-#undef BUFSIZ
-#define BUFSIZ _IO_BUFSIZ
+
/* In some cases we need extra space for all the output which is not
counted in the width of the string. We assume 32 characters is
enough. */
@@ -19,20 +19,16 @@
#include <stddef.h>
#include <bits/types/__mbstate_t.h>
+#include <bits/types/__fpos_t.h>
+#include <bits/types/__fpos64_t.h>
+
+#define _G_fpos_t __fpos_t
+#define _G_fpos64_t __fpos64_t
+
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# include <bits/types/wint_t.h>
#endif
-typedef struct
-{
- __off_t __pos;
- __mbstate_t __state;
-} _G_fpos_t;
-typedef struct
-{
- __off64_t __pos;
- __mbstate_t __state;
-} _G_fpos64_t;
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# include <gconv.h>
typedef union