cwctype 6.1 KB

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