X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fstdio.h;h=3604198c3e503aba5335919cc3f429b7a8350beb;hb=3733c831f293b3bbfd0e51faec8ee71112c62c3e;hp=884d2e6a72768b5ea0d78fb1aef88abd969ba92b;hpb=c8a9c22173f485c8c053709e1dfa0a617cb6be1a;p=musl diff --git a/include/stdio.h b/include/stdio.h index 884d2e6a..3604198c 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -11,6 +11,10 @@ extern "C" { #define __NEED___isoc_va_list #define __NEED_size_t +#if __STDC_VERSION__ < 201112L +#define __NEED_struct__IO_FILE +#endif + #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) @@ -49,6 +53,7 @@ extern "C" { typedef union _G_fpos64_t { char __opaque[16]; + long long __lldata; double __align; } fpos_t; @@ -182,6 +187,20 @@ int vasprintf(char **, const char *, __isoc_va_list); #ifdef _GNU_SOURCE char *fgets_unlocked(char *, int, FILE *); int fputs_unlocked(const char *, FILE *); + +typedef ssize_t (cookie_read_function_t)(void *, char *, size_t); +typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t); +typedef int (cookie_seek_function_t)(void *, off_t *, int); +typedef int (cookie_close_function_t)(void *); + +typedef struct _IO_cookie_io_functions_t { + cookie_read_function_t *read; + cookie_write_function_t *write; + cookie_seek_function_t *seek; + cookie_close_function_t *close; +} cookie_io_functions_t; + +FILE *fopencookie(void *, const char *, cookie_io_functions_t); #endif #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)