00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _CPP_CWCHAR
00037 #define _CPP_CWCHAR 1
00038
00039 #include <bits/c++config.h>
00040 #include <bits/std_cstddef.h>
00041 #include <bits/std_cstdio.h>
00042 #include <bits/std_cstdarg.h>
00043
00044 #if _GLIBCPP_HAVE_WCHAR_H
00045 #pragma GCC system_header
00046 #include <wchar.h>
00047 #endif
00048
00049
00050
00051 #ifndef _GLIBCPP_HAVE_MBSTATE_T
00052 extern "C"
00053 {
00054 typedef struct
00055 {
00056 int __fill[6];
00057 } mbstate_t;
00058 }
00059 #endif
00060
00061 namespace std
00062 {
00063 using ::mbstate_t;
00064 }
00065
00066
00067 #undef vwprintf
00068 #undef vwscanf
00069 #undef wprintf
00070 #undef wscanf
00071 #undef getwc
00072 #undef getwchar
00073 #undef mbsinit
00074 #undef mbrlen
00075 #undef mbrtowc
00076 #undef mbsrtowcs
00077 #undef wcsrtombs
00078 #undef putwc
00079 #undef putwchar
00080 #undef ungetwc
00081 #undef wcrtomb
00082 #undef wcstod
00083 #undef wcstof
00084 #undef wcstol
00085 #undef wcstoul
00086 #undef wcscpy
00087 #undef wcsncpy
00088 #undef wcscat
00089 #undef wcsncat
00090 #undef wcscmp
00091 #undef wcscoll
00092 #undef wcsncmp
00093 #undef wcsxfrm
00094 #undef wcschr
00095 #undef wcscspn
00096 #undef wcslen
00097 #undef wcspbrk
00098 #undef wcsrchr
00099 #undef wcsspn
00100 #undef wcsstr
00101 #undef wcstok
00102 #undef wmemchr
00103 #undef wmemcmp
00104 #undef wmemcpy
00105 #undef wmemmove
00106 #undef wmemset
00107 #undef wcsftime
00108 #undef wcstold
00109 #undef wcstoll
00110 #undef wcstoull
00111
00112 #if _GLIBCPP_USE_WCHAR_T
00113 namespace std
00114 {
00115 using ::wint_t;
00116
00117 extern "C" wint_t btowc(int);
00118 extern "C" int wctob(wint_t);
00119 extern "C" wint_t fgetwc(FILE*);
00120 extern "C" wchar_t* fgetws(wchar_t*, int, FILE*);
00121 extern "C" wint_t fputwc(wchar_t, FILE*);
00122 extern "C" int fputws(const wchar_t*, FILE*);
00123 extern "C" int fwide(FILE*, int);
00124 extern "C" int fwprintf(FILE*, const wchar_t*, ...);
00125 extern "C" int fwscanf(FILE*, const wchar_t*, ...);
00126 extern "C" int swprintf(wchar_t*, size_t, const wchar_t*, ...);
00127 extern "C" int swscanf(const wchar_t*, const wchar_t*, ...);
00128 extern "C" int vfwprintf(FILE*, const wchar_t*, va_list);
00129 extern "C" int vfwscanf(FILE*, const wchar_t*, va_list);
00130 extern "C" int vswprintf(wchar_t*, size_t, const wchar_t*, va_list);
00131 extern "C" int vswscanf(const wchar_t*, const wchar_t*, va_list);
00132 extern "C" int vwprintf(const wchar_t*, va_list);
00133 extern "C" int vwscanf(const wchar_t*, va_list);
00134 extern "C" int wprintf(const wchar_t*, ...);
00135 extern "C" int wscanf(const wchar_t*, ...);
00136 extern "C" wint_t getwc(FILE* stream);
00137 extern "C" wint_t getwchar(void);
00138 extern "C" int mbsinit(const mbstate_t*);
00139 extern "C" size_t mbrlen(const char*, size_t, mbstate_t*);
00140 extern "C" size_t mbrtowc(wchar_t*, const char*, size_t, mbstate_t*);
00141 extern "C" size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*);
00142 extern "C" size_t wcsrtombs(char*, const wchar_t **, size_t, mbstate_t*);
00143 extern "C" wint_t putwc(wchar_t, FILE*);
00144 extern "C" wint_t putwchar(wchar_t);
00145 extern "C" wint_t ungetwc(wint_t, FILE*);
00146 extern "C" size_t wcrtomb(char*, wchar_t, mbstate_t*);
00147 extern "C" double wcstod(const wchar_t*, wchar_t**);
00148 extern "C" float wcstof(const wchar_t*, wchar_t**);
00149 extern "C" long int wcstol(const wchar_t*, wchar_t**, int);
00150 extern "C" unsigned long int wcstoul(const wchar_t*, wchar_t**, int);
00151 extern "C" wchar_t* wcscpy(wchar_t* s1, const wchar_t*);
00152 extern "C" wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
00153 extern "C" wchar_t* wcscat(wchar_t*, const wchar_t*);
00154 extern "C" wchar_t* wcsncat(wchar_t*, const wchar_t*, size_t);
00155 extern "C" int wcscmp(const wchar_t*, const wchar_t*);
00156 extern "C" int wcscoll(const wchar_t*, const wchar_t*);
00157 extern "C" int wcsncmp(const wchar_t*, const wchar_t*, size_t);
00158 extern "C" size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
00159 extern "C" const wchar_t* wcschr(const wchar_t*, wchar_t);
00160 inline wchar_t*
00161 wcschr(wchar_t* __p, wchar_t __c)
00162 {
00163 return const_cast<wchar_t*>(wcschr(const_cast<const wchar_t*>(__p), __c));
00164 }
00165 extern "C" size_t wcscspn(const wchar_t*, const wchar_t*);
00166 extern "C" size_t wcslen(const wchar_t*);
00167 extern "C" const wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
00168 inline wchar_t*
00169 wcspbrk(wchar_t* __s1, wchar_t* __s2)
00170 {
00171 return const_cast<wchar_t*>(wcspbrk(const_cast<const wchar_t*>(__s1), __s2));
00172 }
00173 extern "C" const wchar_t* wcsrchr(const wchar_t*, wchar_t);
00174 inline wchar_t*
00175 wcsrchr(wchar_t* __p, wchar_t __c)
00176 {
00177 return const_cast<wchar_t*>(wcsrchr(const_cast<const wchar_t*>(__p), __c));
00178 }
00179 extern "C" size_t wcsspn(const wchar_t*, const wchar_t*);
00180 extern "C" const wchar_t* wcsstr(const wchar_t*, const wchar_t*);
00181 inline wchar_t*
00182 wcsstr(wchar_t* __s1, wchar_t* __s2)
00183 {
00184 return const_cast<wchar_t*>(wcsstr(const_cast<const wchar_t*>(__s1), __s2));
00185 }
00186 extern "C" wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**);
00187 extern "C" const wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
00188 inline wchar_t*
00189 wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
00190 {
00191 return const_cast<wchar_t*>(wmemchr(const_cast<const wchar_t*>(__p), __c, __n));
00192 }
00193 extern "C" int wmemcmp(const wchar_t*, const wchar_t*, size_t);
00194 extern "C" wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t);
00195 extern "C" wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
00196 extern "C" wchar_t* wmemset(wchar_t*, wchar_t, size_t);
00197 extern "C" size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*);
00198 }
00199
00200 #if _GLIBCPP_USE_C99
00201 namespace c99
00202 {
00203 extern "C" long double wcstold(const wchar_t*, wchar_t**);
00204 extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int);
00205 extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int);
00206 }
00207
00208 namespace std
00209 {
00210 using c99::wcstold;
00211 using c99::wcstoll;
00212 using c99::wcstoull;
00213 }
00214 #endif
00215
00216 #endif //_GLIBCPP_USE_WCHAR_T
00217
00218 #endif