2 //===---------------------------- stdio.h ---------------------------------===//
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 #if defined(__need_FILE) || defined(__need___FILE)
13 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
14 #pragma GCC system_header
17 #include_next <stdio.h>
19 #elif !defined(_LIBCPP_STDIO_H)
20 #define _LIBCPP_STDIO_H
50 int remove(const char* filename);
51 int rename(const char* old, const char* new);
53 char* tmpnam(char* s);
54 int fclose(FILE* stream);
55 int fflush(FILE* stream);
56 FILE* fopen(const char* restrict filename, const char* restrict mode);
57 FILE* freopen(const char* restrict filename, const char * restrict mode,
58 FILE * restrict stream);
59 void setbuf(FILE* restrict stream, char* restrict buf);
60 int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
61 int fprintf(FILE* restrict stream, const char* restrict format, ...);
62 int fscanf(FILE* restrict stream, const char * restrict format, ...);
63 int printf(const char* restrict format, ...);
64 int scanf(const char* restrict format, ...);
65 int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99
66 int sprintf(char* restrict s, const char* restrict format, ...);
67 int sscanf(const char* restrict s, const char* restrict format, ...);
68 int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
69 int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99
70 int vprintf(const char* restrict format, va_list arg);
71 int vscanf(const char* restrict format, va_list arg); // C99
72 int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99
74 int vsprintf(char* restrict s, const char* restrict format, va_list arg);
75 int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
76 int fgetc(FILE* stream);
77 char* fgets(char* restrict s, int n, FILE* restrict stream);
78 int fputc(int c, FILE* stream);
79 int fputs(const char* restrict s, FILE* restrict stream);
80 int getc(FILE* stream);
82 char* gets(char* s); // removed in C++14
83 int putc(int c, FILE* stream);
85 int puts(const char* s);
86 int ungetc(int c, FILE* stream);
87 size_t fread(void* restrict ptr, size_t size, size_t nmemb,
88 FILE* restrict stream);
89 size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
90 FILE* restrict stream);
91 int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
92 int fseek(FILE* stream, long offset, int whence);
93 int fsetpos(FILE*stream, const fpos_t* pos);
94 long ftell(FILE* stream);
95 void rewind(FILE* stream);
96 void clearerr(FILE* stream);
97 int feof(FILE* stream);
98 int ferror(FILE* stream);
99 void perror(const char* s);
104 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
105 #pragma GCC system_header
108 #include_next <stdio.h>
113 #if defined(_LIBCPP_MSVCRT)
115 #include "support/win32/support.h"
127 #endif // _LIBCPP_STDIO_H