Changeset View
Changeset View
Standalone View
Standalone View
include/stdio.h
| Show All 34 Lines | |||||
| #ifndef _STDIO_H_ | #ifndef _STDIO_H_ | ||||
| #define _STDIO_H_ | #define _STDIO_H_ | ||||
| #include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
| #include <sys/_null.h> | #include <sys/_null.h> | ||||
| #include <sys/_types.h> | #include <sys/_types.h> | ||||
| #if defined(__clang__) | |||||
| #pragma clang diagnostic push | |||||
| #pragma clang diagnostic ignored "-Wnullability-completeness" | |||||
| #endif | |||||
| typedef __off_t fpos_t; | typedef __off_t fpos_t; | ||||
| #ifndef _SIZE_T_DECLARED | #ifndef _SIZE_T_DECLARED | ||||
| typedef __size_t size_t; | typedef __size_t size_t; | ||||
| #define _SIZE_T_DECLARED | #define _SIZE_T_DECLARED | ||||
| #endif | #endif | ||||
| #if __POSIX_VISIBLE >= 200809 | #if __POSIX_VISIBLE >= 200809 | ||||
| ▲ Show 20 Lines • Show All 67 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 96 Lines • ▼ Show 20 Lines | |||||
| #define putc_unlocked(x, fp) __sputc(x, fp) | #define putc_unlocked(x, fp) __sputc(x, fp) | ||||
| #define getchar_unlocked() getc_unlocked(stdin) | #define getchar_unlocked() getc_unlocked(stdin) | ||||
| #define putchar_unlocked(x) putc_unlocked(x, stdout) | #define putchar_unlocked(x) putc_unlocked(x, stdout) | ||||
| #endif | #endif | ||||
| #endif /* __cplusplus */ | #endif /* __cplusplus */ | ||||
| __END_DECLS | __END_DECLS | ||||
| #if defined(__clang__) | |||||
| #pragma clang diagnostic pop | |||||
| #endif | |||||
| #endif /* !_STDIO_H_ */ | #endif /* !_STDIO_H_ */ | ||||