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