12 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
13 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
14 || defined(_BSD_SOURCE)
15 #define __NEED_ssize_t
19 #include <bits/alltypes.h>
25 #define NULL ((void*)0)
43 #define FILENAME_MAX 4095
44 #define FOPEN_MAX 1000
53 extern FILE *const stdin;
54 extern FILE *const stdout;
55 extern FILE *const stderr;
58 #define stdout (stdout)
59 #define stderr (stderr)
61 FILE *fopen(const char *, const char *);
62 FILE *freopen(const char *, const char *, FILE *);
65 int remove(const char *);
66 int rename(const char *, const char *);
71 void clearerr(FILE *);
73 int fseek(FILE *, long, int);
77 int fgetpos(FILE *, fpos_t *);
78 int fsetpos(FILE *, const fpos_t *);
80 size_t fread(void *, size_t, size_t, FILE *);
81 size_t fwrite(const void *, size_t, size_t, FILE *);
86 int ungetc(int, FILE *);
88 int fputc(int, FILE *);
89 int putc(int, FILE *);
92 char *fgets(char *, int, FILE *);
93 #if __STDC_VERSION__ < 201112L
97 int fputs(const char *, FILE *);
98 int puts(const char *);
100 int printf(const char *, ...);
101 int fprintf(FILE *, const char *, ...);
102 int sprintf(char *, const char *, ...);
103 int snprintf(char *, size_t, const char *, ...);
105 int vprintf(const char *, va_list);
106 int vfprintf(FILE *, const char *, va_list);
107 int vsprintf(char *, const char *, va_list);
108 int vsnprintf(char *, size_t, const char *, va_list);
110 int scanf(const char *, ...);
111 int fscanf(FILE *, const char *, ...);
112 int sscanf(const char *, const char *, ...);
113 int vscanf(const char *, va_list);
114 int vfscanf(FILE *, const char *, va_list);
115 int vsscanf(const char *, const char *, va_list);
117 void perror(const char *);
119 int setvbuf(FILE *, char *, int, size_t);
120 void setbuf(FILE *, char *);
122 char *tmpnam(char *);
125 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
126 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
127 || defined(_BSD_SOURCE)
128 FILE *fmemopen(void *, size_t, const char *);
129 FILE *open_memstream(char **, size_t *);
130 FILE *fdopen(int, const char *);
131 FILE *popen(const char *, const char *);
134 int fseeko(FILE *, off_t, int);
135 off_t ftello(FILE *);
136 int dprintf(int, const char *, ...);
137 int vdprintf(int, const char *, va_list);
138 void flockfile(FILE *);
139 int ftrylockfile(FILE *);
140 void funlockfile(FILE *);
141 int getc_unlocked(FILE *);
142 int getchar_unlocked(void);
143 int putc_unlocked(int, FILE *);
144 int putchar_unlocked(int);
145 ssize_t getdelim(char **, size_t *, int, FILE *);
146 ssize_t getline(char **, size_t *, FILE *);
147 int renameat(int, const char *, int, const char *);
148 char *ctermid(char *);
153 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
154 || defined(_BSD_SOURCE)
155 #define P_tmpdir "/tmp"
156 char *tempnam(const char *, const char *);
159 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
161 char *cuserid(char *);
162 void setlinebuf(FILE *);
163 void setbuffer(FILE *, char *, size_t);
164 int fgetc_unlocked(FILE *);
165 int fputc_unlocked(int, FILE *);
166 int fflush_unlocked(FILE *);
167 size_t fread_unlocked(void *, size_t, size_t, FILE *);
168 size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
169 void clearerr_unlocked(FILE *);
170 int feof_unlocked(FILE *);
171 int ferror_unlocked(FILE *);
172 int fileno_unlocked(FILE *);
174 int putw(int, FILE *);
178 char *fgetln(FILE *, size_t *);
182 int asprintf(char **, const char *, ...);
183 int vasprintf(char **, const char *, va_list);
184 char *fgets_unlocked(char *, int, FILE *);
185 int fputs_unlocked(const char *, FILE *);
188 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
189 #define tmpfile64 tmpfile
190 #define fopen64 fopen
191 #define freopen64 freopen
192 #define fseeko64 fseeko
193 #define ftello64 ftello
194 #define fgetpos64 fgetpos
195 #define fsetpos64 fsetpos
196 #define fpos64_t fpos_t
197 #define off64_t off_t