Changeset View
Changeset View
Standalone View
Standalone View
include/stdio.h
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | struct __sFILE { | ||||
int _w; /* (*) write space left for putc() */ | int _w; /* (*) write space left for putc() */ | ||||
short _flags; /* (*) flags, below; this FILE is free if 0 */ | short _flags; /* (*) flags, below; this FILE is free if 0 */ | ||||
short _file; /* (*) fileno, if Unix descriptor, else -1 */ | short _file; /* (*) fileno, if Unix descriptor, else -1 */ | ||||
struct __sbuf _bf; /* (*) the buffer (at least 1 byte, if !NULL) */ | struct __sbuf _bf; /* (*) the buffer (at least 1 byte, if !NULL) */ | ||||
int _lbfsize; /* (*) 0 or -_bf._size, for inline putc */ | int _lbfsize; /* (*) 0 or -_bf._size, for inline putc */ | ||||
/* operations */ | /* operations */ | ||||
void *_cookie; /* (*) cookie passed to io functions */ | void *_cookie; /* (*) cookie passed to io functions */ | ||||
int (*_close)(void *); | int (* _Nullable _close)(void *); | ||||
int (*_read)(void *, char *, int); | int (* _Nullable _read)(void *, char *, int); | ||||
fpos_t (*_seek)(void *, fpos_t, int); | fpos_t (* _Nullable _seek)(void *, fpos_t, int); | ||||
int (*_write)(void *, const char *, int); | int (* _Nullable _write)(void *, const char *, int); | ||||
/* separate buffer for long sequences of ungetc() */ | /* separate buffer for long sequences of ungetc() */ | ||||
struct __sbuf _ub; /* ungetc buffer */ | struct __sbuf _ub; /* ungetc buffer */ | ||||
unsigned char *_up; /* saved _p when _p is doing ungetc data */ | unsigned char *_up; /* saved _p when _p is doing ungetc data */ | ||||
int _ur; /* saved _r when _r is counting ungetc data */ | int _ur; /* saved _r when _r is counting ungetc data */ | ||||
/* tricks to meet minimum requirements even when malloc() fails */ | /* tricks to meet minimum requirements even when malloc() fails */ | ||||
unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ | unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ | ||||
▲ Show 20 Lines • Show All 247 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
extern const int sys_nerr; | extern const int sys_nerr; | ||||
extern const char * const sys_errlist[]; | extern const char * const sys_errlist[]; | ||||
/* | /* | ||||
* Stdio function-access interface. | * Stdio function-access interface. | ||||
*/ | */ | ||||
FILE *funopen(const void *, | FILE *funopen(const void *, | ||||
int (*)(void *, char *, int), | int (* _Nullable)(void *, char *, int), | ||||
int (*)(void *, const char *, int), | int (* _Nullable)(void *, const char *, int), | ||||
fpos_t (*)(void *, fpos_t, int), | fpos_t (* _Nullable)(void *, fpos_t, int), | ||||
int (*)(void *)); | int (* _Nullable)(void *)); | ||||
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) | #define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) | ||||
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) | #define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) | ||||
typedef __ssize_t cookie_read_function_t(void *, char *, size_t); | typedef __ssize_t cookie_read_function_t(void *, char *, size_t); | ||||
typedef __ssize_t cookie_write_function_t(void *, const char *, size_t); | typedef __ssize_t cookie_write_function_t(void *, const char *, size_t); | ||||
typedef int cookie_seek_function_t(void *, off64_t *, int); | typedef int cookie_seek_function_t(void *, off64_t *, int); | ||||
typedef int cookie_close_function_t(void *); | typedef int cookie_close_function_t(void *); | ||||
typedef struct { | typedef struct { | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |