_cstdio.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. #ifndef _STLP_INTERNAL_CSTDIO
  16. #define _STLP_INTERNAL_CSTDIO
  17. #if defined (__Lynx__)
  18. # if defined (_STLP_HAS_INCLUDE_NEXT)
  19. # include_next <stdarg.h>
  20. # else
  21. # include _STLP_NATIVE_C_HEADER(stdarg.h)
  22. # endif
  23. #endif
  24. #if defined (_STLP_USE_NEW_C_HEADERS)
  25. # if defined (_STLP_HAS_INCLUDE_NEXT)
  26. # include_next <cstdio>
  27. # else
  28. # include _STLP_NATIVE_CPP_C_HEADER(cstdio)
  29. # endif
  30. #else
  31. # include <stdio.h>
  32. #endif
  33. #if defined (__MWERKS__)
  34. # undef stdin
  35. # undef stdout
  36. # undef stderr
  37. # define stdin (&_STLP_VENDOR_CSTD::__files[0])
  38. # define stdout (&_STLP_VENDOR_CSTD::__files[1])
  39. # define stderr (&_STLP_VENDOR_CSTD::__files[2])
  40. #endif
  41. #if defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB < 1400) || defined (_STLP_USING_PLATFORM_SDK_COMPILER)
  42. inline int vsnprintf(char *s1, size_t n, const char *s2, va_list v)
  43. { return _STLP_VENDOR_CSTD::_vsnprintf(s1, n, s2, v); }
  44. #endif
  45. #if !defined (_STLP_SGX_CONFIG)
  46. #if defined (_STLP_IMPORT_VENDOR_CSTD )
  47. _STLP_BEGIN_NAMESPACE
  48. using _STLP_VENDOR_CSTD::FILE;
  49. using _STLP_VENDOR_CSTD::fpos_t;
  50. using _STLP_VENDOR_CSTD::size_t;
  51. // undef obsolete macros
  52. # undef putc
  53. # undef getc
  54. # undef getchar
  55. # undef putchar
  56. # undef feof
  57. # undef ferror
  58. # if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
  59. using _STLP_VENDOR_CSTD::clearerr;
  60. using _STLP_VENDOR_CSTD::fclose;
  61. using _STLP_VENDOR_CSTD::feof;
  62. using _STLP_VENDOR_CSTD::ferror;
  63. using _STLP_VENDOR_CSTD::fflush;
  64. using _STLP_VENDOR_CSTD::fgetc;
  65. using _STLP_VENDOR_CSTD::fgetpos;
  66. using _STLP_VENDOR_CSTD::fgets;
  67. using _STLP_VENDOR_CSTD::fopen;
  68. using _STLP_VENDOR_CSTD::fprintf;
  69. using _STLP_VENDOR_CSTD::fputc;
  70. using _STLP_VENDOR_CSTD::fputs;
  71. using _STLP_VENDOR_CSTD::fread;
  72. # if !defined (_WIN32_WCE) || (_WIN32_WCE < 400)
  73. using _STLP_VENDOR_CSTD::freopen;
  74. # endif
  75. using _STLP_VENDOR_CSTD::fscanf;
  76. using _STLP_VENDOR_CSTD::fseek;
  77. using _STLP_VENDOR_CSTD::fsetpos;
  78. using _STLP_VENDOR_CSTD::ftell;
  79. using _STLP_VENDOR_CSTD::fwrite;
  80. # if !(defined (__IBMCPP__) && (__IBMCPP__ >= 500))
  81. # if !defined (_WIN32_WCE) || (_WIN32_WCE < 400) // Supplied as macros, TODO: use inline function to redirect to the macros?
  82. using _STLP_VENDOR_CSTD::getc;
  83. using _STLP_VENDOR_CSTD::putc;
  84. # endif
  85. using _STLP_VENDOR_CSTD::getchar;
  86. using _STLP_VENDOR_CSTD::putchar;
  87. # endif
  88. using _STLP_VENDOR_CSTD::gets;
  89. # if !defined (_WIN32_WCE) || (_WIN32_WCE < 400)
  90. using _STLP_VENDOR_CSTD::perror;
  91. # endif
  92. using _STLP_VENDOR_CSTD::printf;
  93. using _STLP_VENDOR_CSTD::puts;
  94. # if !defined (_WIN32_WCE) || (_WIN32_WCE < 400)
  95. using _STLP_VENDOR_CSTD::remove;
  96. using _STLP_VENDOR_CSTD::rename;
  97. using _STLP_VENDOR_CSTD::rewind;
  98. using _STLP_VENDOR_CSTD::setbuf;
  99. using _STLP_VENDOR_CSTD::tmpfile;
  100. using _STLP_VENDOR_CSTD::tmpnam;
  101. # endif
  102. using _STLP_VENDOR_CSTD::scanf;
  103. using _STLP_VENDOR_CSTD::setvbuf;
  104. using _STLP_VENDOR_CSTD::sprintf;
  105. using _STLP_VENDOR_CSTD::sscanf;
  106. using _STLP_VENDOR_CSTD::ungetc;
  107. using _STLP_VENDOR_CSTD::vfprintf;
  108. using _STLP_VENDOR_CSTD::vprintf;
  109. using _STLP_VENDOR_CSTD::vsprintf;
  110. # if (defined (__MWERKS__) || (defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB < 1400)) || \
  111. (defined (__BORLANDC__)))
  112. using _STLP_VENDOR_CSTD::vsnprintf;
  113. # endif
  114. # endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */
  115. _STLP_END_NAMESPACE
  116. #endif /* _STLP_IMPORT_VENDOR_CSTD */
  117. #endif /* !STLP_SE1_CONFIG */
  118. #endif /* _STLP_INTERNAL_CSTDIO */