Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===--------------------------- cwctype ----------------------------------===// |
| 3 | // |
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 4 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 5 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPP_CWCTYPE |
| 12 | #define _LIBCPP_CWCTYPE |
| 13 | |
| 14 | /* |
| 15 | cwctype synopsis |
| 16 | |
| 17 | Macros: |
| 18 | |
| 19 | WEOF |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 20 | |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 21 | namespace std |
| 22 | { |
| 23 | |
| 24 | Types: |
| 25 | |
| 26 | wint_t |
| 27 | wctrans_t |
| 28 | wctype_t |
| 29 | |
| 30 | int iswalnum(wint_t wc); |
| 31 | int iswalpha(wint_t wc); |
| 32 | int iswblank(wint_t wc); // C99 |
| 33 | int iswcntrl(wint_t wc); |
| 34 | int iswdigit(wint_t wc); |
| 35 | int iswgraph(wint_t wc); |
| 36 | int iswlower(wint_t wc); |
| 37 | int iswprint(wint_t wc); |
| 38 | int iswpunct(wint_t wc); |
| 39 | int iswspace(wint_t wc); |
| 40 | int iswupper(wint_t wc); |
| 41 | int iswxdigit(wint_t wc); |
| 42 | int iswctype(wint_t wc, wctype_t desc); |
| 43 | wctype_t wctype(const char* property); |
| 44 | wint_t towlower(wint_t wc); |
| 45 | wint_t towupper(wint_t wc); |
| 46 | wint_t towctrans(wint_t wc, wctrans_t desc); |
| 47 | wctrans_t wctrans(const char* property); |
| 48 | |
| 49 | } // std |
| 50 | |
| 51 | */ |
| 52 | |
| 53 | #include <__config> |
| 54 | #include <cctype> |
| 55 | #include <wctype.h> |
| 56 | |
| 57 | #pragma GCC system_header |
| 58 | |
| 59 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 60 | |
| 61 | using ::wint_t; |
| 62 | using ::wctrans_t; |
| 63 | using ::wctype_t; |
| 64 | |
| 65 | #ifdef iswalnum |
| 66 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalnum(wint_t __wc) {return iswalnum(__wc);} |
| 67 | #undef iswalnum |
| 68 | inline _LIBCPP_INLINE_VISIBILITY int iswalnum(wint_t __wc) {return __libcpp_iswalnum(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 69 | #else // iswalnum |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 70 | using ::iswalnum; |
| 71 | #endif |
| 72 | |
| 73 | #ifdef iswalpha |
| 74 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalpha(wint_t __wc) {return iswalpha(__wc);} |
| 75 | #undef iswalpha |
| 76 | inline _LIBCPP_INLINE_VISIBILITY int iswalpha(wint_t __wc) {return __libcpp_iswalpha(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 77 | #else // iswalpha |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 78 | using ::iswalpha; |
| 79 | #endif |
| 80 | |
| 81 | #ifdef iswblank |
| 82 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswblank(wint_t __wc) {return iswblank(__wc);} |
| 83 | #undef iswblank |
| 84 | inline _LIBCPP_INLINE_VISIBILITY int iswblank(wint_t __wc) {return __libcpp_iswblank(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 85 | #else // iswblank |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 86 | using ::iswblank; |
| 87 | #endif |
| 88 | |
| 89 | #ifdef iswcntrl |
| 90 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswcntrl(wint_t __wc) {return iswcntrl(__wc);} |
| 91 | #undef iswcntrl |
| 92 | inline _LIBCPP_INLINE_VISIBILITY int iswcntrl(wint_t __wc) {return __libcpp_iswcntrl(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 93 | #else // iswcntrl |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 94 | using ::iswcntrl; |
| 95 | #endif |
| 96 | |
| 97 | #ifdef iswdigit |
| 98 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswdigit(wint_t __wc) {return iswdigit(__wc);} |
| 99 | #undef iswdigit |
| 100 | inline _LIBCPP_INLINE_VISIBILITY int iswdigit(wint_t __wc) {return __libcpp_iswdigit(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 101 | #else // iswdigit |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 102 | using ::iswdigit; |
| 103 | #endif |
| 104 | |
| 105 | #ifdef iswgraph |
| 106 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswgraph(wint_t __wc) {return iswgraph(__wc);} |
| 107 | #undef iswgraph |
| 108 | inline _LIBCPP_INLINE_VISIBILITY int iswgraph(wint_t __wc) {return __libcpp_iswgraph(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 109 | #else // iswgraph |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 110 | using ::iswgraph; |
| 111 | #endif |
| 112 | |
| 113 | #ifdef iswlower |
| 114 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswlower(wint_t __wc) {return iswlower(__wc);} |
| 115 | #undef iswlower |
| 116 | inline _LIBCPP_INLINE_VISIBILITY int iswlower(wint_t __wc) {return __libcpp_iswlower(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 117 | #else // iswlower |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 118 | using ::iswlower; |
| 119 | #endif |
| 120 | |
| 121 | #ifdef iswprint |
| 122 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswprint(wint_t __wc) {return iswprint(__wc);} |
| 123 | #undef iswprint |
| 124 | inline _LIBCPP_INLINE_VISIBILITY int iswprint(wint_t __wc) {return __libcpp_iswprint(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 125 | #else // iswprint |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 126 | using ::iswprint; |
| 127 | #endif |
| 128 | |
| 129 | #ifdef iswpunct |
| 130 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswpunct(wint_t __wc) {return iswpunct(__wc);} |
| 131 | #undef iswpunct |
| 132 | inline _LIBCPP_INLINE_VISIBILITY int iswpunct(wint_t __wc) {return __libcpp_iswpunct(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 133 | #else // iswpunct |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 134 | using ::iswpunct; |
| 135 | #endif |
| 136 | |
| 137 | #ifdef iswspace |
| 138 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswspace(wint_t __wc) {return iswspace(__wc);} |
| 139 | #undef iswspace |
| 140 | inline _LIBCPP_INLINE_VISIBILITY int iswspace(wint_t __wc) {return __libcpp_iswspace(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 141 | #else // iswspace |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 142 | using ::iswspace; |
| 143 | #endif |
| 144 | |
| 145 | #ifdef iswupper |
| 146 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswupper(wint_t __wc) {return iswupper(__wc);} |
| 147 | #undef iswupper |
| 148 | inline _LIBCPP_INLINE_VISIBILITY int iswupper(wint_t __wc) {return __libcpp_iswupper(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 149 | #else // iswupper |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 150 | using ::iswupper; |
| 151 | #endif |
| 152 | |
| 153 | #ifdef iswxdigit |
| 154 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswxdigit(wint_t __wc) {return iswxdigit(__wc);} |
| 155 | #undef iswxdigit |
| 156 | inline _LIBCPP_INLINE_VISIBILITY int iswxdigit(wint_t __wc) {return __libcpp_iswxdigit(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 157 | #else // iswxdigit |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 158 | using ::iswxdigit; |
| 159 | #endif |
| 160 | |
| 161 | #ifdef iswctype |
| 162 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswctype(wint_t __w, wctype_t __d) {return iswctype(__w, __d);} |
| 163 | #undef iswctype |
| 164 | inline _LIBCPP_INLINE_VISIBILITY int iswctype(wint_t __w, wctype_t __d) {return __libcpp_iswctype(__w, __d);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 165 | #else // iswctype |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 166 | using ::iswctype; |
| 167 | #endif |
| 168 | |
| 169 | #ifdef wctype |
| 170 | inline _LIBCPP_INLINE_VISIBILITY wctype_t __libcpp_wctype(const char* __p) {return wctype(__p);} |
| 171 | #undef wctype |
| 172 | inline _LIBCPP_INLINE_VISIBILITY wctype_t wctype(const char* __p) {return __libcpp_wctype(__p);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 173 | #else // wctype |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 174 | using ::wctype; |
| 175 | #endif |
| 176 | |
| 177 | #ifdef towlower |
| 178 | inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towlower(wint_t __wc) {return towlower(__wc);} |
| 179 | #undef towlower |
| 180 | inline _LIBCPP_INLINE_VISIBILITY wint_t towlower(wint_t __wc) {return __libcpp_towlower(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 181 | #else // towlower |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 182 | using ::towlower; |
| 183 | #endif |
| 184 | |
| 185 | #ifdef towupper |
| 186 | inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towupper(wint_t __wc) {return towupper(__wc);} |
| 187 | #undef towupper |
| 188 | inline _LIBCPP_INLINE_VISIBILITY wint_t towupper(wint_t __wc) {return __libcpp_towupper(__wc);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 189 | #else // towupper |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 190 | using ::towupper; |
| 191 | #endif |
| 192 | |
| 193 | #ifdef towctrans |
| 194 | inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towctrans(wint_t __wc, wctype_t __d) {return towctrans(__wc, __d);} |
| 195 | #undef towctrans |
| 196 | inline _LIBCPP_INLINE_VISIBILITY wint_t towctrans(wint_t __wc, wctype_t __d) {return __libcpp_towctrans(__wc, __d);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 197 | #else // towctrans |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 198 | using ::towctrans; |
| 199 | #endif |
| 200 | |
| 201 | #ifdef wctrans |
| 202 | inline _LIBCPP_INLINE_VISIBILITY wctrans_t __libcpp_wctrans(const char* __p) {return wctrans(__p);} |
| 203 | #undef wctrans |
| 204 | inline _LIBCPP_INLINE_VISIBILITY wctrans_t wctrans(const char* __p) {return __libcpp_wctrans(__p);} |
Howard Hinnant | 324bb03 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 205 | #else // wctrans |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 206 | using ::wctrans; |
| 207 | #endif |
| 208 | |
| 209 | _LIBCPP_END_NAMESPACE_STD |
| 210 | |
| 211 | #endif // _LIBCPP_CWCTYPE |