19729cf09SDimitry Andric // -*- C++ -*- 29729cf09SDimitry Andric //===---------------------------- stdio.h ---------------------------------===// 39729cf09SDimitry Andric // 49729cf09SDimitry Andric // The LLVM Compiler Infrastructure 59729cf09SDimitry Andric // 69729cf09SDimitry Andric // This file is dual licensed under the MIT and the University of Illinois Open 79729cf09SDimitry Andric // Source Licenses. See LICENSE.TXT for details. 89729cf09SDimitry Andric // 99729cf09SDimitry Andric //===----------------------------------------------------------------------===// 109729cf09SDimitry Andric 119729cf09SDimitry Andric #if defined(__need_FILE) || defined(__need___FILE) 129729cf09SDimitry Andric 139729cf09SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 149729cf09SDimitry Andric #pragma GCC system_header 159729cf09SDimitry Andric #endif 169729cf09SDimitry Andric 179729cf09SDimitry Andric #include_next <stdio.h> 189729cf09SDimitry Andric 199729cf09SDimitry Andric #elif !defined(_LIBCPP_STDIO_H) 209729cf09SDimitry Andric #define _LIBCPP_STDIO_H 219729cf09SDimitry Andric 229729cf09SDimitry Andric /* 239729cf09SDimitry Andric stdio.h synopsis 249729cf09SDimitry Andric 259729cf09SDimitry Andric Macros: 269729cf09SDimitry Andric 279729cf09SDimitry Andric BUFSIZ 289729cf09SDimitry Andric EOF 299729cf09SDimitry Andric FILENAME_MAX 309729cf09SDimitry Andric FOPEN_MAX 319729cf09SDimitry Andric L_tmpnam 329729cf09SDimitry Andric NULL 339729cf09SDimitry Andric SEEK_CUR 349729cf09SDimitry Andric SEEK_END 359729cf09SDimitry Andric SEEK_SET 369729cf09SDimitry Andric TMP_MAX 379729cf09SDimitry Andric _IOFBF 389729cf09SDimitry Andric _IOLBF 399729cf09SDimitry Andric _IONBF 409729cf09SDimitry Andric stderr 419729cf09SDimitry Andric stdin 429729cf09SDimitry Andric stdout 439729cf09SDimitry Andric 449729cf09SDimitry Andric Types: 459729cf09SDimitry Andric 469729cf09SDimitry Andric FILE 479729cf09SDimitry Andric fpos_t 489729cf09SDimitry Andric size_t 499729cf09SDimitry Andric 509729cf09SDimitry Andric int remove(const char* filename); 519729cf09SDimitry Andric int rename(const char* old, const char* new); 529729cf09SDimitry Andric FILE* tmpfile(void); 539729cf09SDimitry Andric char* tmpnam(char* s); 549729cf09SDimitry Andric int fclose(FILE* stream); 559729cf09SDimitry Andric int fflush(FILE* stream); 569729cf09SDimitry Andric FILE* fopen(const char* restrict filename, const char* restrict mode); 579729cf09SDimitry Andric FILE* freopen(const char* restrict filename, const char * restrict mode, 589729cf09SDimitry Andric FILE * restrict stream); 599729cf09SDimitry Andric void setbuf(FILE* restrict stream, char* restrict buf); 609729cf09SDimitry Andric int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size); 619729cf09SDimitry Andric int fprintf(FILE* restrict stream, const char* restrict format, ...); 629729cf09SDimitry Andric int fscanf(FILE* restrict stream, const char * restrict format, ...); 639729cf09SDimitry Andric int printf(const char* restrict format, ...); 649729cf09SDimitry Andric int scanf(const char* restrict format, ...); 659729cf09SDimitry Andric int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99 669729cf09SDimitry Andric int sprintf(char* restrict s, const char* restrict format, ...); 679729cf09SDimitry Andric int sscanf(const char* restrict s, const char* restrict format, ...); 689729cf09SDimitry Andric int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg); 699729cf09SDimitry Andric int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99 709729cf09SDimitry Andric int vprintf(const char* restrict format, va_list arg); 719729cf09SDimitry Andric int vscanf(const char* restrict format, va_list arg); // C99 729729cf09SDimitry Andric int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99 739729cf09SDimitry Andric va_list arg); 749729cf09SDimitry Andric int vsprintf(char* restrict s, const char* restrict format, va_list arg); 759729cf09SDimitry Andric int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99 769729cf09SDimitry Andric int fgetc(FILE* stream); 779729cf09SDimitry Andric char* fgets(char* restrict s, int n, FILE* restrict stream); 789729cf09SDimitry Andric int fputc(int c, FILE* stream); 799729cf09SDimitry Andric int fputs(const char* restrict s, FILE* restrict stream); 809729cf09SDimitry Andric int getc(FILE* stream); 819729cf09SDimitry Andric int getchar(void); 829729cf09SDimitry Andric char* gets(char* s); // removed in C++14 839729cf09SDimitry Andric int putc(int c, FILE* stream); 849729cf09SDimitry Andric int putchar(int c); 859729cf09SDimitry Andric int puts(const char* s); 869729cf09SDimitry Andric int ungetc(int c, FILE* stream); 879729cf09SDimitry Andric size_t fread(void* restrict ptr, size_t size, size_t nmemb, 889729cf09SDimitry Andric FILE* restrict stream); 899729cf09SDimitry Andric size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb, 909729cf09SDimitry Andric FILE* restrict stream); 919729cf09SDimitry Andric int fgetpos(FILE* restrict stream, fpos_t* restrict pos); 929729cf09SDimitry Andric int fseek(FILE* stream, long offset, int whence); 939729cf09SDimitry Andric int fsetpos(FILE*stream, const fpos_t* pos); 949729cf09SDimitry Andric long ftell(FILE* stream); 959729cf09SDimitry Andric void rewind(FILE* stream); 969729cf09SDimitry Andric void clearerr(FILE* stream); 979729cf09SDimitry Andric int feof(FILE* stream); 989729cf09SDimitry Andric int ferror(FILE* stream); 999729cf09SDimitry Andric void perror(const char* s); 1009729cf09SDimitry Andric */ 1019729cf09SDimitry Andric 1029729cf09SDimitry Andric #include <__config> 1039729cf09SDimitry Andric 1049729cf09SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 1059729cf09SDimitry Andric #pragma GCC system_header 1069729cf09SDimitry Andric #endif 1079729cf09SDimitry Andric 1089729cf09SDimitry Andric #include_next <stdio.h> 1099729cf09SDimitry Andric 1109729cf09SDimitry Andric #ifdef __cplusplus 1119729cf09SDimitry Andric 1129729cf09SDimitry Andric #undef getc 1139729cf09SDimitry Andric #undef putc 1149729cf09SDimitry Andric #undef clearerr 1159729cf09SDimitry Andric #undef feof 1169729cf09SDimitry Andric #undef ferror 1179729cf09SDimitry Andric 1189729cf09SDimitry Andric #endif 1199729cf09SDimitry Andric 1209729cf09SDimitry Andric #endif // _LIBCPP_STDIO_H 121