11 #define __NEED___isoc_va_list
14 #if __STDC_VERSION__ < 201112L
15 #define __NEED_struct__IO_FILE
18 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
19 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
20 || defined(_BSD_SOURCE)
21 #define __NEED_ssize_t
23 #define __NEED_va_list
26 #include <bits/alltypes.h>
28 #if __cplusplus >= 201103L
30 #elif defined(__cplusplus)
33 #define NULL ((void*)0)
51 #define FILENAME_MAX 4096
52 #define FOPEN_MAX 1000
56 typedef union _G_fpos64_t
{
62 extern FILE *const stdin
;
63 extern FILE *const stdout
;
64 extern FILE *const stderr
;
67 #define stdout (stdout)
68 #define stderr (stderr)
70 FILE *fopen(const char *__restrict
, const char *__restrict
);
71 FILE *freopen(const char *__restrict
, const char *__restrict
, FILE *__restrict
);
74 int remove(const char *);
75 int rename(const char *, const char *);
80 void clearerr(FILE *);
82 int fseek(FILE *, long, int);
86 int fgetpos(FILE *__restrict
, fpos_t *__restrict
);
87 int fsetpos(FILE *, const fpos_t *);
89 size_t fread(void *__restrict
, size_t, size_t, FILE *__restrict
);
90 size_t fwrite(const void *__restrict
, size_t, size_t, FILE *__restrict
);
95 int ungetc(int, FILE *);
97 int fputc(int, FILE *);
98 int putc(int, FILE *);
101 char *fgets(char *__restrict
, int, FILE *__restrict
);
102 #if __STDC_VERSION__ < 201112L
106 int fputs(const char *__restrict
, FILE *__restrict
);
107 int puts(const char *);
109 int printf(const char *__restrict
, ...);
110 int fprintf(FILE *__restrict
, const char *__restrict
, ...);
111 int sprintf(char *__restrict
, const char *__restrict
, ...);
112 int snprintf(char *__restrict
, size_t, const char *__restrict
, ...);
114 int vprintf(const char *__restrict
, __isoc_va_list
);
115 int vfprintf(FILE *__restrict
, const char *__restrict
, __isoc_va_list
);
116 int vsprintf(char *__restrict
, const char *__restrict
, __isoc_va_list
);
117 int vsnprintf(char *__restrict
, size_t, const char *__restrict
, __isoc_va_list
);
119 int scanf(const char *__restrict
, ...);
120 int fscanf(FILE *__restrict
, const char *__restrict
, ...);
121 int sscanf(const char *__restrict
, const char *__restrict
, ...);
122 int vscanf(const char *__restrict
, __isoc_va_list
);
123 int vfscanf(FILE *__restrict
, const char *__restrict
, __isoc_va_list
);
124 int vsscanf(const char *__restrict
, const char *__restrict
, __isoc_va_list
);
126 void perror(const char *);
128 int setvbuf(FILE *__restrict
, char *__restrict
, int, size_t);
129 void setbuf(FILE *__restrict
, char *__restrict
);
131 char *tmpnam(char *);
134 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
135 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
136 || defined(_BSD_SOURCE)
137 FILE *fmemopen(void *__restrict
, size_t, const char *__restrict
);
138 FILE *open_memstream(char **, size_t *);
139 FILE *fdopen(int, const char *);
140 FILE *popen(const char *, const char *);
143 int fseeko(FILE *, off_t
, int);
144 off_t
ftello(FILE *);
145 int dprintf(int, const char *__restrict
, ...);
146 int vdprintf(int, const char *__restrict
, __isoc_va_list
);
147 void flockfile(FILE *);
148 int ftrylockfile(FILE *);
149 void funlockfile(FILE *);
150 int getc_unlocked(FILE *);
151 int getchar_unlocked(void);
152 int putc_unlocked(int, FILE *);
153 int putchar_unlocked(int);
154 ssize_t
getdelim(char **__restrict
, size_t *__restrict
, int, FILE *__restrict
);
155 ssize_t
getline(char **__restrict
, size_t *__restrict
, FILE *__restrict
);
156 int renameat(int, const char *, int, const char *);
157 char *ctermid(char *);
162 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
163 || defined(_BSD_SOURCE)
164 #define P_tmpdir "/tmp"
165 char *tempnam(const char *, const char *);
168 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
170 char *cuserid(char *);
171 void setlinebuf(FILE *);
172 void setbuffer(FILE *, char *, size_t);
173 int fgetc_unlocked(FILE *);
174 int fputc_unlocked(int, FILE *);
175 int fflush_unlocked(FILE *);
176 size_t fread_unlocked(void *, size_t, size_t, FILE *);
177 size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
178 void clearerr_unlocked(FILE *);
179 int feof_unlocked(FILE *);
180 int ferror_unlocked(FILE *);
181 int fileno_unlocked(FILE *);
183 int putw(int, FILE *);
184 char *fgetln(FILE *, size_t *);
185 int asprintf(char **, const char *, ...);
186 int vasprintf(char **, const char *, __isoc_va_list
);
190 char *fgets_unlocked(char *, int, FILE *);
191 int fputs_unlocked(const char *, FILE *);
193 typedef ssize_t (cookie_read_function_t
)(void *, char *, size_t);
194 typedef ssize_t (cookie_write_function_t
)(void *, const char *, size_t);
195 typedef int (cookie_seek_function_t
)(void *, off_t
*, int);
196 typedef int (cookie_close_function_t
)(void *);
198 typedef struct _IO_cookie_io_functions_t
{
199 cookie_read_function_t
*read
;
200 cookie_write_function_t
*write
;
201 cookie_seek_function_t
*seek
;
202 cookie_close_function_t
*close
;
203 } cookie_io_functions_t
;
205 FILE *fopencookie(void *, const char *, cookie_io_functions_t
);
208 #if defined(_LARGEFILE64_SOURCE)
209 #define tmpfile64 tmpfile
210 #define fopen64 fopen
211 #define freopen64 freopen
212 #define fseeko64 fseeko
213 #define ftello64 ftello
214 #define fgetpos64 fgetpos
215 #define fsetpos64 fsetpos
216 #define fpos64_t fpos_t
217 #define off64_t off_t