__sFILE Struct Reference

struct __sFILE

Stdio state variables.

The following always hold:

if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), _lbfsize is -_bf._size, else _lbfsize is 0 if _flags&__SRD, _w is 0 if _flags&__SWR, _r is 0

This ensures that the getc and putc macros (or inline functions) never try to write or read from a file that is in `read' or `write' mode. (Moreover, they can, and do, automatically switch from read mode to write mode, and back, on "r+" and "w+" files.)

_lbfsize is used only to make the inline line-buffered output stream code as compact as possible.

_ub, _up, and _ur are used when ungetc() pushes back more characters than fit in the current _bf, or when ungetc() pushes back a character that does not match the previous one in _bf. When this happens, _ub._base becomes non-nil (i.e., a stream has ungetc() data iff _ub._base!=NULL) and _up and _ur save the current values of _p and _r.

Public Attributes
struct __sbuf_bf
int_blksize
int(*_close
void *_cookie
struct _reent *_data
short_file
short_flags
struct __sbuf_lb
int_lbfsize
unsigned char_nbuf
int_offset
unsigned char *_p
int_r
int(*_read
_fpos_t(*_seek
struct __sbuf_ub
unsigned char_ubuf
unsigned char *_up
int_ur
int_w
int(*_write

Member Data Documentation

struct __sbuf _bf

struct __sbuf_bf

int _blksize

int_blksize

int(* _close

int(*_close

void * _cookie

void *_cookie

struct _reent * _data

struct _reent *_data

short _file

short_file

short _flags

short_flags

struct __sbuf _lb

struct __sbuf_lb

int _lbfsize

int_lbfsize

unsigned char _nbuf

unsigned char_nbuf

int _offset

int_offset

unsigned char * _p

unsigned char *_p

int _r

int_r

int(* _read

int(*_read

_fpos_t(* _seek

_fpos_t(*_seek

struct __sbuf _ub

struct __sbuf_ub

unsigned char _ubuf

unsigned char_ubuf

unsigned char * _up

unsigned char *_up

int _ur

int_ur

int _w

int_w

int(* _write

int(*_write