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 *);
95 int fputs(const char *, FILE *);
96 int puts(const char *);
98 int printf(const char *, ...);
99 int fprintf(FILE *, const char *, ...);
100 int sprintf(char *, const char *, ...);
101 int snprintf(char *, size_t, const char *, ...);
103 int vprintf(const char *, va_list);
104 int vfprintf(FILE *, const char *, va_list);
105 int vsprintf(char *, const char *, va_list);
106 int vsnprintf(char *, size_t, const char *, va_list);
108 int scanf(const char *, ...);
109 int fscanf(FILE *, const char *, ...);
110 int sscanf(const char *, const char *, ...);
111 int vscanf(const char *, va_list);
112 int vfscanf(FILE *, const char *, va_list);
113 int vsscanf(const char *, const char *, va_list);
115 void perror(const char *);
117 int setvbuf(FILE *, char *, int, size_t);
118 void setbuf(FILE *, char *);
120 char *tmpnam(char *);
123 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
124 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
125 || defined(_BSD_SOURCE)
126 FILE *fmemopen(void *, size_t, const char *);
127 FILE *open_memstream(char **, size_t *);
128 FILE *fdopen(int, const char *);
129 FILE *popen(const char *, const char *);
132 int fseeko(FILE *, off_t, int);
133 off_t ftello(FILE *);
134 int dprintf(int, const char *, ...);
135 int vdprintf(int, const char *, va_list);
136 void flockfile(FILE *);
137 int ftrylockfile(FILE *);
138 void funlockfile(FILE *);
139 int getc_unlocked(FILE *);
140 int getchar_unlocked(void);
141 int putc_unlocked(int, FILE *);
142 int putchar_unlocked(int);
143 ssize_t getdelim(char **, size_t *, int, FILE *);
144 ssize_t getline(char **, size_t *, FILE *);
145 int renameat(int, const char *, int, const char *);
146 char *ctermid(char *);
151 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
152 || defined(_BSD_SOURCE)
153 #define P_tmpdir "/tmp"
154 char *tempnam(const char *, const char *);
157 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
159 char *cuserid(char *);
160 void setlinebuf(FILE *);
161 void setbuffer(FILE *, char *, size_t);
162 int fgetc_unlocked(FILE *);
163 int fputc_unlocked(int, FILE *);
164 int fflush_unlocked(FILE *);
165 size_t fread_unlocked(void *, size_t, size_t, FILE *);
166 size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
167 void clearerr_unlocked(FILE *);
168 int feof_unlocked(FILE *);
169 int ferror_unlocked(FILE *);
170 int fileno_unlocked(FILE *);
172 int putw(int, FILE *);
176 char *fgetln(FILE *, size_t *);
180 int asprintf(char **, const char *, ...);
181 int vasprintf(char **, const char *, va_list);
182 char *fgets_unlocked(char *, int, FILE *);
183 int fputs_unlocked(const char *, FILE *);
186 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
187 #define tmpfile64 tmpfile
188 #define fopen64 fopen
189 #define freopen64 freopen
190 #define fseeko64 fseeko
191 #define ftello64 ftello
192 #define fgetpos64 fgetpos
193 #define fsetpos64 fsetpos
194 #define fpos64_t fpos_t
195 #define off64_t off_t