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