@@ -41,8 +41,6 @@
#ifdef _LIBC
# include <wchar.h>
-# include <libio/libioP.h>
-# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
#endif
#define INIT_BUF_SIZE 200
@@ -149,7 +147,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
size_t i;
for (i = 0; i < pad; i++)
{
- if (_IO_fwide (fs->stream, 0) > 0)
+ if (fwide (fs->stream, 0) > 0)
putwc_unlocked (L' ', fs->stream);
else
putc_unlocked (' ', fs->stream);
@@ -312,7 +310,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
*nl++ = ' ';
else
for (i = 0; i < fs->wmargin; ++i)
- if (_IO_fwide (fs->stream, 0) > 0)
+ if (fwide (fs->stream, 0) > 0)
putwc_unlocked (L' ', fs->stream);
else
putc_unlocked (' ', fs->stream);
@@ -48,10 +48,7 @@ char *alloca ();
#include <stdarg.h>
#include <ctype.h>
#include <limits.h>
-#ifdef _LIBC
-# include <../libio/libioP.h>
-# include <wchar.h>
-#endif
+#include <wchar.h>
#ifndef _
/* This is for other GNU distributions with internationalized messages. */
@@ -1769,7 +1766,7 @@ __argp_error (const struct argp_state *state, const char *fmt, ...)
#ifdef _LIBC
char *buf;
- if (_IO_vasprintf (&buf, fmt, ap) < 0)
+ if (__vasprintf (&buf, fmt, ap) < 0)
buf = NULL;
__fxprintf (stream, "%s: %s\n",
@@ -1839,7 +1836,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
#ifdef _LIBC
char *buf;
- if (_IO_vasprintf (&buf, fmt, ap) < 0)
+ if (__vasprintf (&buf, fmt, ap) < 0)
buf = NULL;
__fxprintf (stream, ": %s", buf);
@@ -1873,7 +1870,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
#endif
}
- if (_IO_fwide (stream, 0) > 0)
+ if (fwide (stream, 0) > 0)
putwc_unlocked (L'\n', stream);
else
putc_unlocked ('\n', stream);
@@ -24,14 +24,10 @@
#include <sysdep.h>
#include <unistd.h>
#include <sys/mman.h>
-
+#include <wchar.h>
extern const char *__progname;
-#include <wchar.h>
-#include <libio/iolibio.h>
-#define fflush(s) _IO_fflush (s)
-
/* This function, when passed a string containing an asserted
expression, a filename, and a line number, prints a message
on the standard error stream of the form:
@@ -10604,7 +10604,6 @@ sin-inputs
pthread_once-source.c
libio
rewind.c
-iolibio.h
wfileops.c
libio.h
tst-wmemstream1.c
@@ -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
@@ -41,7 +41,7 @@ type fpos_t
#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
type va_list
#else
-#define va_list _G_va_list
+#define va_list __gnuc_va_list
#endif
type size_t
#if defined XOPEN2K8 || defined POSIX2008
@@ -18,7 +18,7 @@
#if defined __GNUC__ && __GNUC__ >= 2
-#include <stdio.h>
+#include <libio/libioP.h>
/* This records which stdio is linked against in the application. */
const int _IO_stdin_used = _G_IO_IO_FILE_VERSION;
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
+#include <libio/libioP.h>
/* Write formatted output from FORMAT to a string which is
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
+#include <libio/libioP.h>
/* Write formatted output to D, according to the format string FORMAT. */
@@ -24,9 +24,9 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include <stdio.h>
#include <sys/param.h>
+#include <libio/libioP.h>
char *
__fgets_chk (char *buf, size_t size, int n, _IO_FILE *fp)
@@ -24,9 +24,9 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include <stdio.h>
#include <sys/param.h>
+#include <libio/libioP.h>
char *
__fgets_unlocked_chk (char *buf, size_t size, int n, _IO_FILE *fp)
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "libioP.h"
#include <wchar.h>
#include <sys/param.h>
+#include <libio/libioP.h>
wchar_t *
__fgetws_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
@@ -24,9 +24,9 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include <wchar.h>
#include <sys/param.h>
+#include <libio/libioP.h>
wchar_t *
__fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
@@ -17,7 +17,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to FP from the format string FORMAT. */
@@ -24,8 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include <stdio.h>
+#include <libio/libioP.h>
size_t
__fread_chk (void *__restrict ptr, size_t ptrlen,
@@ -24,8 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include <stdio.h>
+#include <libio/libioP.h>
size_t
__fread_unlocked_chk (void *__restrict ptr, size_t ptrlen,
@@ -17,7 +17,7 @@
#include <stdarg.h>
#include <wchar.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to FP from the format string FORMAT. */
@@ -24,8 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "../libio/libioP.h"
#include <limits.h>
+#include <libio/libioP.h>
char *
__gets_chk (char *buf, size_t size)
@@ -19,14 +19,13 @@
#include <stdlib.h>
-#include <libioP.h>
-#include "../libio/strfile.h"
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <obstack.h>
#include <stdarg.h>
#include <stdio_ext.h>
+#include <libio/strfile.h>
struct _IO_obstack_file
@@ -17,7 +17,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to stdout from the format string FORMAT. */
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
+#include <libio/libioP.h>
/* Write formatted output into S, according to the format
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
+#include <libio/libioP.h>
/* Write formatted output into S, according to the format string FORMAT. */
/* VARARGS4 */
@@ -28,8 +28,7 @@
#include <string.h>
#include <stdio.h>
#include <stdio_ext.h>
-#include "../libio/libioP.h"
-#include "../libio/strfile.h"
+#include <libio/strfile.h>
int
__vasprintf_chk (char **result_ptr, int flags, const char *format,
@@ -24,8 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <stdio_ext.h>
+#include <libio/libioP.h>
int
__vdprintf_chk (int d, int flags, const char *format, va_list arg)
@@ -17,7 +17,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to FP from the format string FORMAT. */
@@ -17,7 +17,7 @@
#include <stdarg.h>
#include <wchar.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to FP from the format string FORMAT. */
@@ -17,7 +17,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to stdout from the format string FORMAT. */
@@ -17,8 +17,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include "../libio/libioP.h"
-#include "../libio/strfile.h"
+#include <libio/strfile.h>
extern const struct _IO_jump_t _IO_strn_jumps libio_vtable attribute_hidden;
@@ -17,8 +17,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include "../libio/libioP.h"
-#include "../libio/strfile.h"
+#include <libio/strfile.h>
static int _IO_str_chk_overflow (_IO_FILE *fp, int c) __THROW;
@@ -17,8 +17,7 @@
#include <stdarg.h>
#include <wchar.h>
-#include "../libio/libioP.h"
-#include "../libio/strfile.h"
+#include <libio/strfile.h>
/* Write formatted output into S, according to the format
@@ -18,7 +18,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to stdout from the format string FORMAT. */
@@ -18,7 +18,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
/* Write formatted output to stdout from the format string FORMAT. */
@@ -20,10 +20,6 @@
#include <grp.h>
#include <stdio.h>
-#include <libio/iolibio.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
-
/* Define a line parsing function using the common code
used in the nss_files module. */
@@ -21,9 +21,6 @@
#include <string.h>
#include <grp.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
-
#define _S(x) x ? x : ""
/* Write an entry to the given stream.
@@ -38,21 +38,21 @@ __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,
{
char *p;
- _IO_flockfile (stream);
+ flockfile (stream);
do
{
buffer[buflen - 1] = '\xff';
p = fgets_unlocked (buffer, buflen, stream);
if (p == NULL && feof_unlocked (stream))
{
- _IO_funlockfile (stream);
+ funlockfile (stream);
*result = NULL;
__set_errno (ENOENT);
return errno;
}
if (p == NULL || buffer[buflen - 1] != '\xff')
{
- _IO_funlockfile (stream);
+ funlockfile (stream);
*result = NULL;
__set_errno (ERANGE);
return errno;
@@ -67,7 +67,7 @@ __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,
! parse_line (buffer, (void *) resbuf, (void *) buffer, buflen,
&errno));
- _IO_funlockfile (stream);
+ funlockfile (stream);
*result = resbuf;
return 0;
@@ -40,7 +40,7 @@ putsgent (const struct sgrp *g, FILE *stream)
return -1;
}
- _IO_flockfile (stream);
+ flockfile (stream);
if (fprintf (stream, "%s:%s:", g->sg_namp, _S (g->sg_passwd)) < 0)
++errors;
@@ -75,7 +75,7 @@ putsgent (const struct sgrp *g, FILE *stream)
if (putc_unlocked ('\n', stream) == EOF)
++errors;
- _IO_funlockfile (stream);
+ funlockfile (stream);
return errors ? -1 : 0;
}
@@ -81,7 +81,7 @@ closeio (void *cookie)
return 0;
}
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
#define fopencookie _IO_fopencookie
static const cookie_io_functions_t funcsio =
{ readio, writeio, seekio, closeio };
@@ -20,7 +20,7 @@
#include <string.h>
#include <hurd.h>
-#include <libioP.h>
+#include <libio/libioP.h>
static ssize_t
do_write (void *cookie, const char *buf, size_t n)
@@ -89,9 +89,6 @@ static const char builtin_aliases[] =
#undef BUILTIN_ALIAS
};
-#include <libio/libioP.h>
-#define __getdelim(line, len, c, fp) _IO_getdelim (line, len, c, fp)
-
/* Value of the GCONV_PATH environment variable. */
const char *__gconv_path_envvar;
@@ -1,45 +1 @@
-#if !defined _ISOMAC && defined _IO_MTSAFE_IO
-# include <stdio-lock.h>
-#endif
#include <libio/bits/libio.h>
-
-#ifndef _ISOMAC
-#ifndef _LIBC_LIBIO_H
-#define _LIBC_LIBIO_H
-
-libc_hidden_proto (__overflow)
-libc_hidden_proto (__underflow)
-libc_hidden_proto (__uflow)
-libc_hidden_proto (__woverflow)
-libc_hidden_proto (__wunderflow)
-libc_hidden_proto (__wuflow)
-libc_hidden_proto (_IO_free_backup_area)
-libc_hidden_proto (_IO_free_wbackup_area)
-libc_hidden_proto (_IO_padn)
-libc_hidden_proto (_IO_putc)
-libc_hidden_proto (_IO_sgetn)
-libc_hidden_proto (_IO_vfprintf)
-libc_hidden_proto (_IO_vfscanf)
-
-#ifdef _IO_MTSAFE_IO
-# undef _IO_peekc
-# undef _IO_flockfile
-# undef _IO_funlockfile
-# undef _IO_ftrylockfile
-
-# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
-# if _IO_lock_inexpensive
-# define _IO_flockfile(_fp) \
- if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock)
-# define _IO_funlockfile(_fp) \
- if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_unlock (*(_fp)->_lock)
-# else
-# define _IO_flockfile(_fp) \
- if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp)
-# define _IO_funlockfile(_fp) \
- if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp)
-# endif
-#endif /* _IO_MTSAFE_IO */
-
-#endif
-#endif
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>
@@ -471,6 +471,8 @@ for linking")
extern __typeof (name) __EI_##name \
__attribute__((alias (__hidden_asmname (#local))))
# define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
+# define hidden_weak_ver(local, name) \
+ __hidden_ver1(local, __GI_##name, name) __attribute__((weak));
# define hidden_data_ver(local, name) hidden_ver(local, name)
# define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
# define hidden_data_def(name) hidden_def(name)
@@ -499,6 +501,7 @@ for linking")
# define hidden_def(name) strong_alias (name, __GI_##name)
# define hidden_weak(name) hidden_def (name)
# define hidden_ver(local, name) strong_alias (local, __GI_##name)
+# define hidden_weak_ver(local, name) hidden_ver (local, name)
# define hidden_data_def(name) strong_data_alias (name, __GI_##name)
# define hidden_data_weak(name) hidden_data_def (name)
# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
@@ -527,6 +530,7 @@ for linking")
# define hidden_weak(name)
# define hidden_def(name)
# define hidden_ver(local, name)
+# define hidden_weak_ver(local, name)
# define hidden_data_weak(name)
# define hidden_data_def(name)
# define hidden_data_ver(local, name)
@@ -545,6 +549,7 @@ for linking")
# define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version)
# endif
# define libc_hidden_ver(local, name) hidden_ver (local, name)
+# define libc_hidden_weak_ver(local, name) hidden_weak_ver (local, name)
# define libc_hidden_data_def(name) hidden_data_def (name)
# define libc_hidden_data_weak(name) hidden_data_weak (name)
# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
@@ -554,6 +559,7 @@ for linking")
# define libc_hidden_def(name)
# define libc_hidden_weak(name)
# define libc_hidden_ver(local, name)
+# define libc_hidden_weak_ver(local, name)
# define libc_hidden_data_def(name)
# define libc_hidden_data_weak(name)
# define libc_hidden_data_ver(local, name)
@@ -1,7 +1,12 @@
#ifndef _STDIO_H
+# if !defined _ISOMAC && defined _IO_MTSAFE_IO
+# include <stdio-lock.h>
+# endif
# include <libio/stdio.h>
# ifndef _ISOMAC
+# include <math_ldbl_opt.h>
+
/* Now define the internal interfaces. */
extern int __fcloseall (void) attribute_hidden;
@@ -10,44 +15,50 @@ extern int __snprintf (char *__restrict __s, size_t __maxlen,
__attribute__ ((__format__ (__printf__, 3, 4)));
libc_hidden_proto (__snprintf)
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)
__attribute__ ((__format__ (__printf__, 3, 0)));
+libc_hidden_proto (__vsnprintf)
extern int __vfscanf (FILE *__restrict __s,
const char *__restrict __format,
- _G_va_list __arg)
+ __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0)));
libc_hidden_proto (__vfscanf)
extern int __vscanf (const char *__restrict __format,
- _G_va_list __arg)
+ __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0)));
-extern _IO_ssize_t __getline (char **__lineptr, size_t *__n,
- FILE *__stream) attribute_hidden;
+extern __ssize_t __getline (char **__lineptr, size_t *__n,
+ FILE *__stream) attribute_hidden;
+extern __ssize_t __getdelim (char **__lineptr, size_t *__n,
+ int __delim, FILE *__stream);
+libc_hidden_proto (__getdelim)
+
extern int __vsscanf (const char *__restrict __s,
const char *__restrict __format,
- _G_va_list __arg)
+ __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0)));
+libc_hidden_proto (__vsscanf)
extern int __sprintf_chk (char *, int, size_t, const char *, ...) __THROW;
extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...)
__THROW;
extern int __vsprintf_chk (char *, int, size_t, const char *,
- _G_va_list) __THROW;
+ __gnuc_va_list) __THROW;
extern int __vsnprintf_chk (char *, size_t, int, size_t, const char *,
- _G_va_list) __THROW;
+ __gnuc_va_list) __THROW;
extern int __printf_chk (int, const char *, ...);
extern int __fprintf_chk (FILE *, int, const char *, ...);
-extern int __vprintf_chk (int, const char *, _G_va_list);
-extern int __vfprintf_chk (FILE *, int, const char *, _G_va_list);
+extern int __vprintf_chk (int, const char *, __gnuc_va_list);
+extern int __vfprintf_chk (FILE *, int, const char *, __gnuc_va_list);
extern char *__fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp);
extern char *__fgets_chk (char *buf, size_t size, int n, FILE *fp);
extern int __asprintf_chk (char **, int, const char *, ...) __THROW;
-extern int __vasprintf_chk (char **, int, const char *, _G_va_list) __THROW;
+extern int __vasprintf_chk (char **, int, const char *, __gnuc_va_list) __THROW;
extern int __dprintf_chk (int, int, const char *, ...);
-extern int __vdprintf_chk (int, int, const char *, _G_va_list);
+extern int __vdprintf_chk (int, int, const char *, __gnuc_va_list);
extern int __obstack_printf_chk (struct obstack *, int, const char *, ...)
__THROW;
extern int __obstack_vprintf_chk (struct obstack *, int, const char *,
- _G_va_list) __THROW;
+ __gnuc_va_list) __THROW;
extern int __isoc99_fscanf (FILE *__restrict __stream,
const char *__restrict __format, ...) __wur;
@@ -56,12 +67,12 @@ extern int __isoc99_sscanf (const char *__restrict __s,
const char *__restrict __format, ...) __THROW;
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;
libc_hidden_proto (__isoc99_vsscanf)
libc_hidden_proto (__isoc99_vfscanf)
@@ -105,14 +116,17 @@ libc_hidden_proto (__fortify_fail)
libc_hidden_proto (__fortify_fail_abort)
/* Acquire ownership of STREAM. */
-extern void __flockfile (FILE *__stream) attribute_hidden;
+extern void __flockfile (FILE *__stream);
+libc_hidden_proto (__flockfile)
/* Relinquish the ownership granted for STREAM. */
-extern void __funlockfile (FILE *__stream) attribute_hidden;
+extern void __funlockfile (FILE *__stream);
+libc_hidden_proto (__funlockfile)
/* Try to acquire ownership of STREAM but do not block if it is not
possible. */
extern int __ftrylockfile (FILE *__stream);
+libc_hidden_proto (__ftrylockfile)
extern int __getc_unlocked (FILE *__fp);
extern wint_t __getwc_unlocked (FILE *__fp);
@@ -125,23 +139,26 @@ extern int __fxprintf_nocancel (FILE *__fp, const char *__fmt, ...)
extern const char *const _sys_errlist_internal[] attribute_hidden;
extern int _sys_nerr_internal attribute_hidden;
-libc_hidden_proto (__asprintf)
# if IS_IN (libc)
-extern _IO_FILE *_IO_new_fopen (const char*, const char*);
+extern FILE *_IO_new_fopen (const char*, const char*);
# define fopen(fname, mode) _IO_new_fopen (fname, mode)
-extern _IO_FILE *_IO_new_fdopen (int, const char*);
+extern FILE *_IO_new_fdopen (int, const char*);
# define fdopen(fd, mode) _IO_new_fdopen (fd, mode)
-extern int _IO_new_fclose (_IO_FILE*);
+extern int _IO_new_fclose (FILE *);
# define fclose(fp) _IO_new_fclose (fp)
-extern int _IO_fputs (const char*, _IO_FILE*);
+extern int _IO_fputs (const char*, FILE *);
libc_hidden_proto (_IO_fputs)
# define fputs(str, fp) _IO_fputs (str, fp)
-extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *);
+extern int _IO_new_fsetpos (FILE *, const fpos_t *);
# define fsetpos(fp, posp) _IO_new_fsetpos (fp, posp)
-extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *);
+extern int _IO_new_fgetpos (FILE *, fpos_t *);
# define fgetpos(fp, posp) _IO_new_fgetpos (fp, posp)
# endif
+libc_hidden_proto (__asprintf)
+extern __typeof (vasprintf) __vasprintf
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+libc_hidden_proto (__vasprintf)
libc_hidden_proto (dprintf)
extern __typeof (dprintf) __dprintf
__attribute__ ((__format__ (__printf__, 2, 3)));
@@ -149,6 +166,7 @@ libc_hidden_proto (__dprintf)
libc_hidden_proto (fprintf)
libc_hidden_proto (vfprintf)
libc_hidden_proto (sprintf)
+libc_hidden_proto (vsprintf)
libc_hidden_proto (sscanf)
libc_hidden_proto (fwrite)
libc_hidden_proto (perror)
@@ -157,11 +175,14 @@ libc_hidden_proto (rewind)
libc_hidden_proto (fileno)
extern __typeof (fileno) __fileno;
libc_hidden_proto (__fileno)
+libc_hidden_proto (fread)
libc_hidden_proto (fwrite)
libc_hidden_proto (fseek)
+libc_hidden_proto (ftell)
extern __typeof (ftello) __ftello;
libc_hidden_proto (__ftello)
libc_hidden_proto (fflush)
+libc_hidden_proto (setvbuf)
libc_hidden_proto (fflush_unlocked)
extern __typeof (fflush_unlocked) __fflush_unlocked;
libc_hidden_proto (__fflush_unlocked)
@@ -194,5 +215,41 @@ libc_hidden_proto (__fmemopen)
extern int __gen_tempfd (int flags);
libc_hidden_proto (__gen_tempfd)
+libc_hidden_proto (__overflow)
+libc_hidden_proto (__underflow)
+libc_hidden_proto (__uflow)
+
+#if IS_IN (libc)
+# undef flockfile
+# define flockfile(s) __flockfile (s)
+# undef funlockfile
+# define funlockfile(s) __funlockfile (s)
+#endif
+
+#ifdef _IO_MTSAFE_IO
+# undef _IO_flockfile
+# undef _IO_funlockfile
+# undef _IO_ftrylockfile
+
+# if _IO_lock_inexpensive
+# define _IO_USER_LOCK 0x8000
+# define _IO_flockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock)
+# define _IO_funlockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_unlock (*(_fp)->_lock)
+# else
+# define _IO_flockfile(_fp) \
+ do { if (((_fp)->_flags & _IO_USER_LOCK) == 0) __flockfile (_fp) } while (0)
+# define _IO_funlockfile(_fp) \
+ do { if (((_fp)->_flags & _IO_USER_LOCK) == 0) __funlockfile (_fp) } while (0)
+# endif
+
+# undef __flockfile
+# define __flockfile(s) _IO_flockfile (s)
+# undef __funlockfile
+# define __funlockfile(s) _IO_funlockfile (s)
+
+#endif /* _IO_MTSAFE_IO */
+
# endif /* not _ISOMAC */
#endif /* stdio.h */
@@ -260,5 +260,11 @@ extern size_t __mbsrtowcs_l (wchar_t *dst, const char **src, size_t len,
# define mbsinit(state) ((state)->__count == 0)
# define __mbsinit(state) ((state)->__count == 0)
+# if IS_IN (libc)
+extern __typeof (fwide) _IO_fwide;
+# undef fwide
+# define fwide(s, m) _IO_fwide (s, m)
+# endif
+
# endif
#endif
@@ -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 \
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio_ext.h>
+#include "libioP.h"
size_t
__fbufsize (FILE *fp)
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio_ext.h>
+#include "libioP.h"
int
__flbf (FILE *fp)
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio_ext.h>
+#include "libioP.h"
size_t
__fpending (FILE *fp)
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio_ext.h>
+#include "libioP.h"
int
__freadable (FILE *fp)
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio_ext.h>
+#include "libioP.h"
int
__freading (FILE *fp)
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio_ext.h>
+#include "libioP.h"
int
__fwritable (FILE *fp)
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio_ext.h>
+#include "libioP.h"
int
__fwriting (FILE *fp)
@@ -28,14 +28,16 @@
#ifndef _BITS_LIBIO_H
#define _BITS_LIBIO_H 1
-#if !defined _STDIO_H && !defined _LIBIO_H
+#if !defined _STDIO_H && !defined _LIBIO_H && !defined _LIBIOP_H
# 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;
@@ -441,9 +380,10 @@ extern int _IO_peekc_locked (_IO_FILE *__fp);
#define _IO_PENDING_OUTPUT_COUNT(_fp) \
((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
-extern void _IO_flockfile (_IO_FILE *) __THROW;
-extern void _IO_funlockfile (_IO_FILE *) __THROW;
-extern int _IO_ftrylockfile (_IO_FILE *) __THROW;
+/* These might have macro definitions while building libc itself. */
+extern void (_IO_flockfile) (_IO_FILE *) __THROW;
+extern void (_IO_funlockfile) (_IO_FILE *) __THROW;
+extern int (_IO_ftrylockfile) (_IO_FILE *) __THROW;
#define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
#define _IO_flockfile(_fp) /**/
@@ -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,16 @@
+#ifndef _____fpos64_t_defined
+#define _____fpos64_t_defined 1
+
+#include <bits/types.h>
+#include <bits/types/__mbstate_t.h>
+
+/* Note: 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
new file mode 100644
@@ -0,0 +1,16 @@
+#ifndef _____fpos_t_defined
+#define _____fpos_t_defined 1
+
+#include <bits/types.h>
+#include <bits/types/__mbstate_t.h>
+
+/* Note: 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
new file mode 100644
@@ -0,0 +1,46 @@
+#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.
+ Note: 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
@@ -26,8 +26,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include <libioP.h>
#include <errno.h>
+#include "libioP.h"
off_t
@@ -26,8 +26,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include <libioP.h>
#include <errno.h>
+#include "libioP.h"
#ifndef __OFF_T_MATCHES_OFF64_T
@@ -24,9 +24,11 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <stdio.h>
#include <wchar.h>
+#include "libioP.h"
+
+#undef fwide
int
fwide (_IO_FILE *fp, int mode)
@@ -15,10 +15,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
+#include "libioP.h"
/* Write formatted output to STREAM from the format string FORMAT. */
@@ -15,10 +15,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
+#include "libioP.h"
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
@@ -24,9 +24,10 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <stdio.h>
#include <stdlib.h>
+#include "libioP.h"
+
#include <shlib-compat.h>
/* Prototyped for local functions. */
@@ -42,6 +42,7 @@ _IO_fread (void *buf, _IO_size_t size, _IO_size_t count, _IO_FILE *fp)
libc_hidden_def (_IO_fread)
weak_alias (_IO_fread, fread)
+libc_hidden_weak (fread)
# ifndef _IO_MTSAFE_IO
strong_alias (_IO_fread, __fread_unlocked)
@@ -24,6 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
+#include <errno.h>
+
/* We need to avoid the header declarations of these, because
the types don't match _IO_fsetpos and then the compiler will
complain about the mismatch when we do the alias below. */
@@ -31,13 +33,12 @@
#define _IO_fsetpos64 __renamed__IO_fsetpos64
#define fsetpos64 __renamed_fsetpos64
-#include <libioP.h>
+#include "libioP.h"
#undef _IO_new_fsetpos64
#undef _IO_fsetpos64
#undef fsetpos64
-#include <errno.h>
#include <shlib-compat.h>
int
@@ -24,8 +24,9 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <errno.h>
+#include "libioP.h"
+
#include <shlib-compat.h>
#ifndef __OFF_T_MATCHES_OFF64_T
@@ -58,3 +58,4 @@ _IO_ftell (_IO_FILE *fp)
libc_hidden_def (_IO_ftell)
weak_alias (_IO_ftell, ftell)
+libc_hidden_weak (ftell)
@@ -24,14 +24,14 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <dlfcn.h>
#include <wchar.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-
#include <langinfo.h>
+
+#include "libioP.h"
#include <locale/localeinfo.h>
#include <wcsmbs/wcsmbsload.h>
#include <iconv/gconv_int.h>
@@ -125,3 +125,4 @@ unlock_return:
weak_alias (_IO_getdelim, __getdelim)
weak_alias (_IO_getdelim, getdelim)
+libc_hidden_weak (__getdelim)
deleted file mode 100644
@@ -1,96 +0,0 @@
-#include <stdio.h>
-
-/* These emulate stdio functionality, but with a different name
- (_IO_ungetc instead of ungetc), and using _IO_FILE instead of FILE. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int _IO_fclose (_IO_FILE*);
-extern int _IO_new_fclose (_IO_FILE*);
-extern int _IO_old_fclose (_IO_FILE*);
-extern _IO_FILE *_IO_fdopen (int, const char*) __THROW;
-libc_hidden_proto (_IO_fdopen)
-extern _IO_FILE *_IO_old_fdopen (int, const char*) __THROW;
-extern _IO_FILE *_IO_new_fdopen (int, const char*) __THROW;
-extern int _IO_fflush (_IO_FILE*);
-libc_hidden_proto (_IO_fflush)
-extern int _IO_fgetpos (_IO_FILE*, _IO_fpos_t*);
-extern int _IO_fgetpos64 (_IO_FILE*, _IO_fpos64_t*);
-extern char* _IO_fgets (char*, int, _IO_FILE*);
-extern _IO_FILE *_IO_fopen (const char*, const char*);
-extern _IO_FILE *_IO_old_fopen (const char*, const char*);
-extern _IO_FILE *_IO_new_fopen (const char*, const char*);
-extern _IO_FILE *_IO_fopen64 (const char*, const char*);
-extern _IO_FILE *__fopen_internal (const char*, const char*, int)
- attribute_hidden;
-extern _IO_FILE *__fopen_maybe_mmap (_IO_FILE *) __THROW attribute_hidden;
-extern int _IO_fprintf (_IO_FILE*, const char*, ...);
-extern int _IO_fputs (const char*, _IO_FILE*);
-libc_hidden_proto (_IO_fputs)
-extern int _IO_fsetpos (_IO_FILE*, const _IO_fpos_t *);
-extern int _IO_fsetpos64 (_IO_FILE*, const _IO_fpos64_t *);
-extern long int _IO_ftell (_IO_FILE*);
-libc_hidden_proto (_IO_ftell)
-extern _IO_size_t _IO_fread (void*, _IO_size_t, _IO_size_t, _IO_FILE*);
-libc_hidden_proto (_IO_fread)
-extern _IO_size_t _IO_fwrite (const void*, _IO_size_t, _IO_size_t, _IO_FILE*);
-libc_hidden_proto (_IO_fwrite)
-extern char* _IO_gets (char*);
-extern void _IO_perror (const char*) __THROW;
-extern int _IO_printf (const char*, ...);
-extern int _IO_puts (const char*);
-extern int _IO_scanf (const char*, ...);
-extern void _IO_setbuffer (_IO_FILE *, char*, _IO_size_t) __THROW;
-libc_hidden_proto (_IO_setbuffer)
-extern int _IO_setvbuf (_IO_FILE*, char*, int, _IO_size_t) __THROW;
-libc_hidden_proto (_IO_setvbuf)
-extern int _IO_sscanf (const char*, const char*, ...) __THROW;
-extern int _IO_sprintf (char *, const char*, ...) __THROW;
-extern int _IO_ungetc (int, _IO_FILE*) __THROW;
-extern int _IO_vsscanf (const char *, const char *, _IO_va_list) __THROW;
-extern int _IO_vsprintf (char*, const char*, _IO_va_list) __THROW;
-libc_hidden_proto (_IO_vsprintf)
-extern int _IO_vswprintf (wchar_t*, _IO_size_t, const wchar_t*, _IO_va_list)
- __THROW;
-
-struct obstack;
-extern int _IO_obstack_vprintf (struct obstack *, const char *, _IO_va_list)
- __THROW;
-extern int _IO_obstack_printf (struct obstack *, const char *, ...) __THROW;
-#ifndef _IO_pos_BAD
-#define _IO_pos_BAD ((_IO_off64_t)(-1))
-#endif
-#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
-#define _IO_fseek(__fp, __offset, __whence) \
- (_IO_seekoff_unlocked (__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) \
- == _IO_pos_BAD ? EOF : 0)
-#define _IO_rewind(FILE) \
- (void) _IO_seekoff_unlocked (FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
-#define _IO_vprintf(FORMAT, ARGS) \
- _IO_vfprintf (_IO_stdout, FORMAT, ARGS)
-#define _IO_freopen(FILENAME, MODE, FP) \
- (_IO_file_close_it (FP), \
- _IO_file_fopen (FP, FILENAME, MODE, 1))
-#define _IO_old_freopen(FILENAME, MODE, FP) \
- (_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
-#define _IO_freopen64(FILENAME, MODE, FP) \
- (_IO_file_close_it (FP), \
- _IO_file_fopen (FP, FILENAME, MODE, 0))
-#define _IO_fileno(FP) ((FP)->_fileno)
-extern _IO_FILE* _IO_popen (const char*, const char*) __THROW;
-extern _IO_FILE* _IO_new_popen (const char*, const char*) __THROW;
-extern _IO_FILE* _IO_old_popen (const char*, const char*) __THROW;
-extern int __new_pclose (_IO_FILE *) __THROW;
-extern int __old_pclose (_IO_FILE *) __THROW;
-#define _IO_pclose _IO_fclose
-#define _IO_setbuf(_FP, _BUF) _IO_setbuffer (_FP, _BUF, _IO_BUFSIZ)
-#define _IO_setlinebuf(_FP) _IO_setvbuf (_FP, NULL, 1, 0)
-
-_IO_FILE *__new_freopen (const char *, const char *, _IO_FILE *) __THROW;
-_IO_FILE *__old_freopen (const char *, const char *, _IO_FILE *) __THROW;
-
-#ifdef __cplusplus
-}
-#endif
@@ -25,8 +25,8 @@
in files containing the exception. */
#include <stdlib.h>
-#include <libioP.h>
#include <errno.h>
+#include "libioP.h"
_IO_off64_t
_IO_seekoff_unlocked (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
@@ -24,7 +24,7 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
+#include "libioP.h"
_IO_off64_t
_IO_seekpos_unlocked (_IO_FILE *fp, _IO_off64_t pos, int mode)
@@ -96,3 +96,4 @@ unlock_return:
libc_hidden_def (_IO_setvbuf)
weak_alias (_IO_setvbuf, setvbuf)
+libc_hidden_weak (setvbuf)
@@ -24,8 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <stdio_ext.h>
+#include "libioP.h"
int
_IO_vdprintf (int d, const char *format, _IO_va_list arg)
@@ -24,7 +24,6 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include "strfile.h"
int
@@ -44,6 +43,6 @@ __IO_vsprintf (char *string, const char *format, _IO_va_list args)
return ret;
}
ldbl_hidden_def (__IO_vsprintf, _IO_vsprintf)
-
ldbl_strong_alias (__IO_vsprintf, _IO_vsprintf)
ldbl_weak_alias (__IO_vsprintf, vsprintf)
+ldbl_hidden_weak (__IO_vsprintf, vsprintf)
@@ -24,7 +24,6 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include "strfile.h"
int
@@ -42,4 +41,5 @@ _IO_vsscanf (const char *string, const char *format, _IO_va_list args)
return ret;
}
ldbl_weak_alias (_IO_vsscanf, __vsscanf)
+ldbl_hidden_weak (_IO_vsscanf, __vsscanf)
ldbl_weak_alias (_IO_vsscanf, vsscanf)
@@ -24,9 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
-#include "strfile.h"
#include <wchar.h>
+#include "strfile.h"
int
__vswscanf (const wchar_t *string, const wchar_t *format, _IO_va_list args)
@@ -24,6 +24,9 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
+#ifndef _LIBIOP_H
+#define _LIBIOP_H 1
+
/* NOTE: libio is now exclusively used only by glibc since libstdc++ has its
own implementation. As a result, functions that were implemented for C++
(like *sputn) may no longer have C++ semantics. This is of course only
@@ -33,17 +36,111 @@
FIXME: All of the C++ cruft eventually needs to go away. */
#include <stddef.h>
-
+#include <stdio.h>
#include <errno.h>
#include <libc-lock.h>
#include <math_ldbl_opt.h>
-#include "iolibio.h"
+#include <bits/libio.h>
+
+__BEGIN_DECLS
+
+libc_hidden_proto (__woverflow)
+libc_hidden_proto (__wunderflow)
+libc_hidden_proto (__wuflow)
+libc_hidden_proto (_IO_flockfile)
+libc_hidden_proto (_IO_free_backup_area)
+libc_hidden_proto (_IO_free_wbackup_area)
+libc_hidden_proto (_IO_ftrylockfile)
+libc_hidden_proto (_IO_funlockfile)
+libc_hidden_proto (_IO_padn)
+libc_hidden_proto (_IO_putc)
+libc_hidden_proto (_IO_sgetn)
+libc_hidden_proto (_IO_vfprintf)
+libc_hidden_proto (_IO_vfscanf)
+
+extern int _IO_fclose (FILE*);
+extern int _IO_new_fclose (FILE*);
+extern int _IO_old_fclose (FILE*);
+extern FILE *_IO_fdopen (int, const char*) __THROW;
+libc_hidden_proto (_IO_fdopen)
+extern FILE *_IO_old_fdopen (int, const char*) __THROW;
+extern FILE *_IO_new_fdopen (int, const char*) __THROW;
+extern int _IO_fflush (FILE*);
+libc_hidden_proto (_IO_fflush)
+extern int _IO_fgetpos (FILE*, __fpos_t*);
+extern int _IO_fgetpos64 (FILE*, __fpos64_t*);
+extern char* _IO_fgets (char*, int, FILE*);
+extern FILE *_IO_fopen (const char*, const char*);
+extern FILE *_IO_old_fopen (const char*, const char*);
+extern FILE *_IO_new_fopen (const char*, const char*);
+extern FILE *_IO_fopen64 (const char*, const char*);
+extern FILE *__fopen_internal (const char*, const char*, int)
+ attribute_hidden;
+extern FILE *__fopen_maybe_mmap (FILE *) __THROW attribute_hidden;
+extern int _IO_fprintf (FILE*, const char*, ...);
+extern int _IO_fputs (const char*, FILE*);
+libc_hidden_proto (_IO_fputs)
+extern int _IO_fsetpos (FILE*, const __fpos_t *);
+extern int _IO_fsetpos64 (FILE*, const __fpos64_t *);
+extern long int _IO_ftell (FILE*);
+libc_hidden_proto (_IO_ftell)
+extern size_t _IO_fread (void*, size_t, size_t, FILE*);
+libc_hidden_proto (_IO_fread)
+extern size_t _IO_fwrite (const void*, size_t, size_t, FILE*);
+libc_hidden_proto (_IO_fwrite)
+extern char* _IO_gets (char*);
+extern void _IO_perror (const char*) __THROW;
+extern int _IO_printf (const char*, ...);
+extern int _IO_puts (const char*);
+extern int _IO_scanf (const char*, ...);
+extern void _IO_setbuffer (FILE *, char*, size_t) __THROW;
+libc_hidden_proto (_IO_setbuffer)
+extern int _IO_setvbuf (FILE*, char*, int, size_t) __THROW;
+libc_hidden_proto (_IO_setvbuf)
+extern int _IO_sscanf (const char*, const char*, ...) __THROW;
+extern int _IO_sprintf (char *, const char*, ...) __THROW;
+extern int _IO_ungetc (int, FILE*) __THROW;
+extern int _IO_vsscanf (const char *, const char *, __gnuc_va_list) __THROW;
+extern int _IO_vsprintf (char*, const char*, __gnuc_va_list) __THROW;
+libc_hidden_proto (_IO_vsprintf)
+extern int _IO_vswprintf (wchar_t*, size_t, const wchar_t*, __gnuc_va_list)
+ __THROW;
+
+struct obstack;
+extern int _IO_obstack_vprintf (struct obstack *, const char *, __gnuc_va_list)
+ __THROW;
+extern int _IO_obstack_printf (struct obstack *, const char *, ...) __THROW;
+#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
+#define _IO_fseek(__fp, __offset, __whence) \
+ (_IO_seekoff_unlocked (__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) \
+ == _IO_pos_BAD ? EOF : 0)
+#define _IO_rewind(FILE) \
+ (void) _IO_seekoff_unlocked (FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
+#define _IO_vprintf(FORMAT, ARGS) \
+ _IO_vfprintf (_IO_stdout, FORMAT, ARGS)
+#define _IO_freopen(FILENAME, MODE, FP) \
+ (_IO_file_close_it (FP), \
+ _IO_file_fopen (FP, FILENAME, MODE, 1))
+#define _IO_old_freopen(FILENAME, MODE, FP) \
+ (_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
+#define _IO_freopen64(FILENAME, MODE, FP) \
+ (_IO_file_close_it (FP), \
+ _IO_file_fopen (FP, FILENAME, MODE, 0))
+#define _IO_fileno(FP) ((FP)->_fileno)
+extern FILE* _IO_popen (const char*, const char*) __THROW;
+extern FILE* _IO_new_popen (const char*, const char*) __THROW;
+extern FILE* _IO_old_popen (const char*, const char*) __THROW;
+extern int __new_pclose (FILE *) __THROW;
+extern int __old_pclose (FILE *) __THROW;
+#define _IO_pclose _IO_fclose
+#define _IO_setbuf(_FP, _BUF) _IO_setbuffer (_FP, _BUF, BUFSIZ)
+#define _IO_setlinebuf(_FP) _IO_setvbuf (_FP, NULL, 1, 0)
+
+FILE *__new_freopen (const char *, const char *, FILE *) __THROW;
+FILE *__old_freopen (const char *, const char *, FILE *) __THROW;
-#ifdef __cplusplus
-extern "C" {
-#endif
#define _IO_seek_set 0
#define _IO_seek_cur 1
@@ -714,21 +811,13 @@ extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE *, _IO_off64_t, int)
extern int _IO_vscanf (const char *, _IO_va_list) __THROW;
/* _IO_pos_BAD is an _IO_off64_t value indicating error, unknown, or EOF. */
-#ifndef _IO_pos_BAD
-# define _IO_pos_BAD ((_IO_off64_t) -1)
-#endif
+#define _IO_pos_BAD ((_IO_off64_t) -1)
+
/* _IO_pos_adjust adjust an _IO_off64_t by some number of bytes. */
-#ifndef _IO_pos_adjust
-# define _IO_pos_adjust(pos, delta) ((pos) += (delta))
-#endif
-/* _IO_pos_0 is an _IO_off64_t value indicating beginning of file. */
-#ifndef _IO_pos_0
-# define _IO_pos_0 ((_IO_off64_t) 0)
-#endif
+#define _IO_pos_adjust(pos, delta) ((pos) += (delta))
-#ifdef __cplusplus
-}
-#endif
+/* _IO_pos_0 is an _IO_off64_t value indicating beginning of file. */
+#define _IO_pos_0 ((_IO_off64_t) 0)
#ifdef _IO_MTSAFE_IO
/* check following! */
@@ -876,3 +965,7 @@ IO_validate_vtable (const struct _IO_jump_t *vtable)
_IO_vtable_check ();
return vtable;
}
+
+__END_DECLS
+
+#endif /* libioP.h. */
@@ -15,10 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "libioP.h"
-#include "strfile.h"
#include <stdio.h>
#include <stdlib.h>
+#include "strfile.h"
struct _IO_FILE_memstream
@@ -19,14 +19,13 @@
#include <stdlib.h>
-#include "libioP.h"
-#include "strfile.h"
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <obstack.h>
#include <stdarg.h>
#include <stdio_ext.h>
+#include "strfile.h"
struct _IO_obstack_file
@@ -24,8 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <errno.h>
+#include "libioP.h"
#include <shlib-compat.h>
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -24,8 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <errno.h>
+#include "libioP.h"
#include <shlib-compat.h>
#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
@@ -21,7 +21,7 @@
#define _IO_USE_OLD_IO_FILE
#include <stdio.h>
#include <unistd.h>
-#include <iolibio.h>
+#include "libioP.h"
/* This returns a new stream opened on a temporary file (generated
by tmpnam). The file is opened with mode "w+b" (binary read/write).
@@ -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,9 @@ extern void funlockfile (FILE *__stream) __THROW;
# include <bits/getopt_posix.h>
#endif
+/* Internal definitions used by optimizing inlines. */
+#include <bits/libio.h>
+
/* If we are compiling with optimizing read this file. It contains
several optimizing inline functions and macros. */
#ifdef __USE_EXTERN_INLINES
@@ -25,6 +25,7 @@
in files containing the exception. */
#include <stdio.h>
+#include "libioP.h"
typedef void *(*_IO_alloc_type) (_IO_size_t);
typedef void (*_IO_free_type) (void*);
@@ -25,10 +25,9 @@
in files containing the exception. */
#include <assert.h>
-#include "strfile.h"
-#include "libioP.h"
#include <string.h>
#include <stdio_ext.h>
+#include "strfile.h"
void
_IO_str_init_static_internal (_IO_strfile *sf, char *ptr, _IO_size_t size,
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <wchar.h>
+#include "libioP.h"
/* Write formatted output into S, according to the format string FORMAT. */
/* VARARGS3 */
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <wchar.h>
+#include "libioP.h"
/* Read formatted input from S, according to the format string FORMAT. */
/* VARARGS2 */
@@ -24,10 +24,9 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
-#include "libioP.h"
-#include "stdio.h"
+#include <stdio.h>
#include <stdio_ext.h>
#include "strfile.h"
@@ -85,4 +84,6 @@ _IO_vasprintf (char **result_ptr, const char *format, _IO_va_list args)
(*result_ptr)[needed - 1] = '\0';
return ret;
}
+strong_alias (_IO_vasprintf, __vasprintf)
+ldbl_hidden_def (_IO_vasprintf, __vasprintf)
ldbl_weak_alias (_IO_vasprintf, vasprintf)
@@ -24,7 +24,6 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include "strfile.h"
static int _IO_strn_overflow (_IO_FILE *fp, int c) __THROW;
@@ -119,3 +118,4 @@ _IO_vsnprintf (char *string, _IO_size_t maxlen, const char *format,
}
ldbl_weak_alias (_IO_vsnprintf, __vsnprintf)
ldbl_weak_alias (_IO_vsnprintf, vsnprintf)
+ldbl_hidden_weak (_IO_vsnprintf, __vsnprintf)
@@ -24,10 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include "libioP.h"
#include "strfile.h"
-
static wint_t _IO_wstrn_overflow (_IO_FILE *fp, wint_t c) __THROW;
static wint_t
@@ -17,8 +17,9 @@
<http://www.gnu.org/licenses/>. */
#include <dlfcn.h>
-#include <libioP.h>
#include <stdio.h>
+#include "libioP.h"
+
#include <ldsodefs.h>
#ifdef SHARED
@@ -15,10 +15,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
+#include "libioP.h"
/* Write formatted output to stdout according to the
format string FORMAT, using the argument list in ARG. */
@@ -27,11 +27,12 @@
in files containing the exception. */
#include <assert.h>
-#include <libioP.h>
#include <wchar.h>
-#include <gconv.h>
#include <stdlib.h>
#include <string.h>
+#include "libioP.h"
+
+#include <gconv.h>
/* Convert TO_DO wide character from DATA to FP.
Then mark FP as having empty buffers. */
@@ -15,11 +15,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include "libioP.h"
-#include "strfile.h"
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
+#include "strfile.h"
struct _IO_FILE_wmemstream
@@ -15,10 +15,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
+#include "libioP.h"
/* Write formatted output to stdout from the format string FORMAT. */
/* VARARGS1 */
@@ -15,10 +15,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
+#include "libioP.h"
/* Read formatted input from stdin according to the format string FORMAT. */
@@ -25,11 +25,10 @@
in files containing the exception. */
#include <assert.h>
-#include "strfile.h"
-#include "libioP.h"
#include <string.h>
#include <wchar.h>
#include <stdio_ext.h>
+#include "strfile.h"
void
_IO_wstr_init_static (_IO_FILE *fp, wchar_t *ptr, _IO_size_t size,
@@ -222,6 +222,7 @@
#include <unistd.h>
#include <stdio.h> /* needed for malloc_stats */
+#include <libio/libioP.h> /* needed for cancellation handling in malloc_stats */
#include <errno.h>
#include <shlib-compat.h>
@@ -4962,7 +4963,7 @@ __malloc_stats (void)
if (__malloc_initialized < 0)
ptmalloc_init ();
- _IO_flockfile (stderr);
+ flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
for (i = 0, ar_ptr = &main_arena;; i++)
@@ -4993,7 +4994,7 @@ __malloc_stats (void)
fprintf (stderr, "max mmap bytes = %10lu\n",
(unsigned long) mp_.max_mmapped_mem);
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
- _IO_funlockfile (stderr);
+ funlockfile (stderr);
}
@@ -35,11 +35,6 @@
#include <libc-internal.h>
#include <dso_handle.h>
-
-#include <libio/iolibio.h>
-#define setvbuf(s, b, f, l) _IO_setvbuf (s, b, f, l)
-#define fwrite(buf, size, count, fp) _IO_fwrite (buf, size, count, fp)
-
#include <kernel-features.h>
#define TRACE_BUFFER_SIZE 512
@@ -400,10 +400,6 @@ _obstack_memory_used (struct obstack *h)
# define _(msgid) gettext (msgid)
# endif
-# ifdef _LIBC
-# include <libio/iolibio.h>
-# endif
-
static _Noreturn void
print_and_abort (void)
{
@@ -19,8 +19,7 @@
#include <stdlib.h>
#include <set-hooks.h>
#include <libc-internal.h>
-
-#include "../libio/libioP.h"
+#include <libio/libioP.h>
DEFINE_HOOK (__libc_subfreeres, (void));
@@ -22,10 +22,9 @@
#include <errno.h>
#include <string.h>
#include <stdio.h>
-
#include <wchar.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
+#include <libio/libioP.h>
+
extern char *__progname;
@@ -86,7 +85,7 @@ void
vwarnx (const char *format, __gnuc_va_list ap)
{
flockfile (stderr);
- if (_IO_fwide (stderr, 0) > 0)
+ if (fwide (stderr, 0) > 0)
{
__fwprintf (stderr, L"%s: ", __progname);
convert_and_print (format, ap);
@@ -109,7 +108,7 @@ vwarn (const char *format, __gnuc_va_list ap)
int error = errno;
flockfile (stderr);
- if (_IO_fwide (stderr, 0) > 0)
+ if (fwide (stderr, 0) > 0)
{
__fwprintf (stderr, L"%s: ", __progname);
if (format)
@@ -39,6 +39,7 @@
# include <stdbool.h>
# include <stdint.h>
# include <wchar.h>
+# include <libio/libioP.h>
# define mbsrtowcs __mbsrtowcs
# define USE_UNLOCKED_IO 0
# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b)
@@ -67,7 +68,6 @@ unsigned int error_message_count;
# define program_name program_invocation_name
# include <errno.h>
# include <limits.h>
-# include <libio/libioP.h>
/* In GNU libc we want do not want to use the common name 'error' directly.
Instead make it a weak alias. */
@@ -80,11 +80,6 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
# define error __error
# define error_at_line __error_at_line
-# include <libio/iolibio.h>
-# define fflush(s) _IO_fflush (s)
-# undef putc
-# define putc(c, fp) _IO_putc (c, fp)
-
# include <libc-lock.h>
#else /* not _LIBC */
@@ -203,7 +198,7 @@ static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3))
error_tail (int status, int errnum, const char *message, va_list args)
{
#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
+ if (fwide (stderr, 0) > 0)
{
size_t len = strlen (message) + 1;
wchar_t *wmessage = NULL;
@@ -304,7 +299,7 @@ error (int status, int errnum, const char *message, ...)
flush_stdout ();
#ifdef _LIBC
- _IO_flockfile (stderr);
+ flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
@@ -321,7 +316,7 @@ error (int status, int errnum, const char *message, ...)
error_tail (status, errnum, message, args);
#ifdef _LIBC
- _IO_funlockfile (stderr);
+ funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
# endif
@@ -367,7 +362,7 @@ error_at_line (int status, int errnum, const char *file_name,
flush_stdout ();
#ifdef _LIBC
- _IO_flockfile (stderr);
+ flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
@@ -392,7 +387,7 @@ error_at_line (int status, int errnum, const char *file_name,
error_tail (status, errnum, message, args);
#ifdef _LIBC
- _IO_funlockfile (stderr);
+ funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
# endif
@@ -20,10 +20,7 @@
#include <string.h> /* For string function builtin redirect. */
#include <termios.h>
#include <unistd.h>
-
#include <wchar.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
#include <libc-lock.h>
/* It is desirable to use this bit on systems that have it.
@@ -37,9 +37,6 @@ static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93";
#include <ctype.h>
#include <string.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
-
static char zapchar;
static FILE *tf;
@@ -23,9 +23,6 @@
#include <string.h>
#include <sys/types.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
-
#undef __setmntent
#undef __endmntent
#undef __getmntent_r
@@ -53,13 +53,10 @@ static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#include <stdarg.h>
-#include <libio/iolibio.h>
#include <math_ldbl_opt.h>
#include <kernel-features.h>
-#define ftell(s) _IO_ftell (s)
-
static int LogType = SOCK_DGRAM; /* type of socket connection */
static int LogFile = -1; /* fd for log */
static int connected; /* have done connect */
@@ -32,7 +32,7 @@
#include <exit-thread.h>
#include <default-sched.h>
#include <futex-internal.h>
-#include "libioP.h"
+#include <libio/libioP.h>
#include <shlib-compat.h>
@@ -31,15 +31,11 @@
#ifdef _LIBC
/* When used as part of glibc, error printing must be done differently
for standards compliance. getopt is not a cancellation point, so
- it must not call functions that are, and it is specified by an
- older standard than stdio locking, so it must not refer to
- functions in the "user namespace" related to stdio locking.
- Finally, it must use glibc's internal message translation so that
- the messages are looked up in the proper text domain. */
+ it must not call functions that are, and it must use glibc's
+ internal message translation so that the messages are looked up in
+ the proper text domain. */
# include <libintl.h>
# define fprintf __fxprintf_nocancel
-# define flockfile(fp) _IO_flockfile (fp)
-# define funlockfile(fp) _IO_funlockfile (fp)
#else
# include "gettext.h"
# define _(msgid) gettext (msgid)
@@ -20,9 +20,6 @@
#include <stdio.h>
#include <pwd.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
-
/* Define a line parsing function using the common code
used in the nss_files module. */
@@ -313,7 +313,7 @@ res_vinit_1 (FILE *fp, struct resolv_conf_parser *parser)
ssize_t ret = __getline (&parser->buffer, &buffer_size, fp);
if (ret <= 0)
{
- if (_IO_ferror_unlocked (fp))
+ if (ferror_unlocked (fp))
return false;
else
break;
@@ -20,9 +20,6 @@
#include <shadow.h>
#include <stdio.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
-
/* Define a line parsing function using the common code
used in the nss_files module. */
@@ -20,9 +20,6 @@
#include <stdio.h>
#include <shadow.h>
-#define flockfile(s) _IO_flockfile (s)
-#define funlockfile(s) _IO_funlockfile (s)
-
#define _S(x) x ? x : ""
@@ -18,8 +18,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
-#define vasprintf(s, f, a) _IO_vasprintf (s, f, a)
#undef __asprintf
/* Write formatted output from FORMAT to a string which is
@@ -32,7 +30,7 @@ ___asprintf (char **string_ptr, const char *format, ...)
int done;
va_start (arg, format);
- done = vasprintf (string_ptr, format, arg);
+ done = __vasprintf (string_ptr, format, arg);
va_end (arg);
return done;
@@ -18,7 +18,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
+#include <libio/libioP.h>
#define vdprintf(d, f, a) _IO_vdprintf (d, f, a)
/* Write formatted output to D, according to the format string FORMAT. */
@@ -17,7 +17,10 @@
<http://www.gnu.org/licenses/>. */
#include <stdio.h>
+#include <libio/libioP.h>
+#undef flockfile
+#undef __flockfile
#undef _IO_flockfile
void
@@ -25,5 +28,7 @@ __flockfile (FILE *stream)
{
/* Do nothing. Using this version does not do any locking. */
}
-weak_alias (__flockfile, flockfile);
-weak_alias (__flockfile, _IO_flockfile)
+strong_alias (__flockfile, _IO_flockfile)
+weak_alias (__flockfile, flockfile)
+libc_hidden_def (__flockfile)
+libc_hidden_def (_IO_flockfile)
@@ -17,7 +17,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
/* Write formatted output to STREAM from the format string FORMAT. */
@@ -15,7 +15,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
@@ -17,7 +17,10 @@
<http://www.gnu.org/licenses/>. */
#include <stdio.h>
+#include <libio/libioP.h>
+#undef ftrylockfile
+#undef __ftrylockfile
#undef _IO_ftrylockfile
int
@@ -26,5 +29,7 @@ __ftrylockfile (FILE *stream)
/* Do nothing. Using this version does not do any locking. */
return 1;
}
-weak_alias (__ftrylockfile, ftrylockfile);
-weak_alias (__ftrylockfile, _IO_ftrylockfile)
+strong_alias (__ftrylockfile, _IO_ftrylockfile)
+weak_alias (__ftrylockfile, ftrylockfile)
+libc_hidden_def (__ftrylockfile)
+libc_hidden_def (_IO_ftrylockfile)
@@ -17,7 +17,10 @@
<http://www.gnu.org/licenses/>. */
#include <stdio.h>
+#include <libio/libioP.h>
+#undef funlockfile
+#undef __funlockfile
#undef _IO_funlockfile
void
@@ -25,5 +28,7 @@ __funlockfile (FILE *stream)
{
/* Do nothing. Using this version does not do any locking. */
}
-weak_alias (__funlockfile, _IO_funlockfile)
-weak_alias (__funlockfile, funlockfile);
+strong_alias (__funlockfile, _IO_funlockfile)
+weak_alias (__funlockfile, funlockfile)
+libc_hidden_def (__funlockfile)
+libc_hidden_def (_IO_funlockfile)
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
-#include <libioP.h>
+#include <libio/libioP.h>
static int
locked_vfxprintf (FILE *fp, const char *fmt, va_list ap)
@@ -20,11 +20,6 @@
#undef __getline
-#include "../libio/libioP.h"
-#undef ssize_t
-#define ssize_t _IO_ssize_t
-#define __getdelim _IO_getdelim
-
/* Like getdelim, but always looks for a newline. */
ssize_t
__getline (char **lineptr, size_t *n, FILE *stream)
@@ -17,9 +17,6 @@
#include <stdio.h>
-#include <libio/iolibio.h>
-#define fread(p, m, n, s) _IO_fread (p, m, n, s)
-
/* Read a word (int) from STREAM. */
int
getw (FILE *stream)
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
+#include <libio/libioP.h>
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
@@ -17,7 +17,7 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
+#include <libio/libioP.h>
/* Read formatted input from stdin according to the format string FORMAT. */
@@ -17,7 +17,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
/* Read formatted input from S, according to the format string FORMAT. */
/* VARARGS2 */
@@ -15,8 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdio.h>
+#include <libio/libioP.h>
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
@@ -15,8 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdio.h>
+#include <libio/libioP.h>
/* Read formatted input from STDIN according to the format string FORMAT. */
/* VARARGS2 */
@@ -24,9 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <stdio.h>
-#include "../libio/strfile.h"
+#include <libio/strfile.h>
int
__isoc99_vsscanf (const char *string, const char *format, _IO_va_list args)
@@ -20,7 +20,8 @@
#include <string.h>
#include <unistd.h>
#include <wchar.h>
-#include "libioP.h"
+
+#include <libio/libioP.h>
static void
perror_internal (FILE *fp, const char *s, int errnum)
@@ -15,7 +15,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
@@ -22,7 +22,7 @@
#define HAVE_ALLOCA 1
#include <array_length.h>
-#include <libioP.h>
+#include <libio/libioP.h>
#include <alloca.h>
#include <ctype.h>
#include <float.h>
@@ -45,7 +45,7 @@
/* This defines make it possible to use the same code for GNU C library and
the GNU I/O library. */
-#include <libioP.h>
+#include <libio/libioP.h>
#define PUT(f, s, n) _IO_sputn (f, s, n)
#define PAD(f, c, n) (wide ? _IO_wpadn (f, c, n) : _IO_padn (f, c, n))
/* We use this file GNU C library and GNU I/O library. So make
@@ -22,7 +22,7 @@
#include <ieee754.h>
#include <math.h>
#include <printf.h>
-#include <libioP.h>
+#include <libio/libioP.h>
/* This defines make it possible to use the same code for GNU C library and
@@ -16,8 +16,6 @@
<http://www.gnu.org/licenses/>. */
#include <stdio.h>
-#include <libio/iolibio.h>
-#define fwrite(p, n, m, s) _IO_fwrite (p, n, m, s)
/* Write the word (int) W to STREAM. */
int
@@ -18,8 +18,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
-
/* Read formatted input from stdin according to the format string FORMAT. */
/* VARARGS1 */
@@ -30,7 +28,7 @@ __scanf (const char *format, ...)
int done;
va_start (arg, format);
- done = _IO_vfscanf (stdin, format, arg, NULL);
+ done = __vfscanf (stdin, format, arg);
va_end (arg);
return done;
@@ -17,8 +17,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
-#define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
/* Write formatted output into S, according to the format
string FORMAT, writing no more than MAXLEN characters. */
@@ -17,8 +17,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
-#define vsprintf(s, f, a) _IO_vsprintf (s, f, a)
/* Write formatted output into S, according to the format string FORMAT. */
/* VARARGS2 */
@@ -17,8 +17,6 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
-#define __vsscanf(s, f, a) _IO_vsscanf (s, f, a)
/* Read formatted input from S, according to the format string FORMAT. */
/* VARARGS2 */
@@ -20,8 +20,6 @@
#include <stdio.h>
#include <unistd.h>
-#include <iolibio.h>
-#define __fdopen _IO_fdopen
#ifndef tmpfile
# define tmpfile __new_tmpfile
#endif
@@ -60,7 +58,7 @@ tmpfile (void)
(void) __unlink (buf);
}
- if ((f = __fdopen (fd, "w+b")) == NULL)
+ if ((f = fdopen (fd, "w+b")) == NULL)
__close (fd);
return f;
@@ -16,8 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <stdio.h>
-#undef ssize_t
-#define ssize_t _IO_ssize_t
+#include <sys/types.h>
int
main (int argc, char *argv[])
@@ -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 <libio/libioP.h>
-#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. */
@@ -71,7 +71,7 @@
#define MALLOC (GNU_MALLOC | POSIX_MALLOC)
#include <locale/localeinfo.h>
-#include <libioP.h>
+#include <libio/libioP.h>
#undef va_list
#define va_list _IO_va_list
@@ -18,7 +18,6 @@
#include <stdarg.h>
#undef __OPTIMIZE__ /* Avoid inline `vprintf' function. */
#include <stdio.h>
-#include <libioP.h>
#undef vprintf
@@ -22,13 +22,12 @@
#include <langinfo.h>
#include <locale.h>
#include <monetary.h>
-#include "../libio/libioP.h"
-#include "../libio/strfile.h"
#include <printf.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
-#include "../locale/localeinfo.h"
+#include <libio/strfile.h>
+#include <locale/localeinfo.h>
#define out_char(Ch) \
@@ -22,10 +22,9 @@
code duplication. */
#include <ctype.h>
-#include "../libio/libioP.h"
-#include "../libio/strfile.h"
-#include <printf.h>
#include <string.h>
+#include <printf.h>
+#include <libio/strfile.h>
#include <locale/localeinfo.h>
#define UCHAR_T char
@@ -35,7 +35,6 @@
#include <libintl.h>
#include <rpc/rpc.h>
#include <wchar.h>
-#include <libio/iolibio.h>
#include <shlib-compat.h>
static char *auth_errmsg (enum auth_stat stat);
@@ -41,10 +41,6 @@
#include <rpc/rpc.h>
#include <rpc/clnt.h>
-#include <libio/iolibio.h>
-#define fflush(s) _IO_fflush (s)
-#define __fdopen(fd,m) _IO_fdopen (fd,m)
-
/*
* returns pid, or -1 for failure
*/
@@ -85,9 +81,9 @@ _openchild (const char *command, FILE ** fto, FILE ** ffrom)
/*
* parent: write into pdto[1], read from pdfrom[0]
*/
- *fto = __fdopen (pdto[1], "w");
+ *fto = fdopen (pdto[1], "w");
__close (pdto[0]);
- *ffrom = __fdopen (pdfrom[0], "r");
+ *ffrom = fdopen (pdfrom[0], "r");
__close (pdfrom[1]);
break;
}
@@ -40,9 +40,7 @@
#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
#include <netdb.h>
-
#include <wchar.h>
-#include <libio/iolibio.h>
#include <shlib-compat.h>
struct proglst_
@@ -61,9 +61,7 @@
#include <sys/poll.h>
#include <errno.h>
#include <stdlib.h>
-
#include <wchar.h>
-#include <libio/iolibio.h>
#include <shlib-compat.h>
/*
@@ -63,7 +63,6 @@
#endif
#include <wchar.h>
-#include <libio/iolibio.h>
#include <shlib-compat.h>
#define rpc_buffer(xprt) ((xprt)->xp_p1)
@@ -49,7 +49,6 @@
#include <rpc/rpc.h>
#include <libintl.h>
#include <wchar.h>
-#include <libio/iolibio.h>
#include <shlib-compat.h>
static bool_t xdrrec_getlong (XDR *, long *);
@@ -40,7 +40,6 @@
#include <rpc/xdr.h>
#include <libintl.h>
#include <wchar.h>
-#include <libio/iolibio.h>
#include <shlib-compat.h>
#define LASTUNSIGNED ((u_int)0-1)
@@ -39,14 +39,8 @@
#include <stdio.h>
#include <rpc/xdr.h>
-#include <libio/iolibio.h>
#include <shlib-compat.h>
-#define fflush(s) _IO_fflush (s)
-#define fread(p, m, n, s) _IO_fread (p, m, n, s)
-#define ftell(s) _IO_ftell (s)
-#define fwrite(p, m, n, s) _IO_fwrite (p, m, n, s)
-
static bool_t xdrstdio_getlong (XDR *, long *);
static bool_t xdrstdio_putlong (XDR *, const long *);
static bool_t xdrstdio_getbytes (XDR *, caddr_t, u_int);
@@ -27,6 +27,7 @@
#include <stddef.h>
#include <string.h>
#include <stdint.h>
+#include <unistd.h>
#include <elf.h>
#include <dlfcn.h>
@@ -9,6 +9,7 @@
#define LONG_DOUBLE_COMPAT(lib, introduced) 0
#define long_double_symbol(lib, local, symbol)
#define ldbl_hidden_def(local, name) libc_hidden_def (name)
+#define ldbl_hidden_weak(local, name) libc_hidden_weak (name)
#define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
#define ldbl_weak_alias(name, aliasname) weak_alias (name, aliasname)
#define __ldbl_is_dbl 0
@@ -12,6 +12,7 @@
long_double_symbol_1 (lib, local, symbol, LONG_DOUBLE_COMPAT_VERSION)
#ifdef SHARED
# define ldbl_hidden_def(local, name) libc_hidden_ver (local, name)
+# define ldbl_hidden_weak(local, name) libc_hidden_weak_ver (local, name)
# define ldbl_strong_alias(name, aliasname) \
strong_alias (name, __GL_##name##_##aliasname) \
long_double_symbol (libc, __GL_##name##_##aliasname, aliasname);
@@ -22,6 +23,7 @@
versioned_symbol (lib, local, symbol, version)
#else
# define ldbl_hidden_def(local, name) libc_hidden_def (name)
+# define ldbl_hidden_weak(local, name) libc_hidden_weak (name)
# define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
# define ldbl_weak_alias(name, aliasname) weak_alias (name, aliasname)
# ifndef __ASSEMBLER__
@@ -19,13 +19,13 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
#include <wchar.h>
#include <printf.h>
#include <monetary.h>
#include <locale/localeinfo.h>
#include <sys/syslog.h>
#include <libc-lock.h>
+#include <libio/libioP.h>
#include "nldbl-compat.h"
@@ -36,7 +36,6 @@
/* Declare the __nldbl_NAME function the wrappers call that's in libc.so. */
#define NLDBL_DECL(name) extern __typeof (name) __nldbl_##name
-NLDBL_DECL (_IO_vfscanf);
NLDBL_DECL (vfscanf);
NLDBL_DECL (vfwscanf);
NLDBL_DECL (obstack_vprintf);
@@ -82,23 +81,25 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)
/* These don't use __typeof because they were not declared by the headers,
since we don't compile with _FORTIFY_SOURCE. */
extern int __nldbl___vfprintf_chk (FILE *__restrict, int,
- const char *__restrict, _G_va_list);
+ const char *__restrict, va_list);
extern int __nldbl___vfwprintf_chk (FILE *__restrict, int,
- const wchar_t *__restrict, __gnuc_va_list);
+ const wchar_t *__restrict, va_list);
extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t,
- const char *__restrict, _G_va_list) __THROW;
+ const char *__restrict, va_list) __THROW;
extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t,
- const char *__restrict, _G_va_list)
+ const char *__restrict, va_list)
__THROW;
extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t,
- const wchar_t *__restrict, __gnuc_va_list)
+ const wchar_t *__restrict, va_list)
__THROW;
-extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list)
+extern int __nldbl___vasprintf_chk (char **, int, const char *, va_list)
__THROW;
-extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list);
+extern int __nldbl___vdprintf_chk (int, int, const char *, va_list);
extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *,
- _G_va_list) __THROW;
+ va_list) __THROW;
extern void __nldbl___vsyslog_chk (int, int, const char *, va_list);
+/* This function is not declared by stdio.h anymore. */
+extern int __nldbl__IO_vfscanf (FILE *, const char *, va_list, int *);
#endif /* __NLDBL_COMPAT_H */
@@ -2,7 +2,7 @@
int
attribute_hidden
-_IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap, int *errp)
+_IO_vfscanf (FILE *s, const char *fmt, __gnuc_va_list ap, int *errp)
{
return __nldbl__IO_vfscanf (s, fmt, ap, errp);
}
@@ -22,7 +22,6 @@
#include <hurd/fd.h>
#include <fcntl.h>
#include <unistd.h>
-#include <iolibio.h>
/* This returns a new stream opened on a temporary file (generated
by tmpnam). The file is opened with mode "w+b" (binary read/write).
@@ -18,8 +18,11 @@
#include <pthread.h>
#include <stdio.h>
-#include <stdio-lock.h>
+#include <libio/libioP.h>
+#undef flockfile
+#undef __flockfile
+#undef _IO_flockfile
void
__flockfile (FILE *stream)
@@ -29,3 +32,5 @@ __flockfile (FILE *stream)
}
strong_alias (__flockfile, _IO_flockfile)
weak_alias (__flockfile, flockfile)
+libc_hidden_def (__flockfile)
+libc_hidden_def (_IO_flockfile)
@@ -16,11 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
#include <pthread.h>
#include <stdio.h>
-#include <stdio-lock.h>
+#include <libio/libioP.h>
+#undef ftrylockfile
+#undef __ftrylockfile
+#undef _IO_ftrylockfile
int
__ftrylockfile (FILE *stream)
@@ -29,3 +31,5 @@ __ftrylockfile (FILE *stream)
}
strong_alias (__ftrylockfile, _IO_ftrylockfile)
weak_alias (__ftrylockfile, ftrylockfile)
+libc_hidden_def (__ftrylockfile)
+libc_hidden_def (_IO_ftrylockfile)
@@ -18,8 +18,11 @@
#include <pthread.h>
#include <stdio.h>
-#include <stdio-lock.h>
+#include <libio/libioP.h>
+#undef funlockfile
+#undef __funlockfile
+#undef _IO_funlockfile
void
__funlockfile (FILE *stream)
@@ -28,3 +31,5 @@ __funlockfile (FILE *stream)
}
strong_alias (__funlockfile, _IO_funlockfile)
weak_alias (__funlockfile, funlockfile)
+libc_hidden_def (__funlockfile)
+libc_hidden_def (_IO_funlockfile)
@@ -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
@@ -7,7 +7,6 @@ libc.so: malloc
libc.so: memalign
libc.so: realloc
libc.so: __sigsetjmp
-libc.so: _IO_funlockfile
libc.so: sigprocmask
libc.so: __errno_location
libm.so: matherr
@@ -21,7 +21,6 @@
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
-#include "libio/libioP.h"
/* Return 1 if the whole area PTR .. PTR+SIZE is not writable.
Return -1 if it is writable. */
@@ -55,7 +54,7 @@ __readonly_area (const char *ptr, size_t size)
while (! feof_unlocked (fp))
{
- if (_IO_getdelim (&line, &linelen, '\n', fp) <= 0)
+ if (__getdelim (&line, &linelen, '\n', fp) <= 0)
break;
char *p;
@@ -15,10 +15,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
+#include <libio/libioP.h>
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
@@ -17,8 +17,8 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
#include <wchar.h>
+#include <libio/libioP.h>
/* Read formatted input from S, according to the format string FORMAT. */
/* VARARGS2 */
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdio.h>
#include <wchar.h>
+#include <libio/libioP.h>
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
@@ -24,9 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
-#include <libioP.h>
#include <wchar.h>
-#include "../libio/strfile.h"
+#include <libio/strfile.h>
int
__isoc99_vswscanf (const wchar_t *string, const wchar_t *format,
@@ -15,9 +15,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <libioP.h>
#include <stdio.h>
#include <wchar.h>
+#include <libio/libioP.h>
/* Read formatted input from STDIN according to the format string FORMAT. */
/* VARARGS2 */
@@ -17,8 +17,8 @@
#include <stdarg.h>
#include <stdio.h>
-#include <libioP.h>
#include <wchar.h>
+#include <libio/libioP.h>
/* Read formatted input from stdin according to the format string FORMAT. */