stdio.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #if defined(__need_FILE) || defined(__need___FILE)
  10. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  11. # pragma GCC system_header
  12. #endif
  13. #ifdef _LIBCPP_COMPILER_MSVC
  14. #include Y_UCRT_INCLUDE_NEXT(stdio.h)
  15. #else
  16. #include_next <stdio.h>
  17. #endif
  18. #elif !defined(_LIBCPP_STDIO_H)
  19. #define _LIBCPP_STDIO_H
  20. /*
  21. stdio.h synopsis
  22. Macros:
  23. BUFSIZ
  24. EOF
  25. FILENAME_MAX
  26. FOPEN_MAX
  27. L_tmpnam
  28. NULL
  29. SEEK_CUR
  30. SEEK_END
  31. SEEK_SET
  32. TMP_MAX
  33. _IOFBF
  34. _IOLBF
  35. _IONBF
  36. stderr
  37. stdin
  38. stdout
  39. Types:
  40. FILE
  41. fpos_t
  42. size_t
  43. int remove(const char* filename);
  44. int rename(const char* old, const char* new);
  45. FILE* tmpfile(void);
  46. char* tmpnam(char* s);
  47. int fclose(FILE* stream);
  48. int fflush(FILE* stream);
  49. FILE* fopen(const char* restrict filename, const char* restrict mode);
  50. FILE* freopen(const char* restrict filename, const char * restrict mode,
  51. FILE * restrict stream);
  52. void setbuf(FILE* restrict stream, char* restrict buf);
  53. int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
  54. int fprintf(FILE* restrict stream, const char* restrict format, ...);
  55. int fscanf(FILE* restrict stream, const char * restrict format, ...);
  56. int printf(const char* restrict format, ...);
  57. int scanf(const char* restrict format, ...);
  58. int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99
  59. int sprintf(char* restrict s, const char* restrict format, ...);
  60. int sscanf(const char* restrict s, const char* restrict format, ...);
  61. int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
  62. int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99
  63. int vprintf(const char* restrict format, va_list arg);
  64. int vscanf(const char* restrict format, va_list arg); // C99
  65. int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99
  66. va_list arg);
  67. int vsprintf(char* restrict s, const char* restrict format, va_list arg);
  68. int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
  69. int fgetc(FILE* stream);
  70. char* fgets(char* restrict s, int n, FILE* restrict stream);
  71. int fputc(int c, FILE* stream);
  72. int fputs(const char* restrict s, FILE* restrict stream);
  73. int getc(FILE* stream);
  74. int getchar(void);
  75. char* gets(char* s); // removed in C++14
  76. int putc(int c, FILE* stream);
  77. int putchar(int c);
  78. int puts(const char* s);
  79. int ungetc(int c, FILE* stream);
  80. size_t fread(void* restrict ptr, size_t size, size_t nmemb,
  81. FILE* restrict stream);
  82. size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
  83. FILE* restrict stream);
  84. int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
  85. int fseek(FILE* stream, long offset, int whence);
  86. int fsetpos(FILE*stream, const fpos_t* pos);
  87. long ftell(FILE* stream);
  88. void rewind(FILE* stream);
  89. void clearerr(FILE* stream);
  90. int feof(FILE* stream);
  91. int ferror(FILE* stream);
  92. void perror(const char* s);
  93. */
  94. #include <__config>
  95. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  96. # pragma GCC system_header
  97. #endif
  98. #ifdef _LIBCPP_COMPILER_MSVC
  99. #include Y_UCRT_INCLUDE_NEXT(stdio.h)
  100. #else
  101. #include_next <stdio.h>
  102. #endif
  103. #ifdef __cplusplus
  104. #undef getc
  105. #undef putc
  106. #undef clearerr
  107. #undef feof
  108. #undef ferror
  109. #endif
  110. #endif // _LIBCPP_STDIO_H