stdio.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #ifndef _STDIO_H
  2. #define _STDIO_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define __NEED_FILE
  7. #define __NEED_va_list
  8. #define __NEED_size_t
  9. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  10. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  11. #define __NEED_ssize_t
  12. #define __NEED_off_t
  13. #endif
  14. #include <bits/alltypes.h>
  15. #undef NULL
  16. #ifdef __cplusplus
  17. #define NULL 0
  18. #else
  19. #define NULL ((void*)0)
  20. #endif
  21. #undef EOF
  22. #define EOF (-1)
  23. #undef SEEK_SET
  24. #undef SEEK_CUR
  25. #undef SEEK_END
  26. #define SEEK_SET 0
  27. #define SEEK_CUR 1
  28. #define SEEK_END 2
  29. #define _IOFBF 0
  30. #define _IOLBF 1
  31. #define _IONBF 2
  32. #include <bits/stdio.h>
  33. typedef union {
  34. char __opaque[16];
  35. double __align;
  36. } fpos_t;
  37. extern FILE *const stdin;
  38. extern FILE *const stdout;
  39. extern FILE *const stderr;
  40. #define stdin (stdin)
  41. #define stdout (stdout)
  42. #define stderr (stderr)
  43. FILE *fopen(const char *, const char *);
  44. FILE *freopen(const char *, const char *, FILE *);
  45. int fclose(FILE *);
  46. int remove(const char *);
  47. int rename(const char *, const char *);
  48. int feof(FILE *);
  49. int ferror(FILE *);
  50. int fflush(FILE *);
  51. void clearerr(FILE *);
  52. int fseek(FILE *, long, int);
  53. long ftell(FILE *);
  54. void rewind(FILE *);
  55. int fgetpos(FILE *, fpos_t *);
  56. int fsetpos(FILE *, const fpos_t *);
  57. size_t fread(void *, size_t, size_t, FILE *);
  58. size_t fwrite(const void *, size_t, size_t, FILE *);
  59. int fgetc(FILE *);
  60. int getc(FILE *);
  61. int getchar(void);
  62. int ungetc(int, FILE *);
  63. int fputc(int, FILE *);
  64. int putc(int, FILE *);
  65. int putchar(int);
  66. char *fgets(char *, int, FILE *);
  67. char *gets(char *);
  68. int fputs(const char *, FILE *);
  69. int puts(const char *);
  70. int printf(const char *, ...);
  71. int fprintf(FILE *, const char *, ...);
  72. int sprintf(char *, const char *, ...);
  73. int snprintf(char *, size_t, const char *, ...);
  74. int vprintf(const char *, va_list);
  75. int vfprintf(FILE *, const char *, va_list);
  76. int vsprintf(char *, const char *, va_list);
  77. int vsnprintf(char *, size_t, const char *, va_list);
  78. int scanf(const char *, ...);
  79. int fscanf(FILE *, const char *, ...);
  80. int sscanf(const char *, const char *, ...);
  81. int vscanf(const char *, va_list);
  82. int vfscanf(FILE *, const char *, va_list);
  83. int vsscanf(const char *, const char *, va_list);
  84. void perror(const char *);
  85. int setvbuf(FILE *, char *, int, size_t);
  86. void setbuf(FILE *, char *);
  87. char *tmpnam(char *);
  88. FILE *tmpfile(void);
  89. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  90. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  91. FILE *fdopen(int, const char *);
  92. FILE *popen(const char *, const char *);
  93. int pclose(FILE *);
  94. int fileno(FILE *);
  95. int fseeko(FILE *, off_t, int);
  96. off_t ftello(FILE *);
  97. int dprintf(int, const char *, ...);
  98. int vdprintf(int, const char *, va_list);
  99. void flockfile(FILE *);
  100. int ftrylockfile(FILE *);
  101. void funlockfile(FILE *);
  102. int getc_unlocked(FILE *);
  103. int getchar_unlocked(void);
  104. int putc_unlocked(int, FILE *);
  105. int putchar_unlocked(int);
  106. ssize_t getdelim(char **, size_t *, int, FILE *);
  107. ssize_t getline(char **, size_t *, FILE *);
  108. int renameat(int, const char *, int, const char *);
  109. char *ctermid(char *);
  110. #endif
  111. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  112. char *tempnam(const char *, const char *);
  113. #endif
  114. #if defined(_GNU_SOURCE)
  115. #undef off64_t
  116. #define off64_t off_t
  117. #endif
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. #endif