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>
31 #define NULL ((void*)0)
49 #define FILENAME_MAX 4096
50 #define FOPEN_MAX 1000
54 typedef union _G_fpos64_t
{
60 extern FILE *const stdin
;
61 extern FILE *const stdout
;
62 extern FILE *const stderr
;
65 #define stdout (stdout)
66 #define stderr (stderr)
68 FILE *fopen(const char *__restrict
, const char *__restrict
);
69 FILE *freopen(const char *__restrict
, const char *__restrict
, FILE *__restrict
);
72 int remove(const char *);
73 int rename(const char *, const char *);
78 void clearerr(FILE *);
80 int fseek(FILE *, long, int);
84 int fgetpos(FILE *__restrict
, fpos_t *__restrict
);
85 int fsetpos(FILE *, const fpos_t *);
87 size_t fread(void *__restrict
, size_t, size_t, FILE *__restrict
);
88 size_t fwrite(const void *__restrict
, size_t, size_t, FILE *__restrict
);
93 int ungetc(int, FILE *);
95 int fputc(int, FILE *);
96 int putc(int, FILE *);
99 char *fgets(char *__restrict
, int, FILE *__restrict
);
100 #if __STDC_VERSION__ < 201112L
104 int fputs(const char *__restrict
, FILE *__restrict
);
105 int puts(const char *);
107 int printf(const char *__restrict
, ...);
108 int fprintf(FILE *__restrict
, const char *__restrict
, ...);
109 int sprintf(char *__restrict
, const char *__restrict
, ...);
110 int snprintf(char *__restrict
, size_t, const char *__restrict
, ...);
112 int vprintf(const char *__restrict
, __isoc_va_list
);
113 int vfprintf(FILE *__restrict
, const char *__restrict
, __isoc_va_list
);
114 int vsprintf(char *__restrict
, const char *__restrict
, __isoc_va_list
);
115 int vsnprintf(char *__restrict
, size_t, const char *__restrict
, __isoc_va_list
);
117 int scanf(const char *__restrict
, ...);
118 int fscanf(FILE *__restrict
, const char *__restrict
, ...);
119 int sscanf(const char *__restrict
, const char *__restrict
, ...);
120 int vscanf(const char *__restrict
, __isoc_va_list
);
121 int vfscanf(FILE *__restrict
, const char *__restrict
, __isoc_va_list
);
122 int vsscanf(const char *__restrict
, const char *__restrict
, __isoc_va_list
);
124 void perror(const char *);
126 int setvbuf(FILE *__restrict
, char *__restrict
, int, size_t);
127 void setbuf(FILE *__restrict
, char *__restrict
);
129 char *tmpnam(char *);
132 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
133 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
134 || defined(_BSD_SOURCE)
135 FILE *fmemopen(void *__restrict
, size_t, const char *__restrict
);
136 FILE *open_memstream(char **, size_t *);
137 FILE *fdopen(int, const char *);
138 FILE *popen(const char *, const char *);
141 int fseeko(FILE *, off_t
, int);
142 off_t
ftello(FILE *);
143 int dprintf(int, const char *__restrict
, ...);
144 int vdprintf(int, const char *__restrict
, __isoc_va_list
);
145 void flockfile(FILE *);
146 int ftrylockfile(FILE *);
147 void funlockfile(FILE *);
148 int getc_unlocked(FILE *);
149 int getchar_unlocked(void);
150 int putc_unlocked(int, FILE *);
151 int putchar_unlocked(int);
152 ssize_t
getdelim(char **__restrict
, size_t *__restrict
, int, FILE *__restrict
);
153 ssize_t
getline(char **__restrict
, size_t *__restrict
, FILE *__restrict
);
154 int renameat(int, const char *, int, const char *);
155 char *ctermid(char *);
160 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
161 || defined(_BSD_SOURCE)
162 #define P_tmpdir "/tmp"
163 char *tempnam(const char *, const char *);
166 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
168 char *cuserid(char *);
169 void setlinebuf(FILE *);
170 void setbuffer(FILE *, char *, size_t);
171 int fgetc_unlocked(FILE *);
172 int fputc_unlocked(int, FILE *);
173 int fflush_unlocked(FILE *);
174 size_t fread_unlocked(void *, size_t, size_t, FILE *);
175 size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
176 void clearerr_unlocked(FILE *);
177 int feof_unlocked(FILE *);
178 int ferror_unlocked(FILE *);
179 int fileno_unlocked(FILE *);
181 int putw(int, FILE *);
182 char *fgetln(FILE *, size_t *);
183 int asprintf(char **, const char *, ...);
184 int vasprintf(char **, const char *, __isoc_va_list
);
188 char *fgets_unlocked(char *, int, FILE *);
189 int fputs_unlocked(const char *, FILE *);
191 typedef ssize_t (cookie_read_function_t
)(void *, char *, size_t);
192 typedef ssize_t (cookie_write_function_t
)(void *, const char *, size_t);
193 typedef int (cookie_seek_function_t
)(void *, off_t
*, int);
194 typedef int (cookie_close_function_t
)(void *);
196 typedef struct _IO_cookie_io_functions_t
{
197 cookie_read_function_t
*read
;
198 cookie_write_function_t
*write
;
199 cookie_seek_function_t
*seek
;
200 cookie_close_function_t
*close
;
201 } cookie_io_functions_t
;
203 FILE *fopencookie(void *, const char *, cookie_io_functions_t
);
206 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
207 #define tmpfile64 tmpfile
208 #define fopen64 fopen
209 #define freopen64 freopen
210 #define fseeko64 fseeko
211 #define ftello64 ftello
212 #define fgetpos64 fgetpos
213 #define fsetpos64 fsetpos
214 #define fpos64_t fpos_t
215 #define off64_t off_t