8 #if __STDC_VERSION__ >= 199901L
9 #define __restrict restrict
10 #elif !defined(__GNUC__)
15 #define __NEED_va_list
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
25 #include <bits/alltypes.h>
31 #define NULL ((void*)0)
49 #define FILENAME_MAX 4095
50 #define FOPEN_MAX 1000
59 extern FILE *const stdin;
60 extern FILE *const stdout;
61 extern FILE *const stderr;
64 #define stdout (stdout)
65 #define stderr (stderr)
67 FILE *fopen(const char *__restrict, const char *__restrict);
68 FILE *freopen(const char *__restrict, const char *__restrict, FILE *__restrict);
71 int remove(const char *);
72 int rename(const char *, const char *);
77 void clearerr(FILE *);
79 int fseek(FILE *, long, int);
83 int fgetpos(FILE *__restrict, fpos_t *__restrict);
84 int fsetpos(FILE *, const fpos_t *);
86 size_t fread(void *__restrict, size_t, size_t, FILE *__restrict);
87 size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict);
92 int ungetc(int, FILE *);
94 int fputc(int, FILE *);
95 int putc(int, FILE *);
98 char *fgets(char *__restrict, int, FILE *__restrict);
99 #if __STDC_VERSION__ < 201112L
103 int fputs(const char *__restrict, FILE *__restrict);
104 int puts(const char *);
106 int printf(const char *__restrict, ...);
107 int fprintf(FILE *__restrict, const char *__restrict, ...);
108 int sprintf(char *__restrict, const char *__restrict, ...);
109 int snprintf(char *__restrict, size_t, const char *__restrict, ...);
111 int vprintf(const char *__restrict, va_list);
112 int vfprintf(FILE *__restrict, const char *__restrict, va_list);
113 int vsprintf(char *__restrict, const char *__restrict, va_list);
114 int vsnprintf(char *__restrict, size_t, const char *__restrict, va_list);
116 int scanf(const char *__restrict, ...);
117 int fscanf(FILE *__restrict, const char *__restrict, ...);
118 int sscanf(const char *__restrict, const char *__restrict, ...);
119 int vscanf(const char *__restrict, va_list);
120 int vfscanf(FILE *__restrict, const char *__restrict, va_list);
121 int vsscanf(const char *__restrict, const char *__restrict, va_list);
123 void perror(const char *);
125 int setvbuf(FILE *__restrict, char *__restrict, int, size_t);
126 void setbuf(FILE *__restrict, char *__restrict);
128 char *tmpnam(char *);
131 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
132 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
133 || defined(_BSD_SOURCE)
134 FILE *fmemopen(void *__restrict, size_t, const char *__restrict);
135 FILE *open_memstream(char **, size_t *);
136 FILE *fdopen(int, const char *);
137 FILE *popen(const char *, const char *);
140 int fseeko(FILE *, off_t, int);
141 off_t ftello(FILE *);
142 int dprintf(int, const char *__restrict, ...);
143 int vdprintf(int, const char *__restrict, va_list);
144 void flockfile(FILE *);
145 int ftrylockfile(FILE *);
146 void funlockfile(FILE *);
147 int getc_unlocked(FILE *);
148 int getchar_unlocked(void);
149 int putc_unlocked(int, FILE *);
150 int putchar_unlocked(int);
151 ssize_t getdelim(char **__restrict, size_t *__restrict, int, FILE *__restrict);
152 ssize_t getline(char **__restrict, size_t *__restrict, FILE *__restrict);
153 int renameat(int, const char *, int, const char *);
154 char *ctermid(char *);
159 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
160 || defined(_BSD_SOURCE)
161 #define P_tmpdir "/tmp"
162 char *tempnam(const char *, const char *);
165 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
167 char *cuserid(char *);
168 void setlinebuf(FILE *);
169 void setbuffer(FILE *, char *, size_t);
170 int fgetc_unlocked(FILE *);
171 int fputc_unlocked(int, FILE *);
172 int fflush_unlocked(FILE *);
173 size_t fread_unlocked(void *, size_t, size_t, FILE *);
174 size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
175 void clearerr_unlocked(FILE *);
176 int feof_unlocked(FILE *);
177 int ferror_unlocked(FILE *);
178 int fileno_unlocked(FILE *);
180 int putw(int, FILE *);
184 char *fgetln(FILE *, size_t *);
188 int asprintf(char **, const char *, ...);
189 int vasprintf(char **, const char *, va_list);
190 char *fgets_unlocked(char *, int, FILE *);
191 int fputs_unlocked(const char *, FILE *);
194 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
195 #define tmpfile64 tmpfile
196 #define fopen64 fopen
197 #define freopen64 freopen
198 #define fseeko64 fseeko
199 #define ftello64 ftello
200 #define fgetpos64 fgetpos
201 #define fsetpos64 fsetpos
202 #define fpos64_t fpos_t
203 #define off64_t off_t