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