implement "low hanging fruit" from C11
[musl] / include / stdio.h
index e4740eb..9aa2f78 100644 (file)
@@ -90,7 +90,9 @@ int putc(int, FILE *);
 int putchar(int);
 
 char *fgets(char *, int, FILE *);
+#if __STDC_VERSION__ < 201112L
 char *gets(char *);
+#endif
 
 int fputs(const char *, FILE *);
 int puts(const char *);
@@ -157,20 +159,33 @@ char *tempnam(const char *, const char *);
 #if defined(_GNU_SOURCE) || defined(_BSD_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 *);
+int fflush_unlocked(FILE *);
+size_t fread_unlocked(void *, size_t, size_t, FILE *);
+size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
+void clearerr_unlocked(FILE *);
+int feof_unlocked(FILE *);
+int ferror_unlocked(FILE *);
+int fileno_unlocked(FILE *);
+int getw(FILE *);
+int putw(int, FILE *);
+#endif
+
+#ifdef _BSD_SOURCE
+char *fgetln(FILE *, size_t *);
+#endif
+
+#ifdef _GNU_SOURCE
+int asprintf(char **, const char *, ...);
+int vasprintf(char **, const char *, va_list);
 char *fgets_unlocked(char *, int, FILE *);
 int fputs_unlocked(const char *, FILE *);
 #endif
 
-#ifdef _LARGEFILE64_SOURCE
+#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
 #define tmpfile64 tmpfile
 #define fopen64 fopen
 #define freopen64 freopen