2018-02-21 Zack Weinberg <zackw@panix.com>
+ * libio/libio.h (_IO_FILE): Delete; all uses changed to FILE.
+ (_IO_fpos_t): Delete; all uses changed to __fpos_t.
+ (_IO_fpos64_t): Delete; all uses changed to __fpos64_t.
+ (_IO_size_t): Delete; all uses changed to size_t.
+ (_IO_ssize_t): Delete; all uses changed to ssize_t or __ssize_t.
+ (_IO_off_t): Delete; all uses changed to off_t.
+ (_IO_off64_t): Delete; all uses changed to off64_t.
+ (_IO_pid_t): Delete; all uses changed to pid_t.
+ (_IO_uid_t): Delete; all uses changed to uid_t.
+ (_IO_wint_t): Delete; all uses changed to wint_t.
+ (_IO_va_list): Delete; all uses changed to va_list or __gnuc_va_list.
+ (_IO_BUFSIZ): Delete; all uses changed to BUFSIZ.
+ (_IO_cookie_io_functions_t): Delete; all uses changed to
+ cookie_io_functions_t.
+ (__io_read_fn): Delete; all uses changed to cookie_read_function_t.
+ (__io_write_fn): Delete; all uses changed to cookie_write_function_t.
+ (__io_seek_fn): Delete; all uses changed to cookie_seek_function_t.
+ (__io_close_fn): Delete: all uses changed to cookie_close_function_t.
+
+ * libio/iofopncook.c: Remove unnecessary forward declarations.
+ * libio/iolibio.h: Correct outdated commentary.
+ * malloc/malloc.c (__malloc_stats): Remove unnecessary casts.
+ * stdio-common/fxprintf.c (__fxprintf_nocancel):
+ Remove unnecessary casts.
+ * stdio-common/getline.c: Use _IO_getdelim directly.
+ Don't redefine ssize_t.
+ * stdio-common/printf_fp.c, stdio_common/printf_fphex.c
+ * stdio-common/printf_size.c: Don't redefine size_t or FILE.
+ Remove outdated comments.
+ * stdio-common/vfscanf.c: Don't redefine va_list.
+
* libio/iolibio.h, libio/libioP.h: Remove extern "C".
* libio/libio.h: Remove __BEGIN_DECLS and __END_DECLS.
Remove preprocessor conditionals on _LIBC and __USE_GNU,
#include <sys/param.h>
char *
-__fgets_chk (char *buf, size_t size, int n, _IO_FILE *fp)
+__fgets_chk (char *buf, size_t size, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
char *result;
CHECK_FILE (fp, NULL);
if (n <= 0)
#include <sys/param.h>
char *
-__fgets_unlocked_chk (char *buf, size_t size, int n, _IO_FILE *fp)
+__fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
char *result;
CHECK_FILE (fp, NULL);
if (n <= 0)
#include <sys/param.h>
wchar_t *
-__fgetws_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
+__fgetws_chk (wchar_t *buf, size_t size, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
wchar_t *result;
int old_error;
CHECK_FILE (fp, NULL);
#include <sys/param.h>
wchar_t *
-__fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
+__fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
wchar_t *result;
int old_error;
CHECK_FILE (fp, NULL);
char *
__gets_chk (char *buf, size_t size)
{
- _IO_size_t count;
+ size_t count;
int ch;
char *retval;
{
/* Initial size of the buffer to be used. Will be doubled each time an
overflow occurs. */
- const _IO_size_t init_string_size = 100;
+ const size_t init_string_size = 100;
char *string;
_IO_strfile sf;
int ret;
- _IO_size_t needed;
- _IO_size_t allocated;
+ size_t needed;
+ size_t allocated;
/* No need to clear the memory here (unlike for open_memstream) since
we know we will never seek on the stream. */
string = (char *) malloc (init_string_size);
#include "../libio/strfile.h"
-static int _IO_str_chk_overflow (_IO_FILE *fp, int c) __THROW;
+static int _IO_str_chk_overflow (FILE *fp, int c) __THROW;
static int
-_IO_str_chk_overflow (_IO_FILE *fp, int c)
+_IO_str_chk_overflow (FILE *fp, int c)
{
/* When we come to here this means the user supplied buffer is
filled. */
sf.f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
_IO_wstr_init_static (&sf.f._sbf._f, s, maxlen - 1, s);
- ret = _IO_vfwprintf ((_IO_FILE *) &sf.f._sbf, format, args);
+ ret = _IO_vfwprintf ((FILE *) &sf.f._sbf, format, args);
if (sf.f._sbf._f._wide_data->_IO_buf_base == sf.overflow_buf)
/* ISO C99 requires swprintf/vswprintf to return an error if the
Returns zero if successful, nonzero if not. */
static int
seekio (void *cookie,
- _IO_off64_t *pos,
+ off64_t *pos,
int whence)
{
error_t err = __io_seek ((file_t) cookie, *pos, whence, pos);
extern int __vscanf (const char *__restrict __format,
__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 int __vsscanf (const char *__restrict __s,
const char *__restrict __format,
__gnuc_va_list __arg)
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)
/* The compiler may optimize calls to fprintf into calls to fputs.
Use libc_hidden_proto to ensure that those calls, not redirected by
the fputs macro, also do not go through the PLT. */
libc_hidden_proto (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
#include "stdio.h"
int
-_IO_feof (_IO_FILE *fp)
+_IO_feof (FILE *fp)
{
int result;
CHECK_FILE (fp, EOF);
#undef feof_unlocked
int
-__feof_unlocked (_IO_FILE *fp)
+__feof_unlocked (FILE *fp)
{
CHECK_FILE (fp, EOF);
return _IO_feof_unlocked (fp);
#include "stdio.h"
int
-_IO_ferror (_IO_FILE *fp)
+_IO_ferror (FILE *fp)
{
int result;
CHECK_FILE (fp, EOF);
#undef ferror_unlocked
int
-__ferror_unlocked (_IO_FILE *fp)
+__ferror_unlocked (FILE *fp)
{
CHECK_FILE (fp, EOF);
return _IO_ferror_unlocked (fp);
/* Allocate a file buffer, or switch to unbuffered I/O. Streams for
TTY devices default to line buffered. */
int
-_IO_file_doallocate (_IO_FILE *fp)
+_IO_file_doallocate (FILE *fp)
{
- _IO_size_t size;
+ size_t size;
char *p;
struct stat64 st;
- size = _IO_BUFSIZ;
+ size = BUFSIZ;
if (fp->_fileno >= 0 && __builtin_expect (_IO_SYSSTAT (fp, &st), 0) >= 0)
{
if (S_ISCHR (st.st_mode))
fp->_flags |= _IO_LINE_BUF;
}
#if defined _STATBUF_ST_BLKSIZE
- if (st.st_blksize > 0 && st.st_blksize < _IO_BUFSIZ)
+ if (st.st_blksize > 0 && st.st_blksize < BUFSIZ)
size = st.st_blksize;
#endif
}
#include <stdio.h>
int
-__fileno (_IO_FILE *fp)
+__fileno (FILE *fp)
{
CHECK_FILE (fp, EOF);
}
int
-_IO_new_file_close_it (_IO_FILE *fp)
+_IO_new_file_close_it (FILE *fp)
{
int write_status;
if (!_IO_file_is_open (fp))
libc_hidden_ver (_IO_new_file_close_it, _IO_file_close_it)
void
-_IO_new_file_finish (_IO_FILE *fp, int dummy)
+_IO_new_file_finish (FILE *fp, int dummy)
{
if (_IO_file_is_open (fp))
{
}
libc_hidden_ver (_IO_new_file_finish, _IO_file_finish)
-_IO_FILE *
-_IO_file_open (_IO_FILE *fp, const char *filename, int posix_mode, int prot,
+FILE *
+_IO_file_open (FILE *fp, const char *filename, int posix_mode, int prot,
int read_write, int is32not64)
{
int fdesc;
if ((read_write & (_IO_IS_APPENDING | _IO_NO_READS))
== (_IO_IS_APPENDING | _IO_NO_READS))
{
- _IO_off64_t new_pos = _IO_SYSSEEK (fp, 0, _IO_seek_end);
+ off64_t new_pos = _IO_SYSSEEK (fp, 0, _IO_seek_end);
if (new_pos == _IO_pos_BAD && errno != ESPIPE)
{
__close_nocancel (fdesc);
}
libc_hidden_def (_IO_file_open)
-_IO_FILE *
-_IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
+FILE *
+_IO_new_file_fopen (FILE *fp, const char *filename, const char *mode,
int is32not64)
{
int oflags = 0, omode;
int read_write;
int oprot = 0666;
int i;
- _IO_FILE *result;
+ FILE *result;
const char *cs;
const char *last_recognized;
}
libc_hidden_ver (_IO_new_file_fopen, _IO_file_fopen)
-_IO_FILE *
-_IO_new_file_attach (_IO_FILE *fp, int fd)
+FILE *
+_IO_new_file_attach (FILE *fp, int fd)
{
if (_IO_file_is_open (fp))
return NULL;
/* We have to do that since that may be junk. */
fp->_offset = _IO_pos_BAD;
int save_errno = errno;
- if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
+ if (_IO_SEEKOFF (fp, (off64_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
== _IO_pos_BAD && errno != ESPIPE)
return NULL;
__set_errno (save_errno);
}
libc_hidden_ver (_IO_new_file_attach, _IO_file_attach)
-_IO_FILE *
-_IO_new_file_setbuf (_IO_FILE *fp, char *p, _IO_ssize_t len)
+FILE *
+_IO_new_file_setbuf (FILE *fp, char *p, ssize_t len)
{
if (_IO_default_setbuf (fp, p, len) == NULL)
return NULL;
libc_hidden_ver (_IO_new_file_setbuf, _IO_file_setbuf)
-_IO_FILE *
-_IO_file_setbuf_mmap (_IO_FILE *fp, char *p, _IO_ssize_t len)
+FILE *
+_IO_file_setbuf_mmap (FILE *fp, char *p, ssize_t len)
{
- _IO_FILE *result;
+ FILE *result;
/* Change the function table. */
_IO_JUMPS_FILE_plus (fp) = &_IO_file_jumps;
return result;
}
-static _IO_size_t new_do_write (_IO_FILE *, const char *, _IO_size_t);
+static size_t new_do_write (FILE *, const char *, size_t);
/* Write TO_DO bytes from DATA to FP.
Then mark FP as having empty buffers. */
int
-_IO_new_do_write (_IO_FILE *fp, const char *data, _IO_size_t to_do)
+_IO_new_do_write (FILE *fp, const char *data, size_t to_do)
{
return (to_do == 0
- || (_IO_size_t) new_do_write (fp, data, to_do) == to_do) ? 0 : EOF;
+ || (size_t) new_do_write (fp, data, to_do) == to_do) ? 0 : EOF;
}
libc_hidden_ver (_IO_new_do_write, _IO_do_write)
-static
-_IO_size_t
-new_do_write (_IO_FILE *fp, const char *data, _IO_size_t to_do)
+static size_t
+new_do_write (FILE *fp, const char *data, size_t to_do)
{
- _IO_size_t count;
+ size_t count;
if (fp->_flags & _IO_IS_APPENDING)
/* On a system without a proper O_APPEND implementation,
you would need to sys_seek(0, SEEK_END) here, but is
fp->_offset = _IO_pos_BAD;
else if (fp->_IO_read_end != fp->_IO_write_base)
{
- _IO_off64_t new_pos
+ off64_t new_pos
= _IO_SYSSEEK (fp, fp->_IO_write_base - fp->_IO_read_end, 1);
if (new_pos == _IO_pos_BAD)
return 0;
}
int
-_IO_new_file_underflow (_IO_FILE *fp)
+_IO_new_file_underflow (FILE *fp)
{
- _IO_ssize_t count;
+ ssize_t count;
#if 0
/* SysV does not make this test; take it out for compatibility */
if (fp->_flags & _IO_EOF_SEEN)
If the file is no longer eligible for mmap, its jump tables are reset to
the vanilla ones and we return nonzero. */
static int
-mmap_remap_check (_IO_FILE *fp)
+mmap_remap_check (FILE *fp)
{
struct stat64 st;
/* Special callback replacing the underflow callbacks if we mmap the file. */
int
-_IO_file_underflow_mmap (_IO_FILE *fp)
+_IO_file_underflow_mmap (FILE *fp)
{
if (fp->_IO_read_ptr < fp->_IO_read_end)
return *(unsigned char *) fp->_IO_read_ptr;
}
static void
-decide_maybe_mmap (_IO_FILE *fp)
+decide_maybe_mmap (FILE *fp)
{
/* We use the file in read-only mode. This could mean we can
mmap the file and use it without any copying. But not all
}
int
-_IO_file_underflow_maybe_mmap (_IO_FILE *fp)
+_IO_file_underflow_maybe_mmap (FILE *fp)
{
/* This is the first read attempt. Choose mmap or vanilla operations
and then punt to the chosen underflow routine. */
int
-_IO_new_file_overflow (_IO_FILE *f, int ch)
+_IO_new_file_overflow (FILE *f, int ch)
{
if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
{
libc_hidden_ver (_IO_new_file_overflow, _IO_file_overflow)
int
-_IO_new_file_sync (_IO_FILE *fp)
+_IO_new_file_sync (FILE *fp)
{
- _IO_ssize_t delta;
+ ssize_t delta;
int retval = 0;
/* char* ptr = cur_ptr(); */
if (_IO_in_backup (fp))
delta -= eGptr () - Gbase ();
#endif
- _IO_off64_t new_pos = _IO_SYSSEEK (fp, delta, 1);
- if (new_pos != (_IO_off64_t) EOF)
+ off64_t new_pos = _IO_SYSSEEK (fp, delta, 1);
+ if (new_pos != (off64_t) EOF)
fp->_IO_read_end = fp->_IO_read_ptr;
else if (errno == ESPIPE)
; /* Ignore error from unseekable devices. */
libc_hidden_ver (_IO_new_file_sync, _IO_file_sync)
static int
-_IO_file_sync_mmap (_IO_FILE *fp)
+_IO_file_sync_mmap (FILE *fp)
{
if (fp->_IO_read_ptr != fp->_IO_read_end)
{
/* ftell{,o} implementation. The only time we modify the state of the stream
is when we have unflushed writes. In that case we seek to the end and
record that offset in the stream object. */
-static _IO_off64_t
-do_ftell (_IO_FILE *fp)
+static off64_t
+do_ftell (FILE *fp)
{
- _IO_off64_t result, offset = 0;
+ off64_t result, offset = 0;
/* No point looking at unflushed data if we haven't allocated buffers
yet. */
return result;
}
-_IO_off64_t
-_IO_new_file_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_new_file_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
- _IO_off64_t result;
- _IO_off64_t delta, new_offset;
+ off64_t result;
+ off64_t delta, new_offset;
long count;
/* Short-circuit into a separate function. We don't want to mix any
if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
&& !_IO_in_backup (fp))
{
- _IO_off64_t start_offset = (fp->_offset
- - (fp->_IO_read_end - fp->_IO_buf_base));
+ off64_t start_offset = (fp->_offset
+ - (fp->_IO_read_end - fp->_IO_buf_base));
if (offset >= start_offset && offset < fp->_offset)
{
_IO_setg (fp, fp->_IO_buf_base,
}
libc_hidden_ver (_IO_new_file_seekoff, _IO_file_seekoff)
-_IO_off64_t
-_IO_file_seekoff_mmap (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_file_seekoff_mmap (FILE *fp, off64_t offset, int dir, int mode)
{
- _IO_off64_t result;
+ off64_t result;
/* If we are only interested in the current position, calculate it and
return right now. This calculation does the right thing when we are
return offset;
}
-static _IO_off64_t
-_IO_file_seekoff_maybe_mmap (_IO_FILE *fp, _IO_off64_t offset, int dir,
+static off64_t
+_IO_file_seekoff_maybe_mmap (FILE *fp, off64_t offset, int dir,
int mode)
{
/* We only get here when we haven't tried to read anything yet.
So there is nothing more useful for us to do here than just
the underlying lseek call. */
- _IO_off64_t result = _IO_SYSSEEK (fp, offset, dir);
+ off64_t result = _IO_SYSSEEK (fp, offset, dir);
if (result < 0)
return EOF;
return result;
}
-_IO_ssize_t
-_IO_file_read (_IO_FILE *fp, void *buf, _IO_ssize_t size)
+ssize_t
+_IO_file_read (FILE *fp, void *buf, ssize_t size)
{
return (__builtin_expect (fp->_flags2 & _IO_FLAGS2_NOTCANCEL, 0)
? __read_nocancel (fp->_fileno, buf, size)
}
libc_hidden_def (_IO_file_read)
-_IO_off64_t
-_IO_file_seek (_IO_FILE *fp, _IO_off64_t offset, int dir)
+off64_t
+_IO_file_seek (FILE *fp, off64_t offset, int dir)
{
return __lseek64 (fp->_fileno, offset, dir);
}
libc_hidden_def (_IO_file_seek)
int
-_IO_file_stat (_IO_FILE *fp, void *st)
+_IO_file_stat (FILE *fp, void *st)
{
return __fxstat64 (_STAT_VER, fp->_fileno, (struct stat64 *) st);
}
libc_hidden_def (_IO_file_stat)
int
-_IO_file_close_mmap (_IO_FILE *fp)
+_IO_file_close_mmap (FILE *fp)
{
/* In addition to closing the file descriptor we have to unmap the file. */
(void) __munmap (fp->_IO_buf_base, fp->_IO_buf_end - fp->_IO_buf_base);
}
int
-_IO_file_close (_IO_FILE *fp)
+_IO_file_close (FILE *fp)
{
/* Cancelling close should be avoided if possible since it leaves an
unrecoverable state behind. */
}
libc_hidden_def (_IO_file_close)
-_IO_ssize_t
-_IO_new_file_write (_IO_FILE *f, const void *data, _IO_ssize_t n)
+ssize_t
+_IO_new_file_write (FILE *f, const void *data, ssize_t n)
{
- _IO_ssize_t to_do = n;
+ ssize_t to_do = n;
while (to_do > 0)
{
- _IO_ssize_t count = (__builtin_expect (f->_flags2
- & _IO_FLAGS2_NOTCANCEL, 0)
+ ssize_t count = (__builtin_expect (f->_flags2
+ & _IO_FLAGS2_NOTCANCEL, 0)
? __write_nocancel (f->_fileno, data, to_do)
: __write (f->_fileno, data, to_do));
if (count < 0)
return n;
}
-_IO_size_t
-_IO_new_file_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
+size_t
+_IO_new_file_xsputn (FILE *f, const void *data, size_t n)
{
const char *s = (const char *) data;
- _IO_size_t to_do = n;
+ size_t to_do = n;
int must_flush = 0;
- _IO_size_t count = 0;
+ size_t count = 0;
if (n <= 0)
return 0;
}
if (to_do + must_flush > 0)
{
- _IO_size_t block_size, do_write;
+ size_t block_size, do_write;
/* Next flush the (full) buffer. */
if (_IO_OVERFLOW (f, EOF) == EOF)
/* If nothing else has to be written we must not signal the
}
libc_hidden_ver (_IO_new_file_xsputn, _IO_file_xsputn)
-_IO_size_t
-_IO_file_xsgetn (_IO_FILE *fp, void *data, _IO_size_t n)
+size_t
+_IO_file_xsgetn (FILE *fp, void *data, size_t n)
{
- _IO_size_t want, have;
- _IO_ssize_t count;
+ size_t want, have;
+ ssize_t count;
char *s = data;
want = n;
count = want;
if (fp->_IO_buf_base)
{
- _IO_size_t block_size = fp->_IO_buf_end - fp->_IO_buf_base;
+ size_t block_size = fp->_IO_buf_end - fp->_IO_buf_base;
if (block_size >= 128)
count -= want % block_size;
}
}
libc_hidden_def (_IO_file_xsgetn)
-static _IO_size_t
-_IO_file_xsgetn_mmap (_IO_FILE *fp, void *data, _IO_size_t n)
+static size_t
+_IO_file_xsgetn_mmap (FILE *fp, void *data, size_t n)
{
- _IO_size_t have;
+ size_t have;
char *read_ptr = fp->_IO_read_ptr;
char *s = (char *) data;
return s - (char *) data;
}
-static _IO_size_t
-_IO_file_xsgetn_maybe_mmap (_IO_FILE *fp, void *data, _IO_size_t n)
+static size_t
+_IO_file_xsgetn_maybe_mmap (FILE *fp, void *data, size_t n)
{
/* We only get here if this is the first attempt to read something.
Decide which operations to use and then punt to the chosen one. */
int mybuffer; /* allocated my buffer? */
int append; /* buffer open for append? */
size_t size; /* buffer length in bytes. */
- _IO_off64_t pos; /* current position at the buffer. */
+ off64_t pos; /* current position at the buffer. */
size_t maxpos; /* max position in buffer. */
};
fmemopen_write (void *cookie, const char *b, size_t s)
{
fmemopen_cookie_t *c = (fmemopen_cookie_t *) cookie;;
- _IO_off64_t pos = c->append ? c->maxpos : c->pos;
+ off64_t pos = c->append ? c->maxpos : c->pos;
int addnullc = (s == 0 || b[s - 1] != '\0');
if (pos + s > c->size)
static int
-fmemopen_seek (void *cookie, _IO_off64_t *p, int w)
+fmemopen_seek (void *cookie, off64_t *p, int w)
{
- _IO_off64_t np;
+ off64_t np;
fmemopen_cookie_t *c = (fmemopen_cookie_t *) cookie;
switch (w)
#include "stdio.h"
int
-fputc (int c, _IO_FILE *fp)
+fputc (int c, FILE *fp)
{
int result;
CHECK_FILE (fp, EOF);
#undef fputc_unlocked
int
-fputc_unlocked (int c, _IO_FILE *fp)
+fputc_unlocked (int c, FILE *fp)
{
CHECK_FILE (fp, EOF);
return _IO_putc_unlocked (c, fp);
#include <wchar.h>
wint_t
-fputwc (wchar_t wc, _IO_FILE *fp)
+fputwc (wchar_t wc, FILE *fp)
{
wint_t result;
CHECK_FILE (fp, EOF);
#undef fputwc_unlocked
wint_t
-fputwc_unlocked (wchar_t wc, _IO_FILE *fp)
+fputwc_unlocked (wchar_t wc, FILE *fp)
{
CHECK_FILE (fp, WEOF);
if (_IO_fwide (fp, 1) < 0)
#include <stdio.h>
int
-fseek (_IO_FILE *fp, long int offset, int whence)
+fseek (FILE *fp, long int offset, int whence)
{
int result;
CHECK_FILE (fp, -1);
#include "stdio.h"
int
-fseeko (_IO_FILE *fp, off_t offset, int whence)
+fseeko (FILE *fp, off_t offset, int whence)
{
int result;
CHECK_FILE (fp, -1);
#ifndef __OFF_T_MATCHES_OFF64_T
int
-fseeko64 (_IO_FILE *fp, __off64_t offset, int whence)
+fseeko64 (FILE *fp, off64_t offset, int whence)
{
int result;
CHECK_FILE (fp, -1);
off_t
-__ftello (_IO_FILE *fp)
+__ftello (FILE *fp)
{
- _IO_off64_t pos;
+ off64_t pos;
CHECK_FILE (fp, -1L);
_IO_acquire_lock (fp);
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
__set_errno (EIO);
return -1L;
}
- if ((_IO_off64_t) (off_t) pos != pos)
+ if ((off64_t) (off_t) pos != pos)
{
__set_errno (EOVERFLOW);
return -1L;
#ifndef __OFF_T_MATCHES_OFF64_T
off64_t
-ftello64 (_IO_FILE *fp)
+ftello64 (FILE *fp)
{
- _IO_off64_t pos;
+ off64_t pos;
CHECK_FILE (fp, -1L);
_IO_acquire_lock (fp);
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
#include <wchar.h>
int
-fwide (_IO_FILE *fp, int mode)
+fwide (FILE *fp, int mode)
{
int result;
static _IO_lock_t list_all_lock = _IO_lock_initializer;
#endif
-static _IO_FILE *run_fp;
+static FILE *run_fp;
#ifdef _IO_MTSAFE_IO
static void
{
if (fp->file._flags & _IO_LINKED)
{
- struct _IO_FILE **f;
+ FILE **f;
#ifdef _IO_MTSAFE_IO
_IO_cleanup_region_start_noarg (flush_cleanup);
_IO_lock_lock (list_all_lock);
- run_fp = (_IO_FILE *) fp;
- _IO_flockfile ((_IO_FILE *) fp);
+ run_fp = (FILE *) fp;
+ _IO_flockfile ((FILE *) fp);
#endif
if (_IO_list_all == NULL)
;
_IO_list_all = (struct _IO_FILE_plus *) _IO_list_all->file._chain;
else
for (f = &_IO_list_all->file._chain; *f; f = &(*f)->_chain)
- if (*f == (_IO_FILE *) fp)
+ if (*f == (FILE *) fp)
{
*f = fp->file._chain;
break;
}
fp->file._flags &= ~_IO_LINKED;
#ifdef _IO_MTSAFE_IO
- _IO_funlockfile ((_IO_FILE *) fp);
+ _IO_funlockfile ((FILE *) fp);
run_fp = NULL;
_IO_lock_unlock (list_all_lock);
_IO_cleanup_region_end (0);
#ifdef _IO_MTSAFE_IO
_IO_cleanup_region_start_noarg (flush_cleanup);
_IO_lock_lock (list_all_lock);
- run_fp = (_IO_FILE *) fp;
- _IO_flockfile ((_IO_FILE *) fp);
+ run_fp = (FILE *) fp;
+ _IO_flockfile ((FILE *) fp);
#endif
- fp->file._chain = (_IO_FILE *) _IO_list_all;
+ fp->file._chain = (FILE *) _IO_list_all;
_IO_list_all = fp;
#ifdef _IO_MTSAFE_IO
- _IO_funlockfile ((_IO_FILE *) fp);
+ _IO_funlockfile ((FILE *) fp);
run_fp = NULL;
_IO_lock_unlock (list_all_lock);
_IO_cleanup_region_end (0);
/* Return minimum _pos markers
Assumes the current get area is the main get area. */
-_IO_ssize_t _IO_least_marker (_IO_FILE *fp, char *end_p);
+ssize_t _IO_least_marker (FILE *fp, char *end_p);
-_IO_ssize_t
-_IO_least_marker (_IO_FILE *fp, char *end_p)
+ssize_t
+_IO_least_marker (FILE *fp, char *end_p)
{
- _IO_ssize_t least_so_far = end_p - fp->_IO_read_base;
+ ssize_t least_so_far = end_p - fp->_IO_read_base;
struct _IO_marker *mark;
for (mark = fp->_markers; mark != NULL; mark = mark->_next)
if (mark->_pos < least_so_far)
/* Switch current get area from backup buffer to (start of) main get area. */
void
-_IO_switch_to_main_get_area (_IO_FILE *fp)
+_IO_switch_to_main_get_area (FILE *fp)
{
char *tmp;
fp->_flags &= ~_IO_IN_BACKUP;
/* Switch current get area from main get area to (end of) backup area. */
void
-_IO_switch_to_backup_area (_IO_FILE *fp)
+_IO_switch_to_backup_area (FILE *fp)
{
char *tmp;
fp->_flags |= _IO_IN_BACKUP;
}
int
-_IO_switch_to_get_mode (_IO_FILE *fp)
+_IO_switch_to_get_mode (FILE *fp)
{
if (fp->_IO_write_ptr > fp->_IO_write_base)
if (_IO_OVERFLOW (fp, EOF) == EOF)
libc_hidden_def (_IO_switch_to_get_mode)
void
-_IO_free_backup_area (_IO_FILE *fp)
+_IO_free_backup_area (FILE *fp)
{
if (_IO_in_backup (fp))
_IO_switch_to_main_get_area (fp); /* Just in case. */
#if 0
int
-_IO_switch_to_put_mode (_IO_FILE *fp)
+_IO_switch_to_put_mode (FILE *fp)
{
fp->_IO_write_base = fp->_IO_read_ptr;
fp->_IO_write_ptr = fp->_IO_read_ptr;
#endif
int
-__overflow (_IO_FILE *f, int ch)
+__overflow (FILE *f, int ch)
{
/* This is a single-byte stream. */
if (f->_mode == 0)
libc_hidden_def (__overflow)
static int
-save_for_backup (_IO_FILE *fp, char *end_p)
+save_for_backup (FILE *fp, char *end_p)
{
/* Append [_IO_read_base..end_p] to backup area. */
- _IO_ssize_t least_mark = _IO_least_marker (fp, end_p);
+ ssize_t least_mark = _IO_least_marker (fp, end_p);
/* needed_size is how much space we need in the backup area. */
- _IO_size_t needed_size = (end_p - fp->_IO_read_base) - least_mark;
+ size_t needed_size = (end_p - fp->_IO_read_base) - least_mark;
/* FIXME: Dubious arithmetic if pointers are NULL */
- _IO_size_t current_Bsize = fp->_IO_save_end - fp->_IO_save_base;
- _IO_size_t avail; /* Extra space available for future expansion. */
- _IO_ssize_t delta;
+ size_t current_Bsize = fp->_IO_save_end - fp->_IO_save_base;
+ size_t avail; /* Extra space available for future expansion. */
+ ssize_t delta;
struct _IO_marker *mark;
if (needed_size > current_Bsize)
{
}
int
-__underflow (_IO_FILE *fp)
+__underflow (FILE *fp)
{
if (_IO_vtable_offset (fp) == 0 && _IO_fwide (fp, -1) != -1)
return EOF;
libc_hidden_def (__underflow)
int
-__uflow (_IO_FILE *fp)
+__uflow (FILE *fp)
{
if (_IO_vtable_offset (fp) == 0 && _IO_fwide (fp, -1) != -1)
return EOF;
libc_hidden_def (__uflow)
void
-_IO_setb (_IO_FILE *f, char *b, char *eb, int a)
+_IO_setb (FILE *f, char *b, char *eb, int a)
{
if (f->_IO_buf_base && !(f->_flags & _IO_USER_BUF))
free (f->_IO_buf_base);
libc_hidden_def (_IO_setb)
void
-_IO_doallocbuf (_IO_FILE *fp)
+_IO_doallocbuf (FILE *fp)
{
if (fp->_IO_buf_base)
return;
libc_hidden_def (_IO_doallocbuf)
int
-_IO_default_underflow (_IO_FILE *fp)
+_IO_default_underflow (FILE *fp)
{
return EOF;
}
int
-_IO_default_uflow (_IO_FILE *fp)
+_IO_default_uflow (FILE *fp)
{
int ch = _IO_UNDERFLOW (fp);
if (ch == EOF)
}
libc_hidden_def (_IO_default_uflow)
-_IO_size_t
-_IO_default_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
+size_t
+_IO_default_xsputn (FILE *f, const void *data, size_t n)
{
const char *s = (char *) data;
- _IO_size_t more = n;
+ size_t more = n;
if (more <= 0)
return 0;
for (;;)
/* Space available. */
if (f->_IO_write_ptr < f->_IO_write_end)
{
- _IO_size_t count = f->_IO_write_end - f->_IO_write_ptr;
+ size_t count = f->_IO_write_end - f->_IO_write_ptr;
if (count > more)
count = more;
if (count > 20)
else if (count)
{
char *p = f->_IO_write_ptr;
- _IO_ssize_t i;
+ ssize_t i;
for (i = count; --i >= 0; )
*p++ = *s++;
f->_IO_write_ptr = p;
}
libc_hidden_def (_IO_default_xsputn)
-_IO_size_t
-_IO_sgetn (_IO_FILE *fp, void *data, _IO_size_t n)
+size_t
+_IO_sgetn (FILE *fp, void *data, size_t n)
{
/* FIXME handle putback buffer here! */
return _IO_XSGETN (fp, data, n);
}
libc_hidden_def (_IO_sgetn)
-_IO_size_t
-_IO_default_xsgetn (_IO_FILE *fp, void *data, _IO_size_t n)
+size_t
+_IO_default_xsgetn (FILE *fp, void *data, size_t n)
{
- _IO_size_t more = n;
+ size_t more = n;
char *s = (char*) data;
for (;;)
{
/* Data available. */
if (fp->_IO_read_ptr < fp->_IO_read_end)
{
- _IO_size_t count = fp->_IO_read_end - fp->_IO_read_ptr;
+ size_t count = fp->_IO_read_end - fp->_IO_read_ptr;
if (count > more)
count = more;
if (count > 20)
#if 0
/* Seems not to be needed. --drepper */
int
-_IO_sync (_IO_FILE *fp)
+_IO_sync (FILE *fp)
{
return 0;
}
#endif
-_IO_FILE *
-_IO_default_setbuf (_IO_FILE *fp, char *p, _IO_ssize_t len)
+FILE *
+_IO_default_setbuf (FILE *fp, char *p, ssize_t len)
{
if (_IO_SYNC (fp) == EOF)
return NULL;
return fp;
}
-_IO_off64_t
-_IO_default_seekpos (_IO_FILE *fp, _IO_off64_t pos, int mode)
+off64_t
+_IO_default_seekpos (FILE *fp, off64_t pos, int mode)
{
return _IO_SEEKOFF (fp, pos, 0, mode);
}
int
-_IO_default_doallocate (_IO_FILE *fp)
+_IO_default_doallocate (FILE *fp)
{
char *buf;
- buf = malloc(_IO_BUFSIZ);
+ buf = malloc(BUFSIZ);
if (__glibc_unlikely (buf == NULL))
return EOF;
- _IO_setb (fp, buf, buf+_IO_BUFSIZ, 1);
+ _IO_setb (fp, buf, buf+BUFSIZ, 1);
return 1;
}
libc_hidden_def (_IO_default_doallocate)
void
-_IO_init_internal (_IO_FILE *fp, int flags)
+_IO_init_internal (FILE *fp, int flags)
{
_IO_no_init (fp, flags, -1, NULL, NULL);
}
void
-_IO_init (_IO_FILE *fp, int flags)
+_IO_init (FILE *fp, int flags)
{
IO_set_accept_foreign_vtables (&_IO_vtable_check);
_IO_init_internal (fp, flags);
libc_hidden_def (_IO_enable_locks)
void
-_IO_old_init (_IO_FILE *fp, int flags)
+_IO_old_init (FILE *fp, int flags)
{
fp->_flags = _IO_MAGIC|flags;
fp->_flags2 = 0;
}
void
-_IO_no_init (_IO_FILE *fp, int flags, int orientation,
+_IO_no_init (FILE *fp, int flags, int orientation,
struct _IO_wide_data *wd, const struct _IO_jump_t *jmp)
{
_IO_old_init (fp, flags);
}
int
-_IO_default_sync (_IO_FILE *fp)
+_IO_default_sync (FILE *fp)
{
return 0;
}
current implementation, this function can get called twice! */
void
-_IO_default_finish (_IO_FILE *fp, int dummy)
+_IO_default_finish (FILE *fp, int dummy)
{
struct _IO_marker *mark;
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
}
libc_hidden_def (_IO_default_finish)
-_IO_off64_t
-_IO_default_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_default_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
return _IO_pos_BAD;
}
int
-_IO_sputbackc (_IO_FILE *fp, int c)
+_IO_sputbackc (FILE *fp, int c)
{
int result;
libc_hidden_def (_IO_sputbackc)
int
-_IO_sungetc (_IO_FILE *fp)
+_IO_sungetc (FILE *fp)
{
int result;
/* Seems not to be needed. */
#if 0
void
-_IO_set_column (_IO_FILE *fp, int c)
+_IO_set_column (FILE *fp, int c)
{
if (c == -1)
fp->_column = -1;
}
#else
int
-_IO_set_column (_IO_FILE *fp, int i)
+_IO_set_column (FILE *fp, int i)
{
fp->_cur_column = i + 1;
return 0;
#if 0
/* Seems not to be needed. --drepper */
int
-_IO_get_column (_IO_FILE *fp)
+_IO_get_column (FILE *fp)
{
if (fp->_cur_column)
return _IO_adjust_column (fp->_cur_column - 1,
_IO_flush_all_lockp (int do_lock)
{
int result = 0;
- struct _IO_FILE *fp;
+ FILE *fp;
#ifdef _IO_MTSAFE_IO
_IO_cleanup_region_start_noarg (flush_cleanup);
_IO_lock_lock (list_all_lock);
#endif
- for (fp = (_IO_FILE *) _IO_list_all; fp != NULL; fp = fp->_chain)
+ for (fp = (FILE *) _IO_list_all; fp != NULL; fp = fp->_chain)
{
run_fp = fp;
if (do_lock)
void
_IO_flush_all_linebuffered (void)
{
- struct _IO_FILE *fp;
+ FILE *fp;
#ifdef _IO_MTSAFE_IO
_IO_cleanup_region_start_noarg (flush_cleanup);
_IO_lock_lock (list_all_lock);
#endif
- for (fp = (_IO_FILE *) _IO_list_all; fp != NULL; fp = fp->_chain)
+ for (fp = (FILE *) _IO_list_all; fp != NULL; fp = fp->_chain)
{
run_fp = fp;
_IO_flockfile (fp);
static void _IO_unbuffer_all (void);
static bool dealloc_buffers;
-static _IO_FILE *freeres_list;
+static FILE *freeres_list;
static void
_IO_unbuffer_all (void)
{
- struct _IO_FILE *fp;
+ FILE *fp;
#ifdef _IO_MTSAFE_IO
_IO_cleanup_region_start_noarg (flush_cleanup);
_IO_lock_lock (list_all_lock);
#endif
- for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
+ for (fp = (FILE *) _IO_list_all; fp; fp = fp->_chain)
{
if (! (fp->_flags & _IO_UNBUFFERED)
/* Iff stream is un-orientated, it wasn't used. */
void
-_IO_init_marker (struct _IO_marker *marker, _IO_FILE *fp)
+_IO_init_marker (struct _IO_marker *marker, FILE *fp)
{
marker->_sbuf = fp;
if (_IO_in_put_mode (fp))
}
int
-_IO_seekmark (_IO_FILE *fp, struct _IO_marker *mark, int delta)
+_IO_seekmark (FILE *fp, struct _IO_marker *mark, int delta)
{
if (mark->_sbuf != fp)
return EOF;
}
void
-_IO_unsave_markers (_IO_FILE *fp)
+_IO_unsave_markers (FILE *fp)
{
struct _IO_marker *mark = fp->_markers;
if (mark)
#if 0
/* Seems not to be needed. --drepper */
int
-_IO_nobackup_pbackfail (_IO_FILE *fp, int c)
+_IO_nobackup_pbackfail (FILE *fp, int c)
{
if (fp->_IO_read_ptr > fp->_IO_read_base)
fp->_IO_read_ptr--;
#endif
int
-_IO_default_pbackfail (_IO_FILE *fp, int c)
+_IO_default_pbackfail (FILE *fp, int c)
{
if (fp->_IO_read_ptr > fp->_IO_read_base && !_IO_in_backup (fp)
&& (unsigned char) fp->_IO_read_ptr[-1] == c)
else if (fp->_IO_read_ptr <= fp->_IO_read_base)
{
/* Increase size of existing backup buffer. */
- _IO_size_t new_size;
- _IO_size_t old_size = fp->_IO_read_end - fp->_IO_read_base;
+ size_t new_size;
+ size_t old_size = fp->_IO_read_end - fp->_IO_read_base;
char *new_buf;
new_size = 2 * old_size;
new_buf = (char *) malloc (new_size);
}
libc_hidden_def (_IO_default_pbackfail)
-_IO_off64_t
-_IO_default_seek (_IO_FILE *fp, _IO_off64_t offset, int dir)
+off64_t
+_IO_default_seek (FILE *fp, off64_t offset, int dir)
{
return _IO_pos_BAD;
}
int
-_IO_default_stat (_IO_FILE *fp, void *st)
+_IO_default_stat (FILE *fp, void *st)
{
return EOF;
}
-_IO_ssize_t
-_IO_default_read (_IO_FILE *fp, void *data, _IO_ssize_t n)
+ssize_t
+_IO_default_read (FILE *fp, void *data, ssize_t n)
{
return -1;
}
-_IO_ssize_t
-_IO_default_write (_IO_FILE *fp, const void *data, _IO_ssize_t n)
+ssize_t
+_IO_default_write (FILE *fp, const void *data, ssize_t n)
{
return 0;
}
int
-_IO_default_showmanyc (_IO_FILE *fp)
+_IO_default_showmanyc (FILE *fp)
{
return -1;
}
void
-_IO_default_imbue (_IO_FILE *fp, void *locale)
+_IO_default_imbue (FILE *fp, void *locale)
{
}
}
libc_hidden_def (_IO_iter_next)
-_IO_FILE *
+FILE *
_IO_iter_file (_IO_ITER iter)
{
return iter;
#include <shlib-compat.h>
int
-_IO_new_fclose (_IO_FILE *fp)
+_IO_new_fclose (FILE *fp)
{
int status;
#include <shlib-compat.h>
-_IO_FILE *
+FILE *
_IO_new_fdopen (int fd, const char *mode)
{
int read_write;
if (do_seek && ((read_write & (_IO_IS_APPENDING | _IO_NO_READS))
== (_IO_IS_APPENDING | _IO_NO_READS)))
{
- _IO_off64_t new_pos = _IO_SYSSEEK (&new_f->fp.file, 0, _IO_seek_end);
+ off64_t new_pos = _IO_SYSSEEK (&new_f->fp.file, 0, _IO_seek_end);
if (new_pos == _IO_pos_BAD && errno != ESPIPE)
return NULL;
}
#include <stdio.h>
int
-_IO_fflush (_IO_FILE *fp)
+_IO_fflush (FILE *fp)
{
if (fp == NULL)
return _IO_flush_all ();
#include <stdio.h>
int
-__fflush_unlocked (_IO_FILE *fp)
+__fflush_unlocked (FILE *fp)
{
if (fp == NULL)
return _IO_flush_all ();
#include <shlib-compat.h>
int
-_IO_new_fgetpos (_IO_FILE *fp, _IO_fpos_t *posp)
+_IO_new_fgetpos (FILE *fp, __fpos_t *posp)
{
- _IO_off64_t pos;
+ off64_t pos;
int result = 0;
CHECK_FILE (fp, EOF);
_IO_acquire_lock (fp);
__set_errno (EIO);
result = EOF;
}
- else if ((_IO_off64_t) (__typeof (posp->__pos)) pos != pos)
+ else if ((off64_t) (__typeof (posp->__pos)) pos != pos)
{
__set_errno (EOVERFLOW);
result = EOF;
#ifndef __OFF_T_MATCHES_OFF64_T
int
-_IO_new_fgetpos64 (_IO_FILE *fp, _IO_fpos64_t *posp)
+_IO_new_fgetpos64 (FILE *fp, __fpos64_t *posp)
{
- _IO_off64_t pos;
+ off64_t pos;
int result = 0;
CHECK_FILE (fp, EOF);
_IO_acquire_lock (fp);
#include <stdio.h>
char *
-_IO_fgets (char *buf, int n, _IO_FILE *fp)
+_IO_fgets (char *buf, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
char *result;
int old_error;
CHECK_FILE (fp, NULL);
#include <stdio.h>
char *
-__fgets_unlocked (char *buf, int n, _IO_FILE *fp)
+__fgets_unlocked (char *buf, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
char *result;
int old_error;
CHECK_FILE (fp, NULL);
#include <wchar.h>
wchar_t *
-fgetws (wchar_t *buf, int n, _IO_FILE *fp)
+fgetws (wchar_t *buf, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
wchar_t *result;
int old_error;
CHECK_FILE (fp, NULL);
#include <wchar.h>
wchar_t *
-fgetws_unlocked (wchar_t *buf, int n, _IO_FILE *fp)
+fgetws_unlocked (wchar_t *buf, int n, FILE *fp)
{
- _IO_size_t count;
+ size_t count;
wchar_t *result;
int old_error;
CHECK_FILE (fp, NULL);
#include <stddef.h>
#include <shlib-compat.h>
-_IO_FILE *
-__fopen_maybe_mmap (_IO_FILE *fp)
+FILE *
+__fopen_maybe_mmap (FILE *fp)
{
#if _G_HAVE_MMAP
if ((fp->_flags2 & _IO_FLAGS2_MMAP) && (fp->_flags & _IO_NO_WRITES))
}
-_IO_FILE *
+FILE *
__fopen_internal (const char *filename, const char *mode, int is32)
{
struct locked_FILE
#if !_IO_UNIFIED_JUMPTABLES
new_f->fp.vtable = NULL;
#endif
- if (_IO_file_fopen ((_IO_FILE *) new_f, filename, mode, is32) != NULL)
+ if (_IO_file_fopen ((FILE *) new_f, filename, mode, is32) != NULL)
return __fopen_maybe_mmap (&new_f->fp.file);
_IO_un_link (&new_f->fp);
return NULL;
}
-_IO_FILE *
+FILE *
_IO_new_fopen (const char *filename, const char *mode)
{
return __fopen_internal (filename, mode, 1);
/* iofopen.c defines _IO_fopen64/fopen64 as aliases if O_LARGEFILE==0. */
#if defined O_LARGEFILE && O_LARGEFILE != 0
-_IO_FILE *
+FILE *
_IO_fopen64 (const char *filename, const char *mode)
{
return __fopen_internal (filename, mode, 0);
#include <stdlib.h>
#include <shlib-compat.h>
-/* Prototyped for local functions. */
-static _IO_ssize_t _IO_cookie_read (_IO_FILE* fp, void* buf,
- _IO_ssize_t size);
-static _IO_ssize_t _IO_cookie_write (_IO_FILE* fp,
- const void* buf, _IO_ssize_t size);
-static _IO_off64_t _IO_cookie_seek (_IO_FILE *fp, _IO_off64_t offset, int dir);
-static _IO_off64_t _IO_cookie_seekoff (_IO_FILE *fp, _IO_off64_t offset,
- int dir, int mode);
-static int _IO_cookie_close (_IO_FILE* fp);
-
-static _IO_ssize_t
-_IO_cookie_read (_IO_FILE *fp, void *buf, _IO_ssize_t size)
+static ssize_t
+_IO_cookie_read (FILE *fp, void *buf, ssize_t size)
{
struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
cookie_read_function_t *read_cb = cfile->__io_functions.read;
return read_cb (cfile->__cookie, buf, size);
}
-static _IO_ssize_t
-_IO_cookie_write (_IO_FILE *fp, const void *buf, _IO_ssize_t size)
+static ssize_t
+_IO_cookie_write (FILE *fp, const void *buf, ssize_t size)
{
struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
cookie_write_function_t *write_cb = cfile->__io_functions.write;
return 0;
}
- _IO_ssize_t n = write_cb (cfile->__cookie, buf, size);
+ ssize_t n = write_cb (cfile->__cookie, buf, size);
if (n < size)
fp->_flags |= _IO_ERR_SEEN;
return n;
}
-static _IO_off64_t
-_IO_cookie_seek (_IO_FILE *fp, _IO_off64_t offset, int dir)
+static off64_t
+_IO_cookie_seek (FILE *fp, off64_t offset, int dir)
{
struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
cookie_seek_function_t *seek_cb = cfile->__io_functions.seek;
return ((seek_cb == NULL
|| (seek_cb (cfile->__cookie, &offset, dir)
== -1)
- || offset == (_IO_off64_t) -1)
+ || offset == (off64_t) -1)
? _IO_pos_BAD : offset);
}
static int
-_IO_cookie_close (_IO_FILE *fp)
+_IO_cookie_close (FILE *fp)
{
struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
cookie_close_function_t *close_cb = cfile->__io_functions.close;
}
-static _IO_off64_t
-_IO_cookie_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+static off64_t
+_IO_cookie_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
/* We must force the fileops code to always use seek to determine
the position. */
/* Copy the callbacks from SOURCE to *TARGET, with pointer
mangling. */
static void
-set_callbacks (_IO_cookie_io_functions_t *target,
- _IO_cookie_io_functions_t source)
+set_callbacks (cookie_io_functions_t *target,
+ cookie_io_functions_t source)
{
#ifdef PTR_MANGLE
PTR_MANGLE (source.read);
void
_IO_cookie_init (struct _IO_cookie_file *cfile, int read_write,
- void *cookie, _IO_cookie_io_functions_t io_functions)
+ void *cookie, cookie_io_functions_t io_functions)
{
_IO_init_internal (&cfile->__fp.file, 0);
_IO_JUMPS (&cfile->__fp) = &_IO_cookie_jumps;
}
-_IO_FILE *
+FILE *
_IO_fopencookie (void *cookie, const char *mode,
- _IO_cookie_io_functions_t io_functions)
+ cookie_io_functions_t io_functions)
{
int read_write;
struct locked_FILE
_IO_cookie_init (&new_f->cfile, read_write, cookie, io_functions);
- return (_IO_FILE *) &new_f->cfile.__fp;
+ return (FILE *) &new_f->cfile.__fp;
}
versioned_symbol (libc, _IO_fopencookie, fopencookie, GLIBC_2_2);
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
-static _IO_off64_t _IO_old_cookie_seek (_IO_FILE *fp, _IO_off64_t offset,
- int dir);
-_IO_FILE * _IO_old_fopencookie (void *cookie, const char *mode,
- _IO_cookie_io_functions_t io_functions);
-
-static _IO_off64_t
+static off64_t
attribute_compat_text_section
-_IO_old_cookie_seek (_IO_FILE *fp, _IO_off64_t offset, int dir)
+_IO_old_cookie_seek (FILE *fp, off64_t offset, int dir)
{
struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
- int (*seek_cb) (_IO_FILE *, _IO_off_t, int)
- = (int (*) (_IO_FILE *, _IO_off_t, int)) cfile->__io_functions.seek;;
+ int (*seek_cb) (FILE *, off_t, int)
+ = (int (*) (FILE *, off_t, int)) cfile->__io_functions.seek;
#ifdef PTR_DEMANGLE
PTR_DEMANGLE (seek_cb);
#endif
JUMP_INIT(imbue, _IO_default_imbue),
};
-_IO_FILE *
+FILE *
attribute_compat_text_section
_IO_old_fopencookie (void *cookie, const char *mode,
- _IO_cookie_io_functions_t io_functions)
+ cookie_io_functions_t io_functions)
{
- _IO_FILE *ret;
+ FILE *ret;
ret = _IO_fopencookie (cookie, mode, io_functions);
if (ret != NULL)
#include <string.h>
int
-_IO_fputs (const char *str, _IO_FILE *fp)
+_IO_fputs (const char *str, FILE *fp)
{
- _IO_size_t len = strlen (str);
+ size_t len = strlen (str);
int result = EOF;
CHECK_FILE (fp, EOF);
_IO_acquire_lock (fp);
#include <string.h>
int
-__fputs_unlocked (const char *str, _IO_FILE *fp)
+__fputs_unlocked (const char *str, FILE *fp)
{
- _IO_size_t len = strlen (str);
+ size_t len = strlen (str);
int result = EOF;
CHECK_FILE (fp, EOF);
if (_IO_fwide (fp, -1) == -1 && _IO_sputn (fp, str, len) == len)
#include <wchar.h>
int
-fputws (const wchar_t *str, _IO_FILE *fp)
+fputws (const wchar_t *str, FILE *fp)
{
- _IO_size_t len = __wcslen (str);
+ size_t len = __wcslen (str);
int result = EOF;
CHECK_FILE (fp, EOF);
_IO_acquire_lock (fp);
#include <wchar.h>
int
-fputws_unlocked (const wchar_t *str, _IO_FILE *fp)
+fputws_unlocked (const wchar_t *str, FILE *fp)
{
- _IO_size_t len = __wcslen (str);
+ size_t len = __wcslen (str);
int result = EOF;
CHECK_FILE (fp, EOF);
if (_IO_fwide (fp, 1) == 1
#include "libioP.h"
-_IO_size_t
-_IO_fread (void *buf, _IO_size_t size, _IO_size_t count, _IO_FILE *fp)
+size_t
+_IO_fread (void *buf, size_t size, size_t count, FILE *fp)
{
- _IO_size_t bytes_requested = size * count;
- _IO_size_t bytes_read;
+ size_t bytes_requested = size * count;
+ size_t bytes_read;
CHECK_FILE (fp, 0);
if (bytes_requested == 0)
return 0;
#undef fread_unlocked
-_IO_size_t
-__fread_unlocked (void *buf, _IO_size_t size, _IO_size_t count, _IO_FILE *fp)
+size_t
+__fread_unlocked (void *buf, size_t size, size_t count, FILE *fp)
{
- _IO_size_t bytes_requested = size * count;
- _IO_size_t bytes_read;
+ size_t bytes_requested = size * count;
+ size_t bytes_read;
CHECK_FILE (fp, 0);
if (bytes_requested == 0)
return 0;
#include <shlib-compat.h>
int
-_IO_new_fsetpos (_IO_FILE *fp, const _IO_fpos_t *posp)
+_IO_new_fsetpos (FILE *fp, const __fpos_t *posp)
{
int result;
CHECK_FILE (fp, EOF);
#ifndef __OFF_T_MATCHES_OFF64_T
int
-_IO_new_fsetpos64 (_IO_FILE *fp, const _IO_fpos64_t *posp)
+_IO_new_fsetpos64 (FILE *fp, const fpos64_t *posp)
{
int result;
CHECK_FILE (fp, EOF);
/* ANSI explicily requires setting errno to a positive value on failure. */
long int
-_IO_ftell (_IO_FILE *fp)
+_IO_ftell (FILE *fp)
{
- _IO_off64_t pos;
+ off64_t pos;
CHECK_FILE (fp, -1L);
_IO_acquire_lock (fp);
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
__set_errno (EIO);
return -1L;
}
- if ((_IO_off64_t) (long int) pos != pos)
+ if ((off64_t) (long int) pos != pos)
{
__set_errno (EOVERFLOW);
return -1L;
static int do_encoding (struct _IO_codecvt *codecvt);
static int do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep,
const char *from_start,
- const char *from_end, _IO_size_t max);
+ const char *from_end, size_t max);
static int do_max_length (struct _IO_codecvt *codecvt);
static int do_always_noconv (struct _IO_codecvt *codecvt);
the orientation first. */
#undef _IO_fwide
int
-_IO_fwide (_IO_FILE *fp, int mode)
+_IO_fwide (FILE *fp, int mode)
{
/* Normalize the value. */
mode = mode < 0 ? -1 : (mode == 0 ? 0 : 1);
static int
do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep,
- const char *from_start, const char *from_end, _IO_size_t max)
+ const char *from_start, const char *from_end, size_t max)
{
int result;
const unsigned char *cp = (const unsigned char *) from_start;
#include "libioP.h"
-_IO_size_t
-_IO_fwrite (const void *buf, _IO_size_t size, _IO_size_t count, _IO_FILE *fp)
+size_t
+_IO_fwrite (const void *buf, size_t size, size_t count, FILE *fp)
{
- _IO_size_t request = size * count;
- _IO_size_t written = 0;
+ size_t request = size * count;
+ size_t written = 0;
CHECK_FILE (fp, 0);
if (request == 0)
return 0;
#undef fwrite_unlocked
-_IO_size_t
-fwrite_unlocked (const void *buf, _IO_size_t size, _IO_size_t count,
- _IO_FILE *fp)
+size_t
+fwrite_unlocked (const void *buf, size_t size, size_t count, FILE *fp)
{
- _IO_size_t request = size * count;
- _IO_size_t written = 0;
+ size_t request = size * count;
+ size_t written = 0;
CHECK_FILE (fp, 0);
if (request == 0)
return 0;
necessary. Returns the number of characters read (not including the
null terminator), or -1 on error or EOF. */
-_IO_ssize_t
-_IO_getdelim (char **lineptr, _IO_size_t *n, int delimiter, _IO_FILE *fp)
+ssize_t
+_IO_getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
{
- _IO_ssize_t result;
- _IO_ssize_t cur_len = 0;
- _IO_ssize_t len;
+ ssize_t result;
+ ssize_t cur_len = 0;
+ ssize_t len;
if (lineptr == NULL || n == NULL)
{
for (;;)
{
- _IO_size_t needed;
+ size_t needed;
char *t;
t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);
if (t != NULL)
#include "libioP.h"
#include <string.h>
-_IO_size_t
-_IO_getline (_IO_FILE *fp, char *buf, _IO_size_t n, int delim,
+size_t
+_IO_getline (FILE *fp, char *buf, size_t n, int delim,
int extract_delim)
{
return _IO_getline_info (fp, buf, n, delim, extract_delim, (int *) 0);
If extract_delim < 0, leave delimiter unread.
If extract_delim > 0, insert delim in output. */
-_IO_size_t
-_IO_getline_info (_IO_FILE *fp, char *buf, _IO_size_t n, int delim,
+size_t
+_IO_getline_info (FILE *fp, char *buf, size_t n, int delim,
int extract_delim, int *eof)
{
char *ptr = buf;
_IO_fwide (fp, -1);
while (n != 0)
{
- _IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
+ ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
if (len <= 0)
{
int c = __uflow (fp);
else
{
char *t;
- if ((_IO_size_t) len >= n)
+ if ((size_t) len >= n)
len = n;
t = (char *) memchr ((void *) fp->_IO_read_ptr, delim, len);
if (t != NULL)
{
- _IO_size_t old_len = ptr-buf;
+ size_t old_len = ptr-buf;
len = t - fp->_IO_read_ptr;
if (extract_delim >= 0)
{
char *
_IO_gets (char *buf)
{
- _IO_size_t count;
+ size_t count;
int ch;
char *retval;
#include <string.h>
#include <wchar.h>
-_IO_size_t
-_IO_getwline (_IO_FILE *fp, wchar_t *buf, _IO_size_t n, wint_t delim,
+size_t
+_IO_getwline (FILE *fp, wchar_t *buf, size_t n, wint_t delim,
int extract_delim)
{
return _IO_getwline_info (fp, buf, n, delim, extract_delim, (wint_t *) 0);
If extract_delim < 0, leave delimiter unread.
If extract_delim > 0, insert delim in output. */
-_IO_size_t
-_IO_getwline_info (_IO_FILE *fp, wchar_t *buf, _IO_size_t n, wint_t delim,
+size_t
+_IO_getwline_info (FILE *fp, wchar_t *buf, size_t n, wint_t delim,
int extract_delim, wint_t *eof)
{
wchar_t *ptr = buf;
_IO_fwide (fp, 1);
while (n != 0)
{
- _IO_ssize_t len = (fp->_wide_data->_IO_read_end
- - fp->_wide_data->_IO_read_ptr);
+ ssize_t len = (fp->_wide_data->_IO_read_end
+ - fp->_wide_data->_IO_read_ptr);
if (len <= 0)
{
wint_t wc = __wuflow (fp);
else
{
wchar_t *t;
- if ((_IO_size_t) len >= n)
+ if ((size_t) len >= n)
len = n;
t = wmemchr ((void *) fp->_wide_data->_IO_read_ptr, delim, len);
if (t != NULL)
{
- _IO_size_t old_len = ptr - buf;
+ size_t old_len = ptr - buf;
len = t - fp->_wide_data->_IO_read_ptr;
if (extract_delim >= 0)
{
#include <stdio.h>
#include <libio/libio.h>
-/* These emulate stdio functionality, but with a different name
- (_IO_ungetc instead of ungetc), and using _IO_FILE instead of FILE. */
+/* Alternative names for many of the stdio.h functions, used
+ internally and exposed for backward compatibility's sake. */
-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;
+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 _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*);
+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 (_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)
+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 _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*);
+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 (_IO_FILE*, const _IO_fpos_t *);
-extern int _IO_fsetpos64 (_IO_FILE*, const _IO_fpos64_t *);
-extern long int _IO_ftell (_IO_FILE*);
+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 _IO_size_t _IO_fread (void*, _IO_size_t, _IO_size_t, _IO_FILE*);
+extern size_t _IO_fread (void*, size_t, size_t, FILE*);
libc_hidden_proto (_IO_fread)
-extern _IO_size_t _IO_fwrite (const void*, _IO_size_t, _IO_size_t, _IO_FILE*);
+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 (_IO_FILE *, char*, _IO_size_t) __THROW;
+extern void _IO_setbuffer (FILE *, char*, size_t) __THROW;
libc_hidden_proto (_IO_setbuffer)
-extern int _IO_setvbuf (_IO_FILE*, char*, int, _IO_size_t) __THROW;
+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, _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;
+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*, _IO_size_t, const wchar_t*, _IO_va_list)
+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 *, _IO_va_list)
+extern int _IO_obstack_vprintf (struct obstack *, const char *, __gnuc_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))
+#define _IO_pos_BAD ((off64_t)(-1))
#endif
#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
#define _IO_fseek(__fp, __offset, __whence) \
(_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;
+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, _IO_BUFSIZ)
+#define _IO_setbuf(_FP, _BUF) _IO_setbuffer (_FP, _BUF, 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;
+FILE *__new_freopen (const char *, const char *, FILE *) __THROW;
+FILE *__old_freopen (const char *, const char *, FILE *) __THROW;
#endif /* iolibio.h. */
static char const zeroes[PADSIZE] =
{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
-_IO_ssize_t
-_IO_padn (_IO_FILE *fp, int pad, _IO_ssize_t count)
+ssize_t
+_IO_padn (FILE *fp, int pad, ssize_t count)
{
char padbuf[PADSIZE];
const char *padptr;
int i;
- _IO_size_t written = 0;
- _IO_size_t w;
+ size_t written = 0;
+ size_t w;
if (pad == ' ')
padptr = blanks;
{
struct _IO_FILE_plus file;
/* Following fields must match those in class procbuf (procbuf.h) */
- _IO_pid_t pid;
+ pid_t pid;
struct _IO_proc_file *next;
};
typedef struct _IO_proc_file _IO_proc_file;
}
#endif
-_IO_FILE *
-_IO_new_proc_open (_IO_FILE *fp, const char *command, const char *mode)
+FILE *
+_IO_new_proc_open (FILE *fp, const char *command, const char *mode)
{
int read_or_write;
int parent_end, child_end;
int pipe_fds[2];
- _IO_pid_t child_pid;
+ pid_t child_pid;
int do_read = 0;
int do_write = 0;
in the new child process." */
for (p = proc_file_chain; p; p = p->next)
{
- int fd = _IO_fileno ((_IO_FILE *) p);
+ int fd = _IO_fileno ((FILE *) p);
/* If any stream from previous popen() calls has fileno
child_std_end, it has been already closed by the dup2 syscall
return fp;
}
-_IO_FILE *
+FILE *
_IO_new_popen (const char *command, const char *mode)
{
struct locked_FILE
_IO_lock_t lock;
#endif
} *new_f;
- _IO_FILE *fp;
+ FILE *fp;
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
new_f->fpx.file.vtable = NULL;
#endif
if (_IO_new_proc_open (fp, command, mode) != NULL)
- return (_IO_FILE *) &new_f->fpx.file;
+ return (FILE *) &new_f->fpx.file;
_IO_un_link (&new_f->fpx.file);
free (new_f);
return NULL;
}
int
-_IO_new_proc_close (_IO_FILE *fp)
+_IO_new_proc_close (FILE *fp)
{
/* This is not name-space clean. FIXME! */
int wstatus;
_IO_proc_file **ptr = &proc_file_chain;
- _IO_pid_t wait_pid;
+ pid_t wait_pid;
int status = -1;
/* Unlink from proc_file_chain. */
_IO_puts (const char *str)
{
int result = EOF;
- _IO_size_t len = strlen (str);
+ size_t len = strlen (str);
_IO_acquire_lock (_IO_stdout);
if ((_IO_vtable_offset (_IO_stdout) != 0
#include <libioP.h>
#include <errno.h>
-_IO_off64_t
-_IO_seekoff_unlocked (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_seekoff_unlocked (FILE *fp, off64_t offset, int dir, int mode)
{
if (dir != _IO_seek_cur && dir != _IO_seek_set && dir != _IO_seek_end)
{
}
-_IO_off64_t
-_IO_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
- _IO_off64_t retval;
+ off64_t retval;
_IO_acquire_lock (fp);
retval = _IO_seekoff_unlocked (fp, offset, dir, mode);
#include <libioP.h>
-_IO_off64_t
-_IO_seekpos_unlocked (_IO_FILE *fp, _IO_off64_t pos, int mode)
+off64_t
+_IO_seekpos_unlocked (FILE *fp, off64_t pos, int mode)
{
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
}
-_IO_off64_t
-_IO_seekpos (_IO_FILE *fp, _IO_off64_t pos, int mode)
+off64_t
+_IO_seekpos (FILE *fp, off64_t pos, int mode)
{
- _IO_off64_t retval;
+ off64_t retval;
_IO_acquire_lock (fp);
retval = _IO_seekpos_unlocked (fp, pos, mode);
#include "libioP.h"
void
-_IO_setbuffer (_IO_FILE *fp, char *buf, _IO_size_t size)
+_IO_setbuffer (FILE *fp, char *buf, size_t size)
{
CHECK_FILE (fp, );
_IO_acquire_lock (fp);
#define _IONBF 2 /* No buffering. */
int
-_IO_setvbuf (_IO_FILE *fp, char *buf, int mode, _IO_size_t size)
+_IO_setvbuf (FILE *fp, char *buf, int mode, size_t size)
{
int result;
CHECK_FILE (fp, EOF);
#include "libioP.h"
int
-_IO_ungetc (int c, _IO_FILE *fp)
+_IO_ungetc (int c, FILE *fp)
{
int result;
CHECK_FILE (fp, EOF);
#include <wchar.h>
wint_t
-ungetwc (wint_t c, _IO_FILE *fp)
+ungetwc (wint_t c, FILE *fp)
{
wint_t result;
CHECK_FILE (fp, WEOF);
#include <stdio_ext.h>
int
-_IO_vdprintf (int d, const char *format, _IO_va_list arg)
+_IO_vdprintf (int d, const char *format, va_list arg)
{
struct _IO_FILE_plus tmpfil;
struct _IO_wide_data wd;
#include "strfile.h"
int
-__IO_vsprintf (char *string, const char *format, _IO_va_list args)
+__IO_vsprintf (char *string, const char *format, va_list args)
{
_IO_strfile sf;
int ret;
#include "strfile.h"
int
-_IO_vsscanf (const char *string, const char *format, _IO_va_list args)
+_IO_vsscanf (const char *string, const char *format, va_list args)
{
int ret;
_IO_strfile sf;
#include <wchar.h>
int
-__vswscanf (const wchar_t *string, const wchar_t *format, _IO_va_list args)
+__vswscanf (const wchar_t *string, const wchar_t *format, va_list args)
{
int ret;
_IO_strfile sf;
_IO_no_init (&sf._sbf._f, _IO_USER_LOCK, 0, &wd, &_IO_wstr_jumps);
_IO_fwide (&sf._sbf._f, 1);
_IO_wstr_init_static (&sf._sbf._f, (wchar_t *)string, 0, NULL);
- ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
+ ret = _IO_vfwscanf ((FILE *) &sf._sbf, format, args, NULL);
return ret;
}
libc_hidden_def (__vswscanf)
L'0', L'0', L'0', L'0', L'0', L'0', L'0', L'0'
};
-_IO_ssize_t
-_IO_wpadn (_IO_FILE *fp, wint_t pad, _IO_ssize_t count)
+ssize_t
+_IO_wpadn (FILE *fp, wint_t pad, ssize_t count)
{
wchar_t padbuf[PADSIZE];
const wchar_t *padptr;
int i;
- _IO_size_t written = 0;
- _IO_size_t w;
+ size_t written = 0;
+ size_t w;
if (pad == L' ')
padptr = blanks;
} __combined;
} _IO_iconv_t;
-/* Map the names used in libio to the names used in libc generally. */
-#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
-#define _IO_off64_t __off64_t
-#define _IO_pid_t __pid_t
-#define _IO_uid_t __uid_t
-#define _IO_BUFSIZ BUFSIZ
-#define _IO_wint_t wint_t
-#define _IO_va_list __gnuc_va_list
-
#include <shlib-compat.h>
/* compatibility defines */
struct _IO_marker {
struct _IO_marker *_next;
- struct _IO_FILE *_sbuf;
+ FILE *_sbuf;
/* If _pos >= 0
it points to _buf->Gbase()+_pos. FIXME comment */
/* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */
int (*__codecvt_do_encoding) (struct _IO_codecvt *);
int (*__codecvt_do_always_noconv) (struct _IO_codecvt *);
int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *,
- const char *, const char *, _IO_size_t);
+ const char *, const char *, size_t);
int (*__codecvt_do_max_length) (struct _IO_codecvt *);
_IO_iconv_t __cd_in;
const struct _IO_jump_t *_wide_vtable;
};
-typedef struct _IO_FILE _IO_FILE;
-
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
-extern _IO_FILE *_IO_stdin attribute_hidden;
-extern _IO_FILE *_IO_stdout attribute_hidden;
-extern _IO_FILE *_IO_stderr attribute_hidden;
-
-/* Compatibility names for cookie I/O functions. */
-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;
+extern FILE *_IO_stdin attribute_hidden;
+extern FILE *_IO_stdout attribute_hidden;
+extern FILE *_IO_stderr attribute_hidden;
struct _IO_cookie_file;
/* Initialize one of those. */
extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
- void *__cookie, _IO_cookie_io_functions_t __fns);
+ void *__cookie, cookie_io_functions_t __fns);
-extern int __underflow (_IO_FILE *);
-extern _IO_wint_t __wunderflow (_IO_FILE *);
-extern _IO_wint_t __wuflow (_IO_FILE *);
-extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);
+extern int __underflow (FILE *);
+extern wint_t __wunderflow (FILE *);
+extern wint_t __wuflow (FILE *);
+extern wint_t __woverflow (FILE *, wint_t);
#if __GNUC__ >= 3
# define _IO_BE(expr, res) __builtin_expect ((expr), res)
(_IO_BE ((_fp)->_wide_data == NULL \
|| ((_fp)->_wide_data->_IO_read_ptr \
>= (_fp)->_wide_data->_IO_read_end), 0) \
- ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
+ ? __wuflow (_fp) : (wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
# define _IO_putwc_unlocked(_wch, _fp) \
(_IO_BE ((_fp)->_wide_data == NULL \
|| ((_fp)->_wide_data->_IO_write_ptr \
>= (_fp)->_wide_data->_IO_write_end), 0) \
? __woverflow (_fp, _wch) \
- : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
+ : (wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
#define _IO_feof_unlocked(_fp) __feof_unlocked_body (_fp)
#define _IO_ferror_unlocked(_fp) __ferror_unlocked_body (_fp)
-extern int _IO_getc (_IO_FILE *__fp);
-extern int _IO_putc (int __c, _IO_FILE *__fp);
-extern int _IO_feof (_IO_FILE *__fp) __THROW;
-extern int _IO_ferror (_IO_FILE *__fp) __THROW;
+extern int _IO_getc (FILE *__fp);
+extern int _IO_putc (int __c, FILE *__fp);
+extern int _IO_feof (FILE *__fp) __THROW;
+extern int _IO_ferror (FILE *__fp) __THROW;
-extern int _IO_peekc_locked (_IO_FILE *__fp);
+extern int _IO_peekc_locked (FILE *__fp);
/* This one is for Emacs. */
#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;
+extern void _IO_flockfile (FILE *) __THROW;
+extern void _IO_funlockfile (FILE *) __THROW;
+extern int _IO_ftrylockfile (FILE *) __THROW;
#define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
#define _IO_flockfile(_fp) /**/
#define _IO_need_lock(_fp) \
(((_fp)->_flags2 & _IO_FLAGS2_NEED_LOCK) != 0)
-extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
- _IO_va_list, int *__restrict);
-extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
- _IO_va_list);
-extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t);
-extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
+extern int _IO_vfscanf (FILE * __restrict, const char * __restrict,
+ __gnuc_va_list, int *__restrict);
+extern int _IO_vfprintf (FILE *__restrict, const char *__restrict,
+ __gnuc_va_list);
+extern __ssize_t _IO_padn (FILE *, int, __ssize_t);
+extern size_t _IO_sgetn (FILE *, void *, size_t);
-extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int);
-extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int);
+extern off64_t _IO_seekoff (FILE *, off64_t, int, int);
+extern off64_t _IO_seekpos (FILE *, off64_t, int);
-extern void _IO_free_backup_area (_IO_FILE *) __THROW;
+extern void _IO_free_backup_area (FILE *) __THROW;
-extern _IO_wint_t _IO_getwc (_IO_FILE *__fp);
-extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp);
-extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW;
+extern wint_t _IO_getwc (FILE *__fp);
+extern wint_t _IO_putwc (wchar_t __wc, FILE *__fp);
+extern int _IO_fwide (FILE *__fp, int __mode) __THROW;
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
# define _IO_fwide_maybe_incompatible \
__result = _IO_fwide (__fp, __result); \
__result; })
-extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict,
- _IO_va_list, int *__restrict);
-extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict,
- _IO_va_list);
-extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t);
-extern void _IO_free_wbackup_area (_IO_FILE *) __THROW;
+extern int _IO_vfwscanf (FILE * __restrict, const wchar_t * __restrict,
+ __gnuc_va_list, int *__restrict);
+extern int _IO_vfwprintf (FILE *__restrict, const wchar_t *__restrict,
+ __gnuc_va_list);
+extern __ssize_t _IO_wpadn (FILE *, wint_t, __ssize_t);
+extern void _IO_free_wbackup_area (FILE *) __THROW;
#ifdef __LDBL_COMPAT
__LDBL_REDIR_DECL (_IO_vfscanf)
* with the _IO_JUMPS macro. The jump table has an eccentric format,
* so as to be compatible with the layout of a C++ virtual function table.
* (as implemented by g++). When a pointer to a streambuf object is
- * coerced to an (_IO_FILE*), then _IO_JUMPS on the result just
+ * coerced to an (FILE*), then _IO_JUMPS on the result just
* happens to point to the virtual function table of the streambuf.
* Thus the _IO_JUMPS function table used for C stdio/libio does
* double duty as the virtual function table for C++ streambuf.
/* The 'finish' function does any final cleaning up of an _IO_FILE object.
It does not delete (free) it, but does everything else to finalize it.
It matches the streambuf::~streambuf virtual destructor. */
-typedef void (*_IO_finish_t) (_IO_FILE *, int); /* finalize */
+typedef void (*_IO_finish_t) (FILE *, int); /* finalize */
#define _IO_FINISH(FP) JUMP1 (__finish, FP, 0)
#define _IO_WFINISH(FP) WJUMP1 (__finish, FP, 0)
/* The 'overflow' hook flushes the buffer.
The second argument is a character, or EOF.
It matches the streambuf::overflow virtual function. */
-typedef int (*_IO_overflow_t) (_IO_FILE *, int);
+typedef int (*_IO_overflow_t) (FILE *, int);
#define _IO_OVERFLOW(FP, CH) JUMP1 (__overflow, FP, CH)
#define _IO_WOVERFLOW(FP, CH) WJUMP1 (__overflow, FP, CH)
It returns the next character (as an unsigned char) or EOF. The next
character remains in the get buffer, and the get position is not changed.
It matches the streambuf::underflow virtual function. */
-typedef int (*_IO_underflow_t) (_IO_FILE *);
+typedef int (*_IO_underflow_t) (FILE *);
#define _IO_UNDERFLOW(FP) JUMP0 (__underflow, FP)
#define _IO_WUNDERFLOW(FP) WJUMP0 (__underflow, FP)
/* The 'pbackfail' hook handles backing up.
It matches the streambuf::pbackfail virtual function. */
-typedef int (*_IO_pbackfail_t) (_IO_FILE *, int);
+typedef int (*_IO_pbackfail_t) (FILE *, int);
#define _IO_PBACKFAIL(FP, CH) JUMP1 (__pbackfail, FP, CH)
#define _IO_WPBACKFAIL(FP, CH) WJUMP1 (__pbackfail, FP, CH)
/* The 'xsputn' hook writes upto N characters from buffer DATA.
Returns EOF or the number of character actually written.
It matches the streambuf::xsputn virtual function. */
-typedef _IO_size_t (*_IO_xsputn_t) (_IO_FILE *FP, const void *DATA,
- _IO_size_t N);
+typedef size_t (*_IO_xsputn_t) (FILE *FP, const void *DATA,
+ size_t N);
#define _IO_XSPUTN(FP, DATA, N) JUMP2 (__xsputn, FP, DATA, N)
#define _IO_WXSPUTN(FP, DATA, N) WJUMP2 (__xsputn, FP, DATA, N)
/* The 'xsgetn' hook reads upto N characters into buffer DATA.
Returns the number of character actually read.
It matches the streambuf::xsgetn virtual function. */
-typedef _IO_size_t (*_IO_xsgetn_t) (_IO_FILE *FP, void *DATA, _IO_size_t N);
+typedef size_t (*_IO_xsgetn_t) (FILE *FP, void *DATA, size_t N);
#define _IO_XSGETN(FP, DATA, N) JUMP2 (__xsgetn, FP, DATA, N)
#define _IO_WXSGETN(FP, DATA, N) WJUMP2 (__xsgetn, FP, DATA, N)
(MODE==1), or the end of the file (MODE==2).
It matches the streambuf::seekoff virtual function.
It is also used for the ANSI fseek function. */
-typedef _IO_off64_t (*_IO_seekoff_t) (_IO_FILE *FP, _IO_off64_t OFF, int DIR,
+typedef off64_t (*_IO_seekoff_t) (FILE *FP, off64_t OFF, int DIR,
int MODE);
#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3 (__seekoff, FP, OFF, DIR, MODE)
#define _IO_WSEEKOFF(FP, OFF, DIR, MODE) WJUMP3 (__seekoff, FP, OFF, DIR, MODE)
It matches the streambuf::seekpos virtual function.
It is also used for the ANSI fgetpos and fsetpos functions. */
/* The _IO_seek_cur and _IO_seek_end options are not allowed. */
-typedef _IO_off64_t (*_IO_seekpos_t) (_IO_FILE *, _IO_off64_t, int);
+typedef off64_t (*_IO_seekpos_t) (FILE *, off64_t, int);
#define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2 (__seekpos, FP, POS, FLAGS)
#define _IO_WSEEKPOS(FP, POS, FLAGS) WJUMP2 (__seekpos, FP, POS, FLAGS)
/* The 'setbuf' hook gives a buffer to the file.
It matches the streambuf::setbuf virtual function. */
-typedef _IO_FILE* (*_IO_setbuf_t) (_IO_FILE *, char *, _IO_ssize_t);
+typedef FILE* (*_IO_setbuf_t) (FILE *, char *, ssize_t);
#define _IO_SETBUF(FP, BUFFER, LENGTH) JUMP2 (__setbuf, FP, BUFFER, LENGTH)
#define _IO_WSETBUF(FP, BUFFER, LENGTH) WJUMP2 (__setbuf, FP, BUFFER, LENGTH)
/* The 'sync' hook attempts to synchronize the internal data structures
of the file with the external state.
It matches the streambuf::sync virtual function. */
-typedef int (*_IO_sync_t) (_IO_FILE *);
+typedef int (*_IO_sync_t) (FILE *);
#define _IO_SYNC(FP) JUMP0 (__sync, FP)
#define _IO_WSYNC(FP) WJUMP0 (__sync, FP)
/* The 'doallocate' hook is used to tell the file to allocate a buffer.
It matches the streambuf::doallocate virtual function, which is not
in the ANSI/ISO C++ standard, but is part traditional implementations. */
-typedef int (*_IO_doallocate_t) (_IO_FILE *);
+typedef int (*_IO_doallocate_t) (FILE *);
#define _IO_DOALLOCATE(FP) JUMP0 (__doallocate, FP)
#define _IO_WDOALLOCATE(FP) WJUMP0 (__doallocate, FP)
sysstat) are low-level hooks specific to this implementation.
There is no correspondence in the ANSI/ISO C++ standard library.
The hooks basically correspond to the Unix system functions
- (read, write, close, lseek, and stat) except that a _IO_FILE*
+ (read, write, close, lseek, and stat) except that a FILE*
parameter is used instead of an integer file descriptor; the default
implementation used for normal files just calls those functions.
The advantage of overriding these functions instead of the higher-level
an existing buffer. It generalizes the Unix read(2) function.
It matches the streambuf::sys_read virtual function, which is
specific to this implementation. */
-typedef _IO_ssize_t (*_IO_read_t) (_IO_FILE *, void *, _IO_ssize_t);
+typedef ssize_t (*_IO_read_t) (FILE *, void *, ssize_t);
#define _IO_SYSREAD(FP, DATA, LEN) JUMP2 (__read, FP, DATA, LEN)
#define _IO_WSYSREAD(FP, DATA, LEN) WJUMP2 (__read, FP, DATA, LEN)
to an external file. It generalizes the Unix write(2) function.
It matches the streambuf::sys_write virtual function, which is
specific to this implementation. */
-typedef _IO_ssize_t (*_IO_write_t) (_IO_FILE *, const void *, _IO_ssize_t);
+typedef ssize_t (*_IO_write_t) (FILE *, const void *, ssize_t);
#define _IO_SYSWRITE(FP, DATA, LEN) JUMP2 (__write, FP, DATA, LEN)
#define _IO_WSYSWRITE(FP, DATA, LEN) WJUMP2 (__write, FP, DATA, LEN)
It generalizes the Unix lseek(2) function.
It matches the streambuf::sys_seek virtual function, which is
specific to this implementation. */
-typedef _IO_off64_t (*_IO_seek_t) (_IO_FILE *, _IO_off64_t, int);
+typedef off64_t (*_IO_seek_t) (FILE *, off64_t, int);
#define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2 (__seek, FP, OFFSET, MODE)
#define _IO_WSYSSEEK(FP, OFFSET, MODE) WJUMP2 (__seek, FP, OFFSET, MODE)
external file. It generalizes the Unix close(2) function.
It matches the streambuf::sys_close virtual function, which is
specific to this implementation. */
-typedef int (*_IO_close_t) (_IO_FILE *); /* finalize */
+typedef int (*_IO_close_t) (FILE *); /* finalize */
#define _IO_SYSCLOSE(FP) JUMP0 (__close, FP)
#define _IO_WSYSCLOSE(FP) WJUMP0 (__close, FP)
into a struct stat buffer. It generalizes the Unix fstat(2) call.
It matches the streambuf::sys_stat virtual function, which is
specific to this implementation. */
-typedef int (*_IO_stat_t) (_IO_FILE *, void *);
+typedef int (*_IO_stat_t) (FILE *, void *);
#define _IO_SYSSTAT(FP, BUF) JUMP1 (__stat, FP, BUF)
#define _IO_WSYSSTAT(FP, BUF) WJUMP1 (__stat, FP, BUF)
/* The 'showmany' hook can be used to get an image how much input is
available. In many cases the answer will be 0 which means unknown
but some cases one can provide real information. */
-typedef int (*_IO_showmanyc_t) (_IO_FILE *);
+typedef int (*_IO_showmanyc_t) (FILE *);
#define _IO_SHOWMANYC(FP) JUMP0 (__showmanyc, FP)
#define _IO_WSHOWMANYC(FP) WJUMP0 (__showmanyc, FP)
/* The 'imbue' hook is used to get information about the currently
installed locales. */
-typedef void (*_IO_imbue_t) (_IO_FILE *, void *);
+typedef void (*_IO_imbue_t) (FILE *, void *);
#define _IO_IMBUE(FP, LOCALE) JUMP1 (__imbue, FP, LOCALE)
#define _IO_WIMBUE(FP, LOCALE) WJUMP1 (__imbue, FP, LOCALE)
struct _IO_FILE_plus
{
- _IO_FILE file;
+ FILE file;
const struct _IO_jump_t *vtable;
};
{
struct _IO_FILE_plus __fp;
void *__cookie;
- _IO_cookie_io_functions_t __io_functions;
+ cookie_io_functions_t __io_functions;
};
-_IO_FILE *_IO_fopencookie (void *cookie, const char *mode,
- _IO_cookie_io_functions_t io_functions);
+FILE *_IO_fopencookie (void *cookie, const char *mode,
+ cookie_io_functions_t io_functions);
/* Iterator type for walking global linked list of _IO_FILE objects. */
-typedef struct _IO_FILE *_IO_ITER;
+typedef FILE *_IO_ITER;
/* Generic functions */
-extern void _IO_switch_to_main_get_area (_IO_FILE *) __THROW;
-extern void _IO_switch_to_backup_area (_IO_FILE *) __THROW;
-extern int _IO_switch_to_get_mode (_IO_FILE *);
+extern void _IO_switch_to_main_get_area (FILE *) __THROW;
+extern void _IO_switch_to_backup_area (FILE *) __THROW;
+extern int _IO_switch_to_get_mode (FILE *);
libc_hidden_proto (_IO_switch_to_get_mode)
-extern void _IO_init_internal (_IO_FILE *, int) attribute_hidden;
-extern int _IO_sputbackc (_IO_FILE *, int) __THROW;
+extern void _IO_init_internal (FILE *, int) attribute_hidden;
+extern int _IO_sputbackc (FILE *, int) __THROW;
libc_hidden_proto (_IO_sputbackc)
-extern int _IO_sungetc (_IO_FILE *) __THROW;
+extern int _IO_sungetc (FILE *) __THROW;
extern void _IO_un_link (struct _IO_FILE_plus *) __THROW;
libc_hidden_proto (_IO_un_link)
extern void _IO_link_in (struct _IO_FILE_plus *) __THROW;
libc_hidden_proto (_IO_link_in)
-extern void _IO_doallocbuf (_IO_FILE *) __THROW;
+extern void _IO_doallocbuf (FILE *) __THROW;
libc_hidden_proto (_IO_doallocbuf)
-extern void _IO_unsave_markers (_IO_FILE *) __THROW;
+extern void _IO_unsave_markers (FILE *) __THROW;
libc_hidden_proto (_IO_unsave_markers)
-extern void _IO_setb (_IO_FILE *, char *, char *, int) __THROW;
+extern void _IO_setb (FILE *, char *, char *, int) __THROW;
libc_hidden_proto (_IO_setb)
extern unsigned _IO_adjust_column (unsigned, const char *, int) __THROW;
libc_hidden_proto (_IO_adjust_column)
#define _IO_sputn(__fp, __s, __n) _IO_XSPUTN (__fp, __s, __n)
-_IO_ssize_t _IO_least_wmarker (_IO_FILE *, wchar_t *) __THROW;
+ssize_t _IO_least_wmarker (FILE *, wchar_t *) __THROW;
libc_hidden_proto (_IO_least_wmarker)
-extern void _IO_switch_to_main_wget_area (_IO_FILE *) __THROW;
+extern void _IO_switch_to_main_wget_area (FILE *) __THROW;
libc_hidden_proto (_IO_switch_to_main_wget_area)
-extern void _IO_switch_to_wbackup_area (_IO_FILE *) __THROW;
+extern void _IO_switch_to_wbackup_area (FILE *) __THROW;
libc_hidden_proto (_IO_switch_to_wbackup_area)
-extern int _IO_switch_to_wget_mode (_IO_FILE *);
+extern int _IO_switch_to_wget_mode (FILE *);
libc_hidden_proto (_IO_switch_to_wget_mode)
-extern void _IO_wsetb (_IO_FILE *, wchar_t *, wchar_t *, int) __THROW;
+extern void _IO_wsetb (FILE *, wchar_t *, wchar_t *, int) __THROW;
libc_hidden_proto (_IO_wsetb)
-extern wint_t _IO_sputbackwc (_IO_FILE *, wint_t) __THROW;
+extern wint_t _IO_sputbackwc (FILE *, wint_t) __THROW;
libc_hidden_proto (_IO_sputbackwc)
-extern wint_t _IO_sungetwc (_IO_FILE *) __THROW;
-extern void _IO_wdoallocbuf (_IO_FILE *) __THROW;
+extern wint_t _IO_sungetwc (FILE *) __THROW;
+extern void _IO_wdoallocbuf (FILE *) __THROW;
libc_hidden_proto (_IO_wdoallocbuf)
-extern void _IO_unsave_wmarkers (_IO_FILE *) __THROW;
+extern void _IO_unsave_wmarkers (FILE *) __THROW;
extern unsigned _IO_adjust_wcolumn (unsigned, const wchar_t *, int) __THROW;
-extern _IO_off64_t get_file_offset (_IO_FILE *fp);
+extern off64_t get_file_offset (FILE *fp);
/* Marker-related function. */
-extern void _IO_init_marker (struct _IO_marker *, _IO_FILE *);
-extern void _IO_init_wmarker (struct _IO_marker *, _IO_FILE *);
+extern void _IO_init_marker (struct _IO_marker *, FILE *);
+extern void _IO_init_wmarker (struct _IO_marker *, FILE *);
extern void _IO_remove_marker (struct _IO_marker *) __THROW;
extern int _IO_marker_difference (struct _IO_marker *, struct _IO_marker *)
__THROW;
extern int _IO_marker_delta (struct _IO_marker *) __THROW;
extern int _IO_wmarker_delta (struct _IO_marker *) __THROW;
-extern int _IO_seekmark (_IO_FILE *, struct _IO_marker *, int) __THROW;
-extern int _IO_seekwmark (_IO_FILE *, struct _IO_marker *, int) __THROW;
+extern int _IO_seekmark (FILE *, struct _IO_marker *, int) __THROW;
+extern int _IO_seekwmark (FILE *, struct _IO_marker *, int) __THROW;
/* Functions for iterating global list and dealing with its lock */
libc_hidden_proto (_IO_iter_end)
extern _IO_ITER _IO_iter_next (_IO_ITER) __THROW;
libc_hidden_proto (_IO_iter_next)
-extern _IO_FILE *_IO_iter_file (_IO_ITER) __THROW;
+extern FILE *_IO_iter_file (_IO_ITER) __THROW;
libc_hidden_proto (_IO_iter_file)
extern void _IO_list_lock (void) __THROW;
libc_hidden_proto (_IO_list_lock)
/* Default jumptable functions. */
-extern int _IO_default_underflow (_IO_FILE *) __THROW;
-extern int _IO_default_uflow (_IO_FILE *);
+extern int _IO_default_underflow (FILE *) __THROW;
+extern int _IO_default_uflow (FILE *);
libc_hidden_proto (_IO_default_uflow)
-extern wint_t _IO_wdefault_uflow (_IO_FILE *);
+extern wint_t _IO_wdefault_uflow (FILE *);
libc_hidden_proto (_IO_wdefault_uflow)
-extern int _IO_default_doallocate (_IO_FILE *) __THROW;
+extern int _IO_default_doallocate (FILE *) __THROW;
libc_hidden_proto (_IO_default_doallocate)
-extern int _IO_wdefault_doallocate (_IO_FILE *) __THROW;
+extern int _IO_wdefault_doallocate (FILE *) __THROW;
libc_hidden_proto (_IO_wdefault_doallocate)
-extern void _IO_default_finish (_IO_FILE *, int) __THROW;
+extern void _IO_default_finish (FILE *, int) __THROW;
libc_hidden_proto (_IO_default_finish)
-extern void _IO_wdefault_finish (_IO_FILE *, int) __THROW;
+extern void _IO_wdefault_finish (FILE *, int) __THROW;
libc_hidden_proto (_IO_wdefault_finish)
-extern int _IO_default_pbackfail (_IO_FILE *, int) __THROW;
+extern int _IO_default_pbackfail (FILE *, int) __THROW;
libc_hidden_proto (_IO_default_pbackfail)
-extern wint_t _IO_wdefault_pbackfail (_IO_FILE *, wint_t) __THROW;
+extern wint_t _IO_wdefault_pbackfail (FILE *, wint_t) __THROW;
libc_hidden_proto (_IO_wdefault_pbackfail)
-extern _IO_FILE* _IO_default_setbuf (_IO_FILE *, char *, _IO_ssize_t);
-extern _IO_size_t _IO_default_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern FILE* _IO_default_setbuf (FILE *, char *, ssize_t);
+extern size_t _IO_default_xsputn (FILE *, const void *, size_t);
libc_hidden_proto (_IO_default_xsputn)
-extern _IO_size_t _IO_wdefault_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern size_t _IO_wdefault_xsputn (FILE *, const void *, size_t);
libc_hidden_proto (_IO_wdefault_xsputn)
-extern _IO_size_t _IO_default_xsgetn (_IO_FILE *, void *, _IO_size_t);
+extern size_t _IO_default_xsgetn (FILE *, void *, size_t);
libc_hidden_proto (_IO_default_xsgetn)
-extern _IO_size_t _IO_wdefault_xsgetn (_IO_FILE *, void *, _IO_size_t);
+extern size_t _IO_wdefault_xsgetn (FILE *, void *, size_t);
libc_hidden_proto (_IO_wdefault_xsgetn)
-extern _IO_off64_t _IO_default_seekoff (_IO_FILE *, _IO_off64_t, int, int)
+extern off64_t _IO_default_seekoff (FILE *, off64_t, int, int)
__THROW;
-extern _IO_off64_t _IO_default_seekpos (_IO_FILE *, _IO_off64_t, int);
-extern _IO_ssize_t _IO_default_write (_IO_FILE *, const void *, _IO_ssize_t);
-extern _IO_ssize_t _IO_default_read (_IO_FILE *, void *, _IO_ssize_t);
-extern int _IO_default_stat (_IO_FILE *, void *) __THROW;
-extern _IO_off64_t _IO_default_seek (_IO_FILE *, _IO_off64_t, int) __THROW;
-extern int _IO_default_sync (_IO_FILE *) __THROW;
+extern off64_t _IO_default_seekpos (FILE *, off64_t, int);
+extern ssize_t _IO_default_write (FILE *, const void *, ssize_t);
+extern ssize_t _IO_default_read (FILE *, void *, ssize_t);
+extern int _IO_default_stat (FILE *, void *) __THROW;
+extern off64_t _IO_default_seek (FILE *, off64_t, int) __THROW;
+extern int _IO_default_sync (FILE *) __THROW;
#define _IO_default_close ((_IO_close_t) _IO_default_sync)
-extern int _IO_default_showmanyc (_IO_FILE *) __THROW;
-extern void _IO_default_imbue (_IO_FILE *, void *) __THROW;
+extern int _IO_default_showmanyc (FILE *) __THROW;
+extern void _IO_default_imbue (FILE *, void *) __THROW;
extern const struct _IO_jump_t _IO_file_jumps;
libc_hidden_proto (_IO_file_jumps)
extern const struct _IO_jump_t _IO_str_jumps attribute_hidden;
extern const struct _IO_jump_t _IO_wstr_jumps attribute_hidden;
extern const struct _IO_codecvt __libio_codecvt attribute_hidden;
-extern int _IO_do_write (_IO_FILE *, const char *, _IO_size_t);
+extern int _IO_do_write (FILE *, const char *, size_t);
libc_hidden_proto (_IO_do_write)
-extern int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t);
-extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t);
-extern int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t);
+extern int _IO_new_do_write (FILE *, const char *, size_t);
+extern int _IO_old_do_write (FILE *, const char *, size_t);
+extern int _IO_wdo_write (FILE *, const wchar_t *, size_t);
libc_hidden_proto (_IO_wdo_write)
extern int _IO_flush_all_lockp (int);
extern int _IO_flush_all (void);
extern int _IO_cleanup (void);
extern void _IO_flush_all_linebuffered (void);
libc_hidden_proto (_IO_flush_all_linebuffered)
-extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *);
-extern int _IO_old_fgetpos (_IO_FILE *, _IO_fpos_t *);
-extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *);
-extern int _IO_old_fsetpos (_IO_FILE *, const _IO_fpos_t *);
-extern int _IO_new_fgetpos64 (_IO_FILE *, _IO_fpos64_t *);
-extern int _IO_old_fgetpos64 (_IO_FILE *, _IO_fpos64_t *);
-extern int _IO_new_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *);
-extern int _IO_old_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *);
-extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
+extern int _IO_new_fgetpos (FILE *, __fpos_t *);
+extern int _IO_old_fgetpos (FILE *, __fpos_t *);
+extern int _IO_new_fsetpos (FILE *, const __fpos_t *);
+extern int _IO_old_fsetpos (FILE *, const __fpos_t *);
+extern int _IO_new_fgetpos64 (FILE *, __fpos64_t *);
+extern int _IO_old_fgetpos64 (FILE *, __fpos64_t *);
+extern int _IO_new_fsetpos64 (FILE *, const __fpos64_t *);
+extern int _IO_old_fsetpos64 (FILE *, const __fpos64_t *);
+extern void _IO_old_init (FILE *fp, int flags) __THROW;
#define _IO_do_flush(_f) \
/* Jumptable functions for files. */
-extern int _IO_file_doallocate (_IO_FILE *) __THROW;
+extern int _IO_file_doallocate (FILE *) __THROW;
libc_hidden_proto (_IO_file_doallocate)
-extern _IO_FILE* _IO_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+extern FILE* _IO_file_setbuf (FILE *, char *, ssize_t);
libc_hidden_proto (_IO_file_setbuf)
-extern _IO_off64_t _IO_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern off64_t _IO_file_seekoff (FILE *, off64_t, int, int);
libc_hidden_proto (_IO_file_seekoff)
-extern _IO_off64_t _IO_file_seekoff_mmap (_IO_FILE *, _IO_off64_t, int, int)
+extern off64_t _IO_file_seekoff_mmap (FILE *, off64_t, int, int)
__THROW;
-extern _IO_size_t _IO_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern size_t _IO_file_xsputn (FILE *, const void *, size_t);
libc_hidden_proto (_IO_file_xsputn)
-extern _IO_size_t _IO_file_xsgetn (_IO_FILE *, void *, _IO_size_t);
+extern size_t _IO_file_xsgetn (FILE *, void *, size_t);
libc_hidden_proto (_IO_file_xsgetn)
-extern int _IO_file_stat (_IO_FILE *, void *) __THROW;
+extern int _IO_file_stat (FILE *, void *) __THROW;
libc_hidden_proto (_IO_file_stat)
-extern int _IO_file_close (_IO_FILE *) __THROW;
+extern int _IO_file_close (FILE *) __THROW;
libc_hidden_proto (_IO_file_close)
-extern int _IO_file_close_mmap (_IO_FILE *) __THROW;
-extern int _IO_file_underflow (_IO_FILE *);
+extern int _IO_file_close_mmap (FILE *) __THROW;
+extern int _IO_file_underflow (FILE *);
libc_hidden_proto (_IO_file_underflow)
-extern int _IO_file_underflow_mmap (_IO_FILE *);
-extern int _IO_file_underflow_maybe_mmap (_IO_FILE *);
-extern int _IO_file_overflow (_IO_FILE *, int);
+extern int _IO_file_underflow_mmap (FILE *);
+extern int _IO_file_underflow_maybe_mmap (FILE *);
+extern int _IO_file_overflow (FILE *, int);
libc_hidden_proto (_IO_file_overflow)
#define _IO_file_is_open(__fp) ((__fp)->_fileno != -1)
-extern _IO_FILE* _IO_file_attach (_IO_FILE *, int);
+extern FILE* _IO_file_attach (FILE *, int);
libc_hidden_proto (_IO_file_attach)
-extern _IO_FILE* _IO_file_open (_IO_FILE *, const char *, int, int, int, int);
+extern FILE* _IO_file_open (FILE *, const char *, int, int, int, int);
libc_hidden_proto (_IO_file_open)
-extern _IO_FILE* _IO_file_fopen (_IO_FILE *, const char *, const char *, int);
+extern FILE* _IO_file_fopen (FILE *, const char *, const char *, int);
libc_hidden_proto (_IO_file_fopen)
-extern _IO_ssize_t _IO_file_write (_IO_FILE *, const void *, _IO_ssize_t);
-extern _IO_ssize_t _IO_file_read (_IO_FILE *, void *, _IO_ssize_t);
+extern ssize_t _IO_file_write (FILE *, const void *, ssize_t);
+extern ssize_t _IO_file_read (FILE *, void *, ssize_t);
libc_hidden_proto (_IO_file_read)
-extern int _IO_file_sync (_IO_FILE *);
+extern int _IO_file_sync (FILE *);
libc_hidden_proto (_IO_file_sync)
-extern int _IO_file_close_it (_IO_FILE *);
+extern int _IO_file_close_it (FILE *);
libc_hidden_proto (_IO_file_close_it)
-extern _IO_off64_t _IO_file_seek (_IO_FILE *, _IO_off64_t, int) __THROW;
+extern off64_t _IO_file_seek (FILE *, off64_t, int) __THROW;
libc_hidden_proto (_IO_file_seek)
-extern void _IO_file_finish (_IO_FILE *, int);
+extern void _IO_file_finish (FILE *, int);
libc_hidden_proto (_IO_file_finish)
-extern _IO_FILE* _IO_new_file_attach (_IO_FILE *, int);
-extern int _IO_new_file_close_it (_IO_FILE *);
-extern void _IO_new_file_finish (_IO_FILE *, int);
-extern _IO_FILE* _IO_new_file_fopen (_IO_FILE *, const char *, const char *,
+extern FILE* _IO_new_file_attach (FILE *, int);
+extern int _IO_new_file_close_it (FILE *);
+extern void _IO_new_file_finish (FILE *, int);
+extern FILE* _IO_new_file_fopen (FILE *, const char *, const char *,
int);
-extern void _IO_no_init (_IO_FILE *, int, int, struct _IO_wide_data *,
+extern void _IO_no_init (FILE *, int, int, struct _IO_wide_data *,
const struct _IO_jump_t *) __THROW;
extern void _IO_new_file_init_internal (struct _IO_FILE_plus *)
__THROW attribute_hidden;
-extern _IO_FILE* _IO_new_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
-extern _IO_FILE* _IO_file_setbuf_mmap (_IO_FILE *, char *, _IO_ssize_t);
-extern int _IO_new_file_sync (_IO_FILE *);
-extern int _IO_new_file_underflow (_IO_FILE *);
-extern int _IO_new_file_overflow (_IO_FILE *, int);
-extern _IO_off64_t _IO_new_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
-extern _IO_ssize_t _IO_new_file_write (_IO_FILE *, const void *, _IO_ssize_t);
-extern _IO_size_t _IO_new_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
-
-extern _IO_FILE* _IO_old_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
-extern _IO_off64_t _IO_old_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
-extern _IO_size_t _IO_old_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
-extern int _IO_old_file_underflow (_IO_FILE *);
-extern int _IO_old_file_overflow (_IO_FILE *, int);
+extern FILE* _IO_new_file_setbuf (FILE *, char *, ssize_t);
+extern FILE* _IO_file_setbuf_mmap (FILE *, char *, ssize_t);
+extern int _IO_new_file_sync (FILE *);
+extern int _IO_new_file_underflow (FILE *);
+extern int _IO_new_file_overflow (FILE *, int);
+extern off64_t _IO_new_file_seekoff (FILE *, off64_t, int, int);
+extern ssize_t _IO_new_file_write (FILE *, const void *, ssize_t);
+extern size_t _IO_new_file_xsputn (FILE *, const void *, size_t);
+
+extern FILE* _IO_old_file_setbuf (FILE *, char *, ssize_t);
+extern off64_t _IO_old_file_seekoff (FILE *, off64_t, int, int);
+extern size_t _IO_old_file_xsputn (FILE *, const void *, size_t);
+extern int _IO_old_file_underflow (FILE *);
+extern int _IO_old_file_overflow (FILE *, int);
extern void _IO_old_file_init_internal (struct _IO_FILE_plus *)
__THROW attribute_hidden;
-extern _IO_FILE* _IO_old_file_attach (_IO_FILE *, int);
-extern _IO_FILE* _IO_old_file_fopen (_IO_FILE *, const char *, const char *);
-extern _IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t);
-extern int _IO_old_file_sync (_IO_FILE *);
-extern int _IO_old_file_close_it (_IO_FILE *);
-extern void _IO_old_file_finish (_IO_FILE *, int);
-
-extern int _IO_wfile_doallocate (_IO_FILE *) __THROW;
-extern _IO_size_t _IO_wfile_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern FILE* _IO_old_file_attach (FILE *, int);
+extern FILE* _IO_old_file_fopen (FILE *, const char *, const char *);
+extern ssize_t _IO_old_file_write (FILE *, const void *, ssize_t);
+extern int _IO_old_file_sync (FILE *);
+extern int _IO_old_file_close_it (FILE *);
+extern void _IO_old_file_finish (FILE *, int);
+
+extern int _IO_wfile_doallocate (FILE *) __THROW;
+extern size_t _IO_wfile_xsputn (FILE *, const void *, size_t);
libc_hidden_proto (_IO_wfile_xsputn)
-extern _IO_FILE* _IO_wfile_setbuf (_IO_FILE *, wchar_t *, _IO_ssize_t);
-extern wint_t _IO_wfile_sync (_IO_FILE *);
+extern FILE* _IO_wfile_setbuf (FILE *, wchar_t *, ssize_t);
+extern wint_t _IO_wfile_sync (FILE *);
libc_hidden_proto (_IO_wfile_sync)
-extern wint_t _IO_wfile_underflow (_IO_FILE *);
+extern wint_t _IO_wfile_underflow (FILE *);
libc_hidden_proto (_IO_wfile_underflow)
-extern wint_t _IO_wfile_overflow (_IO_FILE *, wint_t);
+extern wint_t _IO_wfile_overflow (FILE *, wint_t);
libc_hidden_proto (_IO_wfile_overflow)
-extern _IO_off64_t _IO_wfile_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern off64_t _IO_wfile_seekoff (FILE *, off64_t, int, int);
libc_hidden_proto (_IO_wfile_seekoff)
/* Jumptable functions for proc_files. */
-extern _IO_FILE* _IO_proc_open (_IO_FILE *, const char *, const char *)
+extern FILE* _IO_proc_open (FILE *, const char *, const char *)
__THROW;
-extern _IO_FILE* _IO_new_proc_open (_IO_FILE *, const char *, const char *)
+extern FILE* _IO_new_proc_open (FILE *, const char *, const char *)
__THROW;
-extern _IO_FILE* _IO_old_proc_open (_IO_FILE *, const char *, const char *);
-extern int _IO_proc_close (_IO_FILE *) __THROW;
-extern int _IO_new_proc_close (_IO_FILE *) __THROW;
-extern int _IO_old_proc_close (_IO_FILE *);
+extern FILE* _IO_old_proc_open (FILE *, const char *, const char *);
+extern int _IO_proc_close (FILE *) __THROW;
+extern int _IO_new_proc_close (FILE *) __THROW;
+extern int _IO_old_proc_close (FILE *);
/* Jumptable functions for strfiles. */
-extern int _IO_str_underflow (_IO_FILE *) __THROW;
+extern int _IO_str_underflow (FILE *) __THROW;
libc_hidden_proto (_IO_str_underflow)
-extern int _IO_str_overflow (_IO_FILE *, int) __THROW;
+extern int _IO_str_overflow (FILE *, int) __THROW;
libc_hidden_proto (_IO_str_overflow)
-extern int _IO_str_pbackfail (_IO_FILE *, int) __THROW;
+extern int _IO_str_pbackfail (FILE *, int) __THROW;
libc_hidden_proto (_IO_str_pbackfail)
-extern _IO_off64_t _IO_str_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW;
+extern off64_t _IO_str_seekoff (FILE *, off64_t, int, int) __THROW;
libc_hidden_proto (_IO_str_seekoff)
-extern void _IO_str_finish (_IO_FILE *, int) __THROW;
+extern void _IO_str_finish (FILE *, int) __THROW;
/* Other strfile functions */
struct _IO_strfile_;
-extern _IO_ssize_t _IO_str_count (_IO_FILE *) __THROW;
+extern ssize_t _IO_str_count (FILE *) __THROW;
/* And the wide character versions. */
-extern void _IO_wstr_init_static (_IO_FILE *, wchar_t *, _IO_size_t, wchar_t *)
+extern void _IO_wstr_init_static (FILE *, wchar_t *, size_t, wchar_t *)
__THROW;
-extern _IO_ssize_t _IO_wstr_count (_IO_FILE *) __THROW;
-extern _IO_wint_t _IO_wstr_overflow (_IO_FILE *, _IO_wint_t) __THROW;
-extern _IO_wint_t _IO_wstr_underflow (_IO_FILE *) __THROW;
-extern _IO_off64_t _IO_wstr_seekoff (_IO_FILE *, _IO_off64_t, int, int)
+extern ssize_t _IO_wstr_count (FILE *) __THROW;
+extern wint_t _IO_wstr_overflow (FILE *, wint_t) __THROW;
+extern wint_t _IO_wstr_underflow (FILE *) __THROW;
+extern off64_t _IO_wstr_seekoff (FILE *, off64_t, int, int)
__THROW;
-extern _IO_wint_t _IO_wstr_pbackfail (_IO_FILE *, _IO_wint_t) __THROW;
-extern void _IO_wstr_finish (_IO_FILE *, int) __THROW;
+extern wint_t _IO_wstr_pbackfail (FILE *, wint_t) __THROW;
+extern void _IO_wstr_finish (FILE *, int) __THROW;
extern int _IO_vasprintf (char **result_ptr, const char *format,
- _IO_va_list args) __THROW;
-extern int _IO_vdprintf (int d, const char *format, _IO_va_list arg);
-extern int _IO_vsnprintf (char *string, _IO_size_t maxlen,
- const char *format, _IO_va_list args) __THROW;
+ va_list args) __THROW;
+extern int _IO_vdprintf (int d, const char *format, va_list arg);
+extern int _IO_vsnprintf (char *string, size_t maxlen,
+ const char *format, va_list args) __THROW;
-extern _IO_size_t _IO_getline (_IO_FILE *,char *, _IO_size_t, int, int);
+extern size_t _IO_getline (FILE *,char *, size_t, int, int);
libc_hidden_proto (_IO_getline)
-extern _IO_size_t _IO_getline_info (_IO_FILE *,char *, _IO_size_t,
+extern size_t _IO_getline_info (FILE *,char *, size_t,
int, int, int *);
libc_hidden_proto (_IO_getline_info)
-extern _IO_ssize_t _IO_getdelim (char **, _IO_size_t *, int, _IO_FILE *);
-extern _IO_size_t _IO_getwline (_IO_FILE *,wchar_t *, _IO_size_t, wint_t, int);
-extern _IO_size_t _IO_getwline_info (_IO_FILE *,wchar_t *, _IO_size_t,
+extern ssize_t _IO_getdelim (char **, size_t *, int, FILE *);
+extern size_t _IO_getwline (FILE *,wchar_t *, size_t, wint_t, int);
+extern size_t _IO_getwline_info (FILE *,wchar_t *, size_t,
wint_t, int, wint_t *);
extern struct _IO_FILE_plus *_IO_list_all;
extern void (*_IO_cleanup_registration_needed) (void);
extern void _IO_str_init_static_internal (struct _IO_strfile_ *, char *,
- _IO_size_t, char *) __THROW;
-extern _IO_off64_t _IO_seekoff_unlocked (_IO_FILE *, _IO_off64_t, int, int)
+ size_t, char *) __THROW;
+extern off64_t _IO_seekoff_unlocked (FILE *, off64_t, int, int)
attribute_hidden;
-extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE *, _IO_off64_t, int)
+extern off64_t _IO_seekpos_unlocked (FILE *, off64_t, int)
attribute_hidden;
#ifndef EOF
#endif /* _G_HAVE_MMAP */
-extern int _IO_vscanf (const char *, _IO_va_list) __THROW;
+extern int _IO_vscanf (const char *, va_list) __THROW;
-/* _IO_pos_BAD is an _IO_off64_t value indicating error, unknown, or EOF. */
+/* _IO_pos_BAD is an off64_t value indicating error, unknown, or EOF. */
#ifndef _IO_pos_BAD
-# define _IO_pos_BAD ((_IO_off64_t) -1)
+# define _IO_pos_BAD ((off64_t) -1)
#endif
-/* _IO_pos_adjust adjust an _IO_off64_t by some number of bytes. */
+/* _IO_pos_adjust adjust an 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. */
+/* _IO_pos_0 is an off64_t value indicating beginning of file. */
#ifndef _IO_pos_0
-# define _IO_pos_0 ((_IO_off64_t) 0)
+# define _IO_pos_0 ((off64_t) 0)
#endif
#ifdef _IO_MTSAFE_IO
# ifdef _IO_USE_OLD_IO_FILE
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
# else
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD,\
NULL, WDP, 0 }
# endif
# ifdef _IO_USE_OLD_IO_FILE
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (FILE *) CHAIN, FD, \
0, _IO_pos_BAD }
# else
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, 0, _IO_pos_BAD, \
NULL, WDP, 0 }
# endif
static inline void
__attribute__ ((__always_inline__))
-_IO_acquire_lock_fct (_IO_FILE **p)
+_IO_acquire_lock_fct (FILE **p)
{
- _IO_FILE *fp = *p;
+ FILE *fp = *p;
if ((fp->_flags & _IO_USER_LOCK) == 0)
_IO_funlockfile (fp);
}
static inline void
__attribute__ ((__always_inline__))
-_IO_acquire_lock_clear_flags2_fct (_IO_FILE **p)
+_IO_acquire_lock_clear_flags2_fct (FILE **p)
{
- _IO_FILE *fp = *p;
+ FILE *fp = *p;
fp->_flags2 &= ~(_IO_FLAGS2_FORTIFY | _IO_FLAGS2_SCANF_STD);
if ((fp->_flags & _IO_USER_LOCK) == 0)
_IO_funlockfile (fp);
#if !defined _IO_MTSAFE_IO && IS_IN (libc)
# define _IO_acquire_lock(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file = NULL
+ FILE *_IO_acquire_lock_file = NULL
# define _IO_acquire_lock_clear_flags2(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file = (_fp)
+ FILE *_IO_acquire_lock_file = (_fp)
# define _IO_release_lock(_fp) \
if (_IO_acquire_lock_file != NULL) \
_IO_acquire_lock_file->_flags2 &= ~(_IO_FLAGS2_FORTIFY \
{
_IO_strfile _sf;
char **bufloc;
- _IO_size_t *sizeloc;
+ size_t *sizeloc;
};
-static int _IO_mem_sync (_IO_FILE* fp) __THROW;
-static void _IO_mem_finish (_IO_FILE* fp, int) __THROW;
+static int _IO_mem_sync (FILE* fp) __THROW;
+static void _IO_mem_finish (FILE* fp, int) __THROW;
static const struct _IO_jump_t _IO_mem_jumps libio_vtable =
/* Open a stream that writes into a malloc'd buffer that is expanded as
necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
and the number of characters written on fflush or fclose. */
-_IO_FILE *
-__open_memstream (char **bufloc, _IO_size_t *sizeloc)
+FILE *
+__open_memstream (char **bufloc, size_t *sizeloc)
{
struct locked_FILE
{
new_f->fp._sf._sbf._f._lock = &new_f->lock;
#endif
- buf = calloc (1, _IO_BUFSIZ);
+ buf = calloc (1, BUFSIZ);
if (buf == NULL)
{
free (new_f);
}
_IO_init_internal (&new_f->fp._sf._sbf._f, 0);
_IO_JUMPS_FILE_plus (&new_f->fp._sf._sbf) = &_IO_mem_jumps;
- _IO_str_init_static_internal (&new_f->fp._sf, buf, _IO_BUFSIZ, buf);
+ _IO_str_init_static_internal (&new_f->fp._sf, buf, BUFSIZ, buf);
new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF;
new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc;
new_f->fp._sf._s._free_buffer = (_IO_free_type) free;
/* Disable single thread optimization. BZ 21735. */
new_f->fp._sf._sbf._f._flags2 |= _IO_FLAGS2_NEED_LOCK;
- return (_IO_FILE *) &new_f->fp._sf._sbf;
+ return (FILE *) &new_f->fp._sf._sbf;
}
libc_hidden_def (__open_memstream)
weak_alias (__open_memstream, open_memstream)
static int
-_IO_mem_sync (_IO_FILE *fp)
+_IO_mem_sync (FILE *fp)
{
struct _IO_FILE_memstream *mp = (struct _IO_FILE_memstream *) fp;
static void
-_IO_mem_finish (_IO_FILE *fp, int dummy)
+_IO_mem_finish (FILE *fp, int dummy)
{
struct _IO_FILE_memstream *mp = (struct _IO_FILE_memstream *) fp;
static int
-_IO_obstack_overflow (_IO_FILE *fp, int c)
+_IO_obstack_overflow (FILE *fp, int c)
{
struct obstack *obstack = ((struct _IO_obstack_file *) fp)->obstack;
int size;
}
-static _IO_size_t
-_IO_obstack_xsputn (_IO_FILE *fp, const void *data, _IO_size_t n)
+static size_t
+_IO_obstack_xsputn (FILE *fp, const void *data, size_t n)
{
struct obstack *obstack = ((struct _IO_obstack_file *) fp)->obstack;
int
attribute_compat_text_section
-_IO_old_file_close_it (_IO_FILE *fp)
+_IO_old_file_close_it (FILE *fp)
{
int write_status, close_status;
if (!_IO_file_is_open (fp))
void
attribute_compat_text_section
-_IO_old_file_finish (_IO_FILE *fp, int dummy)
+_IO_old_file_finish (FILE *fp, int dummy)
{
if (_IO_file_is_open (fp))
{
_IO_default_finish (fp, 0);
}
-_IO_FILE *
+FILE *
attribute_compat_text_section
-_IO_old_file_fopen (_IO_FILE *fp, const char *filename, const char *mode)
+_IO_old_file_fopen (FILE *fp, const char *filename, const char *mode)
{
int oflags = 0, omode;
int read_write, fdesc;
fp->_fileno = fdesc;
_IO_mask_flags (fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
if (read_write & _IO_IS_APPENDING)
- if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
+ if (_IO_SEEKOFF (fp, (off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
== _IO_pos_BAD && errno != ESPIPE)
return NULL;
_IO_link_in ((struct _IO_FILE_plus *) fp);
return fp;
}
-_IO_FILE *
+FILE *
attribute_compat_text_section
-_IO_old_file_attach (_IO_FILE *fp, int fd)
+_IO_old_file_attach (FILE *fp, int fd)
{
if (_IO_file_is_open (fp))
return NULL;
/* Get the current position of the file. */
/* We have to do that since that may be junk. */
fp->_old_offset = _IO_pos_BAD;
- if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
+ if (_IO_SEEKOFF (fp, (off_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
== _IO_pos_BAD && errno != ESPIPE)
return NULL;
return fp;
}
-_IO_FILE *
+FILE *
attribute_compat_text_section
-_IO_old_file_setbuf (_IO_FILE *fp, char *p, _IO_ssize_t len)
+_IO_old_file_setbuf (FILE *fp, char *p, ssize_t len)
{
if (_IO_default_setbuf (fp, p, len) == NULL)
return NULL;
return fp;
}
-static int old_do_write (_IO_FILE *, const char *, _IO_size_t);
+static int old_do_write (FILE *, const char *, size_t);
/* Write TO_DO bytes from DATA to FP.
Then mark FP as having empty buffers. */
int
attribute_compat_text_section
-_IO_old_do_write (_IO_FILE *fp, const char *data, _IO_size_t to_do)
+_IO_old_do_write (FILE *fp, const char *data, size_t to_do)
{
- return (to_do == 0 || (_IO_size_t) old_do_write (fp, data, to_do) == to_do)
+ return (to_do == 0 || (size_t) old_do_write (fp, data, to_do) == to_do)
? 0 : EOF;
}
static int
attribute_compat_text_section
-old_do_write (_IO_FILE *fp, const char *data, _IO_size_t to_do)
+old_do_write (FILE *fp, const char *data, size_t to_do)
{
- _IO_size_t count;
+ size_t count;
if (fp->_flags & _IO_IS_APPENDING)
/* On a system without a proper O_APPEND implementation,
you would need to sys_seek(0, SEEK_END) here, but is
fp->_old_offset = _IO_pos_BAD;
else if (fp->_IO_read_end != fp->_IO_write_base)
{
- _IO_off_t new_pos
+ off_t new_pos
= _IO_SYSSEEK (fp, fp->_IO_write_base - fp->_IO_read_end, 1);
if (new_pos == _IO_pos_BAD)
return 0;
int
attribute_compat_text_section
-_IO_old_file_underflow (_IO_FILE *fp)
+_IO_old_file_underflow (FILE *fp)
{
- _IO_ssize_t count;
+ ssize_t count;
#if 0
/* SysV does not make this test; take it out for compatibility */
if (fp->_flags & _IO_EOF_SEEN)
int
attribute_compat_text_section
-_IO_old_file_overflow (_IO_FILE *f, int ch)
+_IO_old_file_overflow (FILE *f, int ch)
{
if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
{
int
attribute_compat_text_section
-_IO_old_file_sync (_IO_FILE *fp)
+_IO_old_file_sync (FILE *fp)
{
- _IO_ssize_t delta;
+ ssize_t delta;
int retval = 0;
/* char* ptr = cur_ptr(); */
if (_IO_in_backup (fp))
delta -= eGptr () - Gbase ();
#endif
- _IO_off_t new_pos = _IO_SYSSEEK (fp, delta, 1);
- if (new_pos != (_IO_off_t) EOF)
+ off_t new_pos = _IO_SYSSEEK (fp, delta, 1);
+ if (new_pos != (off_t) EOF)
fp->_IO_read_end = fp->_IO_read_ptr;
else if (errno == ESPIPE)
; /* Ignore error from unseekable devices. */
return retval;
}
-_IO_off64_t
+off64_t
attribute_compat_text_section
-_IO_old_file_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+_IO_old_file_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
- _IO_off_t result;
- _IO_off64_t delta, new_offset;
+ off_t result;
+ off64_t delta, new_offset;
long count;
/* POSIX.1 8.2.3.7 says that after a call the fflush() the file
offset of the underlying file must be exact. */
&& !_IO_in_backup (fp))
{
/* Offset relative to start of main get area. */
- _IO_off_t rel_offset = (offset - fp->_old_offset
- + (fp->_IO_read_end - fp->_IO_read_base));
+ off_t rel_offset = (offset - fp->_old_offset
+ + (fp->_IO_read_end - fp->_IO_read_base));
if (rel_offset >= 0)
{
#if 0
return offset;
}
-_IO_ssize_t
+ssize_t
attribute_compat_text_section
-_IO_old_file_write (_IO_FILE *f, const void *data, _IO_ssize_t n)
+_IO_old_file_write (FILE *f, const void *data, ssize_t n)
{
- _IO_ssize_t to_do = n;
+ ssize_t to_do = n;
while (to_do > 0)
{
- _IO_ssize_t count = __write (f->_fileno, data, to_do);
+ ssize_t count = __write (f->_fileno, data, to_do);
if (count == EOF)
{
f->_flags |= _IO_ERR_SEEN;
return n;
}
-_IO_size_t
+size_t
attribute_compat_text_section
-_IO_old_file_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
+_IO_old_file_xsputn (FILE *f, const void *data, size_t n)
{
const char *s = (char *) data;
- _IO_size_t to_do = n;
+ size_t to_do = n;
int must_flush = 0;
- _IO_size_t count = 0;
+ size_t count = 0;
if (n <= 0)
return 0;
}
if (to_do + must_flush > 0)
{
- _IO_size_t block_size, do_write;
+ size_t block_size, do_write;
/* Next flush the (full) buffer. */
if (__overflow (f, EOF) == EOF)
return to_do == 0 ? EOF : n - to_do;
int mybuffer;
int binmode;
size_t size;
- _IO_off64_t pos;
+ off64_t pos;
size_t maxpos;
};
static int
-fmemopen_seek (void *cookie, _IO_off64_t *p, int w)
+fmemopen_seek (void *cookie, off64_t *p, int w)
{
- _IO_off64_t np;
+ off64_t np;
fmemopen_cookie_t *c;
c = (fmemopen_cookie_t *) cookie;
int
attribute_compat_text_section
-_IO_old_fclose (_IO_FILE *fp)
+_IO_old_fclose (FILE *fp)
{
int status;
#include "libioP.h"
#include <fcntl.h>
-_IO_FILE *
+FILE *
attribute_compat_text_section
_IO_old_fdopen (int fd, const char *mode)
{
_IO_mask_flags (&new_f->fp.file._file, read_write,
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
- return (_IO_FILE *) &new_f->fp;
+ return (FILE *) &new_f->fp;
}
strong_alias (_IO_old_fdopen, __old_fdopen)
int
attribute_compat_text_section
-_IO_old_fgetpos (_IO_FILE *fp, _IO_fpos_t *posp)
+_IO_old_fgetpos (FILE *fp, __fpos_t *posp)
{
- _IO_off_t pos;
+ off_t pos;
CHECK_FILE (fp, EOF);
_IO_acquire_lock (fp);
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
int
attribute_compat_text_section
-_IO_old_fgetpos64 (_IO_FILE *fp, _IO_fpos64_t *posp)
+_IO_old_fgetpos64 (FILE *fp, __fpos64_t *posp)
{
- _IO_off64_t pos;
+ off64_t pos;
CHECK_FILE (fp, EOF);
_IO_acquire_lock (fp);
pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
#include <stdlib.h>
-_IO_FILE *
+FILE *
attribute_compat_text_section
_IO_old_fopen (const char *filename, const char *mode)
{
#if !_IO_UNIFIED_JUMPTABLES
new_f->fp.vtable = NULL;
#endif
- if (_IO_old_file_fopen ((_IO_FILE *) &new_f->fp, filename, mode) != NULL)
- return (_IO_FILE *) &new_f->fp;
+ if (_IO_old_file_fopen ((FILE *) &new_f->fp, filename, mode) != NULL)
+ return (FILE *) &new_f->fp;
_IO_un_link ((struct _IO_FILE_plus *) &new_f->fp);
free (new_f);
return NULL;
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
int
attribute_compat_text_section
-_IO_old_fsetpos (_IO_FILE *fp, const _IO_fpos_t *posp)
+_IO_old_fsetpos (FILE *fp, const __fpos_t *posp)
{
int result;
CHECK_FILE (fp, EOF);
int
attribute_compat_text_section
-_IO_old_fsetpos64 (_IO_FILE *fp, const _IO_fpos64_t *posp)
+_IO_old_fsetpos64 (FILE *fp, const __fpos64_t *posp)
{
int result;
CHECK_FILE (fp, EOF);
{
struct _IO_FILE_complete_plus file;
/* Following fields must match those in class procbuf (procbuf.h) */
- _IO_pid_t pid;
+ pid_t pid;
struct _IO_proc_file *next;
};
typedef struct _IO_proc_file _IO_proc_file;
}
#endif
-_IO_FILE *
+FILE *
attribute_compat_text_section
-_IO_old_proc_open (_IO_FILE *fp, const char *command, const char *mode)
+_IO_old_proc_open (FILE *fp, const char *command, const char *mode)
{
volatile int read_or_write;
volatile int parent_end, child_end;
int pipe_fds[2];
- _IO_pid_t child_pid;
+ pid_t child_pid;
if (_IO_file_is_open (fp))
return NULL;
if (__pipe (pipe_fds) < 0)
popen() calls that remain open in the parent process are closed
in the new child process." */
for (p = old_proc_file_chain; p; p = p->next)
- __close (_IO_fileno ((_IO_FILE *) p));
+ __close (_IO_fileno ((FILE *) p));
execl ("/bin/sh", "sh", "-c", command, (char *) 0);
_exit (127);
return fp;
}
-_IO_FILE *
+FILE *
attribute_compat_text_section
_IO_old_popen (const char *command, const char *mode)
{
_IO_lock_t lock;
#endif
} *new_f;
- _IO_FILE *fp;
+ FILE *fp;
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
int
attribute_compat_text_section
-_IO_old_proc_close (_IO_FILE *fp)
+_IO_old_proc_close (FILE *fp)
{
/* This is not name-space clean. FIXME! */
int wstatus;
_IO_proc_file **ptr = &old_proc_file_chain;
- _IO_pid_t wait_pid;
+ pid_t wait_pid;
int status = -1;
/* Unlink from old_proc_file_chain. */
if (&_IO_stdin_used == NULL)
{
/* We are using the old one. */
- _IO_stdin = stdin = (_IO_FILE *) &_IO_stdin_;
- _IO_stdout = stdout = (_IO_FILE *) &_IO_stdout_;
- _IO_stderr = stderr = (_IO_FILE *) &_IO_stderr_;
+ _IO_stdin = stdin = (FILE *) &_IO_stdin_;
+ _IO_stdout = stdout = (FILE *) &_IO_stdout_;
+ _IO_stderr = stderr = (FILE *) &_IO_stderr_;
_IO_list_all = &_IO_stderr_;
_IO_stdin->_vtable_offset = _IO_stdout->_vtable_offset =
_IO_stderr->_vtable_offset = stdin->_vtable_offset =
#undef _IO_peekc
int
-_IO_peekc_locked (_IO_FILE *fp)
+_IO_peekc_locked (FILE *fp)
{
int result;
CHECK_FILE (fp, EOF);
#undef _IO_putc
int
-_IO_putc (int c, _IO_FILE *fp)
+_IO_putc (int c, FILE *fp)
{
int result;
CHECK_FILE (fp, EOF);
#undef putc_unlocked
int
-__putc_unlocked (int c, _IO_FILE *fp)
+__putc_unlocked (int c, FILE *fp)
{
CHECK_FILE (fp, EOF);
return _IO_putc_unlocked (c, fp);
#include <wchar.h>
wint_t
-putwc (wchar_t wc, _IO_FILE *fp)
+putwc (wchar_t wc, FILE *fp)
{
wint_t result;
CHECK_FILE (fp, WEOF);
#include <wchar.h>
wint_t
-putwc_unlocked (wchar_t wc, _IO_FILE *fp)
+putwc_unlocked (wchar_t wc, FILE *fp)
{
CHECK_FILE (fp, WEOF);
return _IO_putwc_unlocked (wc, fp);
#include <stdio.h>
void
-rewind (_IO_FILE *fp)
+rewind (FILE *fp)
{
CHECK_FILE (fp, );
_IO_acquire_lock (fp);
#include "stdio.h"
void
-setbuf (_IO_FILE *fp, char *buf)
+setbuf (FILE *fp, char *buf)
{
- _IO_setbuffer (fp, buf, _IO_BUFSIZ);
+ _IO_setbuffer (fp, buf, BUFSIZ);
}
#undef setlinebuf
void
-setlinebuf (_IO_FILE *stream)
+setlinebuf (FILE *stream)
{
_IO_setvbuf (stream, NULL, 1, 0);
}
#undef stdin
#undef stdout
#undef stderr
-_IO_FILE *stdin = (FILE *) &_IO_2_1_stdin_;
-_IO_FILE *stdout = (FILE *) &_IO_2_1_stdout_;
-_IO_FILE *stderr = (FILE *) &_IO_2_1_stderr_;
+FILE *stdin = (FILE *) &_IO_2_1_stdin_;
+FILE *stdout = (FILE *) &_IO_2_1_stdout_;
+FILE *stderr = (FILE *) &_IO_2_1_stderr_;
#undef _IO_stdin
#undef _IO_stdout
in files containing the exception. */
#include <stdio.h>
+#include "libioP.h"
-typedef void *(*_IO_alloc_type) (_IO_size_t);
+typedef void *(*_IO_alloc_type) (size_t);
typedef void (*_IO_free_type) (void*);
struct _IO_str_fields
struct _IO_streambuf
{
- struct _IO_FILE _f;
+ FILE _f;
const struct _IO_jump_t *vtable;
};
#include <stdio_ext.h>
void
-_IO_str_init_static_internal (_IO_strfile *sf, char *ptr, _IO_size_t size,
+_IO_str_init_static_internal (_IO_strfile *sf, char *ptr, size_t size,
char *pstart)
{
- _IO_FILE *fp = &sf->_sbf._f;
+ FILE *fp = &sf->_sbf._f;
char *end;
if (size == 0)
end = __rawmemchr (ptr, '\0');
- else if ((_IO_size_t) ptr + size > (_IO_size_t) ptr)
+ else if ((size_t) ptr + size > (size_t) ptr)
end = ptr + size;
else
end = (char *) -1;
}
int
-_IO_str_overflow (_IO_FILE *fp, int c)
+_IO_str_overflow (FILE *fp, int c)
{
int flush_only = c == EOF;
- _IO_size_t pos;
+ size_t pos;
if (fp->_flags & _IO_NO_WRITES)
return flush_only ? 0 : EOF;
if ((fp->_flags & _IO_TIED_PUT_GET) && !(fp->_flags & _IO_CURRENTLY_PUTTING))
fp->_IO_read_ptr = fp->_IO_read_end;
}
pos = fp->_IO_write_ptr - fp->_IO_write_base;
- if (pos >= (_IO_size_t) (_IO_blen (fp) + flush_only))
+ if (pos >= (size_t) (_IO_blen (fp) + flush_only))
{
if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
return EOF;
char *new_buf;
char *old_buf = fp->_IO_buf_base;
size_t old_blen = _IO_blen (fp);
- _IO_size_t new_size = 2 * old_blen + 100;
+ size_t new_size = 2 * old_blen + 100;
if (new_size < old_blen)
return EOF;
new_buf
libc_hidden_def (_IO_str_overflow)
int
-_IO_str_underflow (_IO_FILE *fp)
+_IO_str_underflow (FILE *fp)
{
if (fp->_IO_write_ptr > fp->_IO_read_end)
fp->_IO_read_end = fp->_IO_write_ptr;
/* The size of the valid part of the buffer. */
-_IO_ssize_t
-_IO_str_count (_IO_FILE *fp)
+ssize_t
+_IO_str_count (FILE *fp)
{
return ((fp->_IO_write_ptr > fp->_IO_read_end
? fp->_IO_write_ptr : fp->_IO_read_end)
static int
-enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
+enlarge_userbuf (FILE *fp, off64_t offset, int reading)
{
- if ((_IO_ssize_t) offset <= _IO_blen (fp))
+ if ((ssize_t) offset <= _IO_blen (fp))
return 0;
- _IO_ssize_t oldend = fp->_IO_write_end - fp->_IO_write_base;
+ ssize_t oldend = fp->_IO_write_end - fp->_IO_write_base;
/* Try to enlarge the buffer. */
if (fp->_flags & _IO_USER_BUF)
/* User-provided buffer. */
return 1;
- _IO_size_t newsize = offset + 100;
+ size_t newsize = offset + 100;
char *oldbuf = fp->_IO_buf_base;
char *newbuf
= (char *) (*((_IO_strfile *) fp)->_s._allocate_buffer) (newsize);
}
static void
-_IO_str_switch_to_get_mode (_IO_FILE *fp)
+_IO_str_switch_to_get_mode (FILE *fp)
{
if (_IO_in_backup (fp))
fp->_IO_read_base = fp->_IO_backup_base;
fp->_flags &= ~_IO_CURRENTLY_PUTTING;
}
-_IO_off64_t
-_IO_str_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_str_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
- _IO_off64_t new_pos;
+ off64_t new_pos;
if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))
mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);
}
else
{
- _IO_ssize_t cur_size = _IO_str_count(fp);
+ ssize_t cur_size = _IO_str_count(fp);
new_pos = EOF;
/* Move the get pointer, if requested. */
if (mode & _IOS_INPUT)
{
- _IO_ssize_t base;
+ ssize_t base;
switch (dir)
{
case _IO_seek_set:
base = cur_size;
break;
}
- _IO_ssize_t maxval = SSIZE_MAX - base;
+ ssize_t maxval = SSIZE_MAX - base;
if (offset < -base || offset > maxval)
{
__set_errno (EINVAL);
/* Move the put pointer, if requested. */
if (mode & _IOS_OUTPUT)
{
- _IO_ssize_t base;
+ ssize_t base;
switch (dir)
{
case _IO_seek_set:
base = cur_size;
break;
}
- _IO_ssize_t maxval = SSIZE_MAX - base;
+ ssize_t maxval = SSIZE_MAX - base;
if (offset < -base || offset > maxval)
{
__set_errno (EINVAL);
libc_hidden_def (_IO_str_seekoff)
int
-_IO_str_pbackfail (_IO_FILE *fp, int c)
+_IO_str_pbackfail (FILE *fp, int c)
{
if ((fp->_flags & _IO_NO_WRITES) && c != EOF)
return EOF;
libc_hidden_def (_IO_str_pbackfail)
void
-_IO_str_finish (_IO_FILE *fp, int dummy)
+_IO_str_finish (FILE *fp, int dummy)
{
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
(((_IO_strfile *) fp)->_s._free_buffer) (fp->_IO_buf_base);
#include "strfile.h"
int
-_IO_vasprintf (char **result_ptr, const char *format, _IO_va_list args)
+_IO_vasprintf (char **result_ptr, const char *format, va_list args)
{
/* Initial size of the buffer to be used. Will be doubled each time an
overflow occurs. */
- const _IO_size_t init_string_size = 100;
+ const size_t init_string_size = 100;
char *string;
_IO_strfile sf;
int ret;
- _IO_size_t needed;
- _IO_size_t allocated;
+ size_t needed;
+ size_t allocated;
/* No need to clear the memory here (unlike for open_memstream) since
we know we will never seek on the stream. */
string = (char *) malloc (init_string_size);
#undef vscanf
int
-_IO_vscanf (const char *format, _IO_va_list args)
+_IO_vscanf (const char *format, va_list args)
{
return _IO_vfscanf (_IO_stdin, format, args, NULL);
}
#include "libioP.h"
#include "strfile.h"
-static int _IO_strn_overflow (_IO_FILE *fp, int c) __THROW;
+static int _IO_strn_overflow (FILE *fp, int c) __THROW;
static int
-_IO_strn_overflow (_IO_FILE *fp, int c)
+_IO_strn_overflow (FILE *fp, int c)
{
/* When we come to here this means the user supplied buffer is
filled. But since we must return the number of characters which
int
-_IO_vsnprintf (char *string, _IO_size_t maxlen, const char *format,
- _IO_va_list args)
+_IO_vsnprintf (char *string, size_t maxlen, const char *format,
+ va_list args)
{
_IO_strnfile sf;
int ret;
#include "strfile.h"
-static wint_t _IO_wstrn_overflow (_IO_FILE *fp, wint_t c) __THROW;
+static wint_t _IO_wstrn_overflow (FILE *fp, wint_t c) __THROW;
static wint_t
-_IO_wstrn_overflow (_IO_FILE *fp, wint_t c)
+_IO_wstrn_overflow (FILE *fp, wint_t c)
{
/* When we come to here this means the user supplied buffer is
filled. But since we must return the number of characters which
int
-_IO_vswprintf (wchar_t *string, _IO_size_t maxlen, const wchar_t *format,
- _IO_va_list args)
+_IO_vswprintf (wchar_t *string, size_t maxlen, const wchar_t *format,
+ va_list args)
{
_IO_wstrnfile sf;
int ret;
_IO_fwide (&sf.f._sbf._f, 1);
string[0] = L'\0';
_IO_wstr_init_static (&sf.f._sbf._f, string, maxlen - 1, string);
- ret = _IO_vfwprintf ((_IO_FILE *) &sf.f._sbf, format, args);
+ ret = _IO_vfwprintf ((FILE *) &sf.f._sbf, format, args);
if (sf.f._sbf._f._wide_data->_IO_buf_base == sf.overflow_buf)
/* ISO C99 requires swprintf/vswprintf to return an error if the
#include <wchar.h>
int
-__vwscanf (const wchar_t *format, _IO_va_list args)
+__vwscanf (const wchar_t *format, va_list args)
{
return _IO_vfwscanf (_IO_stdin, format, args, NULL);
}
/* Allocate a file buffer, or switch to unbuffered I/O. */
int
-_IO_wfile_doallocate (_IO_FILE *fp)
+_IO_wfile_doallocate (FILE *fp)
{
- _IO_size_t size;
+ size_t size;
wchar_t *p;
/* Allocate room for the external buffer. */
/* Convert TO_DO wide character from DATA to FP.
Then mark FP as having empty buffers. */
int
-_IO_wdo_write (_IO_FILE *fp, const wchar_t *data, _IO_size_t to_do)
+_IO_wdo_write (FILE *fp, const wchar_t *data, size_t to_do)
{
struct _IO_codecvt *cc = fp->_codecvt;
wint_t
-_IO_wfile_underflow (_IO_FILE *fp)
+_IO_wfile_underflow (FILE *fp)
{
struct _IO_codecvt *cd;
enum __codecvt_result status;
- _IO_ssize_t count;
+ ssize_t count;
if (__glibc_unlikely (fp->_flags & _IO_NO_READS))
{
static wint_t
-_IO_wfile_underflow_mmap (_IO_FILE *fp)
+_IO_wfile_underflow_mmap (FILE *fp)
{
struct _IO_codecvt *cd;
const char *read_stop;
}
static wint_t
-_IO_wfile_underflow_maybe_mmap (_IO_FILE *fp)
+_IO_wfile_underflow_maybe_mmap (FILE *fp)
{
/* This is the first read attempt. Doing the underflow will choose mmap
or vanilla operations and then punt to the chosen underflow routine.
wint_t
-_IO_wfile_overflow (_IO_FILE *f, wint_t wch)
+_IO_wfile_overflow (FILE *f, wint_t wch)
{
if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
{
libc_hidden_def (_IO_wfile_overflow)
wint_t
-_IO_wfile_sync (_IO_FILE *fp)
+_IO_wfile_sync (FILE *fp)
{
- _IO_ssize_t delta;
+ ssize_t delta;
wint_t retval = 0;
/* char* ptr = cur_ptr(); */
/* We have to find out how many bytes we have to go back in the
external buffer. */
struct _IO_codecvt *cv = fp->_codecvt;
- _IO_off64_t new_pos;
+ off64_t new_pos;
int clen = (*cv->__codecvt_do_encoding) (cv);
}
new_pos = _IO_SYSSEEK (fp, delta, 1);
- if (new_pos != (_IO_off64_t) EOF)
+ if (new_pos != (off64_t) EOF)
{
fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_read_ptr;
fp->_IO_read_end = fp->_IO_read_ptr;
Returns 0 on success and -1 on error with the _IO_ERR_SEEN flag set. */
static int
-adjust_wide_data (_IO_FILE *fp, bool do_convert)
+adjust_wide_data (FILE *fp, bool do_convert)
{
struct _IO_codecvt *cv = fp->_codecvt;
/* ftell{,o} implementation for wide mode. Don't modify any state of the file
pointer while we try to get the current state of the stream except in one
case, which is when we have unflushed writes in append mode. */
-static _IO_off64_t
-do_ftell_wide (_IO_FILE *fp)
+static off64_t
+do_ftell_wide (FILE *fp)
{
- _IO_off64_t result, offset = 0;
+ off64_t result, offset = 0;
/* No point looking for offsets in the buffer if it hasn't even been
allocated. */
return result;
}
-_IO_off64_t
-_IO_wfile_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_wfile_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
- _IO_off64_t result;
- _IO_off64_t delta, new_offset;
+ off64_t result;
+ off64_t delta, new_offset;
long int count;
/* Short-circuit into a separate function. We don't want to mix any
if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
&& !_IO_in_backup (fp))
{
- _IO_off64_t start_offset = (fp->_offset
- - (fp->_IO_read_end - fp->_IO_buf_base));
+ off64_t start_offset = (fp->_offset
+ - (fp->_IO_read_end - fp->_IO_buf_base));
if (offset >= start_offset && offset < fp->_offset)
{
_IO_setg (fp, fp->_IO_buf_base,
libc_hidden_def (_IO_wfile_seekoff)
-_IO_size_t
-_IO_wfile_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
+size_t
+_IO_wfile_xsputn (FILE *f, const void *data, size_t n)
{
const wchar_t *s = (const wchar_t *) data;
- _IO_size_t to_do = n;
+ size_t to_do = n;
int must_flush = 0;
- _IO_size_t count;
+ size_t count;
if (n <= 0)
return 0;
#include <wchar.h>
-static int save_for_wbackup (_IO_FILE *fp, wchar_t *end_p) __THROW;
+static int save_for_wbackup (FILE *fp, wchar_t *end_p) __THROW;
/* Return minimum _pos markers
Assumes the current get area is the main get area. */
-_IO_ssize_t
-_IO_least_wmarker (_IO_FILE *fp, wchar_t *end_p)
+ssize_t
+_IO_least_wmarker (FILE *fp, wchar_t *end_p)
{
- _IO_ssize_t least_so_far = end_p - fp->_wide_data->_IO_read_base;
+ ssize_t least_so_far = end_p - fp->_wide_data->_IO_read_base;
struct _IO_marker *mark;
for (mark = fp->_markers; mark != NULL; mark = mark->_next)
if (mark->_pos < least_so_far)
/* Switch current get area from backup buffer to (start of) main get area. */
void
-_IO_switch_to_main_wget_area (_IO_FILE *fp)
+_IO_switch_to_main_wget_area (FILE *fp)
{
wchar_t *tmp;
fp->_flags &= ~_IO_IN_BACKUP;
/* Switch current get area from main get area to (end of) backup area. */
void
-_IO_switch_to_wbackup_area (_IO_FILE *fp)
+_IO_switch_to_wbackup_area (FILE *fp)
{
wchar_t *tmp;
fp->_flags |= _IO_IN_BACKUP;
void
-_IO_wsetb (_IO_FILE *f, wchar_t *b, wchar_t *eb, int a)
+_IO_wsetb (FILE *f, wchar_t *b, wchar_t *eb, int a)
{
if (f->_wide_data->_IO_buf_base && !(f->_flags2 & _IO_FLAGS2_USER_WBUF))
free (f->_wide_data->_IO_buf_base);
wint_t
-_IO_wdefault_pbackfail (_IO_FILE *fp, wint_t c)
+_IO_wdefault_pbackfail (FILE *fp, wint_t c)
{
if (fp->_wide_data->_IO_read_ptr > fp->_wide_data->_IO_read_base
&& !_IO_in_backup (fp)
else if (fp->_wide_data->_IO_read_ptr <= fp->_wide_data->_IO_read_base)
{
/* Increase size of existing backup buffer. */
- _IO_size_t new_size;
- _IO_size_t old_size = (fp->_wide_data->_IO_read_end
- - fp->_wide_data->_IO_read_base);
+ size_t new_size;
+ size_t old_size = (fp->_wide_data->_IO_read_end
+ - fp->_wide_data->_IO_read_base);
wchar_t *new_buf;
new_size = 2 * old_size;
new_buf = (wchar_t *) malloc (new_size * sizeof (wchar_t));
void
-_IO_wdefault_finish (_IO_FILE *fp, int dummy)
+_IO_wdefault_finish (FILE *fp, int dummy)
{
struct _IO_marker *mark;
if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF))
wint_t
-_IO_wdefault_uflow (_IO_FILE *fp)
+_IO_wdefault_uflow (FILE *fp)
{
wint_t wch;
wch = _IO_UNDERFLOW (fp);
wint_t
-__woverflow (_IO_FILE *f, wint_t wch)
+__woverflow (FILE *f, wint_t wch)
{
if (f->_mode == 0)
_IO_fwide (f, 1);
wint_t
-__wuflow (_IO_FILE *fp)
+__wuflow (FILE *fp)
{
if (fp->_mode < 0 || (fp->_mode == 0 && _IO_fwide (fp, 1) != 1))
return WEOF;
libc_hidden_def (__wuflow)
wint_t
-__wunderflow (_IO_FILE *fp)
+__wunderflow (FILE *fp)
{
if (fp->_mode < 0 || (fp->_mode == 0 && _IO_fwide (fp, 1) != 1))
return WEOF;
libc_hidden_def (__wunderflow)
-_IO_size_t
-_IO_wdefault_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
+size_t
+_IO_wdefault_xsputn (FILE *f, const void *data, size_t n)
{
const wchar_t *s = (const wchar_t *) data;
- _IO_size_t more = n;
+ size_t more = n;
if (more <= 0)
return 0;
for (;;)
{
/* Space available. */
- _IO_ssize_t count = (f->_wide_data->_IO_write_end
- - f->_wide_data->_IO_write_ptr);
+ ssize_t count = (f->_wide_data->_IO_write_end
+ - f->_wide_data->_IO_write_ptr);
if (count > 0)
{
- if ((_IO_size_t) count > more)
+ if ((size_t) count > more)
count = more;
if (count > 20)
{
else
{
wchar_t *p = f->_wide_data->_IO_write_ptr;
- _IO_ssize_t i;
+ ssize_t i;
for (i = count; --i >= 0; )
*p++ = *s++;
f->_wide_data->_IO_write_ptr = p;
libc_hidden_def (_IO_wdefault_xsputn)
-_IO_size_t
-_IO_wdefault_xsgetn (_IO_FILE *fp, void *data, _IO_size_t n)
+size_t
+_IO_wdefault_xsgetn (FILE *fp, void *data, size_t n)
{
- _IO_size_t more = n;
+ size_t more = n;
wchar_t *s = (wchar_t*) data;
for (;;)
{
/* Data available. */
- _IO_ssize_t count = (fp->_wide_data->_IO_read_end
- - fp->_wide_data->_IO_read_ptr);
+ ssize_t count = (fp->_wide_data->_IO_read_end
+ - fp->_wide_data->_IO_read_ptr);
if (count > 0)
{
- if ((_IO_size_t) count > more)
+ if ((size_t) count > more)
count = more;
if (count > 20)
{
void
-_IO_wdoallocbuf (_IO_FILE *fp)
+_IO_wdoallocbuf (FILE *fp)
{
if (fp->_wide_data->_IO_buf_base)
return;
int
-_IO_wdefault_doallocate (_IO_FILE *fp)
+_IO_wdefault_doallocate (FILE *fp)
{
wchar_t *buf;
- buf = malloc (_IO_BUFSIZ);
+ buf = malloc (BUFSIZ);
if (__glibc_unlikely (buf == NULL))
return EOF;
- _IO_wsetb (fp, buf, buf + _IO_BUFSIZ, 1);
+ _IO_wsetb (fp, buf, buf + BUFSIZ, 1);
return 1;
}
libc_hidden_def (_IO_wdefault_doallocate)
int
-_IO_switch_to_wget_mode (_IO_FILE *fp)
+_IO_switch_to_wget_mode (FILE *fp)
{
if (fp->_wide_data->_IO_write_ptr > fp->_wide_data->_IO_write_base)
if ((wint_t)_IO_WOVERFLOW (fp, WEOF) == WEOF)
libc_hidden_def (_IO_switch_to_wget_mode)
void
-_IO_free_wbackup_area (_IO_FILE *fp)
+_IO_free_wbackup_area (FILE *fp)
{
if (_IO_in_backup (fp))
_IO_switch_to_main_wget_area (fp); /* Just in case. */
#if 0
int
-_IO_switch_to_wput_mode (_IO_FILE *fp)
+_IO_switch_to_wput_mode (FILE *fp)
{
fp->_wide_data->_IO_write_base = fp->_wide_data->_IO_read_ptr;
fp->_wide_data->_IO_write_ptr = fp->_wide_data->_IO_read_ptr;
static int
-save_for_wbackup (_IO_FILE *fp, wchar_t *end_p)
+save_for_wbackup (FILE *fp, wchar_t *end_p)
{
/* Append [_IO_read_base..end_p] to backup area. */
- _IO_ssize_t least_mark = _IO_least_wmarker (fp, end_p);
+ ssize_t least_mark = _IO_least_wmarker (fp, end_p);
/* needed_size is how much space we need in the backup area. */
- _IO_size_t needed_size = ((end_p - fp->_wide_data->_IO_read_base)
- - least_mark);
+ size_t needed_size = ((end_p - fp->_wide_data->_IO_read_base)
+ - least_mark);
/* FIXME: Dubious arithmetic if pointers are NULL */
- _IO_size_t current_Bsize = (fp->_wide_data->_IO_save_end
- - fp->_wide_data->_IO_save_base);
- _IO_size_t avail; /* Extra space available for future expansion. */
- _IO_ssize_t delta;
+ size_t current_Bsize = (fp->_wide_data->_IO_save_end
+ - fp->_wide_data->_IO_save_base);
+ size_t avail; /* Extra space available for future expansion. */
+ ssize_t delta;
struct _IO_marker *mark;
if (needed_size > current_Bsize)
{
}
wint_t
-_IO_sputbackwc (_IO_FILE *fp, wint_t c)
+_IO_sputbackwc (FILE *fp, wint_t c)
{
wint_t result;
libc_hidden_def (_IO_sputbackwc)
wint_t
-_IO_sungetwc (_IO_FILE *fp)
+_IO_sungetwc (FILE *fp)
{
wint_t result;
}
void
-_IO_init_wmarker (struct _IO_marker *marker, _IO_FILE *fp)
+_IO_init_wmarker (struct _IO_marker *marker, FILE *fp)
{
marker->_sbuf = fp;
if (_IO_in_put_mode (fp))
}
int
-_IO_seekwmark (_IO_FILE *fp, struct _IO_marker *mark, int delta)
+_IO_seekwmark (FILE *fp, struct _IO_marker *mark, int delta)
{
if (mark->_sbuf != fp)
return EOF;
}
void
-_IO_unsave_wmarkers (_IO_FILE *fp)
+_IO_unsave_wmarkers (FILE *fp)
{
struct _IO_marker *mark = fp->_markers;
if (mark)
{
_IO_strfile _sf;
wchar_t **bufloc;
- _IO_size_t *sizeloc;
+ size_t *sizeloc;
};
-static int _IO_wmem_sync (_IO_FILE* fp) __THROW;
-static void _IO_wmem_finish (_IO_FILE* fp, int) __THROW;
+static int _IO_wmem_sync (FILE* fp) __THROW;
+static void _IO_wmem_finish (FILE* fp, int) __THROW;
static const struct _IO_jump_t _IO_wmem_jumps libio_vtable =
/* Open a stream that writes into a malloc'd buffer that is expanded as
necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
and the number of characters written on fflush or fclose. */
-_IO_FILE *
-open_wmemstream (wchar_t **bufloc, _IO_size_t *sizeloc)
+FILE *
+open_wmemstream (wchar_t **bufloc, size_t *sizeloc)
{
struct locked_FILE
{
new_f->fp._sf._sbf._f._lock = &new_f->lock;
#endif
- buf = calloc (1, _IO_BUFSIZ);
+ buf = calloc (1, BUFSIZ);
if (buf == NULL)
{
free (new_f);
_IO_no_init (&new_f->fp._sf._sbf._f, 0, 0, &new_f->wd, &_IO_wmem_jumps);
_IO_fwide (&new_f->fp._sf._sbf._f, 1);
_IO_wstr_init_static (&new_f->fp._sf._sbf._f, buf,
- _IO_BUFSIZ / sizeof (wchar_t), buf);
+ BUFSIZ / sizeof (wchar_t), buf);
new_f->fp._sf._sbf._f._flags2 &= ~_IO_FLAGS2_USER_WBUF;
new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc;
new_f->fp._sf._s._free_buffer = (_IO_free_type) free;
/* Disable single thread optimization. BZ 21735. */
new_f->fp._sf._sbf._f._flags2 |= _IO_FLAGS2_NEED_LOCK;
- return (_IO_FILE *) &new_f->fp._sf._sbf;
+ return (FILE *) &new_f->fp._sf._sbf;
}
static int
-_IO_wmem_sync (_IO_FILE *fp)
+_IO_wmem_sync (FILE *fp)
{
struct _IO_FILE_wmemstream *mp = (struct _IO_FILE_wmemstream *) fp;
static void
-_IO_wmem_finish (_IO_FILE *fp, int dummy)
+_IO_wmem_finish (FILE *fp, int dummy)
{
struct _IO_FILE_wmemstream *mp = (struct _IO_FILE_wmemstream *) fp;
#include <stdio_ext.h>
void
-_IO_wstr_init_static (_IO_FILE *fp, wchar_t *ptr, _IO_size_t size,
+_IO_wstr_init_static (FILE *fp, wchar_t *ptr, size_t size,
wchar_t *pstart)
{
wchar_t *end;
if (size == 0)
end = ptr + __wcslen (ptr);
- else if ((_IO_size_t) ptr + size * sizeof (wchar_t) > (_IO_size_t) ptr)
+ else if ((size_t) ptr + size * sizeof (wchar_t) > (size_t) ptr)
end = ptr + size;
else
/* Even for misaligned ptr make sure there is integral number of wide
characters. */
- end = ptr + (-1 - (_IO_size_t) ptr) / sizeof (wchar_t);
+ end = ptr + (-1 - (size_t) ptr) / sizeof (wchar_t);
_IO_wsetb (fp, ptr, end, 0);
fp->_wide_data->_IO_write_base = ptr;
(((_IO_strfile *) fp)->_s._allocate_buffer) = (_IO_alloc_type)0;
}
-_IO_wint_t
-_IO_wstr_overflow (_IO_FILE *fp, _IO_wint_t c)
+wint_t
+_IO_wstr_overflow (FILE *fp, wint_t c)
{
int flush_only = c == WEOF;
- _IO_size_t pos;
+ size_t pos;
if (fp->_flags & _IO_NO_WRITES)
return flush_only ? 0 : WEOF;
if ((fp->_flags & _IO_TIED_PUT_GET) && !(fp->_flags & _IO_CURRENTLY_PUTTING))
fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
}
pos = fp->_wide_data->_IO_write_ptr - fp->_wide_data->_IO_write_base;
- if (pos >= (_IO_size_t) (_IO_wblen (fp) + flush_only))
+ if (pos >= (size_t) (_IO_wblen (fp) + flush_only))
{
if (fp->_flags2 & _IO_FLAGS2_USER_WBUF) /* not allowed to enlarge */
return WEOF;
wchar_t *new_buf;
wchar_t *old_buf = fp->_wide_data->_IO_buf_base;
size_t old_wblen = _IO_wblen (fp);
- _IO_size_t new_size = 2 * old_wblen + 100;
+ size_t new_size = 2 * old_wblen + 100;
if (__glibc_unlikely (new_size < old_wblen)
|| __glibc_unlikely (new_size > SIZE_MAX / sizeof (wchar_t)))
}
-_IO_wint_t
-_IO_wstr_underflow (_IO_FILE *fp)
+wint_t
+_IO_wstr_underflow (FILE *fp)
{
if (fp->_wide_data->_IO_write_ptr > fp->_wide_data->_IO_read_end)
fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_write_ptr;
/* The size of the valid part of the buffer. */
-_IO_ssize_t
-_IO_wstr_count (_IO_FILE *fp)
+ssize_t
+_IO_wstr_count (FILE *fp)
{
struct _IO_wide_data *wd = fp->_wide_data;
static int
-enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
+enlarge_userbuf (FILE *fp, off64_t offset, int reading)
{
- if ((_IO_ssize_t) offset <= _IO_wblen (fp))
+ if ((ssize_t) offset <= _IO_wblen (fp))
return 0;
struct _IO_wide_data *wd = fp->_wide_data;
- _IO_ssize_t oldend = wd->_IO_write_end - wd->_IO_write_base;
+ ssize_t oldend = wd->_IO_write_end - wd->_IO_write_base;
/* Try to enlarge the buffer. */
if (fp->_flags2 & _IO_FLAGS2_USER_WBUF)
/* User-provided buffer. */
return 1;
- _IO_size_t newsize = offset + 100;
+ size_t newsize = offset + 100;
if (__glibc_unlikely (newsize > SIZE_MAX / sizeof (wchar_t)))
return 1;
}
static void
-_IO_wstr_switch_to_get_mode (_IO_FILE *fp)
+_IO_wstr_switch_to_get_mode (FILE *fp)
{
if (_IO_in_backup (fp))
fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_backup_base;
fp->_flags &= ~_IO_CURRENTLY_PUTTING;
}
-_IO_off64_t
-_IO_wstr_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
+off64_t
+_IO_wstr_seekoff (FILE *fp, off64_t offset, int dir, int mode)
{
- _IO_off64_t new_pos;
+ off64_t new_pos;
if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))
mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);
}
else
{
- _IO_ssize_t cur_size = _IO_wstr_count (fp);
+ ssize_t cur_size = _IO_wstr_count (fp);
new_pos = EOF;
/* Move the get pointer, if requested. */
if (mode & _IOS_INPUT)
{
- _IO_ssize_t base;
+ ssize_t base;
switch (dir)
{
case _IO_seek_set:
base = cur_size;
break;
}
- _IO_ssize_t maxval = SSIZE_MAX/sizeof (wchar_t) - base;
+ ssize_t maxval = SSIZE_MAX/sizeof (wchar_t) - base;
if (offset < -base || offset > maxval)
{
__set_errno (EINVAL);
/* Move the put pointer, if requested. */
if (mode & _IOS_OUTPUT)
{
- _IO_ssize_t base;
+ ssize_t base;
switch (dir)
{
case _IO_seek_set:
base = cur_size;
break;
}
- _IO_ssize_t maxval = SSIZE_MAX/sizeof (wchar_t) - base;
+ ssize_t maxval = SSIZE_MAX/sizeof (wchar_t) - base;
if (offset < -base || offset > maxval)
{
__set_errno (EINVAL);
return new_pos;
}
-_IO_wint_t
-_IO_wstr_pbackfail (_IO_FILE *fp, _IO_wint_t c)
+wint_t
+_IO_wstr_pbackfail (FILE *fp, wint_t c)
{
if ((fp->_flags & _IO_NO_WRITES) && c != WEOF)
return WEOF;
}
void
-_IO_wstr_finish (_IO_FILE *fp, int dummy)
+_IO_wstr_finish (FILE *fp, int dummy)
{
if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF))
(((_IO_strfile *) fp)->_s._free_buffer) (fp->_wide_data->_IO_buf_base);
if (__malloc_initialized < 0)
ptmalloc_init ();
_IO_flockfile (stderr);
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+ int old_flags2 = stderr->_flags2;
+ stderr->_flags2 |= _IO_FLAGS2_NOTCANCEL;
for (i = 0, ar_ptr = &main_arena;; i++)
{
struct mallinfo mi;
fprintf (stderr, "max mmap regions = %10u\n", (unsigned int) mp_.max_n_mmaps);
fprintf (stderr, "max mmap bytes = %10lu\n",
(unsigned long) mp_.max_mmapped_mem);
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+ stderr->_flags2 = old_flags2;
_IO_funlockfile (stderr);
}
va_list ap;
va_start (ap, fmt);
_IO_flockfile (fp);
- int save_flags2 = ((_IO_FILE *)fp)->_flags2;
- ((_IO_FILE *)fp)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+ int save_flags2 = fp->_flags2;
+ fp->_flags2 |= _IO_FLAGS2_NOTCANCEL;
int res = locked_vfxprintf (fp, fmt, ap);
- ((_IO_FILE *)fp)->_flags2 = save_flags2;
+ fp->_flags2 = save_flags2;
_IO_funlockfile (fp);
va_end (ap);
return res;
#include <stddef.h>
#include <stdio.h>
+#include "../libio/libioP.h"
#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)
{
- return __getdelim (lineptr, n, '\n', stream);
+ return _IO_getdelim (lineptr, n, '\n', stream);
}
weak_alias (__getline, getline)
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
int
-__isoc99_vfscanf (FILE *stream, const char *format, _IO_va_list args)
+__isoc99_vfscanf (FILE *stream, const char *format, va_list args)
{
int done;
/* Read formatted input from STDIN according to the format string FORMAT. */
/* VARARGS2 */
int
-__isoc99_vscanf (const char *format, _IO_va_list args)
+__isoc99_vscanf (const char *format, va_list args)
{
int done;
#include "../libio/strfile.h"
int
-__isoc99_vsscanf (const char *string, const char *format, _IO_va_list args)
+__isoc99_vsscanf (const char *string, const char *format, va_list args)
{
int ret;
_IO_strfile sf;
#endif
#include <assert.h>
-/* This defines make it possible to use the same code for GNU C library and
- the GNU I/O library. */
#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
- names equal. */
#undef putc
#define putc(c, f) (wide \
? (int)_IO_putwc_unlocked (c, f) : _IO_putc_unlocked (c, f))
-#define size_t _IO_size_t
-#define FILE _IO_FILE
+
\f
/* Macros for doing the actual output. */
/* #define NDEBUG 1*/ /* Undefine this for debugging assertions. */
#include <assert.h>
-/* This defines make it possible to use the same code for GNU C library and
- the GNU I/O library. */
#include <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
- names equal. */
#undef putc
#define putc(c, f) (wide \
? (int)_IO_putwc_unlocked (c, f) : _IO_putc_unlocked (c, f))
-#define size_t _IO_size_t
-#define FILE _IO_FILE
+
\f
/* Macros for doing the actual output. */
#include <printf.h>
#include <libioP.h>
-
-/* This defines make it possible to use the same code for GNU C library and
- the GNU I/O library. */
#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
- names equal. */
#undef putc
#define putc(c, f) (wide \
? (int)_IO_putwc_unlocked (c, f) : _IO_putc_unlocked (c, f))
-#define size_t _IO_size_t
-#define FILE _IO_FILE
+
\f
/* Macros for doing the actual output. */
do { \
if (width > 0) \
{ \
- _IO_ssize_t written = _IO_padn (s, (Padchar), width); \
+ ssize_t written = _IO_padn (s, (Padchar), width); \
if (__glibc_unlikely (written != width)) \
{ \
done = -1; \
do { \
if (width > 0) \
{ \
- _IO_ssize_t written = _IO_wpadn (s, (Padchar), width); \
+ ssize_t written = _IO_wpadn (s, (Padchar), width); \
if (__glibc_unlikely (written != width)) \
{ \
done = -1; \
__THROW __attribute__ ((noinline));
/* Handle positional format specifiers. */
-static int printf_positional (_IO_FILE *s,
+static int printf_positional (FILE *s,
const CHAR_T *format, int readonly_format,
va_list ap, va_list *ap_savep, int done,
int nspecs_done, const UCHAR_T *lead_str_end,
}
\f
static int
-printf_positional (_IO_FILE *s, const CHAR_T *format, int readonly_format,
+printf_positional (FILE *s, const CHAR_T *format, int readonly_format,
va_list ap, va_list *ap_savep, int done, int nspecs_done,
const UCHAR_T *lead_str_end,
CHAR_T *work_buffer, int save_errno,
#ifdef COMPILE_WPRINTF
struct _IO_wide_data _wide_data;
#endif
- _IO_FILE *_put_stream;
+ FILE *_put_stream;
#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
#endif
};
static int
-_IO_helper_overflow (_IO_FILE *s, int c)
+_IO_helper_overflow (FILE *s, int c)
{
- _IO_FILE *target = ((struct helper_file*) s)->_put_stream;
+ FILE *target = ((struct helper_file*) s)->_put_stream;
#ifdef COMPILE_WPRINTF
int used = s->_wide_data->_IO_write_ptr - s->_wide_data->_IO_write_base;
if (used)
{
- _IO_size_t written = _IO_sputn (target, s->_wide_data->_IO_write_base,
- used);
+ size_t written = _IO_sputn (target, s->_wide_data->_IO_write_base, used);
if (written == 0 || written == WEOF)
return WEOF;
__wmemmove (s->_wide_data->_IO_write_base,
int used = s->_IO_write_ptr - s->_IO_write_base;
if (used)
{
- _IO_size_t written = _IO_sputn (target, s->_IO_write_base, used);
+ size_t written = _IO_sputn (target, s->_IO_write_base, used);
if (written == 0 || written == EOF)
return EOF;
memmove (s->_IO_write_base, s->_IO_write_base + written,
#endif
static int
-buffered_vfprintf (_IO_FILE *s, const CHAR_T *format,
- _IO_va_list args)
+buffered_vfprintf (FILE *s, const CHAR_T *format, va_list args)
{
- CHAR_T buf[_IO_BUFSIZ];
+ CHAR_T buf[BUFSIZ];
struct helper_file helper;
- _IO_FILE *hp = (_IO_FILE *) &helper._f;
+ FILE *hp = (FILE *) &helper._f;
int result, to_flush;
/* Orient the stream. */
#include <locale/localeinfo.h>
#include <libioP.h>
-#undef va_list
-#define va_list _IO_va_list
-
#ifdef COMPILE_WSCANF
# define ungetc(c, s) ((void) (c == WEOF \
|| (--read_in, \
Return the number of assignments made, or -1 for an input error. */
#ifdef COMPILE_WSCANF
int
-_IO_vfwscanf (_IO_FILE *s, const wchar_t *format, _IO_va_list argptr,
+_IO_vfwscanf (FILE *s, const wchar_t *format, va_list argptr,
int *errp)
#else
int
-_IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+_IO_vfscanf_internal (FILE *s, const char *format, va_list argptr,
int *errp)
#endif
{
# ifdef __EXCEPTIONS
# define _IO_acquire_lock(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
# define _IO_acquire_lock_clear_flags2(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
int
attribute_compat_text_section
-__nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
- int *errp)
+__nldbl__IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
int res;
set_no_long_double ();
int
attribute_hidden
-_IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap, int *errp)
+_IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
return __nldbl__IO_vfscanf (s, fmt, ap, errp);
}
# ifdef __EXCEPTIONS
# define _IO_acquire_lock(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
# define _IO_acquire_lock_clear_flags2(_fp) \
do { \
- _IO_FILE *_IO_acquire_lock_file \
+ FILE *_IO_acquire_lock_file \
__attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct))) \
= (_fp); \
_IO_flockfile (_IO_acquire_lock_file);
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
int
-__isoc99_vfwscanf (FILE *stream, const wchar_t *format, _IO_va_list args)
+__isoc99_vfwscanf (FILE *stream, const wchar_t *format, va_list args)
{
int done;
#include "../libio/strfile.h"
int
-__isoc99_vswscanf (const wchar_t *string, const wchar_t *format,
- _IO_va_list args)
+__isoc99_vswscanf (const wchar_t *string, const wchar_t *format, va_list args)
{
int ret;
_IO_strfile sf;
_IO_fwide (&sf._sbf._f, 1);
_IO_wstr_init_static (&sf._sbf._f, (wchar_t *)string, 0, NULL);
sf._sbf._f._flags2 |= _IO_FLAGS2_SCANF_STD;
- ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
+ ret = _IO_vfwscanf ((FILE *) &sf._sbf, format, args, NULL);
return ret;
}
libc_hidden_def (__isoc99_vswscanf)
/* Read formatted input from STDIN according to the format string FORMAT. */
/* VARARGS2 */
int
-__isoc99_vwscanf (const wchar_t *format, _IO_va_list args)
+__isoc99_vwscanf (const wchar_t *format, va_list args)
{
int done;