epoc32/include/stdapis/stlport/cstd/cwchar
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 cwchar
     1 /*
       
     2  * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
       
     3  *
       
     4  * Copyright (c) 1999 
       
     5  * Boris Fomitchev
       
     6  *
       
     7  * This material is provided "as is", with absolutely no warranty expressed
       
     8  * or implied. Any use is at your own risk.
       
     9  *
       
    10  * Permission to use or copy this software for any purpose is hereby granted 
       
    11  * without fee, provided the above notices are retained on all copies.
       
    12  * Permission to modify the code and to distribute modified code is granted,
       
    13  * provided the above notices are retained, and a notice that the code was
       
    14  * modified is included with the above copyright notice.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef _STLP_CWCHAR
       
    19 # define _STLP_CWCHAR
       
    20 
       
    21 # ifndef _STLP_OUTERMOST_HEADER_ID
       
    22 #  define _STLP_OUTERMOST_HEADER_ID 0x120
       
    23 #  include <stl/_prolog.h>
       
    24 # endif
       
    25 
       
    26 # ifdef __GNUC__
       
    27 #  include <cstddef>
       
    28 # endif
       
    29 
       
    30 # if ! defined (_STLP_WINCE)
       
    31 
       
    32 # if defined (__BORLANDC__) &&  (__BORLANDC__ >= 0x530 ) && ! defined (_STLP_OWN_IOSTREAMS)
       
    33 /*  Borland defines this stuff here */
       
    34 #   include <iosfwd>
       
    35 # endif
       
    36 
       
    37 # if !  defined (_STLP_NO_CWCHAR) && defined  (_STLP_USE_NEW_C_HEADERS)
       
    38 #  include _STLP_NATIVE_CPP_C_HEADER(cwchar)
       
    39 
       
    40 # elif defined (__MRC__) || (defined (__SC__) && !defined (__DMC__)) || defined (__BORLANDC__) || defined(__FreeBSD__) || (defined (__GNUC__) && defined (__APPLE__) || defined( __Lynx__ )) || defined (__SYMBIAN32__) || defined (__WINS__) || defined (_STLP_NO_WCHAR_T)
       
    41 
       
    42 #ifdef __SYMBIAN32__
       
    43 #  include <stddef.h>
       
    44 #else
       
    45 # include _STLP_NATIVE_C_HEADER(stddef.h)
       
    46 #endif
       
    47 #  if defined (__FreeBSD__) || defined (__Lynx__) || defined (__WINS__) || defined (__SYMBIAN32__)
       
    48 #   ifndef _WINT_T
       
    49 #ifdef __SYMBIAN32__
       
    50 #  include <wchar.h>
       
    51 #else
       
    52 # include _STLP_NATIVE_C_HEADER(wchar.h)
       
    53 #endif
       
    54 #    define _WINT_T
       
    55 #   endif /* _WINT_T */
       
    56 #  endif
       
    57 
       
    58 # else 
       
    59 #  include _STLP_NATIVE_C_HEADER(wchar.h)
       
    60 
       
    61 #  if defined(__sun) && (defined(_XOPEN_SOURCE) || (_XOPEN_VERSION - 0 == 4))
       
    62 extern wint_t   btowc();
       
    63 extern int      fwprintf();
       
    64 extern int      fwscanf();
       
    65 extern int      fwide();
       
    66 extern int      mbsinit();
       
    67 extern size_t   mbrlen();
       
    68 extern size_t   mbrtowc();
       
    69 extern size_t   mbsrtowcs();
       
    70 extern int      swprintf();
       
    71 extern int      swscanf();
       
    72 extern int      vfwprintf();
       
    73 extern int      vwprintf();
       
    74 extern int      vswprintf();
       
    75 extern size_t   wcrtomb();
       
    76 extern size_t   wcsrtombs();
       
    77 extern wchar_t  *wcsstr();
       
    78 extern int      wctob();
       
    79 extern wchar_t  *wmemchr();
       
    80 extern int      wmemcmp();
       
    81 extern wchar_t  *wmemcpy();
       
    82 extern wchar_t  *wmemmove();
       
    83 extern wchar_t  *wmemset();
       
    84 extern int      wprintf();
       
    85 extern int      wscanf();
       
    86 #  endif
       
    87 # endif
       
    88 
       
    89 #if defined(__MSL__) && __MSL__ <= 0x51FF	/* dwa 2/28/99 - not yet implemented by MSL  */
       
    90 #   define _STLP_WCHAR_MSL_EXCLUDE 1
       
    91 namespace std
       
    92 { 
       
    93   extern "C" size_t wcsftime(wchar_t * str, size_t max_size, const wchar_t * format_str, const struct tm * timeptr);
       
    94 }
       
    95 #  define _STLP_NO_MBSTATE_T 1
       
    96 #elif defined (__BORLANDC__)
       
    97 #  ifdef _STLP_OWN_IOSTREAMS
       
    98 #   define _STLP_NO_NATIVE_MBSTATE_T
       
    99 #  endif
       
   100 #  define _STLP_WCHAR_BORLAND_EXCLUDE 1
       
   101 #  if (__BORLANDC__ < 0x540 )
       
   102 #   define _STLP_NO_MBSTATE_T 1
       
   103 #   define _STLP_WCHAR_SUNPRO_EXCLUDE
       
   104 #  endif
       
   105 #endif
       
   106 
       
   107 #ifndef _STLP_CWCHAR_H
       
   108 # include <stl/_cwchar.h>
       
   109 #endif
       
   110 
       
   111 # ifdef _STLP_IMPORT_VENDOR_CSTD
       
   112 
       
   113 #if defined (__SUNPRO_CC) && defined (_STLP_NO_OWN_IOSTREAMS) && !defined (_STLP_HAS_NO_NEW_C_HEADERS)
       
   114 using _STLP_VENDOR_CSTD::wint_t; 
       
   115 #endif
       
   116 
       
   117 _STLP_BEGIN_NAMESPACE
       
   118 # ifdef _STLP_NO_WCHAR_T
       
   119 typedef int wint_t;
       
   120 # else
       
   121 // gcc 3.0 has a glitch : wint_t only sucked into the global namespace if _GLIBCPP_USE_WCHAR_T is defined
       
   122 #  if defined (__GNUC__) && ! defined (_GLIBCPP_USE_WCHAR_T)
       
   123 using ::wint_t;
       
   124 #  else
       
   125 using _STLP_VENDOR_CSTD::wint_t;
       
   126 #  endif
       
   127 # endif
       
   128 
       
   129 
       
   130 using _STLP_VENDOR_CSTD::size_t;
       
   131 
       
   132 #  if !defined (_STLP_NO_NATIVE_MBSTATE_T) && ! defined (_STLP_USE_OWN_MBSTATE_T)
       
   133 using _STLP_VENDOR_MB_NAMESPACE::mbstate_t;
       
   134 
       
   135 # if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS) && !defined(_STLP_WCHAR_BORLAND_EXCLUDE) \
       
   136   && (!defined(__MSL__) || __MSL__ > 0x6001)
       
   137 #  if ! (defined (__KCC) || defined (__GNUC__))
       
   138 using _STLP_VENDOR_MB_NAMESPACE::btowc;
       
   139 #   if (!defined(__MSL__) || __MSL__ > 0x7001)
       
   140 using _STLP_VENDOR_MB_NAMESPACE::mbsinit;
       
   141 #   endif
       
   142 #  endif
       
   143 # if ! defined (__GNUC__)
       
   144 using _STLP_VENDOR_MB_NAMESPACE::mbrlen;
       
   145 using _STLP_VENDOR_MB_NAMESPACE::mbrtowc;
       
   146 using _STLP_VENDOR_MB_NAMESPACE::mbsrtowcs;
       
   147 using _STLP_VENDOR_MB_NAMESPACE::wcrtomb;
       
   148 using _STLP_VENDOR_MB_NAMESPACE::wcsrtombs;
       
   149 # endif
       
   150 #    endif /* BORLAND && !__MSL__ || __MSL__ > 0x6001 */
       
   151 
       
   152 #  endif /* _STLP_NO_NATIVE_MBSTATE_T */
       
   153 
       
   154 # if !defined (_STLP_NO_NATIVE_WIDE_FUNCTIONS) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
       
   155 
       
   156 # if !defined (_STLP_WCHAR_BORLAND_EXCLUDE) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
       
   157 using _STLP_VENDOR_CSTD::fgetwc;
       
   158 using _STLP_VENDOR_CSTD::fgetws;
       
   159 using _STLP_VENDOR_CSTD::fputwc;
       
   160 using _STLP_VENDOR_CSTD::fputws;
       
   161 # endif
       
   162 
       
   163 #  if !( defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE) \
       
   164       || defined(_STLP_WCHAR_HPACC_EXCLUDE) )
       
   165 # ifndef __DECCXX
       
   166 using _STLP_VENDOR_CSTD::fwide;
       
   167 # endif
       
   168 using _STLP_VENDOR_CSTD::fwprintf;
       
   169 using _STLP_VENDOR_CSTD::fwscanf;
       
   170 using _STLP_VENDOR_CSTD::getwchar;
       
   171 #  endif
       
   172 
       
   173 # ifndef _STLP_WCHAR_BORLAND_EXCLUDE
       
   174 using _STLP_VENDOR_CSTD::getwc;
       
   175 using _STLP_VENDOR_CSTD::ungetwc;
       
   176 
       
   177 using _STLP_VENDOR_CSTD::putwc;
       
   178 using _STLP_VENDOR_CSTD::putwchar;
       
   179 # endif
       
   180 
       
   181 #  if !( defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE)\
       
   182       || defined(_STLP_WCHAR_HPACC_EXCLUDE) ) 
       
   183 using _STLP_VENDOR_CSTD::swprintf;
       
   184 using _STLP_VENDOR_CSTD::swscanf;
       
   185 using _STLP_VENDOR_CSTD::vfwprintf;
       
   186 using _STLP_VENDOR_CSTD::vwprintf;
       
   187 using _STLP_VENDOR_CSTD::vswprintf;
       
   188 
       
   189 #   if !defined(__MSL__) || __MSL__ > 0x7001
       
   190 using _STLP_VENDOR_CSTD::wcsftime;
       
   191 #   endif
       
   192 using _STLP_VENDOR_CSTD::wcstok;
       
   193 
       
   194 #  endif
       
   195 
       
   196 # if !(defined (__BORLANDC__) && (__BORLANDC__ < 0x540))
       
   197 using _STLP_VENDOR_CSTD::wcscat;
       
   198 using _STLP_VENDOR_CSTD::wcsrchr;
       
   199 using _STLP_VENDOR_CSTD::wcscmp;
       
   200 using _STLP_VENDOR_CSTD::wcscoll;
       
   201 
       
   202 using _STLP_VENDOR_CSTD::wcscpy;
       
   203 using _STLP_VENDOR_CSTD::wcscspn;
       
   204 
       
   205 using _STLP_VENDOR_CSTD::wcslen;
       
   206 using _STLP_VENDOR_CSTD::wcsncat;
       
   207 using _STLP_VENDOR_CSTD::wcsncmp;
       
   208 using _STLP_VENDOR_CSTD::wcsncpy;
       
   209 using _STLP_VENDOR_CSTD::wcspbrk;
       
   210 using _STLP_VENDOR_CSTD::wcschr;
       
   211 
       
   212 using _STLP_VENDOR_CSTD::wcsspn;
       
   213 using _STLP_VENDOR_CSTD::wcsxfrm;
       
   214 
       
   215 # endif
       
   216 
       
   217 #  if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
       
   218 
       
   219 using _STLP_VENDOR_CSTD::wcstod;
       
   220 using _STLP_VENDOR_CSTD::wcstol;
       
   221 
       
   222 # endif
       
   223 
       
   224 #  if !( defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined(_STLP_WCHAR_HPACC_EXCLUDE) )
       
   225 
       
   226 using _STLP_VENDOR_CSTD::wcsstr;
       
   227 using _STLP_VENDOR_CSTD::wmemchr;
       
   228 
       
   229 #  if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
       
   230 
       
   231 #ifndef __DMC__
       
   232 using _STLP_VENDOR_CSTD::wctob;
       
   233 using _STLP_VENDOR_CSTD::wmemcmp;
       
   234 #endif
       
   235 using _STLP_VENDOR_CSTD::wmemmove;
       
   236 using _STLP_VENDOR_CSTD::wprintf;
       
   237 using _STLP_VENDOR_CSTD::wscanf;
       
   238 
       
   239 #  endif
       
   240 
       
   241 using _STLP_VENDOR_CSTD::wmemcpy;
       
   242 using _STLP_VENDOR_CSTD::wmemset;
       
   243 #  endif
       
   244 
       
   245 # endif /* _STLP_NO_NATIVE_WIDE_FUNCTIONS */
       
   246 _STLP_END_NAMESPACE
       
   247 # endif /* _STLP_IMPORT_VENDOR_CSTD */
       
   248 
       
   249 # undef _STLP_WCHAR_SUNPRO_EXCLUDE
       
   250 # undef _STLP_WCHAR_MSL_EXCLUDE
       
   251 
       
   252 # endif /* WINCE */
       
   253 
       
   254 # if (_STLP_OUTERMOST_HEADER_ID == 0x120)
       
   255 #  include <stl/_epilog.h>
       
   256 #  undef _STLP_OUTERMOST_HEADER_ID
       
   257 # endif
       
   258 
       
   259 #endif /* _STLP_CWCHAR */
       
   260