2 //===---------------------------- cstdio ----------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_CSTDIO
12 #define _LIBCPP_CSTDIO
45 int remove(const char* filename);
46 int rename(const char* old, const char* new);
48 char* tmpnam(char* s);
49 int fclose(FILE* stream);
50 int fflush(FILE* stream);
51 FILE* fopen(const char* restrict filename, const char* restrict mode);
52 FILE* freopen(const char* restrict filename, const char * restrict mode,
53 FILE * restrict stream);
54 void setbuf(FILE* restrict stream, char* restrict buf);
55 int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
56 int fprintf(FILE* restrict stream, const char* restrict format, ...);
57 int fscanf(FILE* restrict stream, const char * restrict format, ...);
58 int printf(const char* restrict format, ...);
59 int scanf(const char* restrict format, ...);
60 int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99
61 int sprintf(char* restrict s, const char* restrict format, ...);
62 int sscanf(const char* restrict s, const char* restrict format, ...);
63 int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
64 int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99
65 int vprintf(const char* restrict format, va_list arg);
66 int vscanf(const char* restrict format, va_list arg); // C99
67 int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99
69 int vsprintf(char* restrict s, const char* restrict format, va_list arg);
70 int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
71 int fgetc(FILE* stream);
72 char* fgets(char* restrict s, int n, FILE* restrict stream);
73 int fputc(int c, FILE* stream);
74 int fputs(const char* restrict s, FILE* restrict stream);
75 int getc(FILE* stream);
77 char* gets(char* s); // removed in C++14
78 int putc(int c, FILE* stream);
80 int puts(const char* s);
81 int ungetc(int c, FILE* stream);
82 size_t fread(void* restrict ptr, size_t size, size_t nmemb,
83 FILE* restrict stream);
84 size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
85 FILE* restrict stream);
86 int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
87 int fseek(FILE* stream, long offset, int whence);
88 int fsetpos(FILE*stream, const fpos_t* pos);
89 long ftell(FILE* stream);
90 void rewind(FILE* stream);
91 void clearerr(FILE* stream);
92 int feof(FILE* stream);
93 int ferror(FILE* stream);
94 void perror(const char* s);
102 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
103 #pragma GCC system_header
107 #if defined(_LIBCPP_MSVCRT)
108 #include "support/win32/support.h"
112 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_getc(FILE* __stream) {return getc(__stream);}
114 inline _LIBCPP_INLINE_VISIBILITY int getc(FILE* __stream) {return __libcpp_getc(__stream);}
118 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_putc(int __c, FILE* __stream) {return putc(__c, __stream);}
120 inline _LIBCPP_INLINE_VISIBILITY int putc(int __c, FILE* __stream) {return __libcpp_putc(__c, __stream);}
124 inline _LIBCPP_INLINE_VISIBILITY void __libcpp_clearerr(FILE* __stream) { return clearerr(__stream); }
126 inline _LIBCPP_INLINE_VISIBILITY void clearerr(FILE* __stream) { return __libcpp_clearerr(__stream); }
130 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_feof(FILE* __stream) { return feof(__stream); }
132 inline _LIBCPP_INLINE_VISIBILITY int feof(FILE* __stream) { return __libcpp_feof(__stream); }
136 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ferror(FILE* __stream) { return ferror(__stream); }
138 inline _LIBCPP_INLINE_VISIBILITY int ferror(FILE* __stream) { return __libcpp_ferror(__stream); }
141 _LIBCPP_BEGIN_NAMESPACE_STD
156 #ifndef _LIBCPP_MSVCRT
160 #endif // _LIBCPP_MSVCRT
182 #ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
191 #ifndef _LIBCPP_HAS_NO_STDIN
193 #if _LIBCPP_STD_VER <= 11
200 #ifndef _LIBCPP_HAS_NO_STDOUT
207 _LIBCPP_END_NAMESPACE_STD
209 #endif // _LIBCPP_CSTDIO