Back to index

glibc  2.9
Classes | Defines | Typedefs | Enumerations | Functions
libio.h File Reference
#include <_G_config.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IO_marker
struct  _IO_FILE

Defines

#define _IO_pos_t   _G_fpos_t /* obsolete */
#define _IO_fpos_t   _G_fpos_t
#define _IO_fpos64_t   _G_fpos64_t
#define _IO_size_t   _G_size_t
#define _IO_ssize_t   _G_ssize_t
#define _IO_off_t   _G_off_t
#define _IO_off64_t   _G_off64_t
#define _IO_pid_t   _G_pid_t
#define _IO_uid_t   _G_uid_t
#define _IO_iconv_t   _G_iconv_t
#define _IO_HAVE_SYS_WAIT   _G_HAVE_SYS_WAIT
#define _IO_HAVE_ST_BLKSIZE   _G_HAVE_ST_BLKSIZE
#define _IO_BUFSIZ   _G_BUFSIZ
#define _IO_va_list   _G_va_list
#define _IO_wint_t   _G_wint_t
#define __P(p)   ()
#define __PMT(p)   ()
#define _PARAMS(protos)   __P(protos)
 __P
#define const
 _PARAMS
#define _IO_UNIFIED_JUMPTABLES   1
#define _IO_USE_DTOA   1
#define EOF   (-1)
#define NULL   ((void*)0)
#define _IOS_INPUT   1
#define _IOS_OUTPUT   2
#define _IOS_ATEND   4
#define _IOS_APPEND   8
#define _IOS_TRUNC   16
#define _IOS_NOCREATE   32
#define _IOS_NOREPLACE   64
#define _IOS_BIN   128
#define _IO_MAGIC   0xFBAD0000 /* Magic number */
#define _OLD_STDIO_MAGIC   0xFABC0000 /* Emulate old stdio. */
#define _IO_MAGIC_MASK   0xFFFF0000
#define _IO_USER_BUF   1 /* User owns buffer; don't delete it on close. */
#define _IO_UNBUFFERED   2
#define _IO_NO_READS   4 /* Reading not allowed */
#define _IO_NO_WRITES   8 /* Writing not allowd */
#define _IO_EOF_SEEN   0x10
#define _IO_ERR_SEEN   0x20
#define _IO_DELETE_DONT_CLOSE   0x40 /* Don't call close(_fileno) on cleanup. */
#define _IO_LINKED   0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/
#define _IO_IN_BACKUP   0x100
#define _IO_LINE_BUF   0x200
#define _IO_TIED_PUT_GET   0x400 /* Set if put and get pointer logicly tied. */
#define _IO_CURRENTLY_PUTTING   0x800
#define _IO_IS_APPENDING   0x1000
#define _IO_IS_FILEBUF   0x2000
#define _IO_BAD_SEEN   0x4000
#define _IO_USER_LOCK   0x8000
#define _IO_FLAGS2_MMAP   1
#define _IO_FLAGS2_NOTCANCEL   2
#define _IO_FLAGS2_USER_WBUF   8
#define _IO_SKIPWS   01
#define _IO_LEFT   02
#define _IO_RIGHT   04
#define _IO_INTERNAL   010
#define _IO_DEC   020
#define _IO_OCT   040
#define _IO_HEX   0100
#define _IO_SHOWBASE   0200
#define _IO_SHOWPOINT   0400
#define _IO_UPPERCASE   01000
#define _IO_SHOWPOS   02000
#define _IO_SCIENTIFIC   04000
#define _IO_FIXED   010000
#define _IO_UNITBUF   020000
#define _IO_STDIO   040000
#define _IO_DONT_CLOSE   0100000
#define _IO_BOOLALPHA   0200000
#define _IO_file_flags   _flags
#define __HAVE_COLUMN   /* temporary */
#define _IO_stdin   ((_IO_FILE*)(&_IO_2_1_stdin_))
#define _IO_stdout   ((_IO_FILE*)(&_IO_2_1_stdout_))
#define _IO_stderr   ((_IO_FILE*)(&_IO_2_1_stderr_))
#define _IO_BE(expr, res)   (expr)
#define _IO_getc_unlocked(_fp)
#define _IO_peekc_unlocked(_fp)
#define _IO_putc_unlocked(_ch, _fp)
#define _IO_feof_unlocked(__fp)   (((__fp)->_flags & _IO_EOF_SEEN) != 0)
#define _IO_ferror_unlocked(__fp)   (((__fp)->_flags & _IO_ERR_SEEN) != 0)
#define _IO_PENDING_OUTPUT_COUNT(_fp)   ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
#define _IO_peekc(_fp)   _IO_peekc_unlocked (_fp)
#define _IO_flockfile(_fp)
#define _IO_funlockfile(_fp)
#define _IO_ftrylockfile(_fp)
#define _IO_cleanup_region_start(_fct, _fp)
#define _IO_cleanup_region_end(_Doit)

Typedefs

typedef void _IO_lock_t
typedef struct _IO_FILE
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes)
typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n)
typedef int __io_seek_fn (void *__cookie, _IO_off64_t *__pos, int __w)
typedef int __io_close_fn (void *__cookie)

Enumerations

enum  __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }

Functions

int __underflow (_IO_FILE *)
int __uflow (_IO_FILE *)
int __overflow (_IO_FILE *, int)
int _IO_getc (_IO_FILE *__fp)
int _IO_putc (int __c, _IO_FILE *__fp)
int _IO_feof (_IO_FILE *__fp) __THROW
int _IO_ferror (_IO_FILE *__fp) __THROW
int _IO_peekc_locked (_IO_FILE *__fp)
void _IO_flockfile (_IO_FILE *) __THROW
void _IO_funlockfile (_IO_FILE *) __THROW
int _IO_ftrylockfile (_IO_FILE *) __THROW
int _IO_vfscanf (_IO_FILE *__restrict, const char *__restrict, _IO_va_list, int *__restrict)
int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, _IO_va_list)
_IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t)
_IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t)
_IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int)
_IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int)
void _IO_free_backup_area (_IO_FILE *) __THROW

Class Documentation

struct _IO_marker

Definition at line 186 of file libio.h.

Collaboration diagram for _IO_marker:
Class Members
struct _IO_marker * _next
int _pos
struct _IO_FILE * _sbuf
struct _IO_FILE

Definition at line 271 of file libio.h.

Collaboration diagram for _IO_FILE:
Class Members
struct _IO_FILE * _chain
unsigned short _cur_column
int _fileno
int _flags
int _flags2
char * _IO_backup_base
char * _IO_buf_base
char * _IO_buf_end
char * _IO_read_base
char * _IO_read_end
char * _IO_read_ptr
char * _IO_save_base
char * _IO_save_end
char * _IO_write_base
char * _IO_write_end
char * _IO_write_ptr
_IO_lock_t * _lock
struct _IO_marker * _markers
_IO_off_t _old_offset
char _shortbuf
signed char _vtable_offset

Define Documentation

#define __HAVE_COLUMN   /* temporary */

Definition at line 302 of file libio.h.

#define __P (   p)    ()

Definition at line 68 of file libio.h.

#define __PMT (   p)    ()

Definition at line 69 of file libio.h.

#define _IO_BAD_SEEN   0x4000

Definition at line 137 of file libio.h.

#define _IO_BE (   expr,
  res 
)    (expr)

Definition at line 428 of file libio.h.

#define _IO_BOOLALPHA   0200000

Definition at line 167 of file libio.h.

#define _IO_BUFSIZ   _G_BUFSIZ

Definition at line 46 of file libio.h.

#define _IO_cleanup_region_end (   _Doit)

Definition at line 485 of file libio.h.

#define _IO_cleanup_region_start (   _fct,
  _fp 
)

Definition at line 484 of file libio.h.

#define _IO_CURRENTLY_PUTTING   0x800

Definition at line 134 of file libio.h.

#define _IO_DEC   020

Definition at line 155 of file libio.h.

#define _IO_DELETE_DONT_CLOSE   0x40 /* Don't call close(_fileno) on cleanup. */

Definition at line 129 of file libio.h.

#define _IO_DONT_CLOSE   0100000

Definition at line 166 of file libio.h.

#define _IO_EOF_SEEN   0x10

Definition at line 127 of file libio.h.

#define _IO_ERR_SEEN   0x20

Definition at line 128 of file libio.h.

#define _IO_feof_unlocked (   __fp)    (((__fp)->_flags & _IO_EOF_SEEN) != 0)

Definition at line 455 of file libio.h.

#define _IO_ferror_unlocked (   __fp)    (((__fp)->_flags & _IO_ERR_SEEN) != 0)

Definition at line 456 of file libio.h.

#define _IO_file_flags   _flags

Definition at line 273 of file libio.h.

#define _IO_FIXED   010000

Definition at line 163 of file libio.h.

#define _IO_FLAGS2_MMAP   1

Definition at line 140 of file libio.h.

#define _IO_FLAGS2_NOTCANCEL   2

Definition at line 141 of file libio.h.

#define _IO_FLAGS2_USER_WBUF   8

Definition at line 145 of file libio.h.

#define _IO_flockfile (   _fp)

Definition at line 481 of file libio.h.

#define _IO_fpos64_t   _G_fpos64_t

Definition at line 36 of file libio.h.

#define _IO_fpos_t   _G_fpos_t

Definition at line 35 of file libio.h.

#define _IO_ftrylockfile (   _fp)

Definition at line 483 of file libio.h.

#define _IO_funlockfile (   _fp)

Definition at line 482 of file libio.h.

#define _IO_getc_unlocked (   _fp)
Value:
(_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \
       ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++)

Definition at line 431 of file libio.h.

Definition at line 45 of file libio.h.

Definition at line 44 of file libio.h.

#define _IO_HEX   0100

Definition at line 157 of file libio.h.

#define _IO_iconv_t   _G_iconv_t

Definition at line 43 of file libio.h.

#define _IO_IN_BACKUP   0x100

Definition at line 131 of file libio.h.

#define _IO_INTERNAL   010

Definition at line 154 of file libio.h.

#define _IO_IS_APPENDING   0x1000

Definition at line 135 of file libio.h.

#define _IO_IS_FILEBUF   0x2000

Definition at line 136 of file libio.h.

#define _IO_LEFT   02

Definition at line 152 of file libio.h.

#define _IO_LINE_BUF   0x200

Definition at line 132 of file libio.h.

#define _IO_LINKED   0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/

Definition at line 130 of file libio.h.

#define _IO_MAGIC   0xFBAD0000 /* Magic number */

Definition at line 120 of file libio.h.

#define _IO_MAGIC_MASK   0xFFFF0000

Definition at line 122 of file libio.h.

#define _IO_NO_READS   4 /* Reading not allowed */

Definition at line 125 of file libio.h.

#define _IO_NO_WRITES   8 /* Writing not allowd */

Definition at line 126 of file libio.h.

#define _IO_OCT   040

Definition at line 156 of file libio.h.

#define _IO_off64_t   _G_off64_t

Definition at line 40 of file libio.h.

#define _IO_off_t   _G_off_t

Definition at line 39 of file libio.h.

#define _IO_peekc (   _fp)    _IO_peekc_unlocked (_fp)

Definition at line 480 of file libio.h.

#define _IO_peekc_unlocked (   _fp)
Value:
(_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \
         && __underflow (_fp) == EOF ? EOF \
       : *(unsigned char *) (_fp)->_IO_read_ptr)

Definition at line 434 of file libio.h.

#define _IO_PENDING_OUTPUT_COUNT (   _fp)    ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)

Definition at line 466 of file libio.h.

#define _IO_pid_t   _G_pid_t

Definition at line 41 of file libio.h.

#define _IO_pos_t   _G_fpos_t /* obsolete */

Definition at line 34 of file libio.h.

#define _IO_putc_unlocked (   _ch,
  _fp 
)
Value:
(_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) \
    ? __overflow (_fp, (unsigned char) (_ch)) \
    : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))

Definition at line 438 of file libio.h.

#define _IO_RIGHT   04

Definition at line 153 of file libio.h.

#define _IO_SCIENTIFIC   04000

Definition at line 162 of file libio.h.

#define _IO_SHOWBASE   0200

Definition at line 158 of file libio.h.

#define _IO_SHOWPOINT   0400

Definition at line 159 of file libio.h.

#define _IO_SHOWPOS   02000

Definition at line 161 of file libio.h.

#define _IO_size_t   _G_size_t

Definition at line 37 of file libio.h.

#define _IO_SKIPWS   01

Definition at line 151 of file libio.h.

#define _IO_ssize_t   _G_ssize_t

Definition at line 38 of file libio.h.

#define _IO_stderr   ((_IO_FILE*)(&_IO_2_1_stderr_))

Definition at line 352 of file libio.h.

#define _IO_stdin   ((_IO_FILE*)(&_IO_2_1_stdin_))

Definition at line 350 of file libio.h.

#define _IO_STDIO   040000

Definition at line 165 of file libio.h.

#define _IO_stdout   ((_IO_FILE*)(&_IO_2_1_stdout_))

Definition at line 351 of file libio.h.

#define _IO_TIED_PUT_GET   0x400 /* Set if put and get pointer logicly tied. */

Definition at line 133 of file libio.h.

#define _IO_uid_t   _G_uid_t

Definition at line 42 of file libio.h.

#define _IO_UNBUFFERED   2

Definition at line 124 of file libio.h.

#define _IO_UNIFIED_JUMPTABLES   1

Definition at line 84 of file libio.h.

#define _IO_UNITBUF   020000

Definition at line 164 of file libio.h.

#define _IO_UPPERCASE   01000

Definition at line 160 of file libio.h.

#define _IO_USE_DTOA   1

Definition at line 86 of file libio.h.

#define _IO_USER_BUF   1 /* User owns buffer; don't delete it on close. */

Definition at line 123 of file libio.h.

#define _IO_USER_LOCK   0x8000

Definition at line 138 of file libio.h.

#define _IO_va_list   _G_va_list

Definition at line 47 of file libio.h.

#define _IO_wint_t   _G_wint_t

Definition at line 48 of file libio.h.

#define _IOS_APPEND   8

Definition at line 108 of file libio.h.

#define _IOS_ATEND   4

Definition at line 107 of file libio.h.

#define _IOS_BIN   128

Definition at line 112 of file libio.h.

#define _IOS_INPUT   1

Definition at line 105 of file libio.h.

#define _IOS_NOCREATE   32

Definition at line 110 of file libio.h.

#define _IOS_NOREPLACE   64

Definition at line 111 of file libio.h.

#define _IOS_OUTPUT   2

Definition at line 106 of file libio.h.

#define _IOS_TRUNC   16

Definition at line 109 of file libio.h.

#define _OLD_STDIO_MAGIC   0xFABC0000 /* Emulate old stdio. */

Definition at line 121 of file libio.h.

#define _PARAMS (   protos)    __P(protos)

__P

Definition at line 76 of file libio.h.

#define const

_PARAMS

Definition at line 81 of file libio.h.

#define EOF   (-1)

Definition at line 90 of file libio.h.

#define NULL   ((void*)0)

Definition at line 98 of file libio.h.


Typedef Documentation

typedef int __io_close_fn(void *__cookie)

Definition at line 384 of file libio.h.

typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __nbytes)

Definition at line 364 of file libio.h.

typedef int __io_seek_fn(void *__cookie, _IO_off64_t *__pos, int __w)

Definition at line 381 of file libio.h.

typedef __ssize_t __io_write_fn(void *__cookie, __const char *__buf, size_t __n)

Definition at line 372 of file libio.h.

typedef struct _IO_FILE

Definition at line 341 of file libio.h.

typedef void _IO_lock_t

Definition at line 170 of file libio.h.


Enumeration Type Documentation

Enumerator:
__codecvt_ok 
__codecvt_partial 
__codecvt_error 
__codecvt_noconv 

Definition at line 206 of file libio.h.


Function Documentation

int __overflow ( _IO_FILE ,
int   
)

Definition at line 241 of file genops.c.

{
  /* This is a single-byte stream.  */
  if (f->_mode == 0)
    _IO_fwide (f, -1);
  return _IO_OVERFLOW (f, ch);
}

Here is the call graph for this function:

int __uflow ( _IO_FILE )

Here is the caller graph for this function:

Definition at line 333 of file genops.c.

{
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
  if (_IO_vtable_offset (fp) == 0 && _IO_fwide (fp, -1) != -1)
    return EOF;
#endif

  if (fp->_mode == 0)
    _IO_fwide (fp, -1);
  if (_IO_in_put_mode (fp))
    if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF)
      return EOF;
  if (fp->_IO_read_ptr < fp->_IO_read_end)
    return *(unsigned char *) fp->_IO_read_ptr;
  if (_IO_in_backup (fp))
    {
      _IO_switch_to_main_get_area (fp);
      if (fp->_IO_read_ptr < fp->_IO_read_end)
       return *(unsigned char *) fp->_IO_read_ptr;
    }
  if (_IO_have_markers (fp))
    {
      if (save_for_backup (fp, fp->_IO_read_end))
       return EOF;
    }
  else if (_IO_have_backup (fp))
    INTUSE(_IO_free_backup_area) (fp);
  return _IO_UNDERFLOW (fp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _IO_feof ( _IO_FILE __fp)

Definition at line 32 of file feof.c.

Here is the call graph for this function:

int _IO_ferror ( _IO_FILE __fp)

Definition at line 32 of file ferror.c.

Here is the call graph for this function:

void _IO_flockfile ( _IO_FILE )

Here is the caller graph for this function:

Definition at line 209 of file genops.c.

{
  if (_IO_in_backup (fp))
    _IO_switch_to_main_get_area (fp);  /* Just in case. */
  free (fp->_IO_save_base);
  fp->_IO_save_base = NULL;
  fp->_IO_save_end = NULL;
  fp->_IO_backup_base = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _IO_funlockfile ( _IO_FILE )

Here is the caller graph for this function:

int _IO_getc ( _IO_FILE __fp)

Definition at line 37 of file iopadn.c.

{
  char padbuf[PADSIZE];
  const char *padptr;
  int i;
  _IO_size_t written = 0;
  _IO_size_t w;

  if (pad == ' ')
    padptr = blanks;
  else if (pad == '0')
    padptr = zeroes;
  else
    {
      for (i = PADSIZE; --i >= 0; )
       padbuf[i] = pad;
      padptr = padbuf;
    }
  for (i = count; i >= PADSIZE; i -= PADSIZE)
    {
      w = _IO_sputn (fp, padptr, PADSIZE);
      written += w;
      if (w != PADSIZE)
       return written;
    }

  if (i > 0)
    {
      w = _IO_sputn (fp, padptr, i);
      written += w;
    }
  return written;
}

Definition at line 34 of file peekc.c.

{
  int result;
  CHECK_FILE (fp, EOF);
  _IO_acquire_lock (fp);
  result = _IO_peekc_unlocked (fp);
  _IO_release_lock (fp);
  return result;
}
int _IO_putc ( int  __c,
_IO_FILE __fp 
)

Definition at line 26 of file putc.c.

{
  int result;
  CHECK_FILE (fp, EOF);
  _IO_acquire_lock (fp);
  result = _IO_putc_unlocked (c, fp);
  _IO_release_lock (fp);
  return result;
}

Definition at line 76 of file ioseekoff.c.

{
  _IO_off64_t retval;

  _IO_acquire_lock (fp);
  retval = _IO_seekoff_unlocked (fp, offset, dir, mode);
  _IO_release_lock (fp);
  return retval;
}

Here is the call graph for this function:

Definition at line 55 of file ioseekpos.c.

{
  _IO_off64_t retval;

  _IO_acquire_lock (fp);
  retval = _IO_seekpos_unlocked (fp, pos, mode);
  _IO_release_lock (fp);
  return retval;
}

Here is the call graph for this function:

_IO_size_t _IO_sgetn ( _IO_FILE ,
void *  ,
_IO_size_t   
)

Definition at line 494 of file genops.c.

{
  /* FIXME handle putback buffer here! */
  return _IO_XSGETN (fp, data, n);
}

Here is the caller graph for this function:

int _IO_vfprintf ( _IO_FILE __restrict,
const char *  __restrict,
_IO_va_list   
)

Here is the caller graph for this function:

int _IO_vfscanf ( _IO_FILE __restrict,
const char *  __restrict,
_IO_va_list  ,
int __restrict 
)

Here is the caller graph for this function: