X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fstdio.h;h=dca8acc0272857c7050d333561598e05bf898cd5;hb=c61312596608bf819b693c04a395f1b4e3e0acf0;hp=b00436d9d331ab1f771e3d8e2cea0d9dc9cc9735;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/include/stdio.h b/include/stdio.h index b00436d9..dca8acc0 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -8,8 +8,12 @@ extern "C" { #define __NEED_FILE #define __NEED_va_list #define __NEED_size_t + +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) #define __NEED_ssize_t #define __NEED_off_t +#endif #include @@ -34,7 +38,11 @@ extern "C" { #define _IOLBF 1 #define _IONBF 2 -#include +#define BUFSIZ 1024 +#define FILENAME_MAX 4095 +#define FOPEN_MAX 1000 +#define TMP_MAX 10000 +#define L_tmpnam 20 typedef union { char __opaque[16]; @@ -50,26 +58,19 @@ extern FILE *const stderr; #define stderr (stderr) FILE *fopen(const char *, const char *); -FILE *fdopen(int, const char *); FILE *freopen(const char *, const char *, FILE *); int fclose(FILE *); -FILE *popen(const char *, const char *); -int pclose(FILE *); - int remove(const char *); int rename(const char *, const char *); -int fileno(FILE *); int feof(FILE *); int ferror(FILE *); int fflush(FILE *); void clearerr(FILE *); int fseek(FILE *, long, int); -int fseeko(FILE *, off_t, int); long ftell(FILE *); -off_t ftello(FILE *); void rewind(FILE *); int fgetpos(FILE *, fpos_t *); @@ -103,9 +104,6 @@ int vfprintf(FILE *, const char *, va_list); int vsprintf(char *, const char *, va_list); int vsnprintf(char *, size_t, const char *, va_list); -int dprintf(int, const char *, ...); -int vdprintf(int, const char *, va_list); - int scanf(const char *, ...); int fscanf(FILE *, const char *, ...); int sscanf(const char *, const char *, ...); @@ -115,6 +113,24 @@ int vsscanf(const char *, const char *, va_list); void perror(const char *); +int setvbuf(FILE *, char *, int, size_t); +void setbuf(FILE *, char *); + +char *tmpnam(char *); +FILE *tmpfile(void); + +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) +FILE *fmemopen(void *, size_t, const char *); +FILE *open_memstream(char **, size_t *); +FILE *fdopen(int, const char *); +FILE *popen(const char *, const char *); +int pclose(FILE *); +int fileno(FILE *); +int fseeko(FILE *, off_t, int); +off_t ftello(FILE *); +int dprintf(int, const char *, ...); +int vdprintf(int, const char *, va_list); void flockfile(FILE *); int ftrylockfile(FILE *); void funlockfile(FILE *); @@ -122,20 +138,34 @@ int getc_unlocked(FILE *); int getchar_unlocked(void); int putc_unlocked(int, FILE *); int putchar_unlocked(int); +ssize_t getdelim(char **, size_t *, int, FILE *); +ssize_t getline(char **, size_t *, FILE *); +int renameat(int, const char *, int, const char *); +char *ctermid(char *); +#define L_ctermid 20 +#endif -int setvbuf(FILE *, char *, int, size_t); -void setbuf(FILE *, char *); -char *tmpnam(char *); +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) +#define P_tmpdir "/tmp" char *tempnam(const char *, const char *); -FILE *tmpfile(void); - -char *ctermid(char *); - -ssize_t getdelim(char **, size_t *, int, FILE *); -ssize_t getline(char **, size_t *, FILE *); +#endif -int renameat(int, const char *, int, const char *); +#if defined(_GNU_SOURCE) +#define L_cuserid 20 +char *cuserid(char *); +#undef off64_t +#define off64_t off_t +int asprintf(char **, const char *, ...); +int vasprintf(char **, const char *, va_list); +void setlinebuf(FILE *); +void setbuffer(FILE *, char *, size_t); +int fpurge(FILE *); +int fgetc_unlocked(FILE *); +int fputc_unlocked(int, FILE *); +char *fgets_unlocked(char *, int, FILE *); +int fputs_unlocked(const char *, FILE *); +#endif #ifdef __cplusplus }