122 lines · c
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-exception7//8//===----------------------------------------------------------------------===//9 10/*11 stdio.h synopsis12 13Macros:14 15 BUFSIZ16 EOF17 FILENAME_MAX18 FOPEN_MAX19 L_tmpnam20 NULL21 SEEK_CUR22 SEEK_END23 SEEK_SET24 TMP_MAX25 _IOFBF26 _IOLBF27 _IONBF28 stderr29 stdin30 stdout31 32Types:33 34FILE35fpos_t36size_t37 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, ...); // C9954int 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); // C9958int vprintf(const char* restrict format, va_list arg);59int vscanf(const char* restrict format, va_list arg); // C9960int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C9961 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); // C9964int 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++1471int 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#else93# include <__config>94#endif95 96#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)97# pragma GCC system_header98#endif99 100// The inclusion of the system's <stdio.h> is intentionally done once outside of any include101// guards because some code expects to be able to include the underlying system header multiple102// 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#endif106 107#ifndef _LIBCPP_STDIO_H108# define _LIBCPP_STDIO_H109 110# ifdef __cplusplus111 112# undef getc113# undef putc114# undef clearerr115# undef feof116# undef ferror117# undef putchar118# undef getchar119 120# endif // __cplusplus121#endif // _LIBCPP_STDIO_H122