author | William Pitcock <nenolod@dereferenced.org> | 2017年12月05日 16:04:43 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2017年12月06日 13:11:48 -0500 |
commit | 061843340fbf2493bb615e20e66f60c5d1ef0455 (patch) | |
tree | 0613a9ef9b70c5bd3653617b56cf7ca1a615325a /include/stdio.h | |
parent | 4000b0107ddd7fe733fa31d4f078c6fcd35851d6 (diff) | |
download | musl-061843340fbf2493bb615e20e66f60c5d1ef0455.tar.gz |
-rw-r--r-- | include/stdio.h | 14 |
diff --git a/include/stdio.h b/include/stdio.h index 884d2e6a..2932c76f 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -182,6 +182,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 { + 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) |