1/* 2 * Copyright (c) 1999 3 * Boris Fomitchev 4 * 5 * This material is provided "as is", with absolutely no warranty expressed 6 * or implied. Any use is at your own risk. 7 * 8 * Permission to use or copy this software for any purpose is hereby granted 9 * without fee, provided the above notices are retained on all copies. 10 * Permission to modify the code and to distribute modified code is granted, 11 * provided the above notices are retained, and a notice that the code was 12 * modified is included with the above copyright notice. 13 * 14 */ 15 16#ifndef _STLP_INTERNAL_CSTDIO 17#define _STLP_INTERNAL_CSTDIO 18 19#if defined (__Lynx__) 20# if defined (_STLP_HAS_INCLUDE_NEXT) 21# include_next <stdarg.h> 22# else 23# include _STLP_NATIVE_C_HEADER(stdarg.h) 24# endif 25#endif 26 27#if defined (_STLP_USE_NEW_C_HEADERS) 28# if defined (_STLP_HAS_INCLUDE_NEXT) 29# include_next <cstdio> 30# else 31# include _STLP_NATIVE_CPP_C_HEADER(cstdio) 32# endif 33#else 34# include <stdio.h> 35#endif 36 37#if defined (__MWERKS__) 38# undef stdin 39# undef stdout 40# undef stderr 41# define stdin (&_STLP_VENDOR_CSTD::__files[0]) 42# define stdout (&_STLP_VENDOR_CSTD::__files[1]) 43# define stderr (&_STLP_VENDOR_CSTD::__files[2]) 44#endif 45 46#if defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB < 1400) || defined (_STLP_USING_PLATFORM_SDK_COMPILER) 47inline int vsnprintf(char *s1, size_t n, const char *s2, va_list v) 48{ return _STLP_VENDOR_CSTD::_vsnprintf(s1, n, s2, v); } 49#endif 50 51#if defined (_STLP_IMPORT_VENDOR_CSTD ) 52_STLP_BEGIN_NAMESPACE 53using _STLP_VENDOR_CSTD::FILE; 54using _STLP_VENDOR_CSTD::fpos_t; 55using _STLP_VENDOR_CSTD::size_t; 56 57// undef obsolete macros 58# undef putc 59# undef getc 60# undef getchar 61# undef putchar 62# undef feof 63# undef ferror 64 65# if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS) 66using _STLP_VENDOR_CSTD::clearerr; 67using _STLP_VENDOR_CSTD::fclose; 68using _STLP_VENDOR_CSTD::feof; 69using _STLP_VENDOR_CSTD::ferror; 70using _STLP_VENDOR_CSTD::fflush; 71using _STLP_VENDOR_CSTD::fgetc; 72using _STLP_VENDOR_CSTD::fgetpos; 73using _STLP_VENDOR_CSTD::fgets; 74using _STLP_VENDOR_CSTD::fopen; 75using _STLP_VENDOR_CSTD::fprintf; 76using _STLP_VENDOR_CSTD::fputc; 77using _STLP_VENDOR_CSTD::fputs; 78using _STLP_VENDOR_CSTD::fread; 79# if !defined (_WIN32_WCE) || (_WIN32_WCE < 400) 80using _STLP_VENDOR_CSTD::freopen; 81# endif 82using _STLP_VENDOR_CSTD::fscanf; 83using _STLP_VENDOR_CSTD::fseek; 84using _STLP_VENDOR_CSTD::fsetpos; 85using _STLP_VENDOR_CSTD::ftell; 86using _STLP_VENDOR_CSTD::fwrite; 87 88# if !(defined (__IBMCPP__) && (__IBMCPP__ >= 500)) 89# if !defined (_WIN32_WCE) || (_WIN32_WCE < 400) // Supplied as macros, TODO: use inline function to redirect to the macros? 90 using _STLP_VENDOR_CSTD::getc; 91 using _STLP_VENDOR_CSTD::putc; 92# endif 93 using _STLP_VENDOR_CSTD::getchar; 94 using _STLP_VENDOR_CSTD::putchar; 95# endif 96 97using _STLP_VENDOR_CSTD::gets; 98# if !defined (_WIN32_WCE) || (_WIN32_WCE < 400) 99using _STLP_VENDOR_CSTD::perror; 100# endif 101using _STLP_VENDOR_CSTD::printf; 102using _STLP_VENDOR_CSTD::puts; 103# if !defined (_WIN32_WCE) || (_WIN32_WCE < 400) 104using _STLP_VENDOR_CSTD::remove; 105using _STLP_VENDOR_CSTD::rename; 106using _STLP_VENDOR_CSTD::rewind; 107using _STLP_VENDOR_CSTD::setbuf; 108using _STLP_VENDOR_CSTD::tmpfile; 109using _STLP_VENDOR_CSTD::tmpnam; 110# endif 111using _STLP_VENDOR_CSTD::scanf; 112using _STLP_VENDOR_CSTD::setvbuf; 113using _STLP_VENDOR_CSTD::sprintf; 114using _STLP_VENDOR_CSTD::sscanf; 115using _STLP_VENDOR_CSTD::ungetc; 116using _STLP_VENDOR_CSTD::vfprintf; 117using _STLP_VENDOR_CSTD::vprintf; 118using _STLP_VENDOR_CSTD::vsprintf; 119# if (defined (__MWERKS__) || (defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB < 1400)) || \ 120 (defined (__BORLANDC__))) 121using _STLP_VENDOR_CSTD::vsnprintf; 122# endif 123# endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */ 124_STLP_END_NAMESPACE 125#endif /* _STLP_IMPORT_VENDOR_CSTD */ 126 127#endif /* _STLP_INTERNAL_CSTDIO */ 128