xref: /freebsd-12.1/contrib/libc++/include/cstdio (revision 540d2a8b)
17a984708SDavid Chisnall// -*- C++ -*-
27a984708SDavid Chisnall//===---------------------------- cstdio ----------------------------------===//
37a984708SDavid Chisnall//
47a984708SDavid Chisnall//                     The LLVM Compiler Infrastructure
57a984708SDavid Chisnall//
67a984708SDavid Chisnall// This file is dual licensed under the MIT and the University of Illinois Open
77a984708SDavid Chisnall// Source Licenses. See LICENSE.TXT for details.
87a984708SDavid Chisnall//
97a984708SDavid Chisnall//===----------------------------------------------------------------------===//
107a984708SDavid Chisnall
117a984708SDavid Chisnall#ifndef _LIBCPP_CSTDIO
127a984708SDavid Chisnall#define _LIBCPP_CSTDIO
137a984708SDavid Chisnall
147a984708SDavid Chisnall/*
157a984708SDavid Chisnall    cstdio synopsis
167a984708SDavid Chisnall
177a984708SDavid ChisnallMacros:
187a984708SDavid Chisnall
197a984708SDavid Chisnall    BUFSIZ
207a984708SDavid Chisnall    EOF
217a984708SDavid Chisnall    FILENAME_MAX
227a984708SDavid Chisnall    FOPEN_MAX
237a984708SDavid Chisnall    L_tmpnam
247a984708SDavid Chisnall    NULL
257a984708SDavid Chisnall    SEEK_CUR
267a984708SDavid Chisnall    SEEK_END
277a984708SDavid Chisnall    SEEK_SET
287a984708SDavid Chisnall    TMP_MAX
297a984708SDavid Chisnall    _IOFBF
307a984708SDavid Chisnall    _IOLBF
317a984708SDavid Chisnall    _IONBF
327a984708SDavid Chisnall    stderr
337a984708SDavid Chisnall    stdin
347a984708SDavid Chisnall    stdout
357a984708SDavid Chisnall
367a984708SDavid Chisnallnamespace std
377a984708SDavid Chisnall{
387a984708SDavid Chisnall
397a984708SDavid ChisnallTypes:
407a984708SDavid Chisnall
417a984708SDavid ChisnallFILE
427a984708SDavid Chisnallfpos_t
437a984708SDavid Chisnallsize_t
447a984708SDavid Chisnall
457a984708SDavid Chisnallint remove(const char* filename);
467a984708SDavid Chisnallint rename(const char* old, const char* new);
477a984708SDavid ChisnallFILE* tmpfile(void);
487a984708SDavid Chisnallchar* tmpnam(char* s);
497a984708SDavid Chisnallint fclose(FILE* stream);
507a984708SDavid Chisnallint fflush(FILE* stream);
517a984708SDavid ChisnallFILE* fopen(const char* restrict filename, const char* restrict mode);
527a984708SDavid ChisnallFILE* freopen(const char* restrict filename, const char * restrict mode,
537a984708SDavid Chisnall              FILE * restrict stream);
547a984708SDavid Chisnallvoid setbuf(FILE* restrict stream, char* restrict buf);
557a984708SDavid Chisnallint setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
567a984708SDavid Chisnallint fprintf(FILE* restrict stream, const char* restrict format, ...);
577a984708SDavid Chisnallint fscanf(FILE* restrict stream, const char * restrict format, ...);
587a984708SDavid Chisnallint printf(const char* restrict format, ...);
597a984708SDavid Chisnallint scanf(const char* restrict format, ...);
607a984708SDavid Chisnallint snprintf(char* restrict s, size_t n, const char* restrict format, ...);    // C99
617a984708SDavid Chisnallint sprintf(char* restrict s, const char* restrict format, ...);
627a984708SDavid Chisnallint sscanf(const char* restrict s, const char* restrict format, ...);
637a984708SDavid Chisnallint vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
647a984708SDavid Chisnallint vfscanf(FILE* restrict stream, const char* restrict format, va_list arg);  // C99
657a984708SDavid Chisnallint vprintf(const char* restrict format, va_list arg);
667a984708SDavid Chisnallint vscanf(const char* restrict format, va_list arg);                          // C99
677a984708SDavid Chisnallint vsnprintf(char* restrict s, size_t n, const char* restrict format,         // C99
687a984708SDavid Chisnall              va_list arg);
697a984708SDavid Chisnallint vsprintf(char* restrict s, const char* restrict format, va_list arg);
707a984708SDavid Chisnallint vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
717a984708SDavid Chisnallint fgetc(FILE* stream);
727a984708SDavid Chisnallchar* fgets(char* restrict s, int n, FILE* restrict stream);
737a984708SDavid Chisnallint fputc(int c, FILE* stream);
747a984708SDavid Chisnallint fputs(const char* restrict s, FILE* restrict stream);
757a984708SDavid Chisnallint getc(FILE* stream);
767a984708SDavid Chisnallint getchar(void);
774f7ab58eSDimitry Andricchar* gets(char* s);  // removed in C++14
787a984708SDavid Chisnallint putc(int c, FILE* stream);
797a984708SDavid Chisnallint putchar(int c);
807a984708SDavid Chisnallint puts(const char* s);
817a984708SDavid Chisnallint ungetc(int c, FILE* stream);
827a984708SDavid Chisnallsize_t fread(void* restrict ptr, size_t size, size_t nmemb,
837a984708SDavid Chisnall             FILE* restrict stream);
847a984708SDavid Chisnallsize_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
857a984708SDavid Chisnall              FILE* restrict stream);
867a984708SDavid Chisnallint fgetpos(FILE* restrict stream, fpos_t* restrict pos);
877a984708SDavid Chisnallint fseek(FILE* stream, long offset, int whence);
887a984708SDavid Chisnallint fsetpos(FILE*stream, const fpos_t* pos);
897a984708SDavid Chisnalllong ftell(FILE* stream);
907a984708SDavid Chisnallvoid rewind(FILE* stream);
917a984708SDavid Chisnallvoid clearerr(FILE* stream);
927a984708SDavid Chisnallint feof(FILE* stream);
937a984708SDavid Chisnallint ferror(FILE* stream);
947a984708SDavid Chisnallvoid perror(const char* s);
957a984708SDavid Chisnall
967a984708SDavid Chisnall}  // std
977a984708SDavid Chisnall*/
987a984708SDavid Chisnall
997a984708SDavid Chisnall#include <__config>
1007a984708SDavid Chisnall#include <stdio.h>
1017a984708SDavid Chisnall
1027a984708SDavid Chisnall#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1037a984708SDavid Chisnall#pragma GCC system_header
1047a984708SDavid Chisnall#endif
1057a984708SDavid Chisnall
1067a984708SDavid Chisnall_LIBCPP_BEGIN_NAMESPACE_STD
1077a984708SDavid Chisnall
1087a984708SDavid Chisnallusing ::FILE;
1097a984708SDavid Chisnallusing ::fpos_t;
1107a984708SDavid Chisnallusing ::size_t;
1117a984708SDavid Chisnall
1127a984708SDavid Chisnallusing ::fclose;
1137a984708SDavid Chisnallusing ::fflush;
1147a984708SDavid Chisnallusing ::setbuf;
1157a984708SDavid Chisnallusing ::setvbuf;
1167a984708SDavid Chisnallusing ::fprintf;
1177a984708SDavid Chisnallusing ::fscanf;
1187a984708SDavid Chisnallusing ::snprintf;
1197a984708SDavid Chisnallusing ::sprintf;
1207a984708SDavid Chisnallusing ::sscanf;
1217a984708SDavid Chisnallusing ::vfprintf;
1227a984708SDavid Chisnallusing ::vfscanf;
1237a984708SDavid Chisnallusing ::vsscanf;
1247a984708SDavid Chisnallusing ::vsnprintf;
1257a984708SDavid Chisnallusing ::vsprintf;
1267a984708SDavid Chisnallusing ::fgetc;
1277a984708SDavid Chisnallusing ::fgets;
1287a984708SDavid Chisnallusing ::fputc;
1297a984708SDavid Chisnallusing ::fputs;
1307a984708SDavid Chisnallusing ::getc;
1317a984708SDavid Chisnallusing ::putc;
1327a984708SDavid Chisnallusing ::ungetc;
1337a984708SDavid Chisnallusing ::fread;
1347a984708SDavid Chisnallusing ::fwrite;
1357a984708SDavid Chisnallusing ::fgetpos;
1367a984708SDavid Chisnallusing ::fseek;
1377a984708SDavid Chisnallusing ::fsetpos;
1387a984708SDavid Chisnallusing ::ftell;
1397a984708SDavid Chisnallusing ::rewind;
1407a984708SDavid Chisnallusing ::clearerr;
1417a984708SDavid Chisnallusing ::feof;
1427a984708SDavid Chisnallusing ::ferror;
1437a984708SDavid Chisnallusing ::perror;
1447a984708SDavid Chisnall
145854fa44bSDimitry Andric#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
146854fa44bSDimitry Andricusing ::fopen;
147854fa44bSDimitry Andricusing ::freopen;
148854fa44bSDimitry Andricusing ::remove;
149854fa44bSDimitry Andricusing ::rename;
150854fa44bSDimitry Andricusing ::tmpfile;
151854fa44bSDimitry Andricusing ::tmpnam;
152854fa44bSDimitry Andric#endif
153854fa44bSDimitry Andric
154854fa44bSDimitry Andric#ifndef _LIBCPP_HAS_NO_STDIN
155854fa44bSDimitry Andricusing ::getchar;
156*540d2a8bSDimitry Andric#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT)
157854fa44bSDimitry Andricusing ::gets;
158854fa44bSDimitry Andric#endif
159854fa44bSDimitry Andricusing ::scanf;
160854fa44bSDimitry Andricusing ::vscanf;
161854fa44bSDimitry Andric#endif
162854fa44bSDimitry Andric
163854fa44bSDimitry Andric#ifndef _LIBCPP_HAS_NO_STDOUT
164854fa44bSDimitry Andricusing ::printf;
165854fa44bSDimitry Andricusing ::putchar;
166854fa44bSDimitry Andricusing ::puts;
167854fa44bSDimitry Andricusing ::vprintf;
168854fa44bSDimitry Andric#endif
169854fa44bSDimitry Andric
1707a984708SDavid Chisnall_LIBCPP_END_NAMESPACE_STD
1717a984708SDavid Chisnall
1727a984708SDavid Chisnall#endif  // _LIBCPP_CSTDIO
173