11 #define __NEED___isoc_va_list
14 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
15 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
16 || defined(_BSD_SOURCE)
17 #define __NEED_ssize_t
19 #define __NEED_va_list
22 #include <bits/alltypes.h>
27 #define NULL ((void*)0)
45 #define FILENAME_MAX 4096
46 #define FOPEN_MAX 1000
50 typedef union _G_fpos64_t
{
56 extern FILE *const stdin
;
57 extern FILE *const stdout
;
58 extern FILE *const stderr
;
61 #define stdout (stdout)
62 #define stderr (stderr)
64 FILE *fopen(const char *__restrict
, const char *__restrict
);
65 FILE *freopen(const char *__restrict
, const char *__restrict
, FILE *__restrict
);
68 int remove(const char *);
69 int rename(const char *, const char *);
74 void clearerr(FILE *);
76 int fseek(FILE *, long, int);
80 int fgetpos(FILE *__restrict
, fpos_t *__restrict
);
81 int fsetpos(FILE *, const fpos_t *);
83 size_t fread(void *__restrict
, size_t, size_t, FILE *__restrict
);
84 size_t fwrite(const void *__restrict
, size_t, size_t, FILE *__restrict
);
89 int ungetc(int, FILE *);
91 int fputc(int, FILE *);
92 int putc(int, FILE *);
95 char *fgets(char *__restrict
, int, FILE *__restrict
);
96 #if __STDC_VERSION__ < 201112L
100 int fputs(const char *__restrict
, FILE *__restrict
);
101 int puts(const char *);
103 int printf(const char *__restrict
, ...);
104 int fprintf(FILE *__restrict
, const char *__restrict
, ...);
105 int sprintf(char *__restrict
, const char *__restrict
, ...);
106 int snprintf(char *__restrict
, size_t, const char *__restrict
, ...);
108 int vprintf(const char *__restrict
, __isoc_va_list
);
109 int vfprintf(FILE *__restrict
, const char *__restrict
, __isoc_va_list
);
110 int vsprintf(char *__restrict
, const char *__restrict
, __isoc_va_list
);
111 int vsnprintf(char *__restrict
, size_t, const char *__restrict
, __isoc_va_list
);
113 int scanf(const char *__restrict
, ...);
114 int fscanf(FILE *__restrict
, const char *__restrict
, ...);
115 int sscanf(const char *__restrict
, const char *__restrict
, ...);
116 int vscanf(const char *__restrict
, __isoc_va_list
);
117 int vfscanf(FILE *__restrict
, const char *__restrict
, __isoc_va_list
);
118 int vsscanf(const char *__restrict
, const char *__restrict
, __isoc_va_list
);
120 void perror(const char *);
122 int setvbuf(FILE *__restrict
, char *__restrict
, int, size_t);
123 void setbuf(FILE *__restrict
, char *__restrict
);
125 char *tmpnam(char *);
128 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
129 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
130 || defined(_BSD_SOURCE)
131 FILE *fmemopen(void *__restrict
, size_t, const char *__restrict
);
132 FILE *open_memstream(char **, size_t *);
133 FILE *fdopen(int, const char *);
134 FILE *popen(const char *, const char *);
137 int fseeko(FILE *, off_t
, int);
138 off_t
ftello(FILE *);
139 int dprintf(int, const char *__restrict
, ...);
140 int vdprintf(int, const char *__restrict
, __isoc_va_list
);
141 void flockfile(FILE *);
142 int ftrylockfile(FILE *);
143 void funlockfile(FILE *);
144 int getc_unlocked(FILE *);
145 int getchar_unlocked(void);
146 int putc_unlocked(int, FILE *);
147 int putchar_unlocked(int);
148 ssize_t
getdelim(char **__restrict
, size_t *__restrict
, int, FILE *__restrict
);
149 ssize_t
getline(char **__restrict
, size_t *__restrict
, FILE *__restrict
);
150 int renameat(int, const char *, int, const char *);
151 char *ctermid(char *);
156 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
157 || defined(_BSD_SOURCE)
158 #define P_tmpdir "/tmp"
159 char *tempnam(const char *, const char *);
162 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
164 char *cuserid(char *);
165 void setlinebuf(FILE *);
166 void setbuffer(FILE *, char *, size_t);
167 int fgetc_unlocked(FILE *);
168 int fputc_unlocked(int, FILE *);
169 int fflush_unlocked(FILE *);
170 size_t fread_unlocked(void *, size_t, size_t, FILE *);
171 size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
172 void clearerr_unlocked(FILE *);
173 int feof_unlocked(FILE *);
174 int ferror_unlocked(FILE *);
175 int fileno_unlocked(FILE *);
177 int putw(int, FILE *);
178 char *fgetln(FILE *, size_t *);
179 int asprintf(char **, const char *, ...);
180 int vasprintf(char **, const char *, __isoc_va_list
);
184 char *fgets_unlocked(char *, int, FILE *);
185 int fputs_unlocked(const char *, FILE *);
187 typedef ssize_t (cookie_read_function_t
)(void *, char *, size_t);
188 typedef ssize_t (cookie_write_function_t
)(void *, const char *, size_t);
189 typedef int (cookie_seek_function_t
)(void *, off_t
*, int);
190 typedef int (cookie_close_function_t
)(void *);
192 typedef struct _IO_cookie_io_functions_t
{
193 cookie_read_function_t
*read
;
194 cookie_write_function_t
*write
;
195 cookie_seek_function_t
*seek
;
196 cookie_close_function_t
*close
;
197 } cookie_io_functions_t
;
199 FILE *fopencookie(void *, const char *, cookie_io_functions_t
);
202 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
203 #define tmpfile64 tmpfile
204 #define fopen64 fopen
205 #define freopen64 freopen
206 #define fseeko64 fseeko
207 #define ftello64 ftello
208 #define fgetpos64 fgetpos
209 #define fsetpos64 fsetpos
210 #define fpos64_t fpos_t
211 #define off64_t off_t