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