1227825Stheraven// -*- C++ -*-
2227825Stheraven//===---------------------------- cstdio ----------------------------------===//
3227825Stheraven//
4353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5353358Sdim// See https://llvm.org/LICENSE.txt for license information.
6353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7227825Stheraven//
8227825Stheraven//===----------------------------------------------------------------------===//
9227825Stheraven
10227825Stheraven#ifndef _LIBCPP_CSTDIO
11227825Stheraven#define _LIBCPP_CSTDIO
12227825Stheraven
13227825Stheraven/*
14227825Stheraven    cstdio synopsis
15227825Stheraven
16227825StheravenMacros:
17227825Stheraven
18227825Stheraven    BUFSIZ
19227825Stheraven    EOF
20227825Stheraven    FILENAME_MAX
21227825Stheraven    FOPEN_MAX
22227825Stheraven    L_tmpnam
23227825Stheraven    NULL
24227825Stheraven    SEEK_CUR
25227825Stheraven    SEEK_END
26227825Stheraven    SEEK_SET
27227825Stheraven    TMP_MAX
28227825Stheraven    _IOFBF
29227825Stheraven    _IOLBF
30227825Stheraven    _IONBF
31227825Stheraven    stderr
32227825Stheraven    stdin
33227825Stheraven    stdout
34227825Stheraven
35227825Stheravennamespace std
36227825Stheraven{
37227825Stheraven
38227825StheravenTypes:
39227825Stheraven
40227825StheravenFILE
41227825Stheravenfpos_t
42227825Stheravensize_t
43227825Stheraven
44227825Stheravenint remove(const char* filename);
45227825Stheravenint rename(const char* old, const char* new);
46227825StheravenFILE* tmpfile(void);
47227825Stheravenchar* tmpnam(char* s);
48227825Stheravenint fclose(FILE* stream);
49227825Stheravenint fflush(FILE* stream);
50227825StheravenFILE* fopen(const char* restrict filename, const char* restrict mode);
51227825StheravenFILE* freopen(const char* restrict filename, const char * restrict mode,
52227825Stheraven              FILE * restrict stream);
53227825Stheravenvoid setbuf(FILE* restrict stream, char* restrict buf);
54227825Stheravenint setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
55227825Stheravenint fprintf(FILE* restrict stream, const char* restrict format, ...);
56227825Stheravenint fscanf(FILE* restrict stream, const char * restrict format, ...);
57227825Stheravenint printf(const char* restrict format, ...);
58227825Stheravenint scanf(const char* restrict format, ...);
59227825Stheravenint snprintf(char* restrict s, size_t n, const char* restrict format, ...);    // C99
60227825Stheravenint sprintf(char* restrict s, const char* restrict format, ...);
61227825Stheravenint sscanf(const char* restrict s, const char* restrict format, ...);
62227825Stheravenint vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
63227825Stheravenint vfscanf(FILE* restrict stream, const char* restrict format, va_list arg);  // C99
64227825Stheravenint vprintf(const char* restrict format, va_list arg);
65227825Stheravenint vscanf(const char* restrict format, va_list arg);                          // C99
66227825Stheravenint vsnprintf(char* restrict s, size_t n, const char* restrict format,         // C99
67227825Stheraven              va_list arg);
68227825Stheravenint vsprintf(char* restrict s, const char* restrict format, va_list arg);
69227825Stheravenint vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
70227825Stheravenint fgetc(FILE* stream);
71227825Stheravenchar* fgets(char* restrict s, int n, FILE* restrict stream);
72227825Stheravenint fputc(int c, FILE* stream);
73227825Stheravenint fputs(const char* restrict s, FILE* restrict stream);
74227825Stheravenint getc(FILE* stream);
75227825Stheravenint getchar(void);
76353358Sdimchar* gets(char* s);  // removed in C++14
77227825Stheravenint putc(int c, FILE* stream);
78227825Stheravenint putchar(int c);
79227825Stheravenint puts(const char* s);
80227825Stheravenint ungetc(int c, FILE* stream);
81227825Stheravensize_t fread(void* restrict ptr, size_t size, size_t nmemb,
82227825Stheraven             FILE* restrict stream);
83227825Stheravensize_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
84227825Stheraven              FILE* restrict stream);
85227825Stheravenint fgetpos(FILE* restrict stream, fpos_t* restrict pos);
86227825Stheravenint fseek(FILE* stream, long offset, int whence);
87227825Stheravenint fsetpos(FILE*stream, const fpos_t* pos);
88227825Stheravenlong ftell(FILE* stream);
89227825Stheravenvoid rewind(FILE* stream);
90227825Stheravenvoid clearerr(FILE* stream);
91227825Stheravenint feof(FILE* stream);
92227825Stheravenint ferror(FILE* stream);
93227825Stheravenvoid perror(const char* s);
94227825Stheraven
95227825Stheraven}  // std
96227825Stheraven*/
97227825Stheraven
98227825Stheraven#include <__config>
99227825Stheraven#include <stdio.h>
100227825Stheraven
101227825Stheraven#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
102227825Stheraven#pragma GCC system_header
103227825Stheraven#endif
104227825Stheraven
105227825Stheraven_LIBCPP_BEGIN_NAMESPACE_STD
106227825Stheraven
107227825Stheravenusing ::FILE;
108227825Stheravenusing ::fpos_t;
109227825Stheravenusing ::size_t;
110227825Stheraven
111227825Stheravenusing ::fclose;
112227825Stheravenusing ::fflush;
113227825Stheravenusing ::setbuf;
114227825Stheravenusing ::setvbuf;
115227825Stheravenusing ::fprintf;
116227825Stheravenusing ::fscanf;
117227825Stheravenusing ::snprintf;
118227825Stheravenusing ::sprintf;
119227825Stheravenusing ::sscanf;
120227825Stheravenusing ::vfprintf;
121227825Stheravenusing ::vfscanf;
122227825Stheravenusing ::vsscanf;
123227825Stheravenusing ::vsnprintf;
124227825Stheravenusing ::vsprintf;
125227825Stheravenusing ::fgetc;
126227825Stheravenusing ::fgets;
127227825Stheravenusing ::fputc;
128227825Stheravenusing ::fputs;
129227825Stheravenusing ::getc;
130227825Stheravenusing ::putc;
131227825Stheravenusing ::ungetc;
132227825Stheravenusing ::fread;
133227825Stheravenusing ::fwrite;
134227825Stheravenusing ::fgetpos;
135227825Stheravenusing ::fseek;
136227825Stheravenusing ::fsetpos;
137227825Stheravenusing ::ftell;
138227825Stheravenusing ::rewind;
139227825Stheravenusing ::clearerr;
140227825Stheravenusing ::feof;
141227825Stheravenusing ::ferror;
142227825Stheravenusing ::perror;
143227825Stheraven
144288943Sdim#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
145288943Sdimusing ::fopen;
146288943Sdimusing ::freopen;
147288943Sdimusing ::remove;
148288943Sdimusing ::rename;
149288943Sdimusing ::tmpfile;
150288943Sdimusing ::tmpnam;
151288943Sdim#endif
152288943Sdim
153288943Sdim#ifndef _LIBCPP_HAS_NO_STDIN
154288943Sdimusing ::getchar;
155353358Sdim#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS)
156353358Sdimusing ::gets;
157353358Sdim#endif
158288943Sdimusing ::scanf;
159288943Sdimusing ::vscanf;
160288943Sdim#endif
161288943Sdim
162288943Sdim#ifndef _LIBCPP_HAS_NO_STDOUT
163288943Sdimusing ::printf;
164288943Sdimusing ::putchar;
165288943Sdimusing ::puts;
166288943Sdimusing ::vprintf;
167288943Sdim#endif
168288943Sdim
169227825Stheraven_LIBCPP_END_NAMESPACE_STD
170227825Stheraven
171227825Stheraven#endif  // _LIBCPP_CSTDIO
172