Back to index

glibc  2.9
Classes | Defines | Typedefs | Functions | Variables
libioP.h File Reference
#include <errno.h>
#include <math_ldbl_opt.h>
#include "iolibio.h"

Go to the source code of this file.

Classes

struct  _IO_jump_t
struct  _IO_FILE_plus

Defines

#define __set_errno(Val)   errno = (Val)
#define INTUSE(name)   name
#define INTDEF(name)
#define INTDEF2(name)
#define libc_hidden_proto(name)
#define libc_hidden_def(name)
#define libc_hidden_weak(name)
#define _IO_seek_set   0
#define _IO_seek_cur   1
#define _IO_seek_end   2
#define _IO_JUMPS_OFFSET   1
#define _IO_JUMPS(THIS)   (THIS)->vtable
#define _IO_WIDE_JUMPS(THIS)   ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable
#define _IO_CHECK_WIDE(THIS)   (((struct _IO_FILE *) (THIS))->_wide_data != NULL)
#define _IO_JUMPS_FUNC(THIS)
#define _IO_vtable_offset(THIS)   (THIS)->_vtable_offset
#define _IO_WIDE_JUMPS_FUNC(THIS)   _IO_WIDE_JUMPS(THIS)
#define JUMP_FIELD(TYPE, NAME)   struct { short delta1, delta2; TYPE pfn; } NAME
#define JUMP0(FUNC, THIS)   _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS)
#define JUMP1(FUNC, THIS, X1)   _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1)
#define JUMP2(FUNC, THIS, X1, X2)   _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1, X2)
#define JUMP3(FUNC, THIS, X1, X2, X3)   _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1,X2,X3)
#define JUMP_INIT(NAME, VALUE)   {0, 0, VALUE}
#define JUMP_INIT_DUMMY   JUMP_INIT(dummy, 0)
#define WJUMP0(FUNC, THIS)   _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS)
#define WJUMP1(FUNC, THIS, X1)   _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1)
#define WJUMP2(FUNC, THIS, X1, X2)   _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1, X2)
#define WJUMP3(FUNC, THIS, X1, X2, X3)   _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1,X2,X3)
#define _IO_FINISH(FP)   JUMP1 (__finish, FP, 0)
#define _IO_WFINISH(FP)   WJUMP1 (__finish, FP, 0)
#define _IO_OVERFLOW(FP, CH)   JUMP1 (__overflow, FP, CH)
#define _IO_WOVERFLOW(FP, CH)   WJUMP1 (__overflow, FP, CH)
#define _IO_UNDERFLOW(FP)   JUMP0 (__underflow, FP)
#define _IO_WUNDERFLOW(FP)   WJUMP0 (__underflow, FP)
#define _IO_UFLOW(FP)   JUMP0 (__uflow, FP)
#define _IO_WUFLOW(FP)   WJUMP0 (__uflow, FP)
#define _IO_PBACKFAIL(FP, CH)   JUMP1 (__pbackfail, FP, CH)
#define _IO_WPBACKFAIL(FP, CH)   WJUMP1 (__pbackfail, FP, CH)
#define _IO_XSPUTN(FP, DATA, N)   JUMP2 (__xsputn, FP, DATA, N)
#define _IO_WXSPUTN(FP, DATA, N)   WJUMP2 (__xsputn, FP, DATA, N)
#define _IO_XSGETN(FP, DATA, N)   JUMP2 (__xsgetn, FP, DATA, N)
#define _IO_WXSGETN(FP, DATA, N)   WJUMP2 (__xsgetn, FP, DATA, N)
#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)
#define _IO_SEEKPOS(FP, POS, FLAGS)   JUMP2 (__seekpos, FP, POS, FLAGS)
#define _IO_WSEEKPOS(FP, POS, FLAGS)   WJUMP2 (__seekpos, FP, POS, FLAGS)
#define _IO_SETBUF(FP, BUFFER, LENGTH)   JUMP2 (__setbuf, FP, BUFFER, LENGTH)
#define _IO_WSETBUF(FP, BUFFER, LENGTH)   WJUMP2 (__setbuf, FP, BUFFER, LENGTH)
#define _IO_SYNC(FP)   JUMP0 (__sync, FP)
#define _IO_WSYNC(FP)   WJUMP0 (__sync, FP)
#define _IO_DOALLOCATE(FP)   JUMP0 (__doallocate, FP)
#define _IO_WDOALLOCATE(FP)   WJUMP0 (__doallocate, FP)
#define _IO_SYSREAD(FP, DATA, LEN)   JUMP2 (__read, FP, DATA, LEN)
#define _IO_WSYSREAD(FP, DATA, LEN)   WJUMP2 (__read, FP, DATA, LEN)
#define _IO_SYSWRITE(FP, DATA, LEN)   JUMP2 (__write, FP, DATA, LEN)
#define _IO_WSYSWRITE(FP, DATA, LEN)   WJUMP2 (__write, FP, DATA, LEN)
#define _IO_SYSSEEK(FP, OFFSET, MODE)   JUMP2 (__seek, FP, OFFSET, MODE)
#define _IO_WSYSSEEK(FP, OFFSET, MODE)   WJUMP2 (__seek, FP, OFFSET, MODE)
#define _IO_SYSCLOSE(FP)   JUMP0 (__close, FP)
#define _IO_WSYSCLOSE(FP)   WJUMP0 (__close, FP)
#define _IO_SYSSTAT(FP, BUF)   JUMP1 (__stat, FP, BUF)
#define _IO_WSYSSTAT(FP, BUF)   WJUMP1 (__stat, FP, BUF)
#define _IO_SHOWMANYC(FP)   JUMP0 (__showmanyc, FP)
#define _IO_WSHOWMANYC(FP)   WJUMP0 (__showmanyc, FP)
#define _IO_IMBUE(FP, LOCALE)   JUMP1 (__imbue, FP, LOCALE)
#define _IO_WIMBUE(FP, LOCALE)   WJUMP1 (__imbue, FP, LOCALE)
#define _IO_CHAR_TYPE   char /* unsigned char ? */
#define _IO_INT_TYPE   int
#define _IO_sputn(__fp, __s, __n)   _IO_XSPUTN (__fp, __s, __n)
#define _IO_default_close   ((_IO_close_t) _IO_default_sync)
#define _IO_do_flush(_f)
#define _IO_old_do_flush(_f)
#define _IO_in_put_mode(_fp)   ((_fp)->_flags & _IO_CURRENTLY_PUTTING)
#define _IO_mask_flags(fp, f, mask)   ((fp)->_flags = ((fp)->_flags & ~(mask)) | ((f) & (mask)))
#define _IO_setg(fp, eb, g, eg)
#define _IO_wsetg(fp, eb, g, eg)
#define _IO_setp(__fp, __p, __ep)
#define _IO_wsetp(__fp, __p, __ep)
#define _IO_have_backup(fp)   ((fp)->_IO_save_base != NULL)
#define _IO_have_wbackup(fp)   ((fp)->_wide_data->_IO_save_base != NULL)
#define _IO_in_backup(fp)   ((fp)->_flags & _IO_IN_BACKUP)
#define _IO_have_markers(fp)   ((fp)->_markers != NULL)
#define _IO_blen(fp)   ((fp)->_IO_buf_end - (fp)->_IO_buf_base)
#define _IO_wblen(fp)
#define _IO_file_is_open(__fp)   ((__fp)->_fileno != -1)
#define FREE_BUF(_B, _S)   free(_B)
#define ALLOC_BUF(_B, _S, _R)
#define ALLOC_WBUF(_B, _S, _R)
#define OS_FSTAT   fstat
#define _IO_pos_adjust(pos, delta)   ((pos) += (delta))
#define _IO_pos_0   ((_IO_off64_t) 0)
#define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP)
#define _IO_va_start(args, last)   va_start(args)
#define COERCE_FILE(FILE)   /* Nothing */
#define MAYBE_SET_EINVAL   /* nothing */
#define CHECK_FILE(FILE, RET)   COERCE_FILE (FILE)

Typedefs

typedef void(* _IO_finish_t )(_IO_FILE *, int)
typedef int(* _IO_overflow_t )(_IO_FILE *, int)
typedef int(* _IO_underflow_t )(_IO_FILE *)
typedef int(* _IO_pbackfail_t )(_IO_FILE *, int)
typedef _IO_size_t(* _IO_xsputn_t )(_IO_FILE *FP, const void *DATA, _IO_size_t N)
typedef _IO_size_t(* _IO_xsgetn_t )(_IO_FILE *FP, void *DATA, _IO_size_t N)
typedef _IO_off64_t(* _IO_seekoff_t )(_IO_FILE *FP, _IO_off64_t OFF, int DIR, int MODE)
typedef _IO_off64_t(* _IO_seekpos_t )(_IO_FILE *, _IO_off64_t, int)
typedef _IO_FILE *(* _IO_setbuf_t )(_IO_FILE *, char *, _IO_ssize_t)
typedef int(* _IO_sync_t )(_IO_FILE *)
typedef int(* _IO_doallocate_t )(_IO_FILE *)
typedef _IO_ssize_t(* _IO_read_t )(_IO_FILE *, void *, _IO_ssize_t)
typedef _IO_ssize_t(* _IO_write_t )(_IO_FILE *, const void *, _IO_ssize_t)
typedef _IO_off64_t(* _IO_seek_t )(_IO_FILE *, _IO_off64_t, int)
typedef int(* _IO_close_t )(_IO_FILE *)
typedef int(* _IO_stat_t )(_IO_FILE *, void *)
typedef int(* _IO_showmanyc_t )(_IO_FILE *)
typedef void(* _IO_imbue_t )(_IO_FILE *, void *)
typedef struct _IO_FILE_IO_ITER

Functions

_IO_FILE_IO_fopencookie (void *cookie, const char *mode, _IO_cookie_io_functions_t io_functions)
void _IO_switch_to_main_get_area (_IO_FILE *) __THROW
void _IO_switch_to_backup_area (_IO_FILE *) __THROW
int _IO_switch_to_get_mode (_IO_FILE *)
void _IO_init (_IO_FILE *, int) __THROW
int _IO_sputbackc (_IO_FILE *, int) __THROW
int _IO_sungetc (_IO_FILE *) __THROW
void _IO_un_link (struct _IO_FILE_plus *) __THROW
void _IO_link_in (struct _IO_FILE_plus *) __THROW
void _IO_doallocbuf (_IO_FILE *) __THROW
void _IO_unsave_markers (_IO_FILE *) __THROW
void _IO_setb (_IO_FILE *, char *, char *, int) __THROW
unsigned _IO_adjust_column (unsigned, const char *, int) __THROW
void _IO_switch_to_main_wget_area (_IO_FILE *) __THROW
void _IO_switch_to_wbackup_area (_IO_FILE *) __THROW
int _IO_switch_to_wget_mode (_IO_FILE *)
void _IO_wsetb (_IO_FILE *, wchar_t *, wchar_t *, int) __THROW
wint_t _IO_sputbackwc (_IO_FILE *, wint_t) __THROW
wint_t _IO_sungetwc (_IO_FILE *) __THROW
void _IO_wdoallocbuf (_IO_FILE *) __THROW
void _IO_unsave_wmarkers (_IO_FILE *) __THROW
unsigned _IO_adjust_wcolumn (unsigned, const wchar_t *, int) __THROW
void _IO_init_marker (struct _IO_marker *, _IO_FILE *)
void _IO_init_wmarker (struct _IO_marker *, _IO_FILE *)
void _IO_remove_marker (struct _IO_marker *) __THROW
int _IO_marker_difference (struct _IO_marker *, struct _IO_marker *) __THROW
int _IO_marker_delta (struct _IO_marker *) __THROW
int _IO_wmarker_delta (struct _IO_marker *) __THROW
int _IO_seekmark (_IO_FILE *, struct _IO_marker *, int) __THROW
int _IO_seekwmark (_IO_FILE *, struct _IO_marker *, int) __THROW
_IO_ITER _IO_iter_begin (void) __THROW
 libc_hidden_proto (_IO_iter_begin) extern _IO_ITER _IO_iter_end(void) __THROW
 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
 libc_hidden_proto (_IO_iter_file) extern void _IO_list_lock(void) __THROW
 libc_hidden_proto (_IO_list_lock) extern void _IO_list_unlock(void) __THROW
 libc_hidden_proto (_IO_list_unlock) extern void _IO_list_resetlock(void) __THROW
 libc_hidden_proto (_IO_list_resetlock) extern int _IO_default_underflow(_IO_FILE *) __THROW
int _IO_default_uflow (_IO_FILE *)
wint_t _IO_wdefault_uflow (_IO_FILE *)
int _IO_default_doallocate (_IO_FILE *) __THROW
int _IO_wdefault_doallocate (_IO_FILE *) __THROW
void _IO_default_finish (_IO_FILE *, int) __THROW
void _IO_wdefault_finish (_IO_FILE *, int) __THROW
int _IO_default_pbackfail (_IO_FILE *, int) __THROW
wint_t _IO_wdefault_pbackfail (_IO_FILE *, wint_t) __THROW
_IO_FILE_IO_default_setbuf (_IO_FILE *, char *, _IO_ssize_t)
_IO_size_t _IO_default_xsputn (_IO_FILE *, const void *, _IO_size_t)
_IO_size_t _IO_wdefault_xsputn (_IO_FILE *, const void *, _IO_size_t)
_IO_size_t _IO_default_xsgetn (_IO_FILE *, void *, _IO_size_t)
_IO_size_t _IO_wdefault_xsgetn (_IO_FILE *, void *, _IO_size_t)
_IO_off64_t _IO_default_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW
_IO_off64_t _IO_default_seekpos (_IO_FILE *, _IO_off64_t, int)
_IO_ssize_t _IO_default_write (_IO_FILE *, const void *, _IO_ssize_t)
_IO_ssize_t _IO_default_read (_IO_FILE *, void *, _IO_ssize_t)
int _IO_default_stat (_IO_FILE *, void *) __THROW
_IO_off64_t _IO_default_seek (_IO_FILE *, _IO_off64_t, int) __THROW
int _IO_default_sync (_IO_FILE *) __THROW
int _IO_default_showmanyc (_IO_FILE *) __THROW
void _IO_default_imbue (_IO_FILE *, void *) __THROW
 libc_hidden_proto (_IO_file_jumps) extern const struct _IO_jump_t _IO_file_jumps_mmap attribute_hidden
 libc_hidden_proto (_IO_wfile_jumps) extern const struct _IO_jump_t _IO_wfile_jumps_mmap attribute_hidden
int _IO_do_write (_IO_FILE *, const char *, _IO_size_t)
int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t)
int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t)
int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t)
int _IO_flush_all_lockp (int)
int _IO_flush_all (void)
int _IO_cleanup (void)
void _IO_flush_all_linebuffered (void)
int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *)
int _IO_old_fgetpos (_IO_FILE *, _IO_fpos_t *)
int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *)
int _IO_old_fsetpos (_IO_FILE *, const _IO_fpos_t *)
int _IO_new_fgetpos64 (_IO_FILE *, _IO_fpos64_t *)
int _IO_old_fgetpos64 (_IO_FILE *, _IO_fpos64_t *)
int _IO_new_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *)
int _IO_old_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *)
void _IO_old_init (_IO_FILE *fp, int flags) __THROW
int _IO_file_doallocate (_IO_FILE *) __THROW
_IO_FILE_IO_file_setbuf (_IO_FILE *, char *, _IO_ssize_t)
_IO_off64_t _IO_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
_IO_off64_t _IO_file_seekoff_mmap (_IO_FILE *, _IO_off64_t, int, int) __THROW
_IO_size_t _IO_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
_IO_size_t _IO_file_xsgetn (_IO_FILE *, void *, _IO_size_t)
int _IO_file_stat (_IO_FILE *, void *) __THROW
int _IO_file_close (_IO_FILE *) __THROW
int _IO_file_close_mmap (_IO_FILE *) __THROW
int _IO_file_underflow (_IO_FILE *)
int _IO_file_underflow_mmap (_IO_FILE *)
int _IO_file_underflow_maybe_mmap (_IO_FILE *)
int _IO_file_overflow (_IO_FILE *, int)
void _IO_file_init (struct _IO_FILE_plus *) __THROW
_IO_FILE_IO_file_attach (_IO_FILE *, int)
_IO_FILE_IO_file_open (_IO_FILE *, const char *, int, int, int, int)
 libc_hidden_proto (_IO_file_open) extern _IO_FILE *_IO_file_fopen(_IO_FILE *
_IO_ssize_t _IO_file_write (_IO_FILE *, const void *, _IO_ssize_t)
_IO_ssize_t _IO_file_read (_IO_FILE *, void *, _IO_ssize_t)
int _IO_file_sync (_IO_FILE *)
int _IO_file_close_it (_IO_FILE *)
_IO_off64_t _IO_file_seek (_IO_FILE *, _IO_off64_t, int) __THROW
void _IO_file_finish (_IO_FILE *, int)
_IO_FILE_IO_new_file_attach (_IO_FILE *, int)
int _IO_new_file_close_it (_IO_FILE *)
void _IO_new_file_finish (_IO_FILE *, int)
_IO_FILE_IO_new_file_fopen (_IO_FILE *, const char *, const char *, int)
void _IO_no_init (_IO_FILE *, int, int, struct _IO_wide_data *, const struct _IO_jump_t *) __THROW
void _IO_new_file_init (struct _IO_FILE_plus *) __THROW
_IO_FILE_IO_new_file_setbuf (_IO_FILE *, char *, _IO_ssize_t)
_IO_FILE_IO_file_setbuf_mmap (_IO_FILE *, char *, _IO_ssize_t)
int _IO_new_file_sync (_IO_FILE *)
int _IO_new_file_underflow (_IO_FILE *)
int _IO_new_file_overflow (_IO_FILE *, int)
_IO_off64_t _IO_new_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
_IO_ssize_t _IO_new_file_write (_IO_FILE *, const void *, _IO_ssize_t)
_IO_size_t _IO_new_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
_IO_FILE_IO_old_file_setbuf (_IO_FILE *, char *, _IO_ssize_t)
_IO_off64_t _IO_old_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
_IO_size_t _IO_old_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
int _IO_old_file_underflow (_IO_FILE *)
int _IO_old_file_overflow (_IO_FILE *, int)
void _IO_old_file_init (struct _IO_FILE_plus *) __THROW
_IO_FILE_IO_old_file_attach (_IO_FILE *, int)
_IO_FILE_IO_old_file_fopen (_IO_FILE *, const char *, const char *)
_IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t)
int _IO_old_file_sync (_IO_FILE *)
int _IO_old_file_close_it (_IO_FILE *)
void _IO_old_file_finish (_IO_FILE *, int)
int _IO_wfile_doallocate (_IO_FILE *) __THROW
_IO_size_t _IO_wfile_xsputn (_IO_FILE *, const void *, _IO_size_t)
_IO_FILE_IO_wfile_setbuf (_IO_FILE *, wchar_t *, _IO_ssize_t)
wint_t _IO_wfile_sync (_IO_FILE *)
wint_t _IO_wfile_underflow (_IO_FILE *)
wint_t _IO_wfile_overflow (_IO_FILE *, wint_t)
_IO_off64_t _IO_wfile_seekoff (_IO_FILE *, _IO_off64_t, int, int)
_IO_FILE_IO_proc_open (_IO_FILE *, const char *, const char *) __THROW
_IO_FILE_IO_new_proc_open (_IO_FILE *, const char *, const char *) __THROW
_IO_FILE_IO_old_proc_open (_IO_FILE *, const char *, const char *)
int _IO_proc_close (_IO_FILE *) __THROW
int _IO_new_proc_close (_IO_FILE *) __THROW
int _IO_old_proc_close (_IO_FILE *)
int _IO_str_underflow (_IO_FILE *) __THROW
int _IO_str_overflow (_IO_FILE *, int) __THROW
int _IO_str_pbackfail (_IO_FILE *, int) __THROW
_IO_off64_t _IO_str_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW
void _IO_str_finish (_IO_FILE *, int) __THROW
void _IO_str_init_static (struct _IO_strfile_ *, char *, int, char *) __THROW
void _IO_str_init_readonly (struct _IO_strfile_ *, const char *, int) __THROW
_IO_ssize_t _IO_str_count (_IO_FILE *) __THROW
void _IO_wstr_init_static (_IO_FILE *, wchar_t *, _IO_size_t, wchar_t *) __THROW
_IO_ssize_t _IO_wstr_count (_IO_FILE *) __THROW
_IO_wint_t _IO_wstr_overflow (_IO_FILE *, _IO_wint_t) __THROW
_IO_wint_t _IO_wstr_underflow (_IO_FILE *) __THROW
_IO_off64_t _IO_wstr_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW
_IO_wint_t _IO_wstr_pbackfail (_IO_FILE *, _IO_wint_t) __THROW
void _IO_wstr_finish (_IO_FILE *, int) __THROW
int _IO_vasprintf (char **result_ptr, __const char *format, _IO_va_list args) __THROW
int _IO_vdprintf (int d, __const char *format, _IO_va_list arg)
int _IO_vsnprintf (char *string, _IO_size_t maxlen, __const char *format, _IO_va_list args) __THROW
_IO_size_t _IO_getline (_IO_FILE *, char *, _IO_size_t, int, int)
_IO_size_t _IO_getline_info (_IO_FILE *, char *, _IO_size_t, int, int, int *)
_IO_ssize_t _IO_getdelim (char **, _IO_size_t *, int, _IO_FILE *)
_IO_size_t _IO_getwline (_IO_FILE *, wchar_t *, _IO_size_t, wint_t, int)
_IO_size_t _IO_getwline_info (_IO_FILE *, wchar_t *, _IO_size_t, wint_t, int, wint_t *)
int _IO_flush_all_internal (void)
unsigned _IO_adjust_column_internal (unsigned, const char *, int)
int _IO_default_uflow_internal (_IO_FILE *)
void _IO_default_finish_internal (_IO_FILE *, int) __THROW
int _IO_default_pbackfail_internal (_IO_FILE *, int) __THROW
_IO_size_t _IO_default_xsputn_internal (_IO_FILE *, const void *, _IO_size_t)
_IO_size_t _IO_default_xsgetn_internal (_IO_FILE *, void *, _IO_size_t)
int _IO_default_doallocate_internal (_IO_FILE *) __THROW
void _IO_wdefault_finish_internal (_IO_FILE *, int) __THROW
wint_t _IO_wdefault_pbackfail_internal (_IO_FILE *, wint_t) __THROW
_IO_size_t _IO_wdefault_xsputn_internal (_IO_FILE *, const void *, _IO_size_t)
_IO_size_t _IO_wdefault_xsgetn_internal (_IO_FILE *, void *, _IO_size_t)
int _IO_wdefault_doallocate_internal (_IO_FILE *) __THROW
wint_t _IO_wdefault_uflow_internal (_IO_FILE *)
int _IO_file_doallocate_internal (_IO_FILE *) __THROW
_IO_FILE_IO_file_setbuf_internal (_IO_FILE *, char *, _IO_ssize_t)
_IO_off64_t _IO_file_seekoff_internal (_IO_FILE *, _IO_off64_t, int, int)
_IO_size_t _IO_file_xsputn_internal (_IO_FILE *, const void *, _IO_size_t)
_IO_size_t _IO_file_xsgetn_internal (_IO_FILE *, void *, _IO_size_t)
int _IO_file_stat_internal (_IO_FILE *, void *) __THROW
int _IO_file_close_internal (_IO_FILE *) __THROW
int _IO_file_close_it_internal (_IO_FILE *)
int _IO_file_underflow_internal (_IO_FILE *)
int _IO_file_overflow_internal (_IO_FILE *, int)
void _IO_file_init_internal (struct _IO_FILE_plus *) __THROW
_IO_FILE_IO_file_attach_internal (_IO_FILE *, int)
_IO_FILE_IO_file_fopen_internal (_IO_FILE *, const char *, const char *, int)
_IO_ssize_t _IO_file_read_internal (_IO_FILE *, void *, _IO_ssize_t)
int _IO_file_sync_internal (_IO_FILE *)
_IO_off64_t _IO_file_seek_internal (_IO_FILE *, _IO_off64_t, int) __THROW
void _IO_file_finish_internal (_IO_FILE *, int)
_IO_size_t _IO_wfile_xsputn_internal (_IO_FILE *, const void *, _IO_size_t)
_IO_off64_t _IO_wfile_seekoff_internal (_IO_FILE *, _IO_off64_t, int, int)
wint_t _IO_wfile_sync_internal (_IO_FILE *)
int _IO_str_underflow_internal (_IO_FILE *) __THROW
int _IO_str_overflow_internal (_IO_FILE *, int) __THROW
int _IO_str_pbackfail_internal (_IO_FILE *, int) __THROW
_IO_off64_t _IO_str_seekoff_internal (_IO_FILE *, _IO_off64_t, int, int) __THROW
void _IO_str_init_static_internal (struct _IO_strfile_ *, char *, _IO_size_t, char *) __THROW
void _IO_link_in_internal (struct _IO_FILE_plus *) __THROW
int _IO_sputbackc_internal (_IO_FILE *, int) __THROW
void _IO_wdoallocbuf_internal (_IO_FILE *) __THROW
_IO_size_t _IO_sgetn_internal (_IO_FILE *, void *, _IO_size_t)
void _IO_flush_all_linebuffered_internal (void) __THROW
int _IO_switch_to_wget_mode_internal (_IO_FILE *)
void _IO_unsave_markers_internal (_IO_FILE *) __THROW
void _IO_switch_to_main_wget_area_internal (_IO_FILE *) __THROW
int _IO_wdo_write_internal (_IO_FILE *, const wchar_t *, _IO_size_t)
int _IO_do_write_internal (_IO_FILE *, const char *, _IO_size_t)
_IO_ssize_t _IO_padn_internal (_IO_FILE *, int, _IO_ssize_t)
_IO_size_t _IO_getline_info_internal (_IO_FILE *, char *, _IO_size_t, int, int, int *)
_IO_size_t _IO_getline_internal (_IO_FILE *, char *, _IO_size_t, int, int)
void _IO_free_wbackup_area_internal (_IO_FILE *) __THROW
void _IO_free_backup_area_internal (_IO_FILE *) __THROW
void _IO_switch_to_wbackup_area_internal (_IO_FILE *) __THROW
void _IO_setb_internal (_IO_FILE *, char *, char *, int) __THROW
wint_t _IO_sputbackwc_internal (_IO_FILE *, wint_t) __THROW
int _IO_switch_to_get_mode_internal (_IO_FILE *)
int _IO_vfscanf_internal (_IO_FILE *__restrict, const char *__restrict, _IO_va_list, int *__restrict)
int _IO_vfprintf_internal (_IO_FILE *__restrict, const char *__restrict, _IO_va_list)
void _IO_doallocbuf_internal (_IO_FILE *) __THROW
void _IO_wsetb_internal (_IO_FILE *, wchar_t *, wchar_t *, int) __THROW
_IO_off64_t _IO_seekoff_unlocked (_IO_FILE *, _IO_off64_t, int, int) attribute_hidden
_IO_off64_t _IO_seekpos_unlocked (_IO_FILE *, _IO_off64_t, int) attribute_hidden
int _IO_putc_internal (int __c, _IO_FILE *__fp)
void _IO_init_internal (_IO_FILE *, int) __THROW
void _IO_un_link_internal (struct _IO_FILE_plus *) __THROW
int _IO_vscanf (const char *, _IO_va_list) __THROW
static void __attribute__ ((__always_inline__)) _IO_acquire_lock_fct(_IO_FILE **p)

Variables

const char const char int
struct _IO_FILE_plus_IO_list_all
void(* _IO_cleanup_registration_needed )(void)
struct _IO_FILE_plus
*_IO_list_all_internal 
attribute_hidden

Class Documentation

struct _IO_FILE_plus

Definition at line 346 of file libioP.h.

Collaboration diagram for _IO_FILE_plus:
Class Members
_IO_FILE file
struct _IO_jump_t * vtable
struct _IO_cookie_file

Definition at line 364 of file libioP.h.

Class Members
void * __cookie
_IO_cookie_io_functions_t __io_functions

Define Documentation

#define __set_errno (   Val)    errno = (Val)

Definition at line 31 of file libioP.h.

#define _IO_blen (   fp)    ((fp)->_IO_buf_end - (fp)->_IO_buf_base)

Definition at line 530 of file libioP.h.

#define _IO_CHAR_TYPE   char /* unsigned char ? */

Definition at line 306 of file libioP.h.

#define _IO_CHECK_WIDE (   THIS)    (((struct _IO_FILE *) (THIS))->_wide_data != NULL)

Definition at line 110 of file libioP.h.

Definition at line 458 of file libioP.h.

#define _IO_do_flush (   _f)
Value:
INTUSE(_IO_do_write)(_f, (_f)->_IO_write_base,                       \
                     (_f)->_IO_write_ptr-(_f)->_IO_write_base)

Definition at line 504 of file libioP.h.

#define _IO_DOALLOCATE (   FP)    JUMP0 (__doallocate, FP)

Definition at line 238 of file libioP.h.

#define _IO_file_is_open (   __fp)    ((__fp)->_fileno != -1)

Definition at line 550 of file libioP.h.

#define _IO_FINISH (   FP)    JUMP1 (__finish, FP, 0)

Definition at line 155 of file libioP.h.

#define _IO_have_backup (   fp)    ((fp)->_IO_save_base != NULL)

Definition at line 526 of file libioP.h.

#define _IO_have_markers (   fp)    ((fp)->_markers != NULL)

Definition at line 529 of file libioP.h.

#define _IO_have_wbackup (   fp)    ((fp)->_wide_data->_IO_save_base != NULL)

Definition at line 527 of file libioP.h.

#define _IO_IMBUE (   FP,
  LOCALE 
)    JUMP1 (__imbue, FP, LOCALE)

Definition at line 302 of file libioP.h.

#define _IO_in_backup (   fp)    ((fp)->_flags & _IO_IN_BACKUP)

Definition at line 528 of file libioP.h.

#define _IO_in_put_mode (   _fp)    ((_fp)->_flags & _IO_CURRENTLY_PUTTING)

Definition at line 511 of file libioP.h.

#define _IO_INT_TYPE   int

Definition at line 307 of file libioP.h.

#define _IO_JUMPS (   THIS)    (THIS)->vtable

Definition at line 108 of file libioP.h.

#define _IO_JUMPS_FUNC (   THIS)
Value:
(*(struct _IO_jump_t **) ((void *) &_IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) \
                        + (THIS)->_vtable_offset))

Definition at line 113 of file libioP.h.

#define _IO_JUMPS_OFFSET   1

Definition at line 105 of file libioP.h.

#define _IO_mask_flags (   fp,
  f,
  mask 
)    ((fp)->_flags = ((fp)->_flags & ~(mask)) | ((f) & (mask)))

Definition at line 512 of file libioP.h.

#define _IO_old_do_flush (   _f)
Value:
_IO_old_do_write(_f, (_f)->_IO_write_base, \
                 (_f)->_IO_write_ptr-(_f)->_IO_write_base)

Definition at line 508 of file libioP.h.

#define _IO_OVERFLOW (   FP,
  CH 
)    JUMP1 (__overflow, FP, CH)

Definition at line 162 of file libioP.h.

#define _IO_PBACKFAIL (   FP,
  CH 
)    JUMP1 (__pbackfail, FP, CH)

Definition at line 184 of file libioP.h.

#define _IO_pos_0   ((_IO_off64_t) 0)

Definition at line 854 of file libioP.h.

#define _IO_pos_adjust (   pos,
  delta 
)    ((pos) += (delta))

Definition at line 850 of file libioP.h.

#define _IO_seek_cur   1

Definition at line 69 of file libioP.h.

#define _IO_seek_end   2

Definition at line 70 of file libioP.h.

#define _IO_seek_set   0

Definition at line 68 of file libioP.h.

#define _IO_SEEKOFF (   FP,
  OFF,
  DIR,
  MODE 
)    JUMP3 (__seekoff, FP, OFF, DIR, MODE)

Definition at line 209 of file libioP.h.

#define _IO_SEEKPOS (   FP,
  POS,
  FLAGS 
)    JUMP2 (__seekpos, FP, POS, FLAGS)

Definition at line 218 of file libioP.h.

#define _IO_SETBUF (   FP,
  BUFFER,
  LENGTH 
)    JUMP2 (__setbuf, FP, BUFFER, LENGTH)

Definition at line 224 of file libioP.h.

#define _IO_setg (   fp,
  eb,
  g,
  eg 
)
Value:
((fp)->_IO_read_base = (eb),\
       (fp)->_IO_read_ptr = (g), (fp)->_IO_read_end = (eg))

Definition at line 514 of file libioP.h.

#define _IO_setp (   __fp,
  __p,
  __ep 
)
Value:
((__fp)->_IO_write_base = (__fp)->_IO_write_ptr \
       = __p, (__fp)->_IO_write_end = (__ep))

Definition at line 519 of file libioP.h.

#define _IO_SHOWMANYC (   FP)    JUMP0 (__showmanyc, FP)

Definition at line 296 of file libioP.h.

#define _IO_sputn (   __fp,
  __s,
  __n 
)    _IO_XSPUTN (__fp, __s, __n)

Definition at line 393 of file libioP.h.

#define _IO_SYNC (   FP)    JUMP0 (__sync, FP)

Definition at line 231 of file libioP.h.

#define _IO_SYSCLOSE (   FP)    JUMP0 (__close, FP)

Definition at line 281 of file libioP.h.

#define _IO_SYSREAD (   FP,
  DATA,
  LEN 
)    JUMP2 (__read, FP, DATA, LEN)

Definition at line 257 of file libioP.h.

#define _IO_SYSSEEK (   FP,
  OFFSET,
  MODE 
)    JUMP2 (__seek, FP, OFFSET, MODE)

Definition at line 273 of file libioP.h.

#define _IO_SYSSTAT (   FP,
  BUF 
)    JUMP1 (__stat, FP, BUF)

Definition at line 289 of file libioP.h.

#define _IO_SYSWRITE (   FP,
  DATA,
  LEN 
)    JUMP2 (__write, FP, DATA, LEN)

Definition at line 265 of file libioP.h.

#define _IO_UFLOW (   FP)    JUMP0 (__uflow, FP)

Definition at line 178 of file libioP.h.

#define _IO_UNDERFLOW (   FP)    JUMP0 (__underflow, FP)

Definition at line 170 of file libioP.h.

#define _IO_va_start (   args,
  last 
)    va_start(args)

Definition at line 933 of file libioP.h.

#define _IO_vtable_offset (   THIS)    (THIS)->_vtable_offset

Definition at line 116 of file libioP.h.

#define _IO_wblen (   fp)
Value:
((fp)->_wide_data->_IO_buf_end \
                     - (fp)->_wide_data->_IO_buf_base)

Definition at line 531 of file libioP.h.

#define _IO_WDOALLOCATE (   FP)    WJUMP0 (__doallocate, FP)

Definition at line 239 of file libioP.h.

#define _IO_WFINISH (   FP)    WJUMP1 (__finish, FP, 0)

Definition at line 156 of file libioP.h.

#define _IO_WIDE_JUMPS (   THIS)    ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable

Definition at line 109 of file libioP.h.

#define _IO_WIDE_JUMPS_FUNC (   THIS)    _IO_WIDE_JUMPS(THIS)

Definition at line 121 of file libioP.h.

#define _IO_WIMBUE (   FP,
  LOCALE 
)    WJUMP1 (__imbue, FP, LOCALE)

Definition at line 303 of file libioP.h.

#define _IO_WOVERFLOW (   FP,
  CH 
)    WJUMP1 (__overflow, FP, CH)

Definition at line 163 of file libioP.h.

#define _IO_WPBACKFAIL (   FP,
  CH 
)    WJUMP1 (__pbackfail, FP, CH)

Definition at line 185 of file libioP.h.

#define _IO_WSEEKOFF (   FP,
  OFF,
  DIR,
  MODE 
)    WJUMP3 (__seekoff, FP, OFF, DIR, MODE)

Definition at line 210 of file libioP.h.

#define _IO_WSEEKPOS (   FP,
  POS,
  FLAGS 
)    WJUMP2 (__seekpos, FP, POS, FLAGS)

Definition at line 219 of file libioP.h.

#define _IO_WSETBUF (   FP,
  BUFFER,
  LENGTH 
)    WJUMP2 (__setbuf, FP, BUFFER, LENGTH)

Definition at line 225 of file libioP.h.

#define _IO_wsetg (   fp,
  eb,
  g,
  eg 
)
Value:
((fp)->_wide_data->_IO_read_base = (eb),\
       (fp)->_wide_data->_IO_read_ptr = (g), \
       (fp)->_wide_data->_IO_read_end = (eg))

Definition at line 516 of file libioP.h.

#define _IO_wsetp (   __fp,
  __p,
  __ep 
)
Value:
((__fp)->_wide_data->_IO_write_base \
       = (__fp)->_wide_data->_IO_write_ptr = __p, \
       (__fp)->_wide_data->_IO_write_end = (__ep))

Definition at line 522 of file libioP.h.

#define _IO_WSHOWMANYC (   FP)    WJUMP0 (__showmanyc, FP)

Definition at line 297 of file libioP.h.

#define _IO_WSYNC (   FP)    WJUMP0 (__sync, FP)

Definition at line 232 of file libioP.h.

#define _IO_WSYSCLOSE (   FP)    WJUMP0 (__close, FP)

Definition at line 282 of file libioP.h.

#define _IO_WSYSREAD (   FP,
  DATA,
  LEN 
)    WJUMP2 (__read, FP, DATA, LEN)

Definition at line 258 of file libioP.h.

#define _IO_WSYSSEEK (   FP,
  OFFSET,
  MODE 
)    WJUMP2 (__seek, FP, OFFSET, MODE)

Definition at line 274 of file libioP.h.

#define _IO_WSYSSTAT (   FP,
  BUF 
)    WJUMP1 (__stat, FP, BUF)

Definition at line 290 of file libioP.h.

#define _IO_WSYSWRITE (   FP,
  DATA,
  LEN 
)    WJUMP2 (__write, FP, DATA, LEN)

Definition at line 266 of file libioP.h.

#define _IO_WUFLOW (   FP)    WJUMP0 (__uflow, FP)

Definition at line 179 of file libioP.h.

#define _IO_WUNDERFLOW (   FP)    WJUMP0 (__underflow, FP)

Definition at line 171 of file libioP.h.

#define _IO_WXSGETN (   FP,
  DATA,
  N 
)    WJUMP2 (__xsgetn, FP, DATA, N)

Definition at line 200 of file libioP.h.

#define _IO_WXSPUTN (   FP,
  DATA,
  N 
)    WJUMP2 (__xsputn, FP, DATA, N)

Definition at line 193 of file libioP.h.

#define _IO_XSGETN (   FP,
  DATA,
  N 
)    JUMP2 (__xsgetn, FP, DATA, N)

Definition at line 199 of file libioP.h.

#define _IO_XSPUTN (   FP,
  DATA,
  N 
)    JUMP2 (__xsputn, FP, DATA, N)

Definition at line 192 of file libioP.h.

#define ALLOC_BUF (   _B,
  _S,
  _R 
)
Value:
do {                                                          \
         (_B) = (char*)malloc(_S);                                   \
         if ((_B) == NULL)                                           \
           return (_R);                                              \
       } while (0)

Definition at line 824 of file libioP.h.

#define ALLOC_WBUF (   _B,
  _S,
  _R 
)
Value:
do {                                                          \
         (_B) = (wchar_t *)malloc(_S);                                      \
         if ((_B) == NULL)                                           \
           return (_R);                                              \
       } while (0)

Definition at line 830 of file libioP.h.

#define CHECK_FILE (   FILE,
  RET 
)    COERCE_FILE (FILE)

Definition at line 960 of file libioP.h.

#define COERCE_FILE (   FILE)    /* Nothing */

Definition at line 939 of file libioP.h.

#define FILEBUF_LITERAL (   CHAIN,
  FLAGS,
  FD,
  WDP 
)
Value:
{ _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, _IO_pos_BAD, 0, 0, { 0 }, 0, _IO_pos_BAD, \
        0 }

Definition at line 897 of file libioP.h.

#define FREE_BUF (   _B,
  _S 
)    free(_B)

Definition at line 822 of file libioP.h.

#define INTDEF (   name)

Definition at line 49 of file libioP.h.

#define INTDEF2 (   name)

Definition at line 52 of file libioP.h.

#define INTUSE (   name)    name

Definition at line 46 of file libioP.h.

#define JUMP0 (   FUNC,
  THIS 
)    _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS)

Definition at line 138 of file libioP.h.

#define JUMP1 (   FUNC,
  THIS,
  X1 
)    _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1)

Definition at line 139 of file libioP.h.

#define JUMP2 (   FUNC,
  THIS,
  X1,
  X2 
)    _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1, X2)

Definition at line 140 of file libioP.h.

#define JUMP3 (   FUNC,
  THIS,
  X1,
  X2,
  X3 
)    _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1,X2,X3)

Definition at line 141 of file libioP.h.

#define JUMP_FIELD (   TYPE,
  NAME 
)    struct { short delta1, delta2; TYPE pfn; } NAME

Definition at line 137 of file libioP.h.

#define JUMP_INIT (   NAME,
  VALUE 
)    {0, 0, VALUE}

Definition at line 142 of file libioP.h.

#define JUMP_INIT_DUMMY   JUMP_INIT(dummy, 0)

Definition at line 143 of file libioP.h.

#define libc_hidden_def (   name)

Definition at line 58 of file libioP.h.

#define libc_hidden_proto (   name)

Definition at line 55 of file libioP.h.

#define libc_hidden_weak (   name)

Definition at line 61 of file libioP.h.

#define MAYBE_SET_EINVAL   /* nothing */

Definition at line 950 of file libioP.h.

#define OS_FSTAT   fstat

Definition at line 840 of file libioP.h.

#define WJUMP0 (   FUNC,
  THIS 
)    _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS)

Definition at line 145 of file libioP.h.

#define WJUMP1 (   FUNC,
  THIS,
  X1 
)    _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1)

Definition at line 146 of file libioP.h.

#define WJUMP2 (   FUNC,
  THIS,
  X1,
  X2 
)    _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1, X2)

Definition at line 147 of file libioP.h.

#define WJUMP3 (   FUNC,
  THIS,
  X1,
  X2,
  X3 
)    _IO_WIDE_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1,X2,X3)

Definition at line 148 of file libioP.h.


Typedef Documentation

typedef int(* _IO_close_t)(_IO_FILE *)

Definition at line 280 of file libioP.h.

typedef int(* _IO_doallocate_t)(_IO_FILE *)

Definition at line 237 of file libioP.h.

typedef void(* _IO_finish_t)(_IO_FILE *, int)

Definition at line 154 of file libioP.h.

typedef void(* _IO_imbue_t)(_IO_FILE *, void *)

Definition at line 301 of file libioP.h.

typedef struct _IO_FILE* _IO_ITER

Definition at line 377 of file libioP.h.

typedef int(* _IO_overflow_t)(_IO_FILE *, int)

Definition at line 161 of file libioP.h.

typedef int(* _IO_pbackfail_t)(_IO_FILE *, int)

Definition at line 183 of file libioP.h.

typedef _IO_ssize_t(* _IO_read_t)(_IO_FILE *, void *, _IO_ssize_t)

Definition at line 256 of file libioP.h.

Definition at line 272 of file libioP.h.

typedef _IO_off64_t(* _IO_seekoff_t)(_IO_FILE *FP, _IO_off64_t OFF, int DIR, int MODE)

Definition at line 207 of file libioP.h.

Definition at line 217 of file libioP.h.

typedef _IO_FILE*(* _IO_setbuf_t)(_IO_FILE *, char *, _IO_ssize_t)

Definition at line 223 of file libioP.h.

typedef int(* _IO_showmanyc_t)(_IO_FILE *)

Definition at line 295 of file libioP.h.

typedef int(* _IO_stat_t)(_IO_FILE *, void *)

Definition at line 288 of file libioP.h.

typedef int(* _IO_sync_t)(_IO_FILE *)

Definition at line 230 of file libioP.h.

typedef int(* _IO_underflow_t)(_IO_FILE *)

Definition at line 169 of file libioP.h.

Definition at line 264 of file libioP.h.

typedef _IO_size_t(* _IO_xsgetn_t)(_IO_FILE *FP, void *DATA, _IO_size_t N)

Definition at line 198 of file libioP.h.

Definition at line 190 of file libioP.h.


Function Documentation

static void __attribute__ ( (__always_inline__)  ) [inline, static]

Definition at line 964 of file libioP.h.

{
  _IO_FILE *fp = *p;
  if ((fp->_flags & _IO_USER_LOCK) == 0)
    _IO_funlockfile (fp);
}

Here is the call graph for this function:

unsigned _IO_adjust_column ( unsigned  ,
const char *  ,
int   
)

Definition at line 793 of file genops.c.

{
  const char *ptr = line + count;
  while (ptr > line)
    if (*--ptr == '\n')
      return line + count - ptr - 1;
  return start + count;
}

Here is the caller graph for this function:

unsigned _IO_adjust_column_internal ( unsigned  ,
const char *  ,
int   
)
unsigned _IO_adjust_wcolumn ( unsigned  ,
const wchar_t *  ,
int   
)

Definition at line 645 of file wgenops.c.

{
  const wchar_t *ptr = line + count;
  while (ptr > line)
    if (*--ptr == L'\n')
      return line + count - ptr - 1;
  return start + count;
}
int _IO_cleanup ( void  )

Definition at line 1006 of file genops.c.

{
  /* We do *not* want locking.  Some threads might use streams but
     that is their problem, we flush them underneath them.  */
  int result = _IO_flush_all_lockp (0);

  /* We currently don't have a reliable mechanism for making sure that
     C++ static destructors are executed in the correct order.
     So it is possible that other static destructors might want to
     write to cout - and they're supposed to be able to do so.

     The following will make the standard streambufs be unbuffered,
     which forces any output from late destructors to be written out. */
  _IO_unbuffer_write ();

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 590 of file genops.c.

{
  char *buf;

  ALLOC_BUF (buf, _IO_BUFSIZ, EOF);
  INTUSE(_IO_setb) (fp, buf, buf+_IO_BUFSIZ, 1);
  return 1;
}

Here is the call graph for this function:

void _IO_default_finish ( _IO_FILE ,
int   
)

Definition at line 684 of file genops.c.

{
  struct _IO_marker *mark;
  if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
    {
      FREE_BUF (fp->_IO_buf_base, _IO_blen (fp));
      fp->_IO_buf_base = fp->_IO_buf_end = NULL;
    }

  for (mark = fp->_markers; mark != NULL; mark = mark->_next)
    mark->_sbuf = NULL;

  if (fp->_IO_save_base)
    {
      free (fp->_IO_save_base);
      fp->_IO_save_base = NULL;
    }

  INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);

#ifdef _IO_MTSAFE_IO
  if (fp->_lock != NULL)
    _IO_lock_fini (*fp->_lock);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_default_imbue ( _IO_FILE ,
void *   
)

Definition at line 1259 of file genops.c.

{
}

Here is the caller graph for this function:

Definition at line 1158 of file genops.c.

{
  if (fp->_IO_read_ptr > fp->_IO_read_base && !_IO_in_backup (fp)
      && (unsigned char) fp->_IO_read_ptr[-1] == c)
    --fp->_IO_read_ptr;
  else
    {
      /* Need to handle a filebuf in write mode (switch to read mode). FIXME!*/
      if (!_IO_in_backup (fp))
       {
         /* We need to keep the invariant that the main get area
            logically follows the backup area.  */
         if (fp->_IO_read_ptr > fp->_IO_read_base && _IO_have_backup (fp))
           {
             if (save_for_backup (fp, fp->_IO_read_ptr))
              return EOF;
           }
         else if (!_IO_have_backup (fp))
           {
             /* No backup buffer: allocate one. */
             /* Use nshort buffer, if unused? (probably not)  FIXME */
             int backup_size = 128;
             char *bbuf = (char *) malloc (backup_size);
             if (bbuf == NULL)
              return EOF;
             fp->_IO_save_base = bbuf;
             fp->_IO_save_end = fp->_IO_save_base + backup_size;
             fp->_IO_backup_base = fp->_IO_save_end;
           }
         fp->_IO_read_base = fp->_IO_read_ptr;
         _IO_switch_to_backup_area (fp);
       }
      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;
         char *new_buf;
         new_size = 2 * old_size;
         new_buf = (char *) malloc (new_size);
         if (new_buf == NULL)
           return EOF;
         memcpy (new_buf + (new_size - old_size), fp->_IO_read_base,
                old_size);
         free (fp->_IO_read_base);
         _IO_setg (fp, new_buf, new_buf + (new_size - old_size),
                  new_buf + new_size);
         fp->_IO_backup_base = fp->_IO_read_ptr;
       }

      *--fp->_IO_read_ptr = c;
    }
  return (unsigned char) c;
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_ssize_t _IO_default_read ( _IO_FILE ,
void *  ,
_IO_ssize_t   
)

Definition at line 1234 of file genops.c.

{
  return -1;
}

Definition at line 1217 of file genops.c.

{
  return _IO_pos_BAD;
}

Definition at line 714 of file genops.c.

{
  return _IO_pos_BAD;
}

Definition at line 581 of file genops.c.

{
  return _IO_SEEKOFF (fp, pos, 0, mode);
}

Here is the caller graph for this function:

_IO_FILE* _IO_default_setbuf ( _IO_FILE ,
char *  ,
_IO_ssize_t   
)

Definition at line 558 of file genops.c.

{
    if (_IO_SYNC (fp) == EOF)
       return NULL;
    if (p == NULL || len == 0)
      {
       fp->_flags |= _IO_UNBUFFERED;
       INTUSE(_IO_setb) (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
      }
    else
      {
       fp->_flags &= ~_IO_UNBUFFERED;
       INTUSE(_IO_setb) (fp, p, p+len, 0);
      }
    fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = 0;
    fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = 0;
    return fp;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1252 of file genops.c.

{
  return -1;
}

Here is the caller graph for this function:

int _IO_default_stat ( _IO_FILE ,
void *   
)

Definition at line 1226 of file genops.c.

{
  return EOF;
}

Definition at line 674 of file genops.c.

{
  return 0;
}

Definition at line 437 of file genops.c.

{
  int ch = _IO_UNDERFLOW (fp);
  if (ch == EOF)
    return EOF;
  return *(unsigned char *) fp->_IO_read_ptr++;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1243 of file genops.c.

{
  return 0;
}
_IO_size_t _IO_default_xsgetn ( _IO_FILE ,
void *  ,
_IO_size_t   
)

Definition at line 505 of file genops.c.

{
  _IO_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;
         if (count > more)
           count = more;
         if (count > 20)
           {
#ifdef _LIBC
             s = __mempcpy (s, fp->_IO_read_ptr, count);
#else
             memcpy (s, fp->_IO_read_ptr, count);
             s += count;
#endif
             fp->_IO_read_ptr += count;
           }
         else if (count)
           {
             char *p = fp->_IO_read_ptr;
             int i = (int) count;
             while (--i >= 0)
              *s++ = *p++;
             fp->_IO_read_ptr = p;
            }
            more -= count;
        }
      if (more == 0 || __underflow (fp) == EOF)
       break;
    }
  return n - more;
}

Here is the call graph for this function:

Definition at line 448 of file genops.c.

{
  const char *s = (char *) data;
  _IO_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;
         if (count > more)
           count = more;
         if (count > 20)
           {
#ifdef _LIBC
             f->_IO_write_ptr = __mempcpy (f->_IO_write_ptr, s, count);
#else
             memcpy (f->_IO_write_ptr, s, count);
             f->_IO_write_ptr += count;
#endif
             s += count;
            }
         else if (count)
           {
             char *p = f->_IO_write_ptr;
             _IO_ssize_t i;
             for (i = count; --i >= 0; )
              *p++ = *s++;
             f->_IO_write_ptr = p;
            }
         more -= count;
        }
      if (more == 0 || _IO_OVERFLOW (f, (unsigned char) *s++) == EOF)
       break;
      more--;
    }
  return n - more;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _IO_do_write ( _IO_FILE ,
const char *  ,
_IO_size_t   
)

Here is the caller graph for this function:

int _IO_do_write_internal ( _IO_FILE ,
const char *  ,
_IO_size_t   
)
void _IO_doallocbuf ( _IO_FILE )

Definition at line 417 of file genops.c.

{
  if (fp->_IO_buf_base)
    return;
  if (!(fp->_flags & _IO_UNBUFFERED) || fp->_mode > 0)
    if (_IO_DOALLOCATE (fp) != EOF)
      return;
  INTUSE(_IO_setb) (fp, fp->_shortbuf, fp->_shortbuf+1, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 1247 of file fileops.c.

{
  /* Cancelling close should be avoided if possible since it leaves an
     unrecoverable state behind.  */
  return close_not_cancel (fp->_fileno);
}

Here is the caller graph for this function:

Definition at line 1235 of file fileops.c.

{
  /* 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);
  fp->_IO_buf_base = fp->_IO_buf_end = NULL;
  /* Cancelling close should be avoided if possible since it leaves an
     unrecoverable state behind.  */
  return close_not_cancel (fp->_fileno);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 86 of file filedoalloc.c.

{
  _IO_size_t size;
  char *p;
  struct _G_stat64 st;

#ifndef _LIBC
  /* If _IO_cleanup_registration_needed is non-zero, we should call the
     function it points to.  This is to make sure _IO_cleanup gets called
     on exit.  We call it from _IO_file_doallocate, since that is likely
     to get called by any program that does buffered I/O. */
  if (__builtin_expect (_IO_cleanup_registration_needed != NULL, 0))
    (*_IO_cleanup_registration_needed) ();
#endif

  size = _IO_BUFSIZ;
  if (fp->_fileno >= 0 && __builtin_expect (_IO_SYSSTAT (fp, &st), 0) >= 0)
    {
      if (S_ISCHR (st.st_mode))
       {
         /* Possibly a tty.  */
         if (
#ifdef DEV_TTY_P
             DEV_TTY_P (&st) ||
#endif
             isatty (fp->_fileno))
           fp->_flags |= _IO_LINE_BUF;
       }
#if _IO_HAVE_ST_BLKSIZE
      if (st.st_blksize > 0)
       size = st.st_blksize;
#endif
    }
  ALLOC_BUF (p, size, EOF);
  INTUSE(_IO_setb) (fp, p, p + size, 1);
  return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_file_finish ( _IO_FILE ,
int   
)

Here is the caller graph for this function:

void _IO_file_finish_internal ( _IO_FILE ,
int   
)
_IO_FILE* _IO_file_fopen_internal ( _IO_FILE ,
const char *  ,
const char *  ,
int   
)
void _IO_file_init ( struct _IO_FILE_plus )

Here is the caller graph for this function:

_IO_FILE* _IO_file_open ( _IO_FILE ,
const char *  ,
int  ,
int  ,
int  ,
int   
)

Definition at line 217 of file fileops.c.

{
  int fdesc;
#ifdef _LIBC
  if (__builtin_expect (fp->_flags2 & _IO_FLAGS2_NOTCANCEL, 0))
    fdesc = open_not_cancel (filename,
                          posix_mode | (is32not64 ? 0 : O_LARGEFILE), prot);
  else
    fdesc = open (filename, posix_mode | (is32not64 ? 0 : O_LARGEFILE), prot);
#else
  fdesc = open (filename, posix_mode, prot);
#endif
  if (fdesc < 0)
    return NULL;
  fp->_fileno = fdesc;
  _IO_mask_flags (fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
  if ((read_write & _IO_IS_APPENDING) && (read_write & _IO_NO_READS))
    if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
       == _IO_pos_BAD && errno != ESPIPE)
      {
       close_not_cancel (fdesc);
       return NULL;
      }
  INTUSE(_IO_link_in) ((struct _IO_FILE_plus *) fp);
  return fp;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

_IO_ssize_t _IO_file_read ( _IO_FILE ,
void *  ,
_IO_ssize_t   
)

Definition at line 1196 of file fileops.c.

{
  return (__builtin_expect (fp->_flags2 & _IO_FLAGS2_NOTCANCEL, 0)
         ? read_not_cancel (fp->_fileno, buf, size)
         : read (fp->_fileno, buf, size));
}

Here is the caller graph for this function:

Definition at line 1208 of file fileops.c.

{
#ifdef _G_LSEEK64
  return _G_LSEEK64 (fp->_fileno, offset, dir);
#else
  return lseek (fp->_fileno, offset, dir);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 1121 of file fileops.c.

{
  _IO_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
     using a pushback buffer, but in the usual case has the same value as
     (fp->_IO_read_ptr - fp->_IO_buf_base).  */
  if (mode == 0)
    return fp->_offset - (fp->_IO_read_end - fp->_IO_read_ptr);

  switch (dir)
    {
    case _IO_seek_cur:
      /* Adjust for read-ahead (bytes is buffer). */
      offset += fp->_IO_read_ptr - fp->_IO_read_base;
      break;
    case _IO_seek_set:
      break;
    case _IO_seek_end:
      offset += fp->_IO_buf_end - fp->_IO_buf_base;
      break;
    }
  /* At this point, dir==_IO_seek_set. */

  if (offset < 0)
    {
      /* No negative offsets are valid.  */
      __set_errno (EINVAL);
      return EOF;
    }

  result = _IO_SYSSEEK (fp, offset, 0);
  if (result < 0)
    return EOF;

  if (offset > fp->_IO_buf_end - fp->_IO_buf_base)
    /* One can fseek arbitrarily past the end of the file
       and it is meaningless until one attempts to read.
       Leave the buffer pointers in EOF state until underflow.  */
    _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_end, fp->_IO_buf_end);
  else
    /* Adjust the read pointers to match the file position,
       but so the next read attempt will call underflow.  */
    _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + offset,
             fp->_IO_buf_base + offset);

  fp->_offset = result;

  _IO_mask_flags (fp, 0, _IO_EOF_SEEN);

  return offset;
}

Here is the caller graph for this function:

_IO_FILE* _IO_file_setbuf ( _IO_FILE ,
char *  ,
_IO_ssize_t   
)
_IO_FILE* _IO_file_setbuf_mmap ( _IO_FILE ,
char *  ,
_IO_ssize_t   
)

Definition at line 459 of file fileops.c.

{
  _IO_FILE *result;

  /* Change the function table.  */
  _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps;
  fp->_wide_data->_wide_vtable = &_IO_wfile_jumps;

  /* And perform the normal operation.  */
  result = _IO_new_file_setbuf (fp, p, len);

  /* If the call failed, restore to using mmap.  */
  if (result == NULL)
    {
      _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps_mmap;
      fp->_wide_data->_wide_vtable = &_IO_wfile_jumps_mmap;
    }

  return result;
}

Here is the caller graph for this function:

int _IO_file_stat ( _IO_FILE ,
void *   
)

Definition at line 1222 of file fileops.c.

{
#ifdef _G_FSTAT64
  return _G_FSTAT64 (fp->_fileno, (struct _G_stat64 *) st);
#else
  return fstat (fp->_fileno, (struct stat *) st);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _IO_file_stat_internal ( _IO_FILE ,
void *   
)

Definition at line 816 of file fileops.c.

{
  /* This is the first read attempt.  Choose mmap or vanilla operations
     and then punt to the chosen underflow routine.  */
  decide_maybe_mmap (fp);
  return _IO_UNDERFLOW (fp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 727 of file fileops.c.

{
  if (fp->_IO_read_ptr < fp->_IO_read_end)
    return *(unsigned char *) fp->_IO_read_ptr;

  if (__builtin_expect (mmap_remap_check (fp), 0))
    /* We punted to the regular file functions.  */
    return _IO_UNDERFLOW (fp);

  if (fp->_IO_read_ptr < fp->_IO_read_end)
    return *(unsigned char *) fp->_IO_read_ptr;

  fp->_flags |= _IO_EOF_SEEN;
  return EOF;
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_size_t _IO_file_xsgetn ( _IO_FILE ,
void *  ,
_IO_size_t   
)

Definition at line 1379 of file fileops.c.

{
  register _IO_size_t want, have;
  register _IO_ssize_t count;
  register char *s = data;

  want = n;

  if (fp->_IO_buf_base == NULL)
    {
      /* Maybe we already have a push back pointer.  */
      if (fp->_IO_save_base != NULL)
       {
         free (fp->_IO_save_base);
         fp->_flags &= ~_IO_IN_BACKUP;
       }
      INTUSE(_IO_doallocbuf) (fp);
    }

  while (want > 0)
    {
      have = fp->_IO_read_end - fp->_IO_read_ptr;
      if (want <= have)
       {
         memcpy (s, fp->_IO_read_ptr, want);
         fp->_IO_read_ptr += want;
         want = 0;
       }
      else
       {
         if (have > 0)
           {
#ifdef _LIBC
             s = __mempcpy (s, fp->_IO_read_ptr, have);
#else
             memcpy (s, fp->_IO_read_ptr, have);
             s += have;
#endif
             want -= have;
             fp->_IO_read_ptr += have;
           }

         /* Check for backup and repeat */
         if (_IO_in_backup (fp))
           {
             _IO_switch_to_main_get_area (fp);
             continue;
           }

         /* If we now want less than a buffer, underflow and repeat
            the copy.  Otherwise, _IO_SYSREAD directly to
            the user buffer. */
         if (fp->_IO_buf_base
             && want < (size_t) (fp->_IO_buf_end - fp->_IO_buf_base))
           {
             if (__underflow (fp) == EOF)
              break;

             continue;
           }

         /* These must be set before the sysread as we might longjmp out
            waiting for input. */
         _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
         _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);

         /* Try to maintain alignment: read a whole number of blocks.  */
         count = want;
         if (fp->_IO_buf_base)
           {
             _IO_size_t block_size = fp->_IO_buf_end - fp->_IO_buf_base;
             if (block_size >= 128)
              count -= want % block_size;
           }

         count = _IO_SYSREAD (fp, s, count);
         if (count <= 0)
           {
             if (count == 0)
              fp->_flags |= _IO_EOF_SEEN;
             else
              fp->_flags |= _IO_ERR_SEEN;

             break;
           }

         s += count;
         want -= count;
         if (fp->_offset != _IO_pos_BAD)
           _IO_pos_adjust (fp->_offset, count);
       }
    }

  return n - want;
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_size_t _IO_file_xsputn ( _IO_FILE ,
const void *  ,
_IO_size_t   
)
int _IO_flush_all ( void  )

Definition at line 877 of file genops.c.

{
  /* We want locking.  */
  return _IO_flush_all_lockp (1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_flush_all_linebuffered ( void  )

Definition at line 885 of file genops.c.

{
  struct _IO_FILE *fp;
  int last_stamp;

#ifdef _IO_MTSAFE_IO
  _IO_cleanup_region_start_noarg (flush_cleanup);
  _IO_lock_lock (list_all_lock);
#endif

  last_stamp = _IO_list_all_stamp;
  fp = (_IO_FILE *) INTUSE(_IO_list_all);
  while (fp != NULL)
    {
      run_fp = fp;
      _IO_flockfile (fp);

      if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF)
       _IO_OVERFLOW (fp, EOF);

      _IO_funlockfile (fp);
      run_fp = NULL;

      if (last_stamp != _IO_list_all_stamp)
       {
         /* Something was added to the list.  Start all over again.  */
         fp = (_IO_FILE *) INTUSE(_IO_list_all);
         last_stamp = _IO_list_all_stamp;
       }
      else
       fp = fp->_chain;
    }

#ifdef _IO_MTSAFE_IO
  _IO_lock_unlock (list_all_lock);
  _IO_cleanup_region_end (0);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 822 of file genops.c.

{
  int result = 0;
  struct _IO_FILE *fp;
  int last_stamp;

#ifdef _IO_MTSAFE_IO
  _IO_cleanup_region_start_noarg (flush_cleanup);
  if (do_lock)
    _IO_lock_lock (list_all_lock);
#endif

  last_stamp = _IO_list_all_stamp;
  fp = (_IO_FILE *) INTUSE(_IO_list_all);
  while (fp != NULL)
    {
      run_fp = fp;
      if (do_lock)
       _IO_flockfile (fp);

      if (((fp->_mode <= 0 && fp->_IO_write_ptr > fp->_IO_write_base)
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
          || (_IO_vtable_offset (fp) == 0
              && fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr
                                > fp->_wide_data->_IO_write_base))
#endif
          )
         && _IO_OVERFLOW (fp, EOF) == EOF)
       result = EOF;

      if (do_lock)
       _IO_funlockfile (fp);
      run_fp = NULL;

      if (last_stamp != _IO_list_all_stamp)
       {
         /* Something was added to the list.  Start all over again.  */
         fp = (_IO_FILE *) INTUSE(_IO_list_all);
         last_stamp = _IO_list_all_stamp;
       }
      else
       fp = fp->_chain;
    }

#ifdef _IO_MTSAFE_IO
  if (do_lock)
    _IO_lock_unlock (list_all_lock);
  _IO_cleanup_region_end (0);
#endif

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_FILE* _IO_fopencookie ( void *  cookie,
const char *  mode,
_IO_cookie_io_functions_t  io_functions 
)

Definition at line 169 of file iofopncook.c.

{
  int read_write;
  struct locked_FILE
  {
    struct _IO_cookie_file cfile;
#ifdef _IO_MTSAFE_IO
    _IO_lock_t lock;
#endif
  } *new_f;

  switch (*mode++)
    {
    case 'r':
      read_write = _IO_NO_WRITES;
      break;
    case 'w':
      read_write = _IO_NO_READS;
      break;
    case 'a':
      read_write = _IO_NO_READS|_IO_IS_APPENDING;
      break;
    default:
      return NULL;
  }
  if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
    read_write &= _IO_IS_APPENDING;

  new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
  if (new_f == NULL)
    return NULL;
#ifdef _IO_MTSAFE_IO
  new_f->cfile.__fp.file._lock = &new_f->lock;
#endif

  _IO_cookie_init (&new_f->cfile, read_write, cookie, io_functions);

  return (_IO_FILE *) &new_f->cfile.__fp;
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_ssize_t _IO_getdelim ( char **  ,
_IO_size_t ,
int  ,
_IO_FILE  
)

Definition at line 42 of file iogetdelim.c.

{
  _IO_ssize_t result;
  _IO_ssize_t cur_len = 0;
  _IO_ssize_t len;

  if (lineptr == NULL || n == NULL)
    {
      MAYBE_SET_EINVAL;
      return -1;
    }
  CHECK_FILE (fp, -1);
  _IO_acquire_lock (fp);
  if (_IO_ferror_unlocked (fp))
    {
      result = -1;
      goto unlock_return;
    }

  if (*lineptr == NULL || *n == 0)
    {
      *n = 120;
      *lineptr = (char *) malloc (*n);
      if (*lineptr == NULL)
       {
         result = -1;
         goto unlock_return;
       }
    }

  len = fp->_IO_read_end - fp->_IO_read_ptr;
  if (len <= 0)
    {
      if (__underflow (fp) == EOF)
       {
         result = -1;
         goto unlock_return;
       }
      len = fp->_IO_read_end - fp->_IO_read_ptr;
    }

  for (;;)
    {
      _IO_size_t needed;
      char *t;
      t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);
      if (t != NULL)
       len = (t - fp->_IO_read_ptr) + 1;
      if (__builtin_expect (cur_len + len + 1 < 0, 0))
       {
         __set_errno (EOVERFLOW);
         result = -1;
         goto unlock_return;
       }
      /* Make enough space for len+1 (for final NUL) bytes.  */
      needed = cur_len + len + 1;
      if (needed > *n)
       {
         char *new_lineptr;

         if (needed < 2 * *n)
           needed = 2 * *n;  /* Be generous. */
         new_lineptr = (char *) realloc (*lineptr, needed);
         if (new_lineptr == NULL)
           {
             result = -1;
             goto unlock_return;
           }
         *lineptr = new_lineptr;
         *n = needed;
       }
      memcpy (*lineptr + cur_len, (void *) fp->_IO_read_ptr, len);
      fp->_IO_read_ptr += len;
      cur_len += len;
      if (t != NULL || __underflow (fp) == EOF)
       break;
      len = fp->_IO_read_end - fp->_IO_read_ptr;
    }
  (*lineptr)[cur_len] = '\0';
  result = cur_len;

unlock_return:
  _IO_release_lock (fp);
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_size_t _IO_getline ( _IO_FILE ,
char *  ,
_IO_size_t  ,
int  ,
int   
)

Definition at line 35 of file iogetline.c.

{
  return INTUSE(_IO_getline_info) (fp, buf, n, delim, extract_delim,
                               (int *) 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_size_t _IO_getline_info ( _IO_FILE ,
char *  ,
_IO_size_t  ,
int  ,
int  ,
int  
)

Definition at line 56 of file iogetline.c.

{
  char *ptr = buf;
  if (eof != NULL)
    *eof = 0;
  if (__builtin_expect (fp->_mode, -1) == 0)
    _IO_fwide (fp, -1);
  while (n != 0)
    {
      _IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
      if (len <= 0)
       {
         int c = __uflow (fp);
         if (c == EOF)
           {
             if (eof)
              *eof = c;
             break;
           }
         if (c == delim)
           {
             if (extract_delim > 0)
              *ptr++ = c;
             else if (extract_delim < 0)
              INTUSE(_IO_sputbackc) (fp, c);
             if (extract_delim > 0)
              ++len;
             return ptr - buf;
           }
         *ptr++ = c;
         n--;
       }
      else
       {
         char *t;
         if ((_IO_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;
             len = t - fp->_IO_read_ptr;
             if (extract_delim >= 0)
              {
                ++t;
                if (extract_delim > 0)
                  ++len;
              }
             memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
             fp->_IO_read_ptr = t;
             return old_len + len;
           }
         memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
         fp->_IO_read_ptr += len;
         ptr += len;
         n -= len;
       }
    }
  return ptr - buf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_size_t _IO_getline_info_internal ( _IO_FILE ,
char *  ,
_IO_size_t  ,
int  ,
int  ,
int  
)
_IO_size_t _IO_getline_internal ( _IO_FILE ,
char *  ,
_IO_size_t  ,
int  ,
int   
)
_IO_size_t _IO_getwline ( _IO_FILE ,
wchar_t *  ,
_IO_size_t  ,
wint_t  ,
int   
)

Definition at line 39 of file iogetwline.c.

{
  return _IO_getwline_info (fp, buf, n, delim, extract_delim, (wint_t *) 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

_IO_size_t _IO_getwline_info ( _IO_FILE ,
wchar_t *  ,
_IO_size_t  ,
wint_t  ,
int  ,
wint_t  
)

Definition at line 58 of file iogetwline.c.

{
  wchar_t *ptr = buf;
  if (eof != NULL)
    *eof = 0;
  if (__builtin_expect (fp->_mode, 1) == 0)
    _IO_fwide (fp, 1);
  while (n != 0)
    {
      _IO_ssize_t len = (fp->_wide_data->_IO_read_end
                      - fp->_wide_data->_IO_read_ptr);
      if (len <= 0)
       {
         wint_t wc = __wuflow (fp);
         if (wc == WEOF)
           {
             if (eof)
              *eof = wc;
             break;
           }
         if (wc == delim)
           {
             if (extract_delim > 0)
              *ptr++ = wc;
             else if (extract_delim < 0)
              INTUSE(_IO_sputbackc) (fp, wc);
             if (extract_delim > 0)
              ++len;
             return ptr - buf;
           }
         *ptr++ = wc;
         n--;
       }
      else
       {
         wchar_t *t;
         if ((_IO_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;
             len = t - fp->_wide_data->_IO_read_ptr;
             if (extract_delim >= 0)
              {
                ++t;
                if (extract_delim > 0)
                  ++len;
              }
             wmemcpy ((void *) ptr, (void *) fp->_wide_data->_IO_read_ptr,
                     len);
             fp->_wide_data->_IO_read_ptr = t;
             return old_len + len;
           }
         wmemcpy ((void *) ptr, (void *) fp->_wide_data->_IO_read_ptr, len);
         fp->_wide_data->_IO_read_ptr += len;
         ptr += len;
         n -= len;
       }
    }
  return ptr - buf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_init ( _IO_FILE ,
int   
)

Definition at line 602 of file genops.c.

{
  _IO_no_init (fp, flags, -1, NULL, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_init_internal ( _IO_FILE ,
int   
)
void _IO_init_marker ( struct _IO_marker ,
_IO_FILE  
)

Definition at line 1026 of file genops.c.

{
  marker->_sbuf = fp;
  if (_IO_in_put_mode (fp))
    INTUSE(_IO_switch_to_get_mode) (fp);
  if (_IO_in_backup (fp))
    marker->_pos = fp->_IO_read_ptr - fp->_IO_read_end;
  else
    marker->_pos = fp->_IO_read_ptr - fp->_IO_read_base;

  /* Should perhaps sort the chain? */
  marker->_next = fp->_markers;
  fp->_markers = marker;
}

Here is the call graph for this function:

void _IO_init_wmarker ( struct _IO_marker ,
_IO_FILE  
)

Definition at line 658 of file wgenops.c.

{
  marker->_sbuf = fp;
  if (_IO_in_put_mode (fp))
    INTUSE(_IO_switch_to_wget_mode) (fp);
  if (_IO_in_backup (fp))
    marker->_pos = fp->_wide_data->_IO_read_ptr - fp->_wide_data->_IO_read_end;
  else
    marker->_pos = (fp->_wide_data->_IO_read_ptr
                  - fp->_wide_data->_IO_read_base);

  /* Should perhaps sort the chain? */
  marker->_next = fp->_markers;
  fp->_markers = marker;
}

Here is the call graph for this function:

Definition at line 1266 of file genops.c.

{
  return (_IO_ITER) INTUSE(_IO_list_all);
}

Here is the caller graph for this function:

void _IO_link_in ( struct _IO_FILE_plus )

Definition at line 102 of file genops.c.

{
  if ((fp->file._flags & _IO_LINKED) == 0)
    {
      fp->file._flags |= _IO_LINKED;
#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);
#endif
      fp->file._chain = (_IO_FILE *) INTUSE(_IO_list_all);
      INTUSE(_IO_list_all) = fp;
      ++_IO_list_all_stamp;
#ifdef _IO_MTSAFE_IO
      _IO_funlockfile ((_IO_FILE *) fp);
      run_fp = NULL;
      _IO_lock_unlock (list_all_lock);
      _IO_cleanup_region_end (0);
#endif
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_link_in_internal ( struct _IO_FILE_plus )

Definition at line 1077 of file genops.c.

{
  int cur_pos;
  if (mark->_sbuf == NULL)
    return BAD_DELTA;
  if (_IO_in_backup (mark->_sbuf))
    cur_pos = mark->_sbuf->_IO_read_ptr - mark->_sbuf->_IO_read_end;
  else
    cur_pos = mark->_sbuf->_IO_read_ptr - mark->_sbuf->_IO_read_base;
  return mark->_pos - cur_pos;
}
int _IO_marker_difference ( struct _IO_marker ,
struct _IO_marker  
)

Definition at line 1068 of file genops.c.

{
  return mark1->_pos - mark2->_pos;
}
int _IO_new_do_write ( _IO_FILE ,
const char *  ,
_IO_size_t   
)

Definition at line 489 of file fileops.c.

{
  return (to_do == 0
         || (_IO_size_t) new_do_write (fp, data, to_do) == to_do) ? 0 : EOF;
}

Here is the call graph for this function:

Definition at line 35 of file iofgetpos.c.

{
  _IO_off64_t pos;
  int result = 0;
  CHECK_FILE (fp, EOF);
  _IO_acquire_lock (fp);
  pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
  if (_IO_in_backup (fp) && pos != _IO_pos_BAD)
    {
      if (fp->_mode <= 0)
       pos -= fp->_IO_save_end - fp->_IO_save_base;
    }
  if (pos == _IO_pos_BAD)
    {
      /* ANSI explicitly requires setting errno to a positive value on
        failure.  */
#ifdef EIO
      if (errno == 0)
       __set_errno (EIO);
#endif
      result = EOF;
    }
  else if ((_IO_off64_t) (__typeof (posp->__pos)) pos != pos)
    {
#ifdef EOVERFLOW
      __set_errno (EOVERFLOW);
#endif
      result = EOF;
    }
  else
    {
      posp->__pos = pos;
      if (fp->_mode > 0
         && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
       /* This is a stateful encoding, safe the state.  */
       posp->__state = fp->_wide_data->_IO_state;
    }

  _IO_release_lock (fp);
  return result;
}

Here is the call graph for this function:

Definition at line 35 of file iofgetpos64.c.

{
#ifdef _G_LSEEK64
  _IO_off64_t pos;
  int result = 0;
  CHECK_FILE (fp, EOF);
  _IO_acquire_lock (fp);
  pos = _IO_seekoff_unlocked (fp, 0, _IO_seek_cur, 0);
  if (_IO_in_backup (fp) && pos != _IO_pos_BAD)
    {
      if (fp->_mode <= 0)
       pos -= fp->_IO_save_end - fp->_IO_save_base;
    }
  if (pos == _IO_pos_BAD)
    {
      /* ANSI explicitly requires setting errno to a positive value on
        failure.  */
# ifdef EIO
      if (errno == 0)
       __set_errno (EIO);
# endif
      result = EOF;
    }
  else
    {
      posp->__pos = pos;
      if (fp->_mode > 0
         && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
       /* This is a stateful encoding, safe the state.  */
       posp->__state = fp->_wide_data->_IO_state;
    }
  _IO_release_lock (fp);
  return result;
#else
  __set_errno (ENOSYS);
  return EOF;
#endif
}

Here is the call graph for this function:

Definition at line 419 of file fileops.c.

{
  if (_IO_file_is_open (fp))
    return NULL;
  fp->_fileno = fd;
  fp->_flags &= ~(_IO_NO_READS+_IO_NO_WRITES);
  fp->_flags |= _IO_DELETE_DONT_CLOSE;
  /* Get the current position of the file. */
  /* 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)
      == _IO_pos_BAD && errno != ESPIPE)
    return NULL;
  __set_errno (save_errno);
  return fp;
}

Definition at line 160 of file fileops.c.

{
  int write_status, close_status;
  if (!_IO_file_is_open (fp))
    return EOF;

  if ((fp->_flags & _IO_NO_WRITES) == 0
      && (fp->_flags & _IO_CURRENTLY_PUTTING) != 0)
    write_status = _IO_do_flush (fp);
  else
    write_status = 0;

  INTUSE(_IO_unsave_markers) (fp);

  close_status = _IO_SYSCLOSE (fp);

  /* Free buffer. */
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
  if (fp->_mode > 0)
    {
      if (_IO_have_wbackup (fp))
       INTUSE(_IO_free_wbackup_area) (fp);
      INTUSE(_IO_wsetb) (fp, NULL, NULL, 0);
      _IO_wsetg (fp, NULL, NULL, NULL);
      _IO_wsetp (fp, NULL, NULL);
    }
#endif
  INTUSE(_IO_setb) (fp, NULL, NULL, 0);
  _IO_setg (fp, NULL, NULL, NULL);
  _IO_setp (fp, NULL, NULL);

  INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
  fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
  fp->_fileno = -1;
  fp->_offset = _IO_pos_BAD;

  return close_status ? close_status : write_status;
}

Here is the call graph for this function:

void _IO_new_file_finish ( _IO_FILE ,
int   
)

Definition at line 202 of file fileops.c.

Here is the call graph for this function:

_IO_FILE* _IO_new_file_fopen ( _IO_FILE ,
const char *  ,
const char *  ,
int   
)
void _IO_new_file_init ( struct _IO_FILE_plus )

Definition at line 145 of file fileops.c.

{
  /* POSIX.1 allows another file handle to be used to change the position
     of our file descriptor.  Hence we actually don't know the actual
     position before we do the first fseek (and until a following fflush). */
  fp->file._offset = _IO_pos_BAD;
  fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;

  INTUSE(_IO_link_in) (fp);
  fp->file._fileno = -1;
}

Here is the call graph for this function:

Definition at line 826 of file fileops.c.

{
  if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
    {
      f->_flags |= _IO_ERR_SEEN;
      __set_errno (EBADF);
      return EOF;
    }
  /* If currently reading or no buffer allocated. */
  if ((f->_flags & _IO_CURRENTLY_PUTTING) == 0 || f->_IO_write_base == NULL)
    {
      /* Allocate a buffer if needed. */
      if (f->_IO_write_base == NULL)
       {
         INTUSE(_IO_doallocbuf) (f);
         _IO_setg (f, f->_IO_buf_base, f->_IO_buf_base, f->_IO_buf_base);
       }
      /* Otherwise must be currently reading.
        If _IO_read_ptr (and hence also _IO_read_end) is at the buffer end,
        logically slide the buffer forwards one block (by setting the
        read pointers to all point at the beginning of the block).  This
        makes room for subsequent output.
        Otherwise, set the read pointers to _IO_read_end (leaving that
        alone, so it can continue to correspond to the external position). */
      if (__builtin_expect (_IO_in_backup (f), 0))
       {
         size_t nbackup = f->_IO_read_end - f->_IO_read_ptr;
         INTUSE(_IO_free_backup_area) (f);
         f->_IO_read_base -= MIN (nbackup,
                               f->_IO_read_base - f->_IO_buf_base);
         f->_IO_read_ptr = f->_IO_read_base;
       }

      if (f->_IO_read_ptr == f->_IO_buf_end)
       f->_IO_read_end = f->_IO_read_ptr = f->_IO_buf_base;
      f->_IO_write_ptr = f->_IO_read_ptr;
      f->_IO_write_base = f->_IO_write_ptr;
      f->_IO_write_end = f->_IO_buf_end;
      f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end;

      f->_flags |= _IO_CURRENTLY_PUTTING;
      if (f->_mode <= 0 && f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
       f->_IO_write_end = f->_IO_write_ptr;
    }
  if (ch == EOF)
    return INTUSE(_IO_do_write) (f, f->_IO_write_base,
                             f->_IO_write_ptr - f->_IO_write_base);
  if (f->_IO_write_ptr == f->_IO_buf_end ) /* Buffer is really full */
    if (_IO_do_flush (f) == EOF)
      return EOF;
  *f->_IO_write_ptr++ = ch;
  if ((f->_flags & _IO_UNBUFFERED)
      || ((f->_flags & _IO_LINE_BUF) && ch == '\n'))
    if (INTUSE(_IO_do_write) (f, f->_IO_write_base,
                           f->_IO_write_ptr - f->_IO_write_base) == EOF)
      return EOF;
  return (unsigned char) ch;
}

Here is the call graph for this function:

Definition at line 952 of file fileops.c.

{
  _IO_off64_t result;
  _IO_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.  */
  int must_be_exact = (fp->_IO_read_base == fp->_IO_read_end
                     && fp->_IO_write_base == fp->_IO_write_ptr);

  if (mode == 0)
    dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */

  /* Flush unwritten characters.
     (This may do an unneeded write if we seek within the buffer.
     But to be able to switch to reading, we would need to set
     egptr to ptr.  That can't be done in the current design,
     which assumes file_ptr() is eGptr.  Anyway, since we probably
     end up flushing when we close(), it doesn't make much difference.)
     FIXME: simulate mem-papped files. */

  if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode (fp))
    if (INTUSE(_IO_switch_to_get_mode) (fp))
      return EOF;

  if (fp->_IO_buf_base == NULL)
    {
      /* It could be that we already have a pushback buffer.  */
      if (fp->_IO_read_base != NULL)
       {
         free (fp->_IO_read_base);
         fp->_flags &= ~_IO_IN_BACKUP;
       }
      INTUSE(_IO_doallocbuf) (fp);
      _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
      _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
    }

  switch (dir)
    {
    case _IO_seek_cur:
      /* Adjust for read-ahead (bytes is buffer). */
      offset -= fp->_IO_read_end - fp->_IO_read_ptr;
      if (fp->_offset == _IO_pos_BAD)
        {
          if (mode != 0)
            goto dumb;
          else
            {
              result = _IO_SYSSEEK (fp, 0, dir);
              if (result == EOF)
                return result;

              fp->_offset = result;
            }
        }
      /* Make offset absolute, assuming current pointer is file_ptr(). */
      offset += fp->_offset;
      if (offset < 0)
       {
         __set_errno (EINVAL);
         return EOF;
       }

      dir = _IO_seek_set;
      break;
    case _IO_seek_set:
      break;
    case _IO_seek_end:
      {
       struct _G_stat64 st;
       if (_IO_SYSSTAT (fp, &st) == 0 && S_ISREG (st.st_mode))
         {
           offset += st.st_size;
           dir = _IO_seek_set;
         }
       else
         goto dumb;
      }
    }
  /* At this point, dir==_IO_seek_set. */

  /* If we are only interested in the current position we've found it now.  */
  if (mode == 0)
    return offset;

  /* If destination is within current buffer, optimize: */
  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));
      if (offset >= start_offset && offset < fp->_offset)
       {
         _IO_setg (fp, fp->_IO_buf_base,
                  fp->_IO_buf_base + (offset - start_offset),
                  fp->_IO_read_end);
         _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);

         _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
         goto resync;
       }
    }

  if (fp->_flags & _IO_NO_READS)
    goto dumb;

  /* Try to seek to a block boundary, to improve kernel page management. */
  new_offset = offset & ~(fp->_IO_buf_end - fp->_IO_buf_base - 1);
  delta = offset - new_offset;
  if (delta > fp->_IO_buf_end - fp->_IO_buf_base)
    {
      new_offset = offset;
      delta = 0;
    }
  result = _IO_SYSSEEK (fp, new_offset, 0);
  if (result < 0)
    return EOF;
  if (delta == 0)
    count = 0;
  else
    {
      count = _IO_SYSREAD (fp, fp->_IO_buf_base,
                        (must_be_exact
                         ? delta : fp->_IO_buf_end - fp->_IO_buf_base));
      if (count < delta)
       {
         /* We weren't allowed to read, but try to seek the remainder. */
         offset = count == EOF ? delta : delta-count;
         dir = _IO_seek_cur;
         goto dumb;
       }
    }
  _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + delta,
           fp->_IO_buf_base + count);
  _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
  fp->_offset = result + count;
  _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
  return offset;
 dumb:

  INTUSE(_IO_unsave_markers) (fp);
  result = _IO_SYSSEEK (fp, offset, dir);
  if (result != EOF)
    {
      _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
      fp->_offset = result;
      _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
      _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
    }
  return result;

resync:
  /* We need to do it since it is possible that the file offset in
     the kernel may be changed behind our back. It may happen when
     we fopen a file and then do a fork. One process may access the
     the file and the kernel file offset will be changed. */
  if (fp->_offset >= 0)
    _IO_SYSSEEK (fp, fp->_offset, 0);

  return offset;
}

Here is the call graph for this function:

_IO_FILE* _IO_new_file_setbuf ( _IO_FILE ,
char *  ,
_IO_ssize_t   
)

Definition at line 441 of file fileops.c.

{
  if (_IO_default_setbuf (fp, p, len) == NULL)
    return NULL;

  fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end
    = fp->_IO_buf_base;
  _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);

  return fp;
}

Here is the call graph for this function:

Definition at line 889 of file fileops.c.

{
  _IO_ssize_t delta;
  int retval = 0;

  /*    char* ptr = cur_ptr(); */
  if (fp->_IO_write_ptr > fp->_IO_write_base)
    if (_IO_do_flush(fp)) return EOF;
  delta = fp->_IO_read_ptr - fp->_IO_read_end;
  if (delta != 0)
    {
#ifdef TODO
      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)
       fp->_IO_read_end = fp->_IO_read_ptr;
#ifdef ESPIPE
      else if (errno == ESPIPE)
       ; /* Ignore error from unseekable devices. */
#endif
      else
       retval = EOF;
    }
  if (retval != EOF)
    fp->_offset = _IO_pos_BAD;
  /* FIXME: Cleanup - can this be shared? */
  /*    setg(base(), ptr, ptr); */
  return retval;
}

Here is the call graph for this function:

Definition at line 535 of file fileops.c.

{
  _IO_ssize_t count;
#if 0
  /* SysV does not make this test; take it out for compatibility */
  if (fp->_flags & _IO_EOF_SEEN)
    return (EOF);
#endif

  if (fp->_flags & _IO_NO_READS)
    {
      fp->_flags |= _IO_ERR_SEEN;
      __set_errno (EBADF);
      return EOF;
    }
  if (fp->_IO_read_ptr < fp->_IO_read_end)
    return *(unsigned char *) fp->_IO_read_ptr;

  if (fp->_IO_buf_base == NULL)
    {
      /* Maybe we already have a push back pointer.  */
      if (fp->_IO_save_base != NULL)
       {
         free (fp->_IO_save_base);
         fp->_flags &= ~_IO_IN_BACKUP;
       }
      INTUSE(_IO_doallocbuf) (fp);
    }

  /* Flush all line buffered files before reading. */
  /* FIXME This can/should be moved to genops ?? */
  if (fp->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
    {
#if 0
      INTUSE(_IO_flush_all_linebuffered) ();
#else
      /* We used to flush all line-buffered stream.  This really isn't
        required by any standard.  My recollection is that
        traditional Unix systems did this for stdout.  stderr better
        not be line buffered.  So we do just that here
        explicitly.  --drepper */
      _IO_acquire_lock (_IO_stdout);

      if ((_IO_stdout->_flags & (_IO_LINKED | _IO_NO_WRITES | _IO_LINE_BUF))
         == (_IO_LINKED | _IO_LINE_BUF))
       _IO_OVERFLOW (_IO_stdout, EOF);

      _IO_release_lock (_IO_stdout);
#endif
    }

  INTUSE(_IO_switch_to_get_mode) (fp);

  /* This is very tricky. We have to adjust those
     pointers before we call _IO_SYSREAD () since
     we may longjump () out while waiting for
     input. Those pointers may be screwed up. H.J. */
  fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base;
  fp->_IO_read_end = fp->_IO_buf_base;
  fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end
    = fp->_IO_buf_base;

  count = _IO_SYSREAD (fp, fp->_IO_buf_base,
                     fp->_IO_buf_end - fp->_IO_buf_base);
  if (count <= 0)
    {
      if (count == 0)
       fp->_flags |= _IO_EOF_SEEN;
      else
       fp->_flags |= _IO_ERR_SEEN, count = 0;
  }
  fp->_IO_read_end += count;
  if (count == 0)
    return EOF;
  if (fp->_offset != _IO_pos_BAD)
    _IO_pos_adjust (fp->_offset, count);
  return *(unsigned char *) fp->_IO_read_ptr;
}

Here is the call graph for this function:

Definition at line 1257 of file fileops.c.

{
  _IO_ssize_t to_do = n;
  while (to_do > 0)
    {
      _IO_ssize_t count = (__builtin_expect (f->_flags2
                                        & _IO_FLAGS2_NOTCANCEL, 0)
                        ? write_not_cancel (f->_fileno, data, to_do)
                        : write (f->_fileno, data, to_do));
      if (count < 0)
       {
         f->_flags |= _IO_ERR_SEEN;
         break;
        }
      to_do -= count;
      data = (void *) ((char *) data + count);
    }
  n -= to_do;
  if (f->_offset >= 0)
    f->_offset += n;
  return n;
}

Here is the call graph for this function:

Definition at line 1284 of file fileops.c.

{
  register const char *s = (const char *) data;
  _IO_size_t to_do = n;
  int must_flush = 0;
  _IO_size_t count = 0;

  if (n <= 0)
    return 0;
  /* This is an optimized implementation.
     If the amount to be written straddles a block boundary
     (or the filebuf is unbuffered), use sys_write directly. */

  /* First figure out how much space is available in the buffer. */
  if ((f->_flags & _IO_LINE_BUF) && (f->_flags & _IO_CURRENTLY_PUTTING))
    {
      count = f->_IO_buf_end - f->_IO_write_ptr;
      if (count >= n)
       {
         register const char *p;
         for (p = s + n; p > s; )
           {
             if (*--p == '\n')
              {
                count = p - s + 1;
                must_flush = 1;
                break;
              }
           }
       }
    }
  else if (f->_IO_write_end > f->_IO_write_ptr)
    count = f->_IO_write_end - f->_IO_write_ptr; /* Space available. */

  /* Then fill the buffer. */
  if (count > 0)
    {
      if (count > to_do)
       count = to_do;
      if (count > 20)
       {
#ifdef _LIBC
         f->_IO_write_ptr = __mempcpy (f->_IO_write_ptr, s, count);
#else
         memcpy (f->_IO_write_ptr, s, count);
         f->_IO_write_ptr += count;
#endif
         s += count;
       }
      else
       {
         register char *p = f->_IO_write_ptr;
         register int i = (int) count;
         while (--i >= 0)
           *p++ = *s++;
         f->_IO_write_ptr = p;
       }
      to_do -= count;
    }
  if (to_do + must_flush > 0)
    {
      _IO_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
          caller that everything has been written.  */
       return to_do == 0 ? EOF : n - to_do;

      /* Try to maintain alignment: write a whole number of blocks.
        dont_write is what gets left over. */
      block_size = f->_IO_buf_end - f->_IO_buf_base;
      do_write = to_do - (block_size >= 128 ? to_do % block_size : 0);

      if (do_write)
        {
         count = new_do_write (f, s, do_write);
         to_do -= count;
         if (count < do_write)
           return n - to_do;
        }

      /* Now write out the remainder.  Normally, this will fit in the
        buffer, but it's somewhat messier for line-buffered files,
        so we let _IO_default_xsputn handle the general case. */
      if (to_do)
       to_do -= INTUSE(_IO_default_xsputn) (f, s+do_write, to_do);
    }
  return n - to_do;
}

Here is the call graph for this function:

Definition at line 34 of file iofsetpos.c.

{
  int result;
  CHECK_FILE (fp, EOF);
  _IO_acquire_lock (fp);
  if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
      == _IO_pos_BAD)
    {
      /* ANSI explicitly requires setting errno to a positive value on
        failure.  */
#ifdef EIO
      if (errno == 0)
       __set_errno (EIO);
#endif
      result = EOF;
    }
  else
    {
      result = 0;
      if (fp->_mode > 0
         && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
       /* This is a stateful encoding, restore the state.  */
       fp->_wide_data->_IO_state = posp->__state;
    }
  _IO_release_lock (fp);
  return result;
}

Here is the call graph for this function:

Definition at line 34 of file iofsetpos64.c.

{
#ifdef _G_LSEEK64
  int result;
  CHECK_FILE (fp, EOF);
  _IO_acquire_lock (fp);
  if (_IO_seekpos_unlocked (fp, posp->__pos, _IOS_INPUT|_IOS_OUTPUT)
      == _IO_pos_BAD)
    {
      /* ANSI explicitly requires setting errno to a positive value on
        failure.  */
#ifdef EIO
      if (errno == 0)
       __set_errno (EIO);
#endif
      result = EOF;
    }
  else
    {
      result = 0;
      if (fp->_mode > 0
         && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
       /* This is a stateful encoding, safe the state.  */
       fp->_wide_data->_IO_state = posp->__state;
    }
  _IO_release_lock (fp);
  return result;
#else
  __set_errno (ENOSYS);
  return EOF;
#endif
}

Here is the call graph for this function:

Definition at line 320 of file iopopen.c.

{
  /* This is not name-space clean. FIXME! */
#if _IO_HAVE_SYS_WAIT
  int wstatus;
  _IO_proc_file **ptr = &proc_file_chain;
  _IO_pid_t wait_pid;
  int status = -1;

  /* Unlink from proc_file_chain. */
#ifdef _IO_MTSAFE_IO
  _IO_cleanup_region_start_noarg (unlock);
  _IO_lock_lock (proc_file_chain_lock);
#endif
  for ( ; *ptr != NULL; ptr = &(*ptr)->next)
    {
      if (*ptr == (_IO_proc_file *) fp)
       {
         *ptr = (*ptr)->next;
         status = 0;
         break;
       }
    }
#ifdef _IO_MTSAFE_IO
  _IO_lock_unlock (proc_file_chain_lock);
  _IO_cleanup_region_end (0);
#endif

  if (status < 0 || _IO_close (_IO_fileno(fp)) < 0)
    return -1;
  /* POSIX.2 Rationale:  "Some historical implementations either block
     or ignore the signals SIGINT, SIGQUIT, and SIGHUP while waiting
     for the child process to terminate.  Since this behavior is not
     described in POSIX.2, such implementations are not conforming." */
  do
    {
      wait_pid = _IO_waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
    }
  while (wait_pid == -1 && errno == EINTR);
  if (wait_pid == -1)
    return -1;
  return wstatus;
#else /* !_IO_HAVE_SYS_WAIT */
  return -1;
#endif
}
_IO_FILE* _IO_new_proc_open ( _IO_FILE ,
const char *  ,
const char *   
)

Definition at line 116 of file iopopen.c.

{
#if _IO_HAVE_SYS_WAIT
  int read_or_write;
  int parent_end, child_end;
  int pipe_fds[2];
  _IO_pid_t child_pid;

  int do_read = 0;
  int do_write = 0;
  int do_cloexec = 0;
  while (*mode != '\0')
    switch (*mode++)
      {
      case 'r':
       do_read = 1;
       break;
      case 'w':
       do_write = 1;
       break;
      case 'e':
       do_cloexec = 1;
       break;
      default:
      errout:
       __set_errno (EINVAL);
       return NULL;
      }

  if ((do_read ^ do_write) == 0)
    goto errout;

  if (_IO_file_is_open (fp))
    return NULL;

#ifdef O_CLOEXEC
# ifndef __ASSUME_PIPE2
  if (__have_pipe2 >= 0)
# endif
    {
      int r = __pipe2 (pipe_fds, O_CLOEXEC);
# ifndef __ASSUME_PIPE2
      if (__have_pipe2 == 0)
       __have_pipe2 = r != -1 || errno != ENOSYS ? 1 : -1;

      if (__have_pipe2 > 0)
# endif
       if (r < 0)
         return NULL;
    }
#endif
#ifndef __ASSUME_PIPE2
# ifdef O_CLOEXEC
  if (__have_pipe2 < 0)
# endif
    if (__pipe (pipe_fds) < 0)
      return NULL;
#endif

  if (do_read)
    {
      parent_end = pipe_fds[0];
      child_end = pipe_fds[1];
      read_or_write = _IO_NO_WRITES;
    }
  else
    {
      parent_end = pipe_fds[1];
      child_end = pipe_fds[0];
      read_or_write = _IO_NO_READS;
    }

  ((_IO_proc_file *) fp)->pid = child_pid = _IO_fork ();
  if (child_pid == 0)
    {
      int child_std_end = do_read ? 1 : 0;
      struct _IO_proc_file *p;

#ifndef __ASSUME_PIPE2
      /* If we have pipe2 the descriptor is marked for close-on-exec.  */
      _IO_close (parent_end);
#endif
      if (child_end != child_std_end)
       {
         _IO_dup2 (child_end, child_std_end);
#ifndef __ASSUME_PIPE2
         _IO_close (child_end);
#endif
       }
#ifdef O_CLOEXEC
      else
       {
         /* The descriptor is already the one we will use.  But it must
            not be marked close-on-exec.  Undo the effects.  */
# ifndef __ASSUME_PIPE2
         if (__have_pipe2 > 0)
# endif
           __fcntl (child_end, F_SETFD, 0);
       }
#endif
      /* POSIX.2:  "popen() shall ensure that any streams from previous
         popen() calls that remain open in the parent process are closed
        in the new child process." */
      for (p = proc_file_chain; p; p = p->next)
       {
         int fd = _IO_fileno ((_IO_FILE *) p);

         /* If any stream from previous popen() calls has fileno
            child_std_end, it has been already closed by the dup2 syscall
            above.  */
         if (fd != child_std_end)
           _IO_close (fd);
       }

      _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
      _IO__exit (127);
    }
  _IO_close (child_end);
  if (child_pid < 0)
    {
      _IO_close (parent_end);
      return NULL;
    }

  if (do_cloexec)
    {
#ifndef __ASSUME_PIPE2
# ifdef O_CLOEXEC
      if (__have_pipe2 < 0)
# endif
       __fcntl (parent_end, F_SETFD, FD_CLOEXEC);
#endif
    }
  else
    {
#ifdef O_CLOEXEC
      /* Undo the effects of the pipe2 call which set the
        close-on-exec flag.  */
# ifndef __ASSUME_PIPE2
      if (__have_pipe2 > 0)
# endif
       __fcntl (parent_end, F_SETFD, 0);
#endif
    }

  _IO_fileno (fp) = parent_end;

  /* Link into proc_file_chain. */
#ifdef _IO_MTSAFE_IO
  _IO_cleanup_region_start_noarg (unlock);
  _IO_lock_lock (proc_file_chain_lock);
#endif
  ((_IO_proc_file *) fp)->next = proc_file_chain;
  proc_file_chain = (_IO_proc_file *) fp;
#ifdef _IO_MTSAFE_IO
  _IO_lock_unlock (proc_file_chain_lock);
  _IO_cleanup_region_end (0);
#endif

  _IO_mask_flags (fp, read_or_write, _IO_NO_READS|_IO_NO_WRITES);
  return fp;
#else /* !_IO_HAVE_SYS_WAIT */
  return NULL;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_no_init ( _IO_FILE ,
int  ,
int  ,
struct _IO_wide_data *  ,
const struct _IO_jump_t  
)

Definition at line 642 of file genops.c.

{
  _IO_old_init (fp, flags);
  fp->_mode = orientation;
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
  if (orientation >= 0)
    {
      fp->_wide_data = wd;
      fp->_wide_data->_IO_buf_base = NULL;
      fp->_wide_data->_IO_buf_end = NULL;
      fp->_wide_data->_IO_read_base = NULL;
      fp->_wide_data->_IO_read_ptr = NULL;
      fp->_wide_data->_IO_read_end = NULL;
      fp->_wide_data->_IO_write_base = NULL;
      fp->_wide_data->_IO_write_ptr = NULL;
      fp->_wide_data->_IO_write_end = NULL;
      fp->_wide_data->_IO_save_base = NULL;
      fp->_wide_data->_IO_backup_base = NULL;
      fp->_wide_data->_IO_save_end = NULL;

      fp->_wide_data->_wide_vtable = jmp;
    }
#endif
  fp->_freeres_list = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _IO_old_do_write ( _IO_FILE ,
const char *  ,
_IO_size_t   
)

Here is the caller graph for this function:

void _IO_old_file_finish ( _IO_FILE ,
int   
)
_IO_FILE* _IO_old_file_fopen ( _IO_FILE ,
const char *  ,
const char *   
)

Here is the caller graph for this function:

void _IO_old_file_init ( struct _IO_FILE_plus )
_IO_FILE* _IO_old_file_setbuf ( _IO_FILE ,
char *  ,
_IO_ssize_t   
)
void _IO_old_init ( _IO_FILE fp,
int  flags 
)

Definition at line 611 of file genops.c.

{
  fp->_flags = _IO_MAGIC|flags;
  fp->_flags2 = 0;
  fp->_IO_buf_base = NULL;
  fp->_IO_buf_end = NULL;
  fp->_IO_read_base = NULL;
  fp->_IO_read_ptr = NULL;
  fp->_IO_read_end = NULL;
  fp->_IO_write_base = NULL;
  fp->_IO_write_ptr = NULL;
  fp->_IO_write_end = NULL;
  fp->_chain = NULL; /* Not necessary. */

  fp->_IO_save_base = NULL;
  fp->_IO_backup_base = NULL;
  fp->_IO_save_end = NULL;
  fp->_markers = NULL;
  fp->_cur_column = 0;
#if _IO_JUMPS_OFFSET
  fp->_vtable_offset = 0;
#endif
#ifdef _IO_MTSAFE_IO
  if (fp->_lock != NULL)
    _IO_lock_init (*fp->_lock);
#endif
}

Here is the caller graph for this function:

_IO_FILE* _IO_old_proc_open ( _IO_FILE ,
const char *  ,
const char *   
)
_IO_FILE* _IO_proc_open ( _IO_FILE ,
const char *  ,
const char *   
)
int _IO_putc_internal ( int  __c,
_IO_FILE __fp 
)
void _IO_remove_marker ( struct _IO_marker )

Definition at line 1044 of file genops.c.

{
  /* Unlink from sb's chain. */
  struct _IO_marker **ptr = &marker->_sbuf->_markers;
  for (; ; ptr = &(*ptr)->_next)
    {
      if (*ptr == NULL)
       break;
      else if (*ptr == marker)
       {
         *ptr = marker->_next;
         return;
       }
    }
#if 0
    if _sbuf has a backup area that is no longer needed, should we delete
    it now, or wait until the next underflow?
#endif
}

Here is the call graph for this function:

int _IO_seekmark ( _IO_FILE ,
struct _IO_marker ,
int   
)

Definition at line 1091 of file genops.c.

{
  if (mark->_sbuf != fp)
    return EOF;
 if (mark->_pos >= 0)
    {
      if (_IO_in_backup (fp))
       _IO_switch_to_main_get_area (fp);
      fp->_IO_read_ptr = fp->_IO_read_base + mark->_pos;
    }
  else
    {
      if (!_IO_in_backup (fp))
       _IO_switch_to_backup_area (fp);
      fp->_IO_read_ptr = fp->_IO_read_end + mark->_pos;
    }
  return 0;
}

Here is the call graph for this function:

Definition at line 40 of file ioseekoff.c.

{
  if (dir != _IO_seek_cur && dir != _IO_seek_set && dir != _IO_seek_end)
    {
      __set_errno (EINVAL);
      return EOF;
    }

  /* If we have a backup buffer, get rid of it, since the __seekoff
     callback may not know to do the right thing about it.
     This may be over-kill, but it'll do for now. TODO */
  if (mode != 0 && ((_IO_fwide (fp, 0) < 0 && _IO_have_backup (fp))
                  || (_IO_fwide (fp, 0) > 0 && _IO_have_wbackup (fp))))
    {
      if (dir == _IO_seek_cur && _IO_in_backup (fp))
       {
         if (_IO_vtable_offset (fp) != 0 || fp->_mode <= 0)
           offset -= fp->_IO_read_end - fp->_IO_read_ptr;
         else
           abort ();
       }
      if (_IO_fwide (fp, 0) < 0)
       INTUSE(_IO_free_backup_area) (fp);
      else
       INTUSE(_IO_free_wbackup_area) (fp);
    }

  return _IO_SEEKOFF (fp, offset, dir, mode);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 31 of file ioseekpos.c.

{
  /* If we have a backup buffer, get rid of it, since the __seekoff
     callback may not know to do the right thing about it.
     This may be over-kill, but it'll do for now. TODO */
  if (_IO_fwide (fp, 0) <= 0)
    {
      if (_IO_have_backup (fp))
       INTUSE(_IO_free_backup_area) (fp);
    }
  else
    {
      if (_IO_have_wbackup (fp))
       INTUSE(_IO_free_wbackup_area) (fp);
    }

  return _IO_SEEKOFF (fp, pos, 0, mode);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _IO_seekwmark ( _IO_FILE ,
struct _IO_marker ,
int   
)

Definition at line 696 of file wgenops.c.

{
  if (mark->_sbuf != fp)
    return EOF;
 if (mark->_pos >= 0)
    {
      if (_IO_in_backup (fp))
       INTUSE(_IO_switch_to_main_wget_area) (fp);
      fp->_wide_data->_IO_read_ptr = (fp->_wide_data->_IO_read_base
                                  + mark->_pos);
    }
  else
    {
      if (!_IO_in_backup (fp))
       INTUSE(_IO_switch_to_wbackup_area) (fp);
      fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end + mark->_pos;
    }
  return 0;
}

Here is the call graph for this function:

void _IO_setb ( _IO_FILE ,
char *  ,
char *  ,
int   
)

Here is the caller graph for this function:

void _IO_setb_internal ( _IO_FILE ,
char *  ,
char *  ,
int   
)
_IO_size_t _IO_sgetn_internal ( _IO_FILE ,
void *  ,
_IO_size_t   
)
int _IO_sputbackc ( _IO_FILE ,
int   
)

Definition at line 724 of file genops.c.

{
  int result;

  if (fp->_IO_read_ptr > fp->_IO_read_base
      && (unsigned char)fp->_IO_read_ptr[-1] == (unsigned char)c)
    {
      fp->_IO_read_ptr--;
      result = (unsigned char) c;
    }
  else
    result = _IO_PBACKFAIL (fp, c);

  if (result != EOF)
    fp->_flags &= ~_IO_EOF_SEEN;

  return result;
}

Here is the caller graph for this function:

Definition at line 601 of file wgenops.c.

{
  wint_t result;

  if (fp->_wide_data->_IO_read_ptr > fp->_wide_data->_IO_read_base
      && (wchar_t)fp->_wide_data->_IO_read_ptr[-1] == (wchar_t) c)
    {
      fp->_wide_data->_IO_read_ptr--;
      result = c;
    }
  else
    result = _IO_PBACKFAIL (fp, c);

  if (result != WEOF)
    fp->_flags &= ~_IO_EOF_SEEN;

  return result;
}

Here is the caller graph for this function:

Definition at line 176 of file strops.c.

{
  return ((fp->_IO_write_ptr > fp->_IO_read_end
          ? fp->_IO_write_ptr : fp->_IO_read_end)
         - fp->_IO_read_base);
}

Here is the caller graph for this function:

void _IO_str_finish ( _IO_FILE ,
int   
)

Definition at line 338 of file strops.c.

{
  if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
    (((_IO_strfile *) fp)->_s._free_buffer) (fp->_IO_buf_base);
  fp->_IO_buf_base = NULL;

  INTUSE(_IO_default_finish) (fp, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_str_init_readonly ( struct _IO_strfile_ ,
const char *  ,
int   
)

Definition at line 82 of file strops.c.

{
  _IO_str_init_static_internal (sf, (char *) ptr, size < 0 ? -1 : size, NULL);
  sf->_sbf._f._IO_file_flags |= _IO_NO_WRITES;
}

Here is the call graph for this function:

void _IO_str_init_static ( struct _IO_strfile_ ,
char *  ,
int  ,
char *   
)

Definition at line 72 of file strops.c.

{
  return _IO_str_init_static_internal (sf, ptr, size < 0 ? -1 : size, pstart);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_str_init_static_internal ( struct _IO_strfile_ ,
char *  ,
_IO_size_t  ,
char *   
)

Definition at line 35 of file strops.c.

{
  _IO_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)
    end = ptr + size;
  else
    end = (char *) -1;
  INTUSE(_IO_setb) (fp, ptr, end, 0);

  fp->_IO_write_base = ptr;
  fp->_IO_read_base = ptr;
  fp->_IO_read_ptr = ptr;
  if (pstart)
    {
      fp->_IO_write_ptr = pstart;
      fp->_IO_write_end = end;
      fp->_IO_read_end = pstart;
    }
  else
    {
      fp->_IO_write_ptr = ptr;
      fp->_IO_write_end = ptr;
      fp->_IO_read_end = end;
    }
  /* A null _allocate_buffer function flags the strfile as being static. */
  sf->_s._allocate_buffer = (_IO_alloc_type) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _IO_str_overflow ( _IO_FILE ,
int   
)

Definition at line 92 of file strops.c.

{
  int flush_only = c == EOF;
  _IO_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->_flags |= _IO_CURRENTLY_PUTTING;
      fp->_IO_write_ptr = fp->_IO_read_ptr;
      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 (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
       return EOF;
      else
       {
         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;
         if (new_size < old_blen)
           return EOF;
         new_buf
           = (char *) (*((_IO_strfile *) fp)->_s._allocate_buffer) (new_size);
         if (new_buf == NULL)
           {
             /*        __ferror(fp) = 1; */
             return EOF;
           }
         if (old_buf)
           {
             memcpy (new_buf, old_buf, old_blen);
             (*((_IO_strfile *) fp)->_s._free_buffer) (old_buf);
             /* Make sure _IO_setb won't try to delete _IO_buf_base. */
             fp->_IO_buf_base = NULL;
           }
         memset (new_buf + old_blen, '\0', new_size - old_blen);

         INTUSE(_IO_setb) (fp, new_buf, new_buf + new_size, 1);
         fp->_IO_read_base = new_buf + (fp->_IO_read_base - old_buf);
         fp->_IO_read_ptr = new_buf + (fp->_IO_read_ptr - old_buf);
         fp->_IO_read_end = new_buf + (fp->_IO_read_end - old_buf);
         fp->_IO_write_ptr = new_buf + (fp->_IO_write_ptr - old_buf);

         fp->_IO_write_base = new_buf;
         fp->_IO_write_end = fp->_IO_buf_end;
       }
    }

  if (!flush_only)
    *fp->_IO_write_ptr++ = (unsigned char) c;
  if (fp->_IO_write_ptr > fp->_IO_read_end)
    fp->_IO_read_end = fp->_IO_write_ptr;
  return c;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 327 of file strops.c.

{
  if ((fp->_flags & _IO_NO_WRITES) && c != EOF)
    return EOF;
  return INTUSE(_IO_default_pbackfail) (fp, c);
}

Here is the call graph for this function:

Definition at line 250 of file strops.c.

{
  _IO_off64_t new_pos;

  if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))
    mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);

  if (mode == 0)
    {
      /* Don't move any pointers. But there is no clear indication what
        mode FP is in. Let's guess. */
      if (fp->_IO_file_flags & _IO_NO_WRITES)
        new_pos = fp->_IO_read_ptr - fp->_IO_read_base;
      else
        new_pos = fp->_IO_write_ptr - fp->_IO_write_base;
    }
  else
    {
      _IO_ssize_t cur_size = _IO_str_count(fp);
      new_pos = EOF;

      /* Move the get pointer, if requested. */
      if (mode & _IOS_INPUT)
       {
         switch (dir)
           {
           case _IO_seek_end:
             offset += cur_size;
             break;
           case _IO_seek_cur:
             offset += fp->_IO_read_ptr - fp->_IO_read_base;
             break;
           default: /* case _IO_seek_set: */
             break;
           }
         if (offset < 0)
           return EOF;
         if ((_IO_ssize_t) offset > cur_size
             && enlarge_userbuf (fp, offset, 1) != 0)
           return EOF;
         fp->_IO_read_ptr = fp->_IO_read_base + offset;
         fp->_IO_read_end = fp->_IO_read_base + cur_size;
         new_pos = offset;
       }

      /* Move the put pointer, if requested. */
      if (mode & _IOS_OUTPUT)
       {
         switch (dir)
           {
           case _IO_seek_end:
             offset += cur_size;
             break;
           case _IO_seek_cur:
             offset += fp->_IO_write_ptr - fp->_IO_write_base;
             break;
           default: /* case _IO_seek_set: */
             break;
           }
         if (offset < 0)
           return EOF;
         if ((_IO_ssize_t) offset > cur_size
             && enlarge_userbuf (fp, offset, 0) != 0)
           return EOF;
         fp->_IO_write_ptr = fp->_IO_write_base + offset;
         new_pos = offset;
       }
    }
  return new_pos;
}

Here is the call graph for this function:

Definition at line 155 of file strops.c.

{
  if (fp->_IO_write_ptr > fp->_IO_read_end)
    fp->_IO_read_end = fp->_IO_write_ptr;
  if ((fp->_flags & _IO_TIED_PUT_GET) && (fp->_flags & _IO_CURRENTLY_PUTTING))
    {
      fp->_flags &= ~_IO_CURRENTLY_PUTTING;
      fp->_IO_read_ptr = fp->_IO_write_ptr;
      fp->_IO_write_ptr = fp->_IO_write_end;
    }
  if (fp->_IO_read_ptr < fp->_IO_read_end)
    return *((unsigned char *) fp->_IO_read_ptr);
  else
    return EOF;
}

Definition at line 747 of file genops.c.

{
  int result;

  if (fp->_IO_read_ptr > fp->_IO_read_base)
    {
      fp->_IO_read_ptr--;
      result = (unsigned char) *fp->_IO_read_ptr;
    }
  else
    result = _IO_PBACKFAIL (fp, EOF);

  if (result != EOF)
    fp->_flags &= ~_IO_EOF_SEEN;

  return result;
}

Definition at line 624 of file wgenops.c.

{
  wint_t result;

  if (fp->_wide_data->_IO_read_ptr > fp->_wide_data->_IO_read_base)
    {
      fp->_wide_data->_IO_read_ptr--;
      result = *fp->_wide_data->_IO_read_ptr;
    }
  else
    result = _IO_PBACKFAIL (fp, EOF);

  if (result != WEOF)
    fp->_flags &= ~_IO_EOF_SEEN;

  return result;
}

Definition at line 167 of file genops.c.

{
  char *tmp;
  fp->_flags |= _IO_IN_BACKUP;
  /* Swap _IO_read_end and _IO_save_end. */
  tmp = fp->_IO_read_end;
  fp->_IO_read_end = fp->_IO_save_end;
  fp->_IO_save_end = tmp;
  /* Swap _IO_read_base and _IO_save_base. */
  tmp = fp->_IO_read_base;
  fp->_IO_read_base = fp->_IO_save_base;
  fp->_IO_save_base = tmp;
  /* Set _IO_read_ptr.  */
  fp->_IO_read_ptr = fp->_IO_read_end;
}

Here is the caller graph for this function:

Definition at line 185 of file genops.c.

{
  if (fp->_IO_write_ptr > fp->_IO_write_base)
    if (_IO_OVERFLOW (fp, EOF) == EOF)
      return EOF;
  if (_IO_in_backup (fp))
    fp->_IO_read_base = fp->_IO_backup_base;
  else
    {
      fp->_IO_read_base = fp->_IO_buf_base;
      if (fp->_IO_write_ptr > fp->_IO_read_end)
       fp->_IO_read_end = fp->_IO_write_ptr;
    }
  fp->_IO_read_ptr = fp->_IO_write_ptr;

  fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = fp->_IO_read_ptr;

  fp->_flags &= ~_IO_CURRENTLY_PUTTING;
  return 0;
}

Here is the caller graph for this function:

Definition at line 147 of file genops.c.

{
  char *tmp;
  fp->_flags &= ~_IO_IN_BACKUP;
  /* Swap _IO_read_end and _IO_save_end. */
  tmp = fp->_IO_read_end;
  fp->_IO_read_end = fp->_IO_save_end;
  fp->_IO_save_end= tmp;
  /* Swap _IO_read_base and _IO_save_base. */
  tmp = fp->_IO_read_base;
  fp->_IO_read_base = fp->_IO_save_base;
  fp->_IO_save_base = tmp;
  /* Set _IO_read_ptr. */
  fp->_IO_read_ptr = fp->_IO_read_base;
}

Here is the caller graph for this function:

Definition at line 71 of file wgenops.c.

{
  wchar_t *tmp;
  fp->_flags &= ~_IO_IN_BACKUP;
  /* Swap _IO_read_end and _IO_save_end. */
  tmp = fp->_wide_data->_IO_read_end;
  fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_save_end;
  fp->_wide_data->_IO_save_end= tmp;
  /* Swap _IO_read_base and _IO_save_base. */
  tmp = fp->_wide_data->_IO_read_base;
  fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_save_base;
  fp->_wide_data->_IO_save_base = tmp;
  /* Set _IO_read_ptr. */
  fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_base;
}

Here is the caller graph for this function:

Definition at line 92 of file wgenops.c.

{
  wchar_t *tmp;
  fp->_flags |= _IO_IN_BACKUP;
  /* Swap _IO_read_end and _IO_save_end. */
  tmp = fp->_wide_data->_IO_read_end;
  fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_save_end;
  fp->_wide_data->_IO_save_end = tmp;
  /* Swap _IO_read_base and _IO_save_base. */
  tmp = fp->_wide_data->_IO_read_base;
  fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_save_base;
  fp->_wide_data->_IO_save_base = tmp;
  /* Set _IO_read_ptr.  */
  fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
}

Here is the caller graph for this function:

Definition at line 442 of file wgenops.c.

{
  if (fp->_wide_data->_IO_write_ptr > fp->_wide_data->_IO_write_base)
    if ((wint_t)_IO_WOVERFLOW (fp, WEOF) == WEOF)
      return EOF;
  if (_IO_in_backup (fp))
    fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_backup_base;
  else
    {
      fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_buf_base;
      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;
    }
  fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_write_ptr;

  fp->_wide_data->_IO_write_base = fp->_wide_data->_IO_write_ptr
    = fp->_wide_data->_IO_write_end = fp->_wide_data->_IO_read_ptr;

  fp->_flags &= ~_IO_CURRENTLY_PUTTING;
  return 0;
}

Here is the caller graph for this function:

void _IO_un_link ( struct _IO_FILE_plus )

Definition at line 62 of file genops.c.

{
  if (fp->file._flags & _IO_LINKED)
    {
      struct _IO_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);
#endif
      if (INTUSE(_IO_list_all) == NULL)
       ;
      else if (fp == INTUSE(_IO_list_all))
       {
         INTUSE(_IO_list_all)
           = (struct _IO_FILE_plus *) INTUSE(_IO_list_all)->file._chain;
         ++_IO_list_all_stamp;
       }
      else
       for (f = &INTUSE(_IO_list_all)->file._chain; *f; f = &(*f)->_chain)
         if (*f == (_IO_FILE *) fp)
           {
             *f = fp->file._chain;
             ++_IO_list_all_stamp;
             break;
           }
      fp->file._flags &= ~_IO_LINKED;
#ifdef _IO_MTSAFE_IO
      _IO_funlockfile ((_IO_FILE *) fp);
      run_fp = NULL;
      _IO_lock_unlock (list_all_lock);
      _IO_cleanup_region_end (0);
#endif
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_un_link_internal ( struct _IO_FILE_plus )

Definition at line 1114 of file genops.c.

{
  struct _IO_marker *mark = fp->_markers;
  if (mark)
    {
#ifdef TODO
      streampos offset = seekoff (0, ios::cur, ios::in);
      if (offset != EOF)
       {
         offset += eGptr () - Gbase ();
         for ( ; mark != NULL; mark = mark->_next)
           mark->set_streampos (mark->_pos + offset);
       }
    else
      {
       for ( ; mark != NULL; mark = mark->_next)
         mark->set_streampos (EOF);
      }
#endif
      fp->_markers = 0;
    }

  if (_IO_have_backup (fp))
    INTUSE(_IO_free_backup_area) (fp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 720 of file wgenops.c.

{
  struct _IO_marker *mark = fp->_markers;
  if (mark)
    {
#ifdef TODO
      streampos offset = seekoff (0, ios::cur, ios::in);
      if (offset != EOF)
       {
         offset += eGptr () - Gbase ();
         for ( ; mark != NULL; mark = mark->_next)
           mark->set_streampos (mark->_pos + offset);
       }
    else
      {
       for ( ; mark != NULL; mark = mark->_next)
         mark->set_streampos (EOF);
      }
#endif
      fp->_markers = 0;
    }

  if (_IO_have_backup (fp))
    INTUSE(_IO_free_wbackup_area) (fp);
}

Here is the call graph for this function:

int _IO_vasprintf ( char **  result_ptr,
__const char *  format,
_IO_va_list  args 
)

Here is the caller graph for this function:

int _IO_vdprintf ( int  d,
__const char *  format,
_IO_va_list  arg 
)
int _IO_vfprintf_internal ( _IO_FILE __restrict,
const char *  __restrict,
_IO_va_list   
)
int _IO_vfscanf_internal ( _IO_FILE __restrict,
const char *  __restrict,
_IO_va_list  ,
int __restrict 
)

Definition at line 204 of file vfscanf.c.

{
  va_list arg;
  register const CHAR_T *f = format;
  register UCHAR_T fc;      /* Current character of the format.  */
  register WINT_T done = 0; /* Assignments done.  */
  register size_t read_in = 0;     /* Chars read in.  */
  register WINT_T c = 0;    /* Last char read.  */
  register int width;              /* Maximum field width.  */
  register int flags;              /* Modifiers for current format element.  */
  int errval = 0;
#ifndef COMPILE_WSCANF
  __locale_t loc = _NL_CURRENT_LOCALE;
  struct locale_data *const curctype = loc->__locales[LC_CTYPE];
#endif

  /* Errno of last failed inchar call.  */
  int inchar_errno = 0;
  /* Status for reading F-P nums.  */
  char got_dot, got_e, negative;
  /* If a [...] is a [^...].  */
  CHAR_T not_in;
#define exp_char not_in
  /* Base for integral numbers.  */
  int base;
  /* Decimal point character.  */
#ifdef COMPILE_WSCANF
  wint_t decimal;
#else
  const char *decimal;
#endif
  /* The thousands character of the current locale.  */
#ifdef COMPILE_WSCANF
  wint_t thousands;
#else
  const char *thousands;
#endif
  struct ptrs_to_free *ptrs_to_free = NULL;
  /* State for the conversions.  */
  mbstate_t state;
  /* Integral holding variables.  */
  union
    {
      long long int q;
      unsigned long long int uq;
      long int l;
      unsigned long int ul;
    } num;
  /* Character-buffer pointer.  */
  char *str = NULL;
  wchar_t *wstr = NULL;
  char **strptr = NULL;
  ssize_t strsize = 0;
  /* We must not react on white spaces immediately because they can
     possibly be matched even if in the input stream no character is
     available anymore.  */
  int skip_space = 0;
  /* Workspace.  */
  CHAR_T *tw;               /* Temporary pointer.  */
  CHAR_T *wp = NULL;        /* Workspace.  */
  size_t wpmax = 0;         /* Maximal size of workspace.  */
  size_t wpsize;            /* Currently used bytes in workspace.  */
#define ADDW(Ch)                                                   \
  do                                                               \
    {                                                              \
      if (wpsize == wpmax)                                         \
       {                                                           \
         CHAR_T *old = wp;                                         \
         wpmax = (UCHAR_MAX + 1 > 2 * wpmax ? UCHAR_MAX + 1 : 2 * wpmax);  \
         wp = (CHAR_T *) alloca (wpmax * sizeof (CHAR_T));                \
         if (old != NULL)                                          \
           MEMCPY (wp, old, wpsize);                                      \
       }                                                           \
      wp[wpsize++] = (Ch);                                         \
    }                                                              \
  while (0)

#ifdef __va_copy
  __va_copy (arg, argptr);
#else
  arg = (va_list) argptr;
#endif

#ifdef ORIENT
  ORIENT;
#endif

  ARGCHECK (s, format);

 {
#ifndef COMPILE_WSCANF
   struct locale_data *const curnumeric = loc->__locales[LC_NUMERIC];
#endif

   /* Figure out the decimal point character.  */
#ifdef COMPILE_WSCANF
   decimal = _NL_CURRENT_WORD (LC_NUMERIC, _NL_NUMERIC_DECIMAL_POINT_WC);
#else
   decimal = curnumeric->values[_NL_ITEM_INDEX (DECIMAL_POINT)].string;
#endif
   /* Figure out the thousands separator character.  */
#ifdef COMPILE_WSCANF
   thousands = _NL_CURRENT_WORD (LC_NUMERIC, _NL_NUMERIC_THOUSANDS_SEP_WC);
#else
   thousands = curnumeric->values[_NL_ITEM_INDEX (THOUSANDS_SEP)].string;
   if (*thousands == '\0')
     thousands = NULL;
#endif
 }

  /* Lock the stream.  */
  LOCK_STREAM (s);


#ifndef COMPILE_WSCANF
  /* From now on we use `state' to convert the format string.  */
  memset (&state, '\0', sizeof (state));
#endif

  /* Run through the format string.  */
  while (*f != '\0')
    {
      unsigned int argpos;
      /* Extract the next argument, which is of type TYPE.
        For a %N$... spec, this is the Nth argument from the beginning;
        otherwise it is the next argument after the state now in ARG.  */
#ifdef __va_copy
# define ARG(type)   (argpos == 0 ? va_arg (arg, type) :                    \
                      ({ unsigned int pos = argpos;                         \
                         va_list arg;                                \
                         __va_copy (arg, argptr);                           \
                         while (--pos > 0)                                  \
                           (void) va_arg (arg, void *);              \
                         va_arg (arg, type);                                \
                       }))
#else
# if 0
      /* XXX Possible optimization.  */
#  define ARG(type)  (argpos == 0 ? va_arg (arg, type) :                    \
                      ({ va_list arg = (va_list) argptr;                    \
                         arg = (va_list) ((char *) arg               \
                                        + (argpos - 1)               \
                                        * __va_rounded_size (void *));   \
                         va_arg (arg, type);                                \
                      }))
# else
#  define ARG(type)  (argpos == 0 ? va_arg (arg, type) :                    \
                      ({ unsigned int pos = argpos;                         \
                         va_list arg = (va_list) argptr;                    \
                         while (--pos > 0)                                  \
                           (void) va_arg (arg, void *);              \
                         va_arg (arg, type);                                \
                       }))
# endif
#endif

#ifndef COMPILE_WSCANF
      if (!isascii ((unsigned char) *f))
       {
         /* Non-ASCII, may be a multibyte.  */
         int len = __mbrlen (f, strlen (f), &state);
         if (len > 0)
           {
             do
              {
                c = inchar ();
                if (__builtin_expect (c == EOF, 0))
                  input_error ();
                else if (c != (unsigned char) *f++)
                  {
                    ungetc_not_eof (c, s);
                    conv_error ();
                  }
              }
             while (--len > 0);
             continue;
           }
       }
#endif

      fc = *f++;
      if (fc != '%')
       {
         /* Remember to skip spaces.  */
         if (ISSPACE (fc))
           {
             skip_space = 1;
             continue;
           }

         /* Read a character.  */
         c = inchar ();

         /* Characters other than format specs must just match.  */
         if (__builtin_expect (c == EOF, 0))
           input_error ();

         /* We saw white space char as the last character in the format
            string.  Now it's time to skip all leading white space.  */
         if (skip_space)
           {
             while (ISSPACE (c))
              if (__builtin_expect (inchar () == EOF, 0))
                input_error ();
             skip_space = 0;
           }

         if (__builtin_expect (c != fc, 0))
           {
             ungetc (c, s);
             conv_error ();
           }

         continue;
       }

      /* This is the start of the conversion string. */
      flags = 0;

      /* Initialize state of modifiers.  */
      argpos = 0;

      /* Prepare temporary buffer.  */
      wpsize = 0;

      /* Check for a positional parameter specification.  */
      if (ISDIGIT ((UCHAR_T) *f))
       {
         argpos = (UCHAR_T) *f++ - L_('0');
         while (ISDIGIT ((UCHAR_T) *f))
           argpos = argpos * 10 + ((UCHAR_T) *f++ - L_('0'));
         if (*f == L_('$'))
           ++f;
         else
           {
             /* Oops; that was actually the field width.  */
             width = argpos;
             argpos = 0;
             goto got_width;
           }
       }

      /* Check for the assignment-suppressing, the number grouping flag,
        and the signal to use the locale's digit representation.  */
      while (*f == L_('*') || *f == L_('\'') || *f == L_('I'))
       switch (*f++)
         {
         case L_('*'):
           flags |= SUPPRESS;
           break;
         case L_('\''):
#ifdef COMPILE_WSCANF
           if (thousands != L'\0')
#else
           if (thousands != NULL)
#endif
             flags |= GROUP;
           break;
         case L_('I'):
           flags |= I18N;
           break;
         }

      /* Find the maximum field width.  */
      width = 0;
      while (ISDIGIT ((UCHAR_T) *f))
       {
         width *= 10;
         width += (UCHAR_T) *f++ - L_('0');
       }
    got_width:
      if (width == 0)
       width = -1;

      /* Check for type modifiers.  */
      switch (*f++)
       {
       case L_('h'):
         /* ints are short ints or chars.  */
         if (*f == L_('h'))
           {
             ++f;
             flags |= CHAR;
           }
         else
           flags |= SHORT;
         break;
       case L_('l'):
         if (*f == L_('l'))
           {
             /* A double `l' is equivalent to an `L'.  */
             ++f;
             flags |= LONGDBL | LONG;
           }
         else
           /* ints are long ints.  */
           flags |= LONG;
         break;
       case L_('q'):
       case L_('L'):
         /* doubles are long doubles, and ints are long long ints.  */
         flags |= LONGDBL | LONG;
         break;
       case L_('a'):
         /* The `a' is used as a flag only if followed by `s', `S' or
            `['.  */
         if (*f != L_('s') && *f != L_('S') && *f != L_('['))
           {
             --f;
             break;
           }
         /* In __isoc99_*scanf %as, %aS and %a[ extension is not
            supported at all.  */
         if (s->_flags2 & _IO_FLAGS2_SCANF_STD)
           {
             --f;
             break;
           }
         /* String conversions (%s, %[) take a `char **'
            arg and fill it in with a malloc'd pointer.  */
         flags |= GNU_MALLOC;
         break;
       case L_('m'):
         flags |= POSIX_MALLOC;
         if (*f == L_('l'))
           {
             ++f;
             flags |= LONG;
           }
         break;
       case L_('z'):
         if (need_longlong && sizeof (size_t) > sizeof (unsigned long int))
           flags |= LONGDBL;
         else if (sizeof (size_t) > sizeof (unsigned int))
           flags |= LONG;
         break;
       case L_('j'):
         if (need_longlong && sizeof (uintmax_t) > sizeof (unsigned long int))
           flags |= LONGDBL;
         else if (sizeof (uintmax_t) > sizeof (unsigned int))
           flags |= LONG;
         break;
       case L_('t'):
         if (need_longlong && sizeof (ptrdiff_t) > sizeof (long int))
           flags |= LONGDBL;
         else if (sizeof (ptrdiff_t) > sizeof (int))
           flags |= LONG;
         break;
       default:
         /* Not a recognized modifier.  Backup.  */
         --f;
         break;
       }

      /* End of the format string?  */
      if (__builtin_expect (*f == L_('\0'), 0))
       conv_error ();

      /* Find the conversion specifier.  */
      fc = *f++;
      if (skip_space || (fc != L_('[') && fc != L_('c')
                      && fc != L_('C') && fc != L_('n')))
       {
         /* Eat whitespace.  */
         int save_errno = errno;
         __set_errno (0);
         do
           /* We add the additional test for EOF here since otherwise
              inchar will restore the old errno value which might be
              EINTR but does not indicate an interrupt since nothing
              was read at this time.  */
           if (__builtin_expect ((c == EOF || inchar () == EOF)
                              && errno == EINTR, 0))
             input_error ();
         while (ISSPACE (c));
         __set_errno (save_errno);
         ungetc (c, s);
         skip_space = 0;
       }

      switch (fc)
       {
       case L_('%'): /* Must match a literal '%'.  */
         c = inchar ();
         if (__builtin_expect (c == EOF, 0))
           input_error ();
         if (__builtin_expect (c != fc, 0))
           {
             ungetc_not_eof (c, s);
             conv_error ();
           }
         break;

       case L_('n'): /* Answer number of assignments done.  */
         /* Corrigendum 1 to ISO C 1990 describes the allowed flags
            with the 'n' conversion specifier.  */
         if (!(flags & SUPPRESS))
           {
             /* Don't count the read-ahead.  */
             if (need_longlong && (flags & LONGDBL))
              *ARG (long long int *) = read_in;
             else if (need_long && (flags & LONG))
              *ARG (long int *) = read_in;
             else if (flags & SHORT)
              *ARG (short int *) = read_in;
             else if (!(flags & CHAR))
              *ARG (int *) = read_in;
             else
              *ARG (char *) = read_in;

#ifdef NO_BUG_IN_ISO_C_CORRIGENDUM_1
             /* We have a severe problem here.  The ISO C standard
               contradicts itself in explaining the effect of the %n
               format in `scanf'.  While in ISO C:1990 and the ISO C
               Amendement 1:1995 the result is described as

                 Execution of a %n directive does not effect the
                 assignment count returned at the completion of
                 execution of the f(w)scanf function.

               in ISO C Corrigendum 1:1994 the following was added:

                 Subclause 7.9.6.2
                 Add the following fourth example:
                   In:
                     #include <stdio.h>
                     int d1, d2, n1, n2, i;
                     i = sscanf("123", "%d%n%n%d", &d1, &n1, &n2, &d2);
                   the value 123 is assigned to d1 and the value3 to n1.
                   Because %n can never get an input failure the value
                   of 3 is also assigned to n2.  The value of d2 is not
                   affected.  The value 3 is assigned to i.

               We go for now with the historically correct code from ISO C,
               i.e., we don't count the %n assignments.  When it ever
               should proof to be wrong just remove the #ifdef above.  */
             ++done;
#endif
           }
         break;

       case L_('c'): /* Match characters.  */
         if ((flags & LONG) == 0)
           {
             if (width == -1)
              width = 1;

#define STRING_ARG(Str, Type, Width)                                        \
             do if (!(flags & SUPPRESS))                             \
              {                                                      \
                if (flags & MALLOC)                                         \
                  {                                                  \
                    /* The string is to be stored in a malloc'd buffer.  */ \
                    /* For %mS using char ** is actually wrong, but         \
                      shouldn't make a difference on any arch glibc         \
                      supports and would unnecessarily complicate           \
                      things. */                                     \
                    strptr = ARG (char **);                                 \
                    if (strptr == NULL)                              \
                     conv_error ();                                         \
                    /* Allocate an initial buffer.  */               \
                    strsize = Width;                                        \
                    *strptr = (char *) malloc (strsize * sizeof (Type));    \
                    Str = (Type *) *strptr;                                 \
                    if (Str != NULL)                                        \
                     add_ptr_to_free (strptr);                       \
                    else if (flags & POSIX_MALLOC)                          \
                     goto reteof;                                    \
                  }                                                  \
                else                                                 \
                  Str = ARG (Type *);                                       \
                if (Str == NULL)                                     \
                  conv_error ();                                     \
              } while (0)
#ifdef COMPILE_WSCANF
             STRING_ARG (str, char, 100);
#else
             STRING_ARG (str, char, (width > 1024 ? 1024 : width));
#endif

             c = inchar ();
             if (__builtin_expect (c == EOF, 0))
              input_error ();

#ifdef COMPILE_WSCANF
             /* We have to convert the wide character(s) into multibyte
               characters and store the result.  */
             memset (&state, '\0', sizeof (state));

             do
              {
                size_t n;

                if (!(flags & SUPPRESS) && (flags & POSIX_MALLOC)
                    && str + MB_CUR_MAX >= *strptr + strsize)
                  {
                    /* We have to enlarge the buffer if the `m' flag
                      was given.  */
                    size_t strleng = str - *strptr;
                    char *newstr;

                    newstr = (char *) realloc (*strptr, strsize * 2);
                    if (newstr == NULL)
                     {
                       /* Can't allocate that much.  Last-ditch effort.  */
                       newstr = (char *) realloc (*strptr,
                                               strleng + MB_CUR_MAX);
                       if (newstr == NULL)
                         /* c can't have `a' flag, only `m'.  */
                         goto reteof;
                       else
                         {
                           *strptr = newstr;
                           str = newstr + strleng;
                           strsize = strleng + MB_CUR_MAX;
                         }
                     }
                    else
                     {
                       *strptr = newstr;
                       str = newstr + strleng;
                       strsize *= 2;
                     }
                  }

                n = __wcrtomb (!(flags & SUPPRESS) ? str : NULL, c, &state);
                if (__builtin_expect (n == (size_t) -1, 0))
                  /* No valid wide character.  */
                  input_error ();

                /* Increment the output pointer.  Even if we don't
                   write anything.  */
                str += n;
              }
             while (--width > 0 && inchar () != EOF);
#else
             if (!(flags & SUPPRESS))
              {
                do
                  {
                    if ((flags & MALLOC)
                       && (char *) str == *strptr + strsize)
                     {
                       /* Enlarge the buffer.  */
                       size_t newsize
                         = strsize
                           + (strsize >= width ? width - 1 : strsize);

                       str = (char *) realloc (*strptr, newsize);
                       if (str == NULL)
                         {
                           /* Can't allocate that much.  Last-ditch
                             effort.  */
                           str = (char *) realloc (*strptr, strsize + 1);
                           if (str == NULL)
                            /* c can't have `a' flag, only `m'.  */
                            goto reteof;
                           else
                            {
                              *strptr = (char *) str;
                              str += strsize;
                              ++strsize;
                            }
                         }
                       else
                         {
                           *strptr = (char *) str;
                           str += strsize;
                           strsize = newsize;
                         }
                     }
                    *str++ = c;
                  }
                while (--width > 0 && inchar () != EOF);
              }
             else
              while (--width > 0 && inchar () != EOF);
#endif

             if (!(flags & SUPPRESS))
              {
                if ((flags & MALLOC) && str - *strptr != strsize)
                  {
                    char *cp = (char *) realloc (*strptr, str - *strptr);
                    if (cp != NULL)
                     *strptr = cp;
                  }
                strptr = NULL;
                ++done;
              }

             break;
           }
         /* FALLTHROUGH */
       case L_('C'):
         if (width == -1)
           width = 1;

         STRING_ARG (wstr, wchar_t, (width > 1024 ? 1024 : width));

         c = inchar ();
         if (__builtin_expect (c == EOF, 0))
           input_error ();

#ifdef COMPILE_WSCANF
         /* Just store the incoming wide characters.  */
         if (!(flags & SUPPRESS))
           {
             do
              {
                if ((flags & MALLOC)
                    && wstr == (wchar_t *) *strptr + strsize)
                  {
                    size_t newsize
                     = strsize + (strsize > width ? width - 1 : strsize);
                    /* Enlarge the buffer.  */
                    wstr = (wchar_t *) realloc (*strptr,
                                            newsize * sizeof (wchar_t));
                    if (wstr == NULL)
                     {
                       /* Can't allocate that much.  Last-ditch effort.  */
                       wstr = (wchar_t *) realloc (*strptr,
                                                (strsize + 1)
                                                * sizeof (wchar_t));
                       if (wstr == NULL)
                         /* C or lc can't have `a' flag, only `m' flag.  */
                         goto reteof;
                       else
                         {
                           *strptr = (char *) wstr;
                           wstr += strsize;
                           ++strsize;
                         }
                     }
                    else
                     {
                       *strptr = (char *) wstr;
                       wstr += strsize;
                       strsize = newsize;
                     }
                  }
                *wstr++ = c;
              }
             while (--width > 0 && inchar () != EOF);
           }
         else
           while (--width > 0 && inchar () != EOF);
#else
         {
           /* We have to convert the multibyte input sequence to wide
              characters.  */
           char buf[1];
           mbstate_t cstate;

           memset (&cstate, '\0', sizeof (cstate));

           do
             {
              /* This is what we present the mbrtowc function first.  */
              buf[0] = c;

              if (!(flags & SUPPRESS) && (flags & MALLOC)
                  && wstr == (wchar_t *) *strptr + strsize)
                {
                  size_t newsize
                    = strsize + (strsize > width ? width - 1 : strsize);
                  /* Enlarge the buffer.  */
                  wstr = (wchar_t *) realloc (*strptr,
                                          newsize * sizeof (wchar_t));
                  if (wstr == NULL)
                    {
                     /* Can't allocate that much.  Last-ditch effort.  */
                     wstr = (wchar_t *) realloc (*strptr,
                                              ((strsize + 1)
                                               * sizeof (wchar_t)));
                     if (wstr == NULL)
                       /* C or lc can't have `a' flag, only `m' flag.  */
                       goto reteof;
                     else
                       {
                         *strptr = (char *) wstr;
                         wstr += strsize;
                         ++strsize;
                       }
                    }
                  else
                    {
                     *strptr = (char *) wstr;
                     wstr += strsize;
                     strsize = newsize;
                    }
                }

              while (1)
                {
                  size_t n;

                  n = __mbrtowc (!(flags & SUPPRESS) ? wstr : NULL,
                               buf, 1, &cstate);

                  if (n == (size_t) -2)
                    {
                     /* Possibly correct character, just not enough
                        input.  */
                     if (__builtin_expect (inchar () == EOF, 0))
                       encode_error ();

                     buf[0] = c;
                     continue;
                    }

                  if (__builtin_expect (n != 1, 0))
                    encode_error ();

                  /* We have a match.  */
                  break;
                }

              /* Advance the result pointer.  */
              ++wstr;
             }
           while (--width > 0 && inchar () != EOF);
         }
#endif

         if (!(flags & SUPPRESS))
           {
             if ((flags & MALLOC) && wstr - (wchar_t *) *strptr != strsize)
              {
                wchar_t *cp = (wchar_t *) realloc (*strptr,
                                               ((wstr
                                                 - (wchar_t *) *strptr)
                                                * sizeof (wchar_t)));
                if (cp != NULL)
                  *strptr = (char *) cp;
              }
             strptr = NULL;

             ++done;
           }

         break;

       case L_('s'):        /* Read a string.  */
         if (!(flags & LONG))
           {
             STRING_ARG (str, char, 100);

             c = inchar ();
             if (__builtin_expect (c == EOF, 0))
              input_error ();

#ifdef COMPILE_WSCANF
             memset (&state, '\0', sizeof (state));
#endif

             do
              {
                if (ISSPACE (c))
                  {
                    ungetc_not_eof (c, s);
                    break;
                  }

#ifdef COMPILE_WSCANF
                /* This is quite complicated.  We have to convert the
                   wide characters into multibyte characters and then
                   store them.  */
                {
                  size_t n;

                  if (!(flags & SUPPRESS) && (flags & MALLOC)
                     && str + MB_CUR_MAX >= *strptr + strsize)
                    {
                     /* We have to enlarge the buffer if the `a' or `m'
                        flag was given.  */
                     size_t strleng = str - *strptr;
                     char *newstr;

                     newstr = (char *) realloc (*strptr, strsize * 2);
                     if (newstr == NULL)
                       {
                         /* Can't allocate that much.  Last-ditch
                            effort.  */
                         newstr = (char *) realloc (*strptr,
                                                 strleng + MB_CUR_MAX);
                         if (newstr == NULL)
                           {
                            if (flags & POSIX_MALLOC)
                              goto reteof;
                            /* We lose.  Oh well.  Terminate the
                               string and stop converting,
                               so at least we don't skip any input.  */
                            ((char *) (*strptr))[strleng] = '\0';
                            strptr = NULL;
                            ++done;
                            conv_error ();
                           }
                         else
                           {
                            *strptr = newstr;
                            str = newstr + strleng;
                            strsize = strleng + MB_CUR_MAX;
                           }
                       }
                     else
                       {
                         *strptr = newstr;