std_cstdio.h revision 132720
198675Sdes// -*- C++ -*- forwarding header. 298675Sdes 398675Sdes// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 498675Sdes// Free Software Foundation, Inc. 598675Sdes// 698675Sdes// This file is part of the GNU ISO C++ Library. This library is free 798675Sdes// software; you can redistribute it and/or modify it under the 898675Sdes// terms of the GNU General Public License as published by the 998675Sdes// Free Software Foundation; either version 2, or (at your option) 1098675Sdes// any later version. 1198675Sdes 1298675Sdes// This library is distributed in the hope that it will be useful, 1398675Sdes// but WITHOUT ANY WARRANTY; without even the implied warranty of 1498675Sdes// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1598675Sdes// GNU General Public License for more details. 1698675Sdes 1798675Sdes// You should have received a copy of the GNU General Public License along 1898675Sdes// with this library; see the file COPYING. If not, write to the Free 1998675Sdes// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 2098675Sdes// USA. 2198675Sdes 2298675Sdes// As a special exception, you may use this file as part of a free software 2398675Sdes// library without restriction. Specifically, if other files instantiate 2498675Sdes// templates or use macros or inline functions from this file, or you compile 2598675Sdes// this file and link it with other files to produce an executable, this 2698675Sdes// file does not by itself cause the resulting executable to be covered by 2798675Sdes// the GNU General Public License. This exception does not however 28137019Sdes// invalidate any other reasons why the executable file might be covered by 2999052Sdes// the GNU General Public License. 3098675Sdes 3198675Sdes// 3298675Sdes// ISO C++ 14882: 27.8.2 C Library files 3398675Sdes// 3498675Sdes 3598675Sdes/** @file cstdio 3698675Sdes * This is a Standard C++ Library file. You should @c #include this file 3798675Sdes * in your programs, rather than any of the "*.h" implementation files. 38113911Sdes * 3998675Sdes * This is the C++ version of the Standard C Library header @c stdio.h, 4098675Sdes * and its contents are (mostly) the same as that header, but are all 4198675Sdes * contained in the namespace @c std. 4298675Sdes */ 4398675Sdes 44128460Sdes#ifndef _GLIBCXX_CSTDIO 45128460Sdes#define _GLIBCXX_CSTDIO 1 4698675Sdes 47128460Sdes#pragma GCC system_header 48128460Sdes 49128460Sdes#include <bits/c++config.h> 50128460Sdes#include <cstddef> 5198675Sdes 5298675Sdes#include <stdio.h> 5398675Sdes 5498675Sdes// Get rid of those macros defined in <stdio.h> in lieu of real functions. 5598675Sdes#undef clearerr 5698675Sdes#undef fclose 57124211Sdes#undef feof 5898675Sdes#undef ferror 5998675Sdes#undef fflush 6098675Sdes#undef fgetc 6198675Sdes#undef fgetpos 6298675Sdes#undef fgets 63124211Sdes#undef fopen 64124211Sdes#undef fprintf 65124211Sdes#undef fputc 66124211Sdes#undef fputs 6798675Sdes#undef fread 6898675Sdes#undef freopen 6998675Sdes#undef fscanf 7098675Sdes#undef fseek 7198675Sdes#undef fsetpos 7298675Sdes#undef ftell 7398675Sdes#undef fwrite 74137019Sdes#undef getc 75124211Sdes#undef getchar 7698675Sdes#undef gets 77126277Sdes#undef perror 78126277Sdes#undef printf 79126277Sdes#undef putc 80126277Sdes#undef putchar 81126277Sdes#undef puts 82126277Sdes#undef remove 83126277Sdes#undef rename 84126277Sdes#undef rewind 85126277Sdes#undef scanf 86126277Sdes#undef setbuf 8798675Sdes#undef setvbuf 88137019Sdes#undef sprintf 8998675Sdes#undef sscanf 90106130Sdes#undef tmpfile 9198675Sdes#undef tmpnam 9298675Sdes#undef ungetc 9398675Sdes#undef vfprintf 9498675Sdes#undef vprintf 9598675Sdes#undef vsprintf 9698675Sdes 97137019Sdesnamespace std 9898675Sdes{ 99137019Sdes using ::FILE; 10098675Sdes using ::fpos_t; 10198675Sdes 10298675Sdes using ::clearerr; 10398675Sdes using ::fclose; 104137019Sdes using ::feof; 10598675Sdes using ::ferror; 10698675Sdes using ::fflush; 107106130Sdes using ::fgetc; 10898675Sdes using ::fgetpos; 10998675Sdes using ::fgets; 11098675Sdes using ::fopen; 11198675Sdes using ::fprintf; 112137019Sdes using ::fputc; 11398675Sdes using ::fputs; 11498675Sdes using ::fread; 115126277Sdes using ::freopen; 11698675Sdes using ::fscanf; 11798675Sdes using ::fseek; 11898675Sdes using ::fsetpos; 11998675Sdes using ::ftell; 12098675Sdes using ::fwrite; 12198675Sdes using ::getc; 12298675Sdes using ::getchar; 123137019Sdes using ::gets; 12498675Sdes using ::perror; 12598675Sdes using ::printf; 12698675Sdes using ::putc; 12798675Sdes using ::putchar; 12898675Sdes using ::puts; 129137019Sdes using ::remove; 13098675Sdes using ::rename; 13198675Sdes using ::rewind; 13298675Sdes using ::scanf; 13398675Sdes using ::setbuf; 13498675Sdes using ::setvbuf; 135137019Sdes using ::sprintf; 13698675Sdes using ::sscanf; 13798675Sdes using ::tmpfile; 13898675Sdes using ::tmpnam; 13998675Sdes using ::ungetc; 14098675Sdes using ::vfprintf; 14198675Sdes using ::vprintf; 14298675Sdes using ::vsprintf; 14398675Sdes} 14498675Sdes 14598675Sdes#if _GLIBCXX_USE_C99 14698675Sdes 14798675Sdes#undef snprintf 14898675Sdes#undef vfscanf 14998675Sdes#undef vscanf 15098675Sdes#undef vsnprintf 15198675Sdes#undef vsscanf 15298675Sdes 15398675Sdesnamespace __gnu_cxx 15498675Sdes{ 15598675Sdes#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC 15698675Sdes extern "C" int 15798675Sdes (snprintf)(char * restrict, size_t, const char * restrict, ...); 15898675Sdes extern "C" int 15998675Sdes (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list); 16098675Sdes extern "C" int (vscanf)(const char * restrict, __gnuc_va_list); 16198675Sdes extern "C" int 16298675Sdes (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list); 16398675Sdes extern "C" int 16498675Sdes (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list); 16598675Sdes#endif 16698675Sdes#if !_GLIBCXX_USE_C99_DYNAMIC 16798675Sdes using ::snprintf; 16898675Sdes using ::vfscanf; 16998675Sdes using ::vscanf; 17098675Sdes using ::vsnprintf; 17198675Sdes using ::vsscanf; 17298675Sdes#endif 17398675Sdes} 17498675Sdes 17598675Sdesnamespace std 17698675Sdes{ 17798675Sdes using __gnu_cxx::snprintf; 17898675Sdes using __gnu_cxx::vfscanf; 17998675Sdes using __gnu_cxx::vscanf; 18098675Sdes using __gnu_cxx::vsnprintf; 18198675Sdes using __gnu_cxx::vsscanf; 18298675Sdes} 18398675Sdes#endif 18498675Sdes 18598675Sdes#endif 18698675Sdes