1
0

stdio.h 5.1 KB

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