xref: /aosp_15_r20/external/libcxx/include/cstdio (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1*58b9f456SAndroid Build Coastguard Worker// -*- C++ -*-
2*58b9f456SAndroid Build Coastguard Worker//===---------------------------- cstdio ----------------------------------===//
3*58b9f456SAndroid Build Coastguard Worker//
4*58b9f456SAndroid Build Coastguard Worker//                     The LLVM Compiler Infrastructure
5*58b9f456SAndroid Build Coastguard Worker//
6*58b9f456SAndroid Build Coastguard Worker// This file is dual licensed under the MIT and the University of Illinois Open
7*58b9f456SAndroid Build Coastguard Worker// Source Licenses. See LICENSE.TXT for details.
8*58b9f456SAndroid Build Coastguard Worker//
9*58b9f456SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
10*58b9f456SAndroid Build Coastguard Worker
11*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CSTDIO
12*58b9f456SAndroid Build Coastguard Worker#define _LIBCPP_CSTDIO
13*58b9f456SAndroid Build Coastguard Worker
14*58b9f456SAndroid Build Coastguard Worker/*
15*58b9f456SAndroid Build Coastguard Worker    cstdio synopsis
16*58b9f456SAndroid Build Coastguard Worker
17*58b9f456SAndroid Build Coastguard WorkerMacros:
18*58b9f456SAndroid Build Coastguard Worker
19*58b9f456SAndroid Build Coastguard Worker    BUFSIZ
20*58b9f456SAndroid Build Coastguard Worker    EOF
21*58b9f456SAndroid Build Coastguard Worker    FILENAME_MAX
22*58b9f456SAndroid Build Coastguard Worker    FOPEN_MAX
23*58b9f456SAndroid Build Coastguard Worker    L_tmpnam
24*58b9f456SAndroid Build Coastguard Worker    NULL
25*58b9f456SAndroid Build Coastguard Worker    SEEK_CUR
26*58b9f456SAndroid Build Coastguard Worker    SEEK_END
27*58b9f456SAndroid Build Coastguard Worker    SEEK_SET
28*58b9f456SAndroid Build Coastguard Worker    TMP_MAX
29*58b9f456SAndroid Build Coastguard Worker    _IOFBF
30*58b9f456SAndroid Build Coastguard Worker    _IOLBF
31*58b9f456SAndroid Build Coastguard Worker    _IONBF
32*58b9f456SAndroid Build Coastguard Worker    stderr
33*58b9f456SAndroid Build Coastguard Worker    stdin
34*58b9f456SAndroid Build Coastguard Worker    stdout
35*58b9f456SAndroid Build Coastguard Worker
36*58b9f456SAndroid Build Coastguard Workernamespace std
37*58b9f456SAndroid Build Coastguard Worker{
38*58b9f456SAndroid Build Coastguard Worker
39*58b9f456SAndroid Build Coastguard WorkerTypes:
40*58b9f456SAndroid Build Coastguard Worker
41*58b9f456SAndroid Build Coastguard WorkerFILE
42*58b9f456SAndroid Build Coastguard Workerfpos_t
43*58b9f456SAndroid Build Coastguard Workersize_t
44*58b9f456SAndroid Build Coastguard Worker
45*58b9f456SAndroid Build Coastguard Workerint remove(const char* filename);
46*58b9f456SAndroid Build Coastguard Workerint rename(const char* old, const char* new);
47*58b9f456SAndroid Build Coastguard WorkerFILE* tmpfile(void);
48*58b9f456SAndroid Build Coastguard Workerchar* tmpnam(char* s);
49*58b9f456SAndroid Build Coastguard Workerint fclose(FILE* stream);
50*58b9f456SAndroid Build Coastguard Workerint fflush(FILE* stream);
51*58b9f456SAndroid Build Coastguard WorkerFILE* fopen(const char* restrict filename, const char* restrict mode);
52*58b9f456SAndroid Build Coastguard WorkerFILE* freopen(const char* restrict filename, const char * restrict mode,
53*58b9f456SAndroid Build Coastguard Worker              FILE * restrict stream);
54*58b9f456SAndroid Build Coastguard Workervoid setbuf(FILE* restrict stream, char* restrict buf);
55*58b9f456SAndroid Build Coastguard Workerint setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
56*58b9f456SAndroid Build Coastguard Workerint fprintf(FILE* restrict stream, const char* restrict format, ...);
57*58b9f456SAndroid Build Coastguard Workerint fscanf(FILE* restrict stream, const char * restrict format, ...);
58*58b9f456SAndroid Build Coastguard Workerint printf(const char* restrict format, ...);
59*58b9f456SAndroid Build Coastguard Workerint scanf(const char* restrict format, ...);
60*58b9f456SAndroid Build Coastguard Workerint snprintf(char* restrict s, size_t n, const char* restrict format, ...);    // C99
61*58b9f456SAndroid Build Coastguard Workerint sprintf(char* restrict s, const char* restrict format, ...);
62*58b9f456SAndroid Build Coastguard Workerint sscanf(const char* restrict s, const char* restrict format, ...);
63*58b9f456SAndroid Build Coastguard Workerint vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
64*58b9f456SAndroid Build Coastguard Workerint vfscanf(FILE* restrict stream, const char* restrict format, va_list arg);  // C99
65*58b9f456SAndroid Build Coastguard Workerint vprintf(const char* restrict format, va_list arg);
66*58b9f456SAndroid Build Coastguard Workerint vscanf(const char* restrict format, va_list arg);                          // C99
67*58b9f456SAndroid Build Coastguard Workerint vsnprintf(char* restrict s, size_t n, const char* restrict format,         // C99
68*58b9f456SAndroid Build Coastguard Worker              va_list arg);
69*58b9f456SAndroid Build Coastguard Workerint vsprintf(char* restrict s, const char* restrict format, va_list arg);
70*58b9f456SAndroid Build Coastguard Workerint vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
71*58b9f456SAndroid Build Coastguard Workerint fgetc(FILE* stream);
72*58b9f456SAndroid Build Coastguard Workerchar* fgets(char* restrict s, int n, FILE* restrict stream);
73*58b9f456SAndroid Build Coastguard Workerint fputc(int c, FILE* stream);
74*58b9f456SAndroid Build Coastguard Workerint fputs(const char* restrict s, FILE* restrict stream);
75*58b9f456SAndroid Build Coastguard Workerint getc(FILE* stream);
76*58b9f456SAndroid Build Coastguard Workerint getchar(void);
77*58b9f456SAndroid Build Coastguard Workerchar* gets(char* s);  // removed in C++14
78*58b9f456SAndroid Build Coastguard Workerint putc(int c, FILE* stream);
79*58b9f456SAndroid Build Coastguard Workerint putchar(int c);
80*58b9f456SAndroid Build Coastguard Workerint puts(const char* s);
81*58b9f456SAndroid Build Coastguard Workerint ungetc(int c, FILE* stream);
82*58b9f456SAndroid Build Coastguard Workersize_t fread(void* restrict ptr, size_t size, size_t nmemb,
83*58b9f456SAndroid Build Coastguard Worker             FILE* restrict stream);
84*58b9f456SAndroid Build Coastguard Workersize_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
85*58b9f456SAndroid Build Coastguard Worker              FILE* restrict stream);
86*58b9f456SAndroid Build Coastguard Workerint fgetpos(FILE* restrict stream, fpos_t* restrict pos);
87*58b9f456SAndroid Build Coastguard Workerint fseek(FILE* stream, long offset, int whence);
88*58b9f456SAndroid Build Coastguard Workerint fsetpos(FILE*stream, const fpos_t* pos);
89*58b9f456SAndroid Build Coastguard Workerlong ftell(FILE* stream);
90*58b9f456SAndroid Build Coastguard Workervoid rewind(FILE* stream);
91*58b9f456SAndroid Build Coastguard Workervoid clearerr(FILE* stream);
92*58b9f456SAndroid Build Coastguard Workerint feof(FILE* stream);
93*58b9f456SAndroid Build Coastguard Workerint ferror(FILE* stream);
94*58b9f456SAndroid Build Coastguard Workervoid perror(const char* s);
95*58b9f456SAndroid Build Coastguard Worker
96*58b9f456SAndroid Build Coastguard Worker}  // std
97*58b9f456SAndroid Build Coastguard Worker*/
98*58b9f456SAndroid Build Coastguard Worker
99*58b9f456SAndroid Build Coastguard Worker#include <__config>
100*58b9f456SAndroid Build Coastguard Worker#include <stdio.h>
101*58b9f456SAndroid Build Coastguard Worker
102*58b9f456SAndroid Build Coastguard Worker#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
103*58b9f456SAndroid Build Coastguard Worker#pragma GCC system_header
104*58b9f456SAndroid Build Coastguard Worker#endif
105*58b9f456SAndroid Build Coastguard Worker
106*58b9f456SAndroid Build Coastguard Worker_LIBCPP_BEGIN_NAMESPACE_STD
107*58b9f456SAndroid Build Coastguard Worker
108*58b9f456SAndroid Build Coastguard Workerusing ::FILE;
109*58b9f456SAndroid Build Coastguard Workerusing ::fpos_t;
110*58b9f456SAndroid Build Coastguard Workerusing ::size_t;
111*58b9f456SAndroid Build Coastguard Worker
112*58b9f456SAndroid Build Coastguard Workerusing ::fclose;
113*58b9f456SAndroid Build Coastguard Workerusing ::fflush;
114*58b9f456SAndroid Build Coastguard Workerusing ::setbuf;
115*58b9f456SAndroid Build Coastguard Workerusing ::setvbuf;
116*58b9f456SAndroid Build Coastguard Workerusing ::fprintf;
117*58b9f456SAndroid Build Coastguard Workerusing ::fscanf;
118*58b9f456SAndroid Build Coastguard Workerusing ::snprintf;
119*58b9f456SAndroid Build Coastguard Workerusing ::sprintf;
120*58b9f456SAndroid Build Coastguard Workerusing ::sscanf;
121*58b9f456SAndroid Build Coastguard Workerusing ::vfprintf;
122*58b9f456SAndroid Build Coastguard Workerusing ::vfscanf;
123*58b9f456SAndroid Build Coastguard Workerusing ::vsscanf;
124*58b9f456SAndroid Build Coastguard Workerusing ::vsnprintf;
125*58b9f456SAndroid Build Coastguard Workerusing ::vsprintf;
126*58b9f456SAndroid Build Coastguard Workerusing ::fgetc;
127*58b9f456SAndroid Build Coastguard Workerusing ::fgets;
128*58b9f456SAndroid Build Coastguard Workerusing ::fputc;
129*58b9f456SAndroid Build Coastguard Workerusing ::fputs;
130*58b9f456SAndroid Build Coastguard Workerusing ::getc;
131*58b9f456SAndroid Build Coastguard Workerusing ::putc;
132*58b9f456SAndroid Build Coastguard Workerusing ::ungetc;
133*58b9f456SAndroid Build Coastguard Workerusing ::fread;
134*58b9f456SAndroid Build Coastguard Workerusing ::fwrite;
135*58b9f456SAndroid Build Coastguard Workerusing ::fgetpos;
136*58b9f456SAndroid Build Coastguard Workerusing ::fseek;
137*58b9f456SAndroid Build Coastguard Workerusing ::fsetpos;
138*58b9f456SAndroid Build Coastguard Workerusing ::ftell;
139*58b9f456SAndroid Build Coastguard Workerusing ::rewind;
140*58b9f456SAndroid Build Coastguard Workerusing ::clearerr;
141*58b9f456SAndroid Build Coastguard Workerusing ::feof;
142*58b9f456SAndroid Build Coastguard Workerusing ::ferror;
143*58b9f456SAndroid Build Coastguard Workerusing ::perror;
144*58b9f456SAndroid Build Coastguard Worker
145*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
146*58b9f456SAndroid Build Coastguard Workerusing ::fopen;
147*58b9f456SAndroid Build Coastguard Workerusing ::freopen;
148*58b9f456SAndroid Build Coastguard Workerusing ::remove;
149*58b9f456SAndroid Build Coastguard Workerusing ::rename;
150*58b9f456SAndroid Build Coastguard Workerusing ::tmpfile;
151*58b9f456SAndroid Build Coastguard Workerusing ::tmpnam;
152*58b9f456SAndroid Build Coastguard Worker#endif
153*58b9f456SAndroid Build Coastguard Worker
154*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_HAS_NO_STDIN
155*58b9f456SAndroid Build Coastguard Workerusing ::getchar;
156*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT)
157*58b9f456SAndroid Build Coastguard Workerusing ::gets;
158*58b9f456SAndroid Build Coastguard Worker#endif
159*58b9f456SAndroid Build Coastguard Workerusing ::scanf;
160*58b9f456SAndroid Build Coastguard Workerusing ::vscanf;
161*58b9f456SAndroid Build Coastguard Worker#endif
162*58b9f456SAndroid Build Coastguard Worker
163*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_HAS_NO_STDOUT
164*58b9f456SAndroid Build Coastguard Workerusing ::printf;
165*58b9f456SAndroid Build Coastguard Workerusing ::putchar;
166*58b9f456SAndroid Build Coastguard Workerusing ::puts;
167*58b9f456SAndroid Build Coastguard Workerusing ::vprintf;
168*58b9f456SAndroid Build Coastguard Worker#endif
169*58b9f456SAndroid Build Coastguard Worker
170*58b9f456SAndroid Build Coastguard Worker_LIBCPP_END_NAMESPACE_STD
171*58b9f456SAndroid Build Coastguard Worker
172*58b9f456SAndroid Build Coastguard Worker#endif  // _LIBCPP_CSTDIO
173