blob: 4ca40df2b526907fb9018f14f85c397b26332f49 [file] [log] [blame]
Richard Smith4fe03f02015-10-09 01:29:09 +00001// -*- C++ -*-
Louis Dionne9bd93882021-11-17 16:25:01 -05002//===----------------------------------------------------------------------===//
Richard Smith4fe03f02015-10-09 01:29:09 +00003//
Chandler Carruthd2012102019-01-19 10:56:40 +00004// 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
Richard Smith4fe03f02015-10-09 01:29:09 +00007//
8//===----------------------------------------------------------------------===//
9
Louis Dionne463596e2022-08-08 14:06:40 -040010#ifndef _LIBCPP_STDIO_H
Richard Smith4fe03f02015-10-09 01:29:09 +000011#define _LIBCPP_STDIO_H
12
13/*
14 stdio.h synopsis
15
16Macros:
17
18 BUFSIZ
19 EOF
20 FILENAME_MAX
21 FOPEN_MAX
22 L_tmpnam
23 NULL
24 SEEK_CUR
25 SEEK_END
26 SEEK_SET
27 TMP_MAX
28 _IOFBF
29 _IOLBF
30 _IONBF
31 stderr
32 stdin
33 stdout
34
35Types:
36
37FILE
38fpos_t
39size_t
40
41int remove(const char* filename);
42int rename(const char* old, const char* new);
43FILE* tmpfile(void);
44char* tmpnam(char* s);
45int fclose(FILE* stream);
46int fflush(FILE* stream);
47FILE* fopen(const char* restrict filename, const char* restrict mode);
48FILE* freopen(const char* restrict filename, const char * restrict mode,
49 FILE * restrict stream);
50void setbuf(FILE* restrict stream, char* restrict buf);
51int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
52int fprintf(FILE* restrict stream, const char* restrict format, ...);
53int fscanf(FILE* restrict stream, const char * restrict format, ...);
54int printf(const char* restrict format, ...);
55int scanf(const char* restrict format, ...);
56int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99
57int sprintf(char* restrict s, const char* restrict format, ...);
58int sscanf(const char* restrict s, const char* restrict format, ...);
59int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
60int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99
61int vprintf(const char* restrict format, va_list arg);
62int vscanf(const char* restrict format, va_list arg); // C99
63int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99
64 va_list arg);
65int vsprintf(char* restrict s, const char* restrict format, va_list arg);
66int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
67int fgetc(FILE* stream);
68char* fgets(char* restrict s, int n, FILE* restrict stream);
69int fputc(int c, FILE* stream);
70int fputs(const char* restrict s, FILE* restrict stream);
71int getc(FILE* stream);
72int getchar(void);
73char* gets(char* s); // removed in C++14
74int putc(int c, FILE* stream);
75int putchar(int c);
76int puts(const char* s);
77int ungetc(int c, FILE* stream);
78size_t fread(void* restrict ptr, size_t size, size_t nmemb,
79 FILE* restrict stream);
80size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
81 FILE* restrict stream);
82int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
83int fseek(FILE* stream, long offset, int whence);
84int fsetpos(FILE*stream, const fpos_t* pos);
85long ftell(FILE* stream);
86void rewind(FILE* stream);
87void clearerr(FILE* stream);
88int feof(FILE* stream);
89int ferror(FILE* stream);
90void perror(const char* s);
91*/
92
93#include <__config>
94
95#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Arthur O'Dwyer6eeaa002022-02-01 20:16:40 -050096# pragma GCC system_header
Richard Smith4fe03f02015-10-09 01:29:09 +000097#endif
98
Louis Dionnebe1aa9e2022-11-15 17:08:01 -050099# if __has_include_next(<stdio.h>)
100# include_next <stdio.h>
101# endif
Richard Smith4fe03f02015-10-09 01:29:09 +0000102
103#ifdef __cplusplus
104
Richard Smith4fe03f02015-10-09 01:29:09 +0000105#undef getc
106#undef putc
107#undef clearerr
108#undef feof
109#undef ferror
110
111#endif
112
Louis Dionne2b1ceaa2021-04-20 12:03:32 -0400113#endif // _LIBCPP_STDIO_H