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 | |
Howard Hinnant | 08e1747 | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 57 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 58 | #pragma GCC system_header |
Howard Hinnant | 08e1747 | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 59 | #endif |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 60 | |
| 61 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 62 | |
| 63 | using ::wint_t; |
| 64 | using ::wctrans_t; |
| 65 | using ::wctype_t; |
| 66 | |
| 67 | #ifdef iswalnum |
| 68 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalnum(wint_t __wc) {return iswalnum(__wc);} |
| 69 | #undef iswalnum |
| 70 | 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] | 71 | #else // iswalnum |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 72 | using ::iswalnum; |
| 73 | #endif |
| 74 | |
| 75 | #ifdef iswalpha |
| 76 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalpha(wint_t __wc) {return iswalpha(__wc);} |
| 77 | #undef iswalpha |
| 78 | 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] | 79 | #else // iswalpha |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 80 | using ::iswalpha; |
| 81 | #endif |
| 82 | |
| 83 | #ifdef iswblank |
| 84 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswblank(wint_t __wc) {return iswblank(__wc);} |
| 85 | #undef iswblank |
| 86 | 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] | 87 | #else // iswblank |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 88 | using ::iswblank; |
| 89 | #endif |
| 90 | |
| 91 | #ifdef iswcntrl |
| 92 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswcntrl(wint_t __wc) {return iswcntrl(__wc);} |
| 93 | #undef iswcntrl |
| 94 | 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] | 95 | #else // iswcntrl |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 96 | using ::iswcntrl; |
| 97 | #endif |
| 98 | |
| 99 | #ifdef iswdigit |
| 100 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswdigit(wint_t __wc) {return iswdigit(__wc);} |
| 101 | #undef iswdigit |
| 102 | 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] | 103 | #else // iswdigit |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 104 | using ::iswdigit; |
| 105 | #endif |
| 106 | |
| 107 | #ifdef iswgraph |
| 108 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswgraph(wint_t __wc) {return iswgraph(__wc);} |
| 109 | #undef iswgraph |
| 110 | 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] | 111 | #else // iswgraph |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 112 | using ::iswgraph; |
| 113 | #endif |
| 114 | |
| 115 | #ifdef iswlower |
| 116 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswlower(wint_t __wc) {return iswlower(__wc);} |
| 117 | #undef iswlower |
| 118 | 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] | 119 | #else // iswlower |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 120 | using ::iswlower; |
| 121 | #endif |
| 122 | |
| 123 | #ifdef iswprint |
| 124 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswprint(wint_t __wc) {return iswprint(__wc);} |
| 125 | #undef iswprint |
| 126 | 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] | 127 | #else // iswprint |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 128 | using ::iswprint; |
| 129 | #endif |
| 130 | |
| 131 | #ifdef iswpunct |
| 132 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswpunct(wint_t __wc) {return iswpunct(__wc);} |
| 133 | #undef iswpunct |
| 134 | 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] | 135 | #else // iswpunct |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 136 | using ::iswpunct; |
| 137 | #endif |
| 138 | |
| 139 | #ifdef iswspace |
| 140 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswspace(wint_t __wc) {return iswspace(__wc);} |
| 141 | #undef iswspace |
| 142 | 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] | 143 | #else // iswspace |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 144 | using ::iswspace; |
| 145 | #endif |
| 146 | |
| 147 | #ifdef iswupper |
| 148 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswupper(wint_t __wc) {return iswupper(__wc);} |
| 149 | #undef iswupper |
| 150 | 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] | 151 | #else // iswupper |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 152 | using ::iswupper; |
| 153 | #endif |
| 154 | |
| 155 | #ifdef iswxdigit |
| 156 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswxdigit(wint_t __wc) {return iswxdigit(__wc);} |
| 157 | #undef iswxdigit |
| 158 | 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] | 159 | #else // iswxdigit |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 160 | using ::iswxdigit; |
| 161 | #endif |
| 162 | |
| 163 | #ifdef iswctype |
| 164 | inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswctype(wint_t __w, wctype_t __d) {return iswctype(__w, __d);} |
| 165 | #undef iswctype |
| 166 | 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] | 167 | #else // iswctype |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 168 | using ::iswctype; |
| 169 | #endif |
| 170 | |
| 171 | #ifdef wctype |
| 172 | inline _LIBCPP_INLINE_VISIBILITY wctype_t __libcpp_wctype(const char* __p) {return wctype(__p);} |
| 173 | #undef wctype |
| 174 | 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] | 175 | #else // wctype |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 176 | using ::wctype; |
| 177 | #endif |
| 178 | |
| 179 | #ifdef towlower |
| 180 | inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towlower(wint_t __wc) {return towlower(__wc);} |
| 181 | #undef towlower |
| 182 | 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] | 183 | #else // towlower |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 184 | using ::towlower; |
| 185 | #endif |
| 186 | |
| 187 | #ifdef towupper |
| 188 | inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towupper(wint_t __wc) {return towupper(__wc);} |
| 189 | #undef towupper |
| 190 | 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] | 191 | #else // towupper |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 192 | using ::towupper; |
| 193 | #endif |
| 194 | |
| 195 | #ifdef towctrans |
| 196 | inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towctrans(wint_t __wc, wctype_t __d) {return towctrans(__wc, __d);} |
| 197 | #undef towctrans |
| 198 | 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] | 199 | #else // towctrans |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 200 | using ::towctrans; |
| 201 | #endif |
| 202 | |
| 203 | #ifdef wctrans |
| 204 | inline _LIBCPP_INLINE_VISIBILITY wctrans_t __libcpp_wctrans(const char* __p) {return wctrans(__p);} |
| 205 | #undef wctrans |
| 206 | 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] | 207 | #else // wctrans |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 208 | using ::wctrans; |
| 209 | #endif |
| 210 | |
| 211 | _LIBCPP_END_NAMESPACE_STD |
| 212 | |
| 213 | #endif // _LIBCPP_CWCTYPE |