12 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
13 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
14 #define __NEED_ssize_t
18 #include <bits/alltypes.h>
24 #define NULL ((void*)0)
42 #define FILENAME_MAX 4095
43 #define FOPEN_MAX 1000
52 extern FILE *const stdin;
53 extern FILE *const stdout;
54 extern FILE *const stderr;
57 #define stdout (stdout)
58 #define stderr (stderr)
60 FILE *fopen(const char *, const char *);
61 FILE *freopen(const char *, const char *, FILE *);
64 int remove(const char *);
65 int rename(const char *, const char *);
70 void clearerr(FILE *);
72 int fseek(FILE *, long, int);
76 int fgetpos(FILE *, fpos_t *);
77 int fsetpos(FILE *, const fpos_t *);
79 size_t fread(void *, size_t, size_t, FILE *);
80 size_t fwrite(const void *, size_t, size_t, FILE *);
85 int ungetc(int, FILE *);
87 int fputc(int, FILE *);
88 int putc(int, FILE *);
91 char *fgets(char *, int, FILE *);
94 int fputs(const char *, FILE *);
95 int puts(const char *);
97 int printf(const char *, ...);
98 int fprintf(FILE *, const char *, ...);
99 int sprintf(char *, const char *, ...);
100 int snprintf(char *, size_t, const char *, ...);
102 int vprintf(const char *, va_list);
103 int vfprintf(FILE *, const char *, va_list);
104 int vsprintf(char *, const char *, va_list);
105 int vsnprintf(char *, size_t, const char *, va_list);
107 int scanf(const char *, ...);
108 int fscanf(FILE *, const char *, ...);
109 int sscanf(const char *, const char *, ...);
110 int vscanf(const char *, va_list);
111 int vfscanf(FILE *, const char *, va_list);
112 int vsscanf(const char *, const char *, va_list);
114 void perror(const char *);
116 int setvbuf(FILE *, char *, int, size_t);
117 void setbuf(FILE *, char *);
119 char *tmpnam(char *);
122 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
123 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
124 FILE *open_memstream(char **, size_t *);
125 FILE *fdopen(int, const char *);
126 FILE *popen(const char *, const char *);
129 int fseeko(FILE *, off_t, int);
130 off_t ftello(FILE *);
131 int dprintf(int, const char *, ...);
132 int vdprintf(int, const char *, va_list);
133 void flockfile(FILE *);
134 int ftrylockfile(FILE *);
135 void funlockfile(FILE *);
136 int getc_unlocked(FILE *);
137 int getchar_unlocked(void);
138 int putc_unlocked(int, FILE *);
139 int putchar_unlocked(int);
140 ssize_t getdelim(char **, size_t *, int, FILE *);
141 ssize_t getline(char **, size_t *, FILE *);
142 int renameat(int, const char *, int, const char *);
143 char *ctermid(char *);
148 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
149 #define P_tmpdir "/tmp"
150 char *tempnam(const char *, const char *);
153 #if defined(_GNU_SOURCE)
155 char *cuserid(char *);
157 #define off64_t off_t
158 int asprintf(char **, const char *, ...);
159 int vasprintf(char **, const char *, va_list);
160 void setlinebuf(FILE *);
161 void setbuffer(FILE *, char *, size_t);