[337] | 1 | #ifndef _STDIO_H
|
---|
| 2 | #define _STDIO_H
|
---|
| 3 |
|
---|
| 4 | #ifdef __cplusplus
|
---|
| 5 | extern "C" {
|
---|
| 6 | #endif
|
---|
| 7 |
|
---|
| 8 | #include <features.h>
|
---|
| 9 |
|
---|
| 10 | #define __NEED_FILE
|
---|
| 11 | #define __NEED___isoc_va_list
|
---|
| 12 | #define __NEED_size_t
|
---|
| 13 |
|
---|
| 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
|
---|
| 18 | #define __NEED_off_t
|
---|
| 19 | #define __NEED_va_list
|
---|
| 20 | #endif
|
---|
| 21 |
|
---|
| 22 | #include <bits/alltypes.h>
|
---|
| 23 |
|
---|
| 24 | #ifndef _UCRT
|
---|
| 25 | #ifdef __cplusplus
|
---|
| 26 | #define NULL 0L
|
---|
| 27 | #else
|
---|
| 28 | #define NULL ((void*)0)
|
---|
| 29 | #endif
|
---|
| 30 | #endif
|
---|
| 31 |
|
---|
| 32 | #undef EOF
|
---|
| 33 | #define EOF (-1)
|
---|
| 34 |
|
---|
| 35 | #undef SEEK_SET
|
---|
| 36 | #undef SEEK_CUR
|
---|
| 37 | #undef SEEK_END
|
---|
| 38 | #define SEEK_SET 0
|
---|
| 39 | #define SEEK_CUR 1
|
---|
| 40 | #define SEEK_END 2
|
---|
| 41 |
|
---|
| 42 | #define _IOFBF 0
|
---|
| 43 | #define _IOLBF 1
|
---|
| 44 | #define _IONBF 2
|
---|
| 45 |
|
---|
| 46 | #define BUFSIZ 1024
|
---|
| 47 | #define FILENAME_MAX 4096
|
---|
| 48 | #define FOPEN_MAX 1000
|
---|
| 49 | #define TMP_MAX 10000
|
---|
| 50 | #define L_tmpnam 20
|
---|
| 51 |
|
---|
| 52 | typedef union _G_fpos64_t {
|
---|
| 53 | char __opaque[16];
|
---|
| 54 | double __align;
|
---|
| 55 | } fpos_t;
|
---|
| 56 |
|
---|
| 57 | extern FILE *const stdin;
|
---|
| 58 | extern FILE *const stdout;
|
---|
| 59 | extern FILE *const stderr;
|
---|
| 60 |
|
---|
| 61 | #define stdin (stdin)
|
---|
| 62 | #define stdout (stdout)
|
---|
| 63 | #define stderr (stderr)
|
---|
| 64 |
|
---|
| 65 | FILE *fopen(const char *__restrict, const char *__restrict);
|
---|
| 66 | FILE *freopen(const char *__restrict, const char *__restrict, FILE *__restrict);
|
---|
| 67 | int fclose(FILE *);
|
---|
| 68 |
|
---|
| 69 | int remove(const char *);
|
---|
| 70 | int rename(const char *, const char *);
|
---|
| 71 |
|
---|
| 72 | int feof(FILE *);
|
---|
| 73 | int ferror(FILE *);
|
---|
| 74 | int fflush(FILE *);
|
---|
| 75 | void clearerr(FILE *);
|
---|
| 76 |
|
---|
| 77 | int fseek(FILE *, long, int);
|
---|
| 78 | long ftell(FILE *);
|
---|
| 79 | void rewind(FILE *);
|
---|
| 80 |
|
---|
| 81 | int fgetpos(FILE *__restrict, fpos_t *__restrict);
|
---|
| 82 | int fsetpos(FILE *, const fpos_t *);
|
---|
| 83 |
|
---|
| 84 | size_t fread(void *__restrict, size_t, size_t, FILE *__restrict);
|
---|
| 85 | size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict);
|
---|
| 86 |
|
---|
| 87 | int fgetc(FILE *);
|
---|
| 88 | int getc(FILE *);
|
---|
| 89 | int getchar(void);
|
---|
| 90 | int ungetc(int, FILE *);
|
---|
| 91 |
|
---|
| 92 | int fputc(int, FILE *);
|
---|
| 93 | int putc(int, FILE *);
|
---|
| 94 | int putchar(int);
|
---|
| 95 |
|
---|
| 96 | char *fgets(char *__restrict, int, FILE *__restrict);
|
---|
| 97 | #if __STDC_VERSION__ < 201112L
|
---|
| 98 | char *gets(char *);
|
---|
| 99 | #endif
|
---|
| 100 |
|
---|
| 101 | int fputs(const char *__restrict, FILE *__restrict);
|
---|
| 102 | int puts(const char *);
|
---|
| 103 |
|
---|
| 104 | int printf(const char *__restrict, ...);
|
---|
| 105 | int fprintf(FILE *__restrict, const char *__restrict, ...);
|
---|
| 106 | int sprintf(char *__restrict, const char *__restrict, ...);
|
---|
| 107 | int snprintf(char *__restrict, size_t, const char *__restrict, ...);
|
---|
| 108 |
|
---|
| 109 | int vprintf(const char *__restrict, __isoc_va_list);
|
---|
| 110 | int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list);
|
---|
| 111 | int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list);
|
---|
| 112 | int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list);
|
---|
| 113 |
|
---|
| 114 | int scanf(const char *__restrict, ...);
|
---|
| 115 | int fscanf(FILE *__restrict, const char *__restrict, ...);
|
---|
| 116 | int sscanf(const char *__restrict, const char *__restrict, ...);
|
---|
| 117 | int vscanf(const char *__restrict, __isoc_va_list);
|
---|
| 118 | int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list);
|
---|
| 119 | int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list);
|
---|
| 120 |
|
---|
| 121 | void perror(const char *);
|
---|
| 122 |
|
---|
| 123 | int setvbuf(FILE *__restrict, char *__restrict, int, size_t);
|
---|
| 124 | void setbuf(FILE *__restrict, char *__restrict);
|
---|
| 125 |
|
---|
| 126 | char *tmpnam(char *);
|
---|
| 127 | FILE *tmpfile(void);
|
---|
| 128 |
|
---|
| 129 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
---|
| 130 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
---|
| 131 | || defined(_BSD_SOURCE)
|
---|
| 132 | FILE *fmemopen(void *__restrict, size_t, const char *__restrict);
|
---|
| 133 | FILE *open_memstream(char **, size_t *);
|
---|
| 134 | FILE *fdopen(int, const char *);
|
---|
| 135 | FILE *popen(const char *, const char *);
|
---|
| 136 | int pclose(FILE *);
|
---|
| 137 | int fileno(FILE *);
|
---|
| 138 | int fseeko(FILE *, off_t, int);
|
---|
| 139 | off_t ftello(FILE *);
|
---|
| 140 | int dprintf(int, const char *__restrict, ...);
|
---|
| 141 | int vdprintf(int, const char *__restrict, __isoc_va_list);
|
---|
| 142 | void flockfile(FILE *);
|
---|
| 143 | int ftrylockfile(FILE *);
|
---|
| 144 | void funlockfile(FILE *);
|
---|
| 145 | int getc_unlocked(FILE *);
|
---|
| 146 | int getchar_unlocked(void);
|
---|
| 147 | int putc_unlocked(int, FILE *);
|
---|
| 148 | int putchar_unlocked(int);
|
---|
| 149 | ssize_t getdelim(char **__restrict, size_t *__restrict, int, FILE *__restrict);
|
---|
| 150 | ssize_t getline(char **__restrict, size_t *__restrict, FILE *__restrict);
|
---|
| 151 | int renameat(int, const char *, int, const char *);
|
---|
| 152 | char *ctermid(char *);
|
---|
| 153 | #define L_ctermid 20
|
---|
| 154 | #endif
|
---|
| 155 |
|
---|
| 156 |
|
---|
| 157 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
---|
| 158 | || defined(_BSD_SOURCE)
|
---|
| 159 | #define P_tmpdir "/tmp"
|
---|
| 160 | char *tempnam(const char *, const char *);
|
---|
| 161 | #endif
|
---|
| 162 |
|
---|
| 163 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
---|
| 164 | #define L_cuserid 20
|
---|
| 165 | char *cuserid(char *);
|
---|
| 166 | void setlinebuf(FILE *);
|
---|
| 167 | void setbuffer(FILE *, char *, size_t);
|
---|
| 168 | int fgetc_unlocked(FILE *);
|
---|
| 169 | int fputc_unlocked(int, FILE *);
|
---|
| 170 | int fflush_unlocked(FILE *);
|
---|
| 171 | size_t fread_unlocked(void *, size_t, size_t, FILE *);
|
---|
| 172 | size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
|
---|
| 173 | void clearerr_unlocked(FILE *);
|
---|
| 174 | int feof_unlocked(FILE *);
|
---|
| 175 | int ferror_unlocked(FILE *);
|
---|
| 176 | int fileno_unlocked(FILE *);
|
---|
| 177 | int getw(FILE *);
|
---|
| 178 | int putw(int, FILE *);
|
---|
| 179 | char *fgetln(FILE *, size_t *);
|
---|
| 180 | int asprintf(char **, const char *, ...);
|
---|
| 181 | int vasprintf(char **, const char *, __isoc_va_list);
|
---|
| 182 | #endif
|
---|
| 183 |
|
---|
| 184 | #ifdef _GNU_SOURCE
|
---|
| 185 | char *fgets_unlocked(char *, int, FILE *);
|
---|
| 186 | int fputs_unlocked(const char *, FILE *);
|
---|
| 187 | #endif
|
---|
| 188 |
|
---|
| 189 | #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
---|
| 190 | #define tmpfile64 tmpfile
|
---|
| 191 | #define fopen64 fopen
|
---|
| 192 | #define freopen64 freopen
|
---|
| 193 | #define fseeko64 fseeko
|
---|
| 194 | #define ftello64 ftello
|
---|
| 195 | #define fgetpos64 fgetpos
|
---|
| 196 | #define fsetpos64 fsetpos
|
---|
| 197 | #define fpos64_t fpos_t
|
---|
| 198 | #define off64_t off_t
|
---|
| 199 | #endif
|
---|
| 200 |
|
---|
| 201 | #ifdef __cplusplus
|
---|
| 202 | }
|
---|
| 203 | #endif
|
---|
| 204 |
|
---|
| 205 | #endif
|
---|